mirror of
https://github.com/neovim/neovim.git
synced 2025-01-01 17:23:36 -07:00
Merge pull request #1850 from JackDanger/halfway-a-line
doc: "halfway a line" is a very confusing phrase
This commit is contained in:
commit
0f39097e53
@ -869,9 +869,9 @@ TermResponse After the response to |t_RV| is received from
|
||||
the terminal. The value of |v:termresponse|
|
||||
can be used to do things depending on the
|
||||
terminal version. Note that this event may be
|
||||
triggered halfway executing another event,
|
||||
especially if file I/O, a shell command or
|
||||
anything else that takes time is involved.
|
||||
triggered halfway through another event
|
||||
(especially if file I/O, a shell command, or
|
||||
anything else that takes time is involved).
|
||||
*TextChanged*
|
||||
TextChanged After a change was made to the text in the
|
||||
current buffer in Normal mode. That is when
|
||||
|
@ -5322,8 +5322,8 @@ searchpair({start}, {middle}, {end} [, {flags} [, {skip}
|
||||
to be found. Note that single-quote strings are used to avoid
|
||||
having to double the backslashes. The skip expression only
|
||||
catches comments at the start of a line, not after a command.
|
||||
Also, a word "en" or "if" halfway a line is considered a
|
||||
match.
|
||||
Also, a word "en" or "if" halfway through a line is considered
|
||||
a match.
|
||||
Another example, to search for the matching "{" of a "}": >
|
||||
|
||||
:echo searchpair('{', '', '}', 'bW')
|
||||
|
@ -33,7 +33,8 @@ know what the hjkl keys do. The mnemonic value of hjkl is clear from looking
|
||||
at the keyboard. Think of j as an arrow pointing downwards.
|
||||
|
||||
The 'virtualedit' option can be set to make it possible to move the cursor to
|
||||
positions where there is no character or halfway a character.
|
||||
positions where there is no character or within a multi-column character (like
|
||||
a tab).
|
||||
|
||||
==============================================================================
|
||||
1. Motions and operators *operator*
|
||||
|
@ -1173,7 +1173,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
Some applications use the BOM to recognize the encoding of the file.
|
||||
Often used for UCS-2 files on MS-Windows. For other applications it
|
||||
causes trouble, for example: "cat file1 file2" makes the BOM of file2
|
||||
appear halfway the resulting file. Gcc doesn't accept a BOM.
|
||||
appear halfway through the resulting file. Gcc doesn't accept a BOM.
|
||||
When Vim reads a file and 'fileencodings' starts with "ucs-bom", a
|
||||
check for the presence of the BOM is done and 'bomb' set accordingly.
|
||||
Unless 'binary' is set, it is removed from the first line, so that you
|
||||
@ -1998,9 +1998,10 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
Also see the '<' flag below.
|
||||
*cpo-K*
|
||||
K Don't wait for a key code to complete when it is
|
||||
halfway a mapping. This breaks mapping <F1><F1> when
|
||||
only part of the second <F1> has been read. It
|
||||
enables cancelling the mapping by typing <F1><Esc>.
|
||||
halfway through a mapping. This breaks mapping
|
||||
<F1><F1> when only part of the second <F1> has been
|
||||
read. It enables cancelling the mapping by typing
|
||||
<F1><Esc>.
|
||||
*cpo-l*
|
||||
l Backslash in a [] range in a search pattern is taken
|
||||
literally, only "\]", "\^", "\-" and "\\" are special.
|
||||
|
@ -1357,8 +1357,8 @@ Note: this doesn't work for postponed prefixes yet.
|
||||
*spell-COMPOUNDPERMITFLAG*
|
||||
The COMPOUNDPERMITFLAG specifies a flag that can be used on an affix. It
|
||||
means that the word plus affix can also be used in a compound word in a way
|
||||
where the affix ends up halfway the word. Without this flag that is not
|
||||
allowed.
|
||||
where the affix ends up halfway through the word. Without this flag that is
|
||||
not allowed.
|
||||
Note: this doesn't work for postponed prefixes yet.
|
||||
|
||||
*spell-COMPOUNDROOT*
|
||||
|
@ -4075,8 +4075,8 @@ the match doesn't move to another line.
|
||||
The skip pattern can include the "\n", but the search for an end pattern will
|
||||
continue in the first character of the next line, also when that character is
|
||||
matched by the skip pattern. This is because redrawing may start in any line
|
||||
halfway a region and there is no check if the skip pattern started in a
|
||||
previous line. For example, if the skip pattern is "a\nb" and an end pattern
|
||||
halfway in a region and there is no check if the skip pattern started in a
|
||||
previous line. For example, if the skip pattern is "a\nb" and an end pattern
|
||||
is "b", the end pattern does match in the second line of this: >
|
||||
x x a
|
||||
b x x
|
||||
|
@ -818,7 +818,7 @@ Common arguments for the commands above:
|
||||
When excluded, a match is ignored when the line is recognized as a
|
||||
comment (according to 'comments'), or the match is in a C comment (after
|
||||
"//" or inside /* */). Note that a match may be missed if a line is
|
||||
recognized as a comment, but the comment ends halfway the line.
|
||||
recognized as a comment, but the comment ends halfway through the line.
|
||||
And if the line is a comment, but it is not recognized (according to
|
||||
'comments') a match may be found in it anyway. Example: >
|
||||
/* comment
|
||||
|
@ -1783,8 +1783,8 @@ Using UTF-8 character with ":command" does not work properly. (Matt Wozniski,
|
||||
In the Netbeans interface add a "vimeval" function, so that the other side can
|
||||
check the result of has("patch13").
|
||||
|
||||
Cursor line at bottom of window instead of halfway after saving view and
|
||||
restoring. Only with 'nowrap'. (Robert Webb, 2008 Aug 25)
|
||||
Cursor line at bottom of window instead of halfway through after saving view
|
||||
and restoring. Only with 'nowrap'. (Robert Webb, 2008 Aug 25)
|
||||
|
||||
Netrw has trouble executing autocommands only for a directory. Add <isdir>
|
||||
and <notisdir> to autocommand patterns? Also <isfile>?
|
||||
@ -2796,7 +2796,7 @@ Most interesting new features to be added when all bugs have been fixed:
|
||||
Especially when using the scrollbar. Typing a cursor-movement command
|
||||
scrolls back to where the cursor is.
|
||||
- Scroll commands by screen line. g CTRL-E and g CTRL-Y ? Requires the
|
||||
first line to be able to start halfway.
|
||||
first line to be able to start halfway through.
|
||||
- Running a shell command from the GUI still has limitations. Look into how
|
||||
the terminal emulator of the Vim shell project can help:
|
||||
http://vimshell.wana.at
|
||||
|
@ -200,7 +200,8 @@ more typing.
|
||||
last line of a file V
|
||||
|
||||
Another way to move to a line is using the "%" command with a count. For
|
||||
example "50%" moves you to halfway the file. "90%" goes to near the end.
|
||||
example, "50%" moves you halfway through the file, and "90%" goes to near the
|
||||
end.
|
||||
|
||||
The previous assumes that you want to move to a line in the file, no matter if
|
||||
it's currently visible or not. What if you want to move to one of the lines
|
||||
|
@ -201,7 +201,7 @@ change. Then you can use Visual mode.
|
||||
You start Visual mode by pressing "v". You move the cursor over the text you
|
||||
want to work on. While you do this, the text is highlighted. Finally type
|
||||
the operator command.
|
||||
For example, to delete from halfway one word to halfway another word:
|
||||
For example, to delete from the middle of a word to the middle of another:
|
||||
|
||||
This is an examination sample of visual mode ~
|
||||
---------->
|
||||
|
@ -133,7 +133,7 @@ the "2fw" command is executed and the displayed "2f" is removed.
|
||||
>
|
||||
set incsearch
|
||||
|
||||
Display the match for a search pattern when halfway typing it.
|
||||
Display matches for a search pattern while you type.
|
||||
|
||||
>
|
||||
map Q gq
|
||||
|
@ -215,14 +215,14 @@ change: >
|
||||
|
||||
`.
|
||||
|
||||
Suppose you are editing the file "one.txt". Somewhere halfway the file you
|
||||
use "x" to delete a character. Then you go to the last line with "G" and
|
||||
write the file with ":w". You edit several other files, and then use ":edit
|
||||
one.txt" to come back to "one.txt". If you now use `" Vim jumps to the last
|
||||
line of the file. Using `. takes you to the position where you deleted the
|
||||
character. Even when you move around in the file `" and `. will take you to
|
||||
the remembered position. At least until you make another change or leave the
|
||||
file.
|
||||
Suppose you are editing the file "one.txt". Somewhere halfway through the
|
||||
file you use "x" to delete a character. Then you go to the last line with "G"
|
||||
and write the file with ":w". You edit several other files, and then use
|
||||
":edit one.txt" to come back to "one.txt". If you now use `" Vim jumps to the
|
||||
last line of the file. Using `. takes you to the position where you deleted
|
||||
the character. Even when you move around in the file `" and `. will take you
|
||||
to the remembered position, at least until you make another change or leave
|
||||
the file.
|
||||
|
||||
|
||||
FILE MARKS
|
||||
@ -233,8 +233,8 @@ another file and place marks there, these are specific for that file. Thus
|
||||
each file has its own set of marks, they are local to the file.
|
||||
So far we were using marks with a lowercase letter. There are also marks
|
||||
with an uppercase letter. These are global, they can be used from any file.
|
||||
For example suppose that we are editing the file "foo.txt". Go to halfway the
|
||||
file ("50%") and place the F mark there (F for foo): >
|
||||
For example suppose that we are editing the file "foo.txt". Go to halfway of
|
||||
the file ("50%") and place the F mark there (F for foo): >
|
||||
|
||||
50%mF
|
||||
|
||||
@ -242,8 +242,8 @@ Now edit the file "bar.txt" and place the B mark (B for bar) at its last line:
|
||||
>
|
||||
GmB
|
||||
|
||||
Now you can use the "'F" command to jump back to halfway foo.txt. Or edit yet
|
||||
another file, type "'B" and you are at the end of bar.txt again.
|
||||
Now you can use the "'F" command to jump back to halfway of foo.txt. Or edit
|
||||
yet another file, type "'B" and you jump to the end of bar.txt.
|
||||
|
||||
The file marks are remembered until they are placed somewhere else. Thus you
|
||||
can place the mark, do hours of editing and still be able to jump back to that
|
||||
|
@ -370,7 +370,7 @@ into "barfoo".
|
||||
was specified in this example. This is different from ":substitute", which
|
||||
works on one line without a range.
|
||||
The command isn't perfect, since it also matches lines where "//" appears
|
||||
halfway a line, and the substitution will also take place before the "//".
|
||||
halfway in a line, and the substitution will also take place before the "//".
|
||||
|
||||
Just like with ":substitute", any pattern can be used. When you learn more
|
||||
complicated patterns later, you can use them here.
|
||||
@ -625,7 +625,7 @@ When you are typing plain text, it's nice if the length of each line is
|
||||
automatically trimmed to fit in the window. To make this happen while
|
||||
inserting text, set the 'textwidth' option: >
|
||||
|
||||
:set textwidth=72
|
||||
:set textwidth=78
|
||||
|
||||
You might remember that in the example vimrc file this command was used for
|
||||
every text file. Thus if you are using that vimrc file, you were already
|
||||
@ -633,10 +633,10 @@ using it. To check the current value of 'textwidth': >
|
||||
|
||||
:set textwidth
|
||||
|
||||
Now lines will be broken to take only up to 72 characters. But when you
|
||||
insert text halfway a line, or when you delete a few words, the lines will get
|
||||
too long or too short. Vim doesn't automatically reformat the text.
|
||||
To tell Vim to format the current paragraph: >
|
||||
Now lines will be broken to take only up to 78 characters. However, when you
|
||||
insert text halfway through a line or delete a few words, the line will get
|
||||
too long or too short as Vim won't automatically reformat the text. To tell
|
||||
Vim to format the current paragraph:
|
||||
|
||||
gqap
|
||||
|
||||
|
@ -155,9 +155,9 @@ to be lost. Each item can be remembered only once.
|
||||
|
||||
GETTING BACK TO WHERE YOU STOPPED VIM
|
||||
|
||||
You are halfway editing a file and it's time to leave for holidays. You exit
|
||||
Vim and go enjoy yourselves, forgetting all about your work. After a couple
|
||||
of weeks you start Vim, and type:
|
||||
You are halfway through editing a file and it's time to leave for holidays.
|
||||
You exit Vim and go enjoy yourselves, forgetting all about your work. After a
|
||||
couple of weeks you start Vim, and type:
|
||||
>
|
||||
'0
|
||||
|
||||
|
@ -61,10 +61,10 @@ The three names that Vim uses are:
|
||||
USING THE MAC FORMAT
|
||||
|
||||
On Unix, <LF> is used to break a line. It's not unusual to have a <CR>
|
||||
character halfway a line. Incidentally, this happens quite often in Vi (and
|
||||
Vim) scripts.
|
||||
character halfway in a line. Incidentally, this happens quite often in Vi
|
||||
(and Vim) scripts.
|
||||
On the Macintosh, where <CR> is the line break character, it's possible to
|
||||
have a <LF> character halfway a line.
|
||||
have a <LF> character halfway in a line.
|
||||
The result is that it's not possible to be 100% sure whether a file
|
||||
containing both <CR> and <LF> characters is a Mac or a Unix file. Therefore,
|
||||
Vim assumes that on Unix you probably won't edit a Mac file, and doesn't check
|
||||
|
@ -223,8 +223,8 @@ example, suppose you want to select a tag that starts with "write_": >
|
||||
:tselect /^write_
|
||||
|
||||
The "^" specifies that the tag starts with "write_". Otherwise it would also
|
||||
be found halfway a tag name. Similarly "$" at the end makes sure the pattern
|
||||
matches until the end of a tag.
|
||||
be found halfway in a tag name. Similarly "$" at the end makes sure the
|
||||
pattern matches until the end of a tag.
|
||||
|
||||
|
||||
A TAGS BROWSER
|
||||
|
@ -19,9 +19,9 @@ CTRL-L Clear and redraw the screen. The redraw may happen
|
||||
*:redr* *:redraw*
|
||||
:redr[aw][!] Redraw the screen right now. When ! is included it is
|
||||
cleared first.
|
||||
Useful to update the screen halfway executing a script
|
||||
or function. Also when halfway a mapping and
|
||||
'lazyredraw' is set.
|
||||
Useful to update the screen halfway through executing
|
||||
a script or function (or a mapping if 'lazyredraw'
|
||||
set).
|
||||
|
||||
*:redraws* *:redrawstatus*
|
||||
:redraws[tatus][!] Redraw the status line of the current window. When !
|
||||
@ -79,8 +79,8 @@ g8 Print the hex values of the bytes used in the
|
||||
encoding because it contains illegal bytes.
|
||||
Does not wrap around the end of the file.
|
||||
Note that when the cursor is on an illegal byte or the
|
||||
cursor is halfway a multi-byte character the command
|
||||
won't move the cursor.
|
||||
cursor is halfway through a multi-byte character the
|
||||
command won't move the cursor.
|
||||
{not in Vi} {only when compiled with the |+multi_byte|
|
||||
feature}
|
||||
|
||||
|
@ -308,7 +308,7 @@ mode.
|
||||
{not available when compiled without the |+visualextra| feature}
|
||||
|
||||
Reminder: Use 'virtualedit' to be able to select blocks that start or end
|
||||
after the end of a line or halfway a tab.
|
||||
after the end of a line or halfway through a tab.
|
||||
|
||||
Visual-block Insert *v_b_I*
|
||||
With a blockwise selection, I{string}<ESC> will insert {string} at the start
|
||||
@ -492,7 +492,8 @@ Otherwise, typed characters are handled as in Visual mode.
|
||||
|
||||
When using an operator in Select mode, and the selection is linewise, the
|
||||
selected lines are operated upon, but like in characterwise selection. For
|
||||
example, when a whole line is deleted, it can later be pasted halfway a line.
|
||||
example, when a whole line is deleted, it can later be pasted in the middle of
|
||||
a line.
|
||||
|
||||
|
||||
Mappings and menus in Select mode. *Select-mode-mapping*
|
||||
|
@ -1084,7 +1084,7 @@ void diff_win_options(win_T *wp, int addbuf)
|
||||
wp->w_p_fdl = 0;
|
||||
foldUpdateAll(wp);
|
||||
|
||||
// make sure topline is not halfway a fold
|
||||
// make sure topline is not halfway through a fold
|
||||
changed_window_setting_win(wp);
|
||||
if (vim_strchr(p_sbo, 'h') == NULL) {
|
||||
do_cmdline_cmd((char_u *)"set sbo+=hor");
|
||||
@ -1160,7 +1160,7 @@ void ex_diffoff(exarg_T *eap)
|
||||
|
||||
foldUpdateAll(wp);
|
||||
|
||||
// make sure topline is not halfway a fold
|
||||
// make sure topline is not halfway through a fold
|
||||
changed_window_setting_win(wp);
|
||||
|
||||
// Note: 'sbo' is not restored, it's a global option.
|
||||
@ -1511,8 +1511,8 @@ int diff_check(win_T *wp, linenr_T lnum)
|
||||
// If there is no buffer with zero lines then there is no difference
|
||||
// any longer. Happens when making a change (or undo) that removes
|
||||
// the difference. Can't remove the entry here, we might be halfway
|
||||
// updating the window. Just report the text as unchanged. Other
|
||||
// windows might still show the change though.
|
||||
// through updating the window. Just report the text as unchanged.
|
||||
// Other windows might still show the change though.
|
||||
if (zero == FALSE) {
|
||||
return 0;
|
||||
}
|
||||
|
@ -766,8 +766,8 @@ edit (
|
||||
#ifdef UNIX
|
||||
do_intr:
|
||||
#endif
|
||||
/* when 'insertmode' set, and not halfway a mapping, don't leave
|
||||
* Insert mode */
|
||||
// when 'insertmode' set, and not halfway through a mapping, don't leave
|
||||
// Insert mode
|
||||
if (goto_im()) {
|
||||
if (got_int) {
|
||||
(void)vgetc(); /* flush all buffers */
|
||||
|
@ -3093,7 +3093,7 @@ do_ecmd (
|
||||
if (!skip_redraw) {
|
||||
n = p_so;
|
||||
if (topline == 0 && command == NULL)
|
||||
p_so = 999; /* force cursor halfway the window */
|
||||
p_so = 999; // force cursor to be vertically centered in the window
|
||||
update_topline();
|
||||
curwin->w_scbind_pos = curwin->w_topline;
|
||||
p_so = n;
|
||||
|
@ -827,7 +827,7 @@ static colnr_T hardcopy_line(prt_settings_T *psettings, int page_line, prt_pos_T
|
||||
prt_line_number(psettings, page_line, ppos->file_line);
|
||||
ppos->ff = FALSE;
|
||||
} else {
|
||||
/* left over from wrap halfway a tab */
|
||||
// left over from wrap halfway through a tab
|
||||
print_pos = ppos->print_pos;
|
||||
tab_spaces = ppos->lead_spaces;
|
||||
}
|
||||
|
@ -1629,10 +1629,10 @@ void scroll_cursor_bot(int min_scroll, int set_topbot)
|
||||
curwin->w_valid |= VALID_TOPLINE;
|
||||
}
|
||||
|
||||
/*
|
||||
* Recompute topline to put the cursor halfway the window
|
||||
* If "atend" is TRUE, also put it halfway at the end of the file.
|
||||
*/
|
||||
/// Recompute topline to put the cursor halfway across the window
|
||||
///
|
||||
/// @param atend if TRUE, also put the cursor halfway to the end of the file.
|
||||
///
|
||||
void scroll_cursor_halfway(int atend)
|
||||
{
|
||||
int above = 0;
|
||||
|
@ -6954,7 +6954,7 @@ static void nv_esc(cmdarg_T *cap)
|
||||
MSG(_("Type :quit<Enter> to exit Vim"));
|
||||
|
||||
/* Don't reset "restart_edit" when 'insertmode' is set, it won't be
|
||||
* set again below when halfway a mapping. */
|
||||
* set again below when halfway through a mapping. */
|
||||
if (!p_im)
|
||||
restart_edit = 0;
|
||||
if (cmdwin_type != 0) {
|
||||
|
@ -517,7 +517,7 @@ static void block_insert(oparg_T *oap, char_u *s, int b_insert, struct block_def
|
||||
if (has_mbyte && spaces > 0) {
|
||||
int off;
|
||||
|
||||
// Avoid starting halfway a multi-byte character.
|
||||
// Avoid starting halfway through a multi-byte character.
|
||||
if (b_insert) {
|
||||
off = (*mb_head_off)(oldp, oldp + offset + spaces);
|
||||
} else {
|
||||
|
@ -1345,7 +1345,7 @@ static void win_update(win_T *wp)
|
||||
/*
|
||||
* Update a line when it is in an area that needs updating, when it
|
||||
* has changes or w_lines[idx] is invalid.
|
||||
* bot_start may be halfway a wrapped line after using
|
||||
* bot_start may be halfway through a wrapped line after using
|
||||
* win_del_lines(), check if the current line includes it.
|
||||
* When syntax folding is being used, the saved syntax states will
|
||||
* already have been updated, we can't see where the syntax state is
|
||||
@ -4037,7 +4037,7 @@ win_line (
|
||||
/* DBCS: Put second byte in the second screen char. */
|
||||
ScreenLines[off] = mb_c & 0xff;
|
||||
++vcol;
|
||||
/* When "tocol" is halfway a character, set it to the end of
|
||||
/* When "tocol" is halfway through a character, set it to the end of
|
||||
* the character, otherwise highlighting won't stop. */
|
||||
if (tocol == vcol)
|
||||
++tocol;
|
||||
|
@ -1631,9 +1631,9 @@ static void find_word(matchinf_T *mip, int mode)
|
||||
mip->mi_compoff = wlen;
|
||||
find_word(mip, FIND_KEEPCOMPOUND);
|
||||
|
||||
#if 0 // Disabled, a prefix must not appear halfway a compound word,
|
||||
// unless the COMPOUNDPERMITFLAG is used and then it can't be a
|
||||
// postponed prefix.
|
||||
#if 0 // Disabled, a prefix must not appear halfway through a compound
|
||||
// word, unless the COMPOUNDPERMITFLAG is used, in which case it
|
||||
// can't be a postponed prefix.
|
||||
if (!slang->sl_nobreak || mip->mi_result == SP_BAD) {
|
||||
// Check for following word with prefix.
|
||||
mip->mi_compoff = c;
|
||||
@ -2081,7 +2081,7 @@ spell_move_to (
|
||||
return 0;
|
||||
|
||||
// Start looking for bad word at the start of the line, because we can't
|
||||
// start halfway a word, we don't know where it starts or ends.
|
||||
// start halfway through a word, we don't know where it starts or ends.
|
||||
//
|
||||
// When searching backwards, we continue in the line to find the last
|
||||
// bad word (in the cursor line: before the cursor).
|
||||
@ -5428,8 +5428,8 @@ static int spell_read_dic(spellinfo_T *spin, char_u *fname, afffile_T *affile)
|
||||
if (line[0] == '#' || line[0] == '/')
|
||||
continue; // comment line
|
||||
|
||||
// Remove CR, LF and white space from the end. White space halfway
|
||||
// the word is kept to allow e.g., "et al.".
|
||||
// Remove CR, LF and white space from the end. White space halfway through
|
||||
// the word is kept to allow multi-word terms like "et al.".
|
||||
l = (int)STRLEN(line);
|
||||
while (l > 0 && line[l - 1] <= ' ')
|
||||
--l;
|
||||
@ -9740,7 +9740,7 @@ static void suggest_trie_walk(suginfo_T *su, langp_T *lp, char_u *fword, bool so
|
||||
|
||||
// Try word split and/or compounding.
|
||||
if ((sp->ts_fidx >= sp->ts_fidxtry || fword_ends)
|
||||
// Don't split halfway a character.
|
||||
// Don't split in the middle of a character
|
||||
&& (!has_mbyte || sp->ts_tcharlen == 0)
|
||||
) {
|
||||
bool try_compound;
|
||||
@ -12275,7 +12275,7 @@ soundalike_score (
|
||||
int score = 0;
|
||||
|
||||
// Adding/inserting "*" at the start (word starts with vowel) shouldn't be
|
||||
// counted so much, vowels halfway the word aren't counted at all.
|
||||
// counted so much, vowels in the middle of the word aren't counted at all.
|
||||
if ((*badsound == '*' || *goodsound == '*') && *badsound != *goodsound) {
|
||||
if ((badsound[0] == NUL && goodsound[1] == NUL)
|
||||
|| (goodsound[0] == NUL && badsound[1] == NUL))
|
||||
|
Loading…
Reference in New Issue
Block a user