diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-05-05 18:13:34 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-05-05 18:13:34 +0200 |
commit | 25c9c680ec4dfbb51f4ef21c3460a48d3c67ffc8 (patch) | |
tree | 0b70444195e194bf5c99df419361bc2052373c02 /runtime/doc/editing.txt | |
parent | 9a061cb78ccbf78ec9ae454d37a49edccb4e94fc (diff) |
patch 8.1.1280: remarks about functionality not in Vi clutters the helpv8.1.1280
Problem: Remarks about functionality not in Vi clutters the help.
Solution: Move all info about what is new in Vim or already existed in Vi to
vi_diff.txt. Remove {not in Vi} remarks. (closes #4268) Add
"noet" to the help files modeline. Also include many other help
file improvements.
Diffstat (limited to 'runtime/doc/editing.txt')
-rw-r--r-- | runtime/doc/editing.txt | 93 |
1 files changed, 35 insertions, 58 deletions
diff --git a/runtime/doc/editing.txt b/runtime/doc/editing.txt index 60ac959b58..4d01e49a1b 100644 --- a/runtime/doc/editing.txt +++ b/runtime/doc/editing.txt @@ -1,4 +1,4 @@ -*editing.txt* For Vim version 8.1. Last change: 2018 Dec 16 +*editing.txt* For Vim version 8.1. Last change: 2019 May 05 VIM REFERENCE MANUAL by Bram Moolenaar @@ -44,7 +44,7 @@ An alternate file name is remembered for each window. :keepalt {cmd} Execute {cmd} while keeping the current alternate file name. Note that commands invoked indirectly (e.g., with a function) may still set the alternate file - name. {not in Vi} + name. All file names are remembered in the buffer list. When you enter a file name, for editing (e.g., with ":e filename") or writing (e.g., with ":w filename"), @@ -60,14 +60,13 @@ CTRL-G or *CTRL-G* *:f* *:fi* *:file* option is set), and the file status (readonly, modified, read errors, new file). See the 'shortmess' option about how to make this message shorter. - {Vi does not include column number} :f[ile]! like |:file|, but don't truncate the name even when 'shortmess' indicates this. {count}CTRL-G Like CTRL-G, but prints the current file name with full path. If the count is higher than 1 the current - buffer number is also given. {not in Vi} + buffer number is also given. *g_CTRL-G* *word-count* *byte-count* g CTRL-G Prints the current position of the cursor in five @@ -80,7 +79,6 @@ g CTRL-G Prints the current position of the cursor in five column are shown, separated with a dash. Also see the 'ruler' option and the |wordcount()| function. - {not in Vi} *v_g_CTRL-G* {Visual}g CTRL-G Similar to "g CTRL-G", but Word, Character, Line, and @@ -88,7 +86,6 @@ g CTRL-G Prints the current position of the cursor in five displayed. In Blockwise mode, Column count is also shown. (For {Visual} see |Visual-mode|.) - {not in VI} *:file_f* :f[ile][!] {name} Sets the current file name to {name}. The optional ! @@ -98,14 +95,12 @@ g CTRL-G Prints the current position of the cursor in five to hold the old name. *:0file* :0f[ile][!] Remove the name of the current buffer. The optional ! - avoids truncating the message, as with |:file|. {not - in Vi} + avoids truncating the message, as with |:file|. :buffers :files :ls List all the currently known file names. See - 'windows.txt' |:files| |:buffers| |:ls|. {not in - Vi} + 'windows.txt' |:files| |:buffers| |:ls|. Vim will remember the full path name of a file name that you enter. In most cases when the file name is displayed only the name you typed is shown, but @@ -244,19 +239,17 @@ If you want to keep the changed buffer without saving it, switch on the If 'fileformats' is not empty, the first format given will be used for the new buffer. If 'fileformats' is empty, the 'fileformat' of the current buffer is used. - {not in Vi} *:ene!* *:enew!* :ene[w]! Edit a new, unnamed buffer. Discard any changes to the current buffer. Set 'fileformat' like |:enew|. - {not in Vi} *:fin* *:find* :fin[d][!] [++opt] [+cmd] {file} Find {file} in 'path' and then |:edit| it. - {not in Vi} {not available when the |+file_in_path| - feature was disabled at compile time} + {not available when the |+file_in_path| feature was + disabled at compile time} :{count}fin[d][!] [++opt] [+cmd] {file} Just like ":find", but use the {count} match in @@ -278,7 +271,7 @@ If you want to keep the changed buffer without saving it, switch on the :vie[w][!] [++opt] [+cmd] file When used in Ex mode: Leave |Ex-mode|, go back to Normal mode. Otherwise same as |:edit|, but set - 'readonly' option for this buffer. {not in Vi} + 'readonly' option for this buffer. *CTRL-^* *CTRL-6* CTRL-^ Edit the alternate file. Mostly the alternate file is @@ -297,7 +290,6 @@ CTRL-^ Edit the alternate file. Mostly the alternate file is ":e #[count]"). This is a quick way to switch between files. See |CTRL-^| above for further details. - {not in Vi} [count]]f *]f* *[f* [count][f Same as "gf". Deprecated. @@ -331,7 +323,6 @@ CTRL-^ Edit the alternate file. Mostly the alternate file is For Unix the '~' character is expanded, like in "~user/file". Environment variables are expanded too |expand-env|. - {not in Vi} {not available when the |+file_in_path| feature was disabled at compile time} @@ -341,7 +332,6 @@ CTRL-^ Edit the alternate file. Mostly the alternate file is Leading blanks are skipped, otherwise all blanks and special characters are included in the file name. (For {Visual} see |Visual-mode|.) - {not in VI} *gF* [count]gF Same as "gf", except if a number follows the file @@ -637,7 +627,6 @@ list of the current window. still be added to the argument list, but won't be edited. No check for duplicates is done. Also see |++opt| and |+cmd|. - {not in Vi} :[count]arga[dd] {name} .. *:arga* *:argadd* *E479* :[count]arga[dd] @@ -659,7 +648,6 @@ list of the current window. There is no check for duplicates, it is possible to add a file to the argument list twice. The currently edited file is not changed. - {not in Vi} Note: you can also use this method: > :args ## x < This will add the "x" item and sort the new list. @@ -673,7 +661,6 @@ list of the current window. when it's deleted from the argument list. Example: > :argdel *.obj -< {not in Vi} :[range]argd[elete] Delete the {range} files from the argument list. Example: > @@ -688,7 +675,6 @@ list of the current window. < Removes all the files from the arglist. When the last number in the range is too high, up to the last argument is deleted. - {not in Vi} *:argu* *:argument* :[count]argu[ment] [count] [++opt] [+cmd] @@ -697,14 +683,12 @@ list of the current window. when changes have been made and Vim does not want to |abandon| the current buffer. Also see |++opt| and |+cmd|. - {not in Vi} :[count]argu[ment]! [count] [++opt] [+cmd] Edit file [count] in the argument list, discard any changes to the current buffer. When [count] is omitted the current entry is used. Also see |++opt| and |+cmd|. - {not in Vi} :[count]n[ext] [++opt] [+cmd] *:n* *:ne* *:next* *E165* *E163* Edit [count] next file. This fails when changes have @@ -727,7 +711,7 @@ list of the current window. Edit [count] previous file in argument list. This fails when changes have been made and Vim does not want to |abandon| the current buffer. - Also see |++opt| and |+cmd|. {Vi: no count or ++opt}. + Also see |++opt| and |+cmd|. :[count]N[ext]! [count] [++opt] [+cmd] Edit [count] previous file in argument list. Discard @@ -748,44 +732,43 @@ list of the current window. :rew[ind]! [++opt] [+cmd] Start editing the first file in the argument list. Discard any changes to the buffer. Also see |++opt| - and |+cmd|. {Vi: no ++opt} + and |+cmd|. *:fir* *:first* :fir[st][!] [++opt] [+cmd] - Other name for ":rewind". {not in Vi} + Other name for ":rewind". *:la* *:last* :la[st] [++opt] [+cmd] Start editing the last file in the argument list. This fails when changes have been made and Vim does not want to |abandon| the current buffer. - Also see |++opt| and |+cmd|. {not in Vi} + Also see |++opt| and |+cmd|. :la[st]! [++opt] [+cmd] Start editing the last file in the argument list. Discard any changes to the buffer. Also see |++opt| - and |+cmd|. {not in Vi} + and |+cmd|. *:wn* *:wnext* :[count]wn[ext] [++opt] Write current file and start editing the [count] - next file. Also see |++opt| and |+cmd|. {not in Vi} + next file. Also see |++opt| and |+cmd|. :[count]wn[ext] [++opt] {file} Write current file to {file} and start editing the [count] next file, unless {file} already exists and the 'writeany' option is off. Also see |++opt| and - |+cmd|. {not in Vi} + |+cmd|. :[count]wn[ext]! [++opt] {file} Write current file to {file} and start editing the - [count] next file. Also see |++opt| and |+cmd|. {not - in Vi} + [count] next file. Also see |++opt| and |+cmd|. :[count]wN[ext][!] [++opt] [file] *:wN* *:wNext* :[count]wp[revious][!] [++opt] [file] *:wp* *:wprevious* Same as :wnext, but go to previous file instead of - next. {not in Vi} + next. The [count] in the commands above defaults to one. For some commands it is possible to use two counts. The last one (rightmost one) is used. @@ -826,8 +809,6 @@ fourth file in the argument list. This happens when you do ":e file". LOCAL ARGUMENT LIST -{not in Vi} - *:arglocal* :argl[ocal] Make a local copy of the global argument list. Doesn't start editing another file. @@ -878,7 +859,6 @@ USING THE ARGUMENT LIST autocommand event is disabled by adding it to 'eventignore'. This considerably speeds up editing each file. - {not in Vi} Also see |:windo|, |:tabdo|, |:bufdo|, |:cdo|, |:ldo|, |:cfdo| and |:lfdo| @@ -970,12 +950,11 @@ slower (but safer). When 'filetype' is empty filetype detection is done with the new name, before the file is written. When the write was successful 'readonly' is reset. - {not in Vi} *:up* *:update* :[range]up[date][!] [++opt] [>>] [file] Like ":write", but only write when the buffer has been - modified. {not in Vi} + modified. WRITING WITH MULTIPLE BUFFERS *buffer-write* @@ -983,11 +962,11 @@ WRITING WITH MULTIPLE BUFFERS *buffer-write* *:wa* *:wall* :wa[ll] Write all changed buffers. Buffers without a file name cause an error message. Buffers which are - readonly are not written. {not in Vi} + readonly are not written. :wa[ll]! Write all changed buffers, even the ones that are readonly. Buffers without a file name are not - written and cause an error message. {not in Vi} + written and cause an error message. Vim will warn you if you try to overwrite a file that has been changed @@ -1118,7 +1097,7 @@ The names can be in upper- or lowercase. :conf[irm] q[uit] Quit, but give prompt when changes have been made, or the last file in the argument list has not been - edited. See |:confirm| and 'confirm'. {not in Vi} + edited. See |:confirm| and 'confirm'. :q[uit]! Quit without writing, also when the current buffer has changes. The buffer is unloaded, also when it has @@ -1131,7 +1110,7 @@ The names can be in upper- or lowercase. :cq[uit] Quit always, without writing, and return an error code. See |:cq|. Used for Manx's QuickFix mode (see - |quickfix|). {not in Vi} + |quickfix|). *:wq* :wq [++opt] Write the current file and quit. Writing fails when @@ -1169,7 +1148,7 @@ ZZ Write current file, if modified, and quit (same as *ZQ* ZQ Quit without checking for changes (same as ":q!"). - {not in Vi} + MULTIPLE WINDOWS AND BUFFERS *window-exit* @@ -1177,36 +1156,35 @@ MULTIPLE WINDOWS AND BUFFERS *window-exit* :qa[ll] Exit Vim, unless there are some buffers which have been changed. (Use ":bmod" to go to the next modified buffer). When 'autowriteall' is set all changed buffers will be - written, like |:wqall|. {not in Vi} + written, like |:wqall|. :conf[irm] qa[ll] Exit Vim. Bring up a prompt when some buffers have been - changed. See |:confirm|. {not in Vi} + changed. See |:confirm|. -:qa[ll]! Exit Vim. Any changes to buffers are lost. {not in Vi} +:qa[ll]! Exit Vim. Any changes to buffers are lost. Also see |:cquit|, it does the same but exits with a non-zero value. *:quita* *:quitall* -:quita[ll][!] Same as ":qall". {not in Vi} +:quita[ll][!] Same as ":qall". :wqa[ll] [++opt] *:wqa* *:wqall* *:xa* *:xall* :xa[ll] Write all changed buffers and exit Vim. If there are buffers without a file name, which are readonly or which cannot be - written for another reason, Vim will not quit. {not in Vi} + written for another reason, Vim will not quit. :conf[irm] wqa[ll] [++opt] :conf[irm] xa[ll] Write all changed buffers and exit Vim. Bring up a prompt when some buffers are readonly or cannot be written for - another reason. See |:confirm|. {not in Vi} + another reason. See |:confirm|. :wqa[ll]! [++opt] :xa[ll]! Write all changed buffers, even the ones that are readonly, and exit Vim. If there are buffers without a file name or which cannot be written for another reason, or there is a terminal with a running job, Vim will not quit. - {not in Vi} ============================================================================== 6. Dialogs *edit-dialogs* @@ -1317,10 +1295,12 @@ present in 'cpoptions' and "!" is not used in the command. name. On Unix systems: Change the current directory to the home directory. Use |:pwd| to print the current directory on all systems. + On Unix systems: clear any window-local directory. :cd[!] {path} Change the current directory to {path}. If {path} is relative, it is searched for in the directories listed in |'cdpath'|. + Clear any window-local directory. Does not change the meaning of an already opened file, because its full path name is remembered. Files from the |arglist| may change though! @@ -1330,7 +1310,7 @@ present in 'cpoptions' and "!" is not used in the command. < *:cd-* *E186* :cd[!] - Change to the previous current directory (before the - previous ":cd {path}" command). {not in Vi} + previous ":cd {path}" command). *:chd* *:chdir* :chd[ir][!] [path] Same as |:cd|. @@ -1341,20 +1321,18 @@ present in 'cpoptions' and "!" is not used in the command. The current directory is not changed for windows in other tabs and for windows in the current tab that have their own window-local directory. - {not in Vi} *:tch* *:tchdir* -:tch[dir][!] Same as |:tcd|. {not in Vi} +:tch[dir][!] Same as |:tcd|. *:lc* *:lcd* :lc[d][!] {path} Like |:cd|, but only set the current directory when the cursor is in the current window. The current directory for other windows is not changed, switching to another window will stop using {path}. - {not in Vi} *:lch* *:lchdir* -:lch[dir][!] Same as |:lcd|. {not in Vi} +:lch[dir][!] Same as |:lcd|. *:pw* *:pwd* *E187* :pw[d] Print the current directory name. {Vi: no pwd} @@ -1416,8 +1394,7 @@ There are a few things to remember when editing binary files: file. Otherwise both <CR> <NL> and <NL> are considered to end a line and when the file is written the <NL> will be replaced with <CR> <NL>. - <Nul> characters are shown on the screen as ^@. You can enter them with - "CTRL-V CTRL-@" or "CTRL-V 000" {Vi cannot handle <Nul> characters in the - file} + "CTRL-V CTRL-@" or "CTRL-V 000" - To insert a <NL> character in the file split a line. When writing the buffer to a file a <NL> will be written for the <EOL>. - Vim normally appends an <EOL> at the end of the file if there is none. |