diff options
author | Michael Reed <m.reed@mykolab.com> | 2015-11-07 15:14:58 -0500 |
---|---|---|
committer | Michael Reed <m.reed@mykolab.com> | 2015-11-23 15:46:10 -0500 |
commit | acadfc20c439bf449745762a1e4c8a187c00c023 (patch) | |
tree | 7d9213d4581fcc81053a1f41ddc8639747bf6b49 | |
parent | 02478686f1df93623ea8ffc9a6f272abde673f80 (diff) | |
download | rneovim-acadfc20c439bf449745762a1e4c8a187c00c023.tar.gz rneovim-acadfc20c439bf449745762a1e4c8a187c00c023.tar.bz2 rneovim-acadfc20c439bf449745762a1e4c8a187c00c023.zip |
doc: vi_diff: Remove 'Other vim features' section
These are more like notes than proper documentation, so remove it as
they're not of much use unless you don't know what you're looking for.
Many of these are somewhat useful, but many also duplicate what's
already documented elsewhere. In any case, vi_diff.txt is the last
place that assorted tips'n'tricks should be located (we already have
tips.txt!!!).
-rw-r--r-- | runtime/doc/vi_diff.txt | 307 |
1 files changed, 0 insertions, 307 deletions
diff --git a/runtime/doc/vi_diff.txt b/runtime/doc/vi_diff.txt index f01d9b86db..d181b4999d 100644 --- a/runtime/doc/vi_diff.txt +++ b/runtime/doc/vi_diff.txt @@ -13,7 +13,6 @@ mentioned in other files and gives an overview. 1. Missing options |missing-options| 2. Limits |limits| 3. The most interesting additions |vim-additions| -4. Other vim features |other-features| ============================================================================== 1. Missing options *missing-options* @@ -417,311 +416,5 @@ Move cursor beyond lines. screen, also where there is no text. This is useful to edit tables and figures easily. -============================================================================== -5. Other vim features *other-features* - -A random collection of nice extra features. - - -When Vim is started with "-s scriptfile", the characters read from -"scriptfile" are treated as if you typed them. If end of file is reached -before the editor exits, further characters are read from the console. - -The "-w" option can be used to record all typed characters in a script file. -This file can then be used to redo the editing, possibly on another file or -after changing some commands in the script file. - -The "-o" option opens a window for each argument. "-o4" opens four windows. - -Vi requires several termcap entries to be able to work full-screen. Vim only -requires the "cm" entry (cursor motion). - - -In command mode: - -When the 'showcmd' option is set, the command characters are shown in the last -line of the screen. They are removed when the command is finished. - -If the 'ruler' option is set, the current cursor position is shown in the -last line of the screen. - -"U" still works after having moved off the last changed line and after "u". - -Characters with the 8th bit set are displayed. The characters between '~' and -0xa0 are displayed as "~?", "~@", "~A", etc., unless they are included in the -'isprint' option. - -"][" goes to the next ending of a C function ('}' in column 1). -"[]" goes to the previous ending of a C function ('}' in column 1). - -"]f", "[f" and "gf" start editing the file whose name is under the cursor. -CTRL-W f splits the window and starts editing the file whose name is under -the cursor. - -"*" searches forward for the identifier under the cursor, "#" backward. -"K" runs the program defined by the 'keywordprg' option, with the identifier -under the cursor as argument. - -"%" can be preceded with a count. The cursor jumps to the line that -percentage down in the file. The normal "%" function to jump to the matching -brace skips braces inside quotes. - -With the CTRL-] command, the cursor may be in the middle of the identifier. - -The used tags are remembered. Commands that can be used with the tag stack -are CTRL-T, ":pop" and ":tag". ":tags" lists the tag stack. - -The 'tags' option can be set to a list of tag file names. Thus multiple -tag files can be used. For file names that start with "./", the "./" is -replaced with the path of the current file. This makes it possible to use a -tags file in the same directory as the file being edited. - -Previously used file names are remembered in the alternate file name list. -CTRL-^ accepts a count, which is an index in this list. -":files" command shows the list of alternate file names. -"#<N>" is replaced with the <N>th alternate file name in the list. -"#<" is replaced with the current file name without extension. - -Search patterns have more features. The <NL> character is seen as part of the -search pattern and the substitute string of ":s". Vi sees it as the end of -the command. - -Searches can put the cursor on the end of a match and may include a character -offset. - -Count added to "~", ":next", ":Next", "n" and "N". - -The command ":next!" with 'autowrite' set does not write the file. In vi the -file was written, but this is considered to be a bug, because one does not -expect it and the file is not written with ":rewind!". - -In Vi when entering a <CR> in replace mode deletes a character only when 'ai' -is set (but does not show it until you hit <Esc>). Vim always deletes a -character (and shows it immediately). - -Added :wnext command. Same as ":write" followed by ":next". - -The ":w!" command always writes, also when the file is write protected. In Vi -you would have to do ":!chmod +w %:S" and ":set noro". - -When 'tildeop' has been set, "~" is an operator (must be followed by a -movement command). - -With the "J" (join) command you can reset the 'joinspaces' option to have only -one space after a period (Vi inserts two spaces). - -"cw" can be used to change white space formed by several characters (Vi is -confusing: "cw" only changes one space, while "dw" deletes all white space). - -"o" and "O" accept a count for repeating the insert (Vi clears a part of -display). - -Flags after Ex commands not supported (no plans to include it). - -On non-UNIX systems ":cd" command shows current directory instead of going to -the home directory (there isn't one). ":pwd" prints the current directory on -all systems. - -After a ":cd" command the file names (in the argument list, opened files) -still point to the same files. In Vi ":cd" is not allowed in a changed file; -otherwise the meaning of file names change. - -":source!" command reads Vi commands from a file. - -":mkexrc" command writes current modified options and mappings to a ".exrc" -file. ":mkvimrc" writes to a ".vimrc" file. - -No check for "tail recursion" with mappings. This allows things like -":map! foo ^]foo". - -When a mapping starts with number, vi loses the count typed before it (e.g. -when using the mapping ":map g 4G" the command "7g" goes to line 4). This is -considered a vi bug. Vim concatenates the counts (in the example it becomes -"74G"), as most people would expect. - -The :put! command inserts the contents of a register above the current line. - -The "p" and "P" commands of vi cannot be repeated with "." when the putted -text is less than a line. In Vim they can always be repeated. - -":noremap" command can be used to enter a mapping that will not be remapped. -This is useful to exchange the meaning of two keys. ":cmap", ":cunmap" and -":cnoremap" can be used for mapping in command-line editing only. ":imap", -":iunmap" and ":inoremap" can be used for mapping in insert mode only. -Similar commands exist for abbreviations: ":noreabbrev", ":iabbrev" -":cabbrev", ":iunabbrev", ":cunabbrev", ":inoreabbrev", ":cnoreabbrev". - -In Vi the command ":map foo bar" would remove a previous mapping -":map bug foo". This is considered a bug, so it is not included in Vim. -":unmap! foo" does remove ":map! bug foo", because unmapping would be very -difficult otherwise (this is vi compatible). - -The ':' register contains the last command-line. -The '%' register contains the current file name. -The '.' register contains the last inserted text. - -":dis" command shows the contents of the yank registers. - -CTRL-O/CTRL-I can be used to jump to older/newer positions. These are the -same positions as used with the '' command, but may be in another file. The -":jumps" command lists the older positions. - -If the 'shiftround' option is set, an indent is rounded to a multiple of -'shiftwidth' with ">" and "<" commands. - -The 'scrolljump' option can be set to the minimum number of lines to scroll -when the cursor gets off the screen. Use this when scrolling is slow. - -The 'scrolloff' option can be set to the minimum number of lines to keep -above and below the cursor. This gives some context to where you are -editing. When set to a large number the cursor line is always in the middle -of the window. - -Uppercase marks can be used to jump between files. The ":marks" command lists -all currently set marks. The commands "']" and "`]" jump to the end of the -previous operator or end of the text inserted with the put command. "'[" and -"`[" do jump to the start. - -The 'highlight' option can be set for the highlight mode to be used for -several commands. - -The CTRL-A (add) and CTRL-X (subtract) commands are new. The count to the -command (default 1) is added to/subtracted from the number at or after the -cursor. That number may be decimal, octal (starts with a '0') or hexadecimal -(starts with '0x'). Very useful in macros. - -With the :set command the prefix "inv" can be used to invert boolean options. - -In both Vi and Vim you can create a line break with the ":substitute" command -by using a CTRL-M. For Vi this means you cannot insert a real CTRL-M in the -text. With Vim you can put a real CTRL-M in the text by preceding it with a -CTRL-V. - - -In Insert mode: - -If the 'revins' option is set, insert happens backwards. This is for typing -Hebrew. When inserting normal characters the cursor will not be shifted and -the text moves rightwards. Backspace, CTRL-W and CTRL-U will also work in -the opposite direction. CTRL-B toggles the 'revins' option. In replace mode -'revins' has no effect. Only when enabled at compile time. - -The backspace key can be used just like CTRL-D to remove auto-indents. - -You can backspace, CTRL-U and CTRL-W over line breaks if the 'backspace' (bs) -option includes "eol". You can backspace over the start of insert if the -'backspace' option includes "start". - -When the 'paste' option is set, a few options are reset and mapping in insert -mode and abbreviation are disabled. This allows for pasting text in windowing -systems without unexpected results. When the 'paste' option is reset, the old -option values are restored. - -CTRL-T/CTRL-D always insert/delete an indent in the current line, no matter -what column the cursor is in. - -CTRL-@ (insert previously inserted text) works always (Vi: only when typed as -first character). - -CTRL-A works like CTRL-@ but does not leave insert mode. - -CTRL-R {0-9a-z..} can be used to insert the contents of a register. - -When the 'smartindent' option is set, C programs will be better auto-indented. -With 'cindent' even more. - -CTRL-Y and CTRL-E can be used to copy a character from above/below the -current cursor position. - -After CTRL-V you can enter a three digit decimal number. This byte value is -inserted in the text as a single character. Useful for international -characters that are not on your keyboard. - -When the 'expandtab' (et) option is set, a <Tab> is expanded to the -appropriate number of spaces. - -The window always reflects the contents of the buffer (Vi does not do this -when changing text and in some other cases). - -If Vim is compiled with DIGRAPHS defined, digraphs are supported. A set of -normal digraphs is included. They are shown with the ":digraph" command. -More can be added with ":digraph {char1}{char2} {number}". A digraph is -entered with "CTRL-K {char1} {char2}" or "{char1} BS {char2}" (only when -'digraph' option is set). - -When repeating an insert, e.g. "10atest <Esc>" vi would only handle wrapmargin -for the first insert. Vim does it for all. - -A count to the "i" or "a" command is used for all the text. Vi uses the count -only for one line. "3iabc<NL>def<Esc>" would insert "abcabcabc<NL>def" in Vi -but "abc<NL>defabc<NL>defabc<NL>def" in Vim. - - -In Command-line mode: - -<Esc> terminates the command-line without executing it. In vi the command -line would be executed, which is not what most people expect (hitting <Esc> -should always get you back to command mode). To avoid problems with some -obscure macros, an <Esc> in a macro will execute the command. If you want a -typed <Esc> to execute the command like vi does you can fix this with - ":cmap ^V<Esc> ^V<CR>" - -General: - -The 'ttimeout' option is like 'timeout', but only works for cursor and -function keys, not for ordinary mapped characters. The 'timeoutlen' option -gives the number of milliseconds that is waited for. If the 'esckeys' option -is not set, cursor and function keys that start with <Esc> are not recognized -in insert mode. - -There is an option for each terminal string. Can be used when termcap is not -supported or to change individual strings. - -The 'fileformat' option can be set to select the <EOL>: "dos" <CR><NL>, "unix" -<NL> or "mac" <CR>. -When the 'fileformats' option is not empty, Vim tries to detect the type of -<EOL> automatically. The 'fileformat' option is set accordingly. - -On systems that have no job control (older Unix systems and non-Unix systems) -the CTRL-Z, ":stop" or ":suspend" command starts a new shell. - -The 'columns' and 'lines' options are used to set or get the width and height -of the display. - -Option settings are read from the first and last few lines of the file. -Option 'modelines' determines how many lines are tried (default is 5). Note -that this is different from the Vi versions that can execute any Ex command -in a modeline (a major security problem). |trojan-horse| - -If the 'insertmode' option is set (e.g. in .exrc), Vim starts in insert mode. -And it comes back there, when pressing <Esc>. - -Undo information is kept in memory. Available memory limits the number and -size of change that can be undone. This may be a problem with MS-DOS, but is -almost never one with Unix and Win32. - -If the 'backup' or 'writebackup' option is set: Before a file is overwritten, -a backup file (.bak) is made. If the "backup" option is set it is left -behind. - -Vim creates a file ending in ".swp" to store parts of the file that have been -changed or that do not fit in memory. This file can be used to recover from -an aborted editing session with "vim -r file". Using the swap file can be -switched off by setting the 'updatecount' option to 0 or starting Vim with -the "-n" option. Use the 'directory' option for placing the .swp file -somewhere else. - -Error messages are shown at least one second (Vi overwrites error messages). - -If Vim gives the |hit-enter| prompt, you can hit any key. Characters other -than <CR>, <NL> and <Space> are interpreted as the (start of) a command. (Vi -only accepts a command starting with ':'). - -The contents of the numbered and unnamed registers is remembered when -changing files. - -The "No lines in buffer" message is a normal message instead of an error -message, since that may cause a mapping to be aborted. - vim:tw=78:ts=8:ft=help:norl: |