Mercurial > vim
comparison runtime/doc/vi_diff.txt @ 16553:0e473e9e70c2 v8.1.1280
patch 8.1.1280: remarks about functionality not in Vi clutters the help
commit https://github.com/vim/vim/commit/25c9c680ec4dfbb51f4ef21c3460a48d3c67ffc8
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun May 5 18:13:34 2019 +0200
patch 8.1.1280: remarks about functionality not in Vi clutters the help
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.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 05 May 2019 18:15:06 +0200 |
parents | 32a543152dc0 |
children | 1eaf34420bb3 |
comparison
equal
deleted
inserted
replaced
16552:deb3d4f5be8b | 16553:0e473e9e70c2 |
---|---|
1 *vi_diff.txt* For Vim version 8.1. Last change: 2019 Apr 28 | 1 *vi_diff.txt* For Vim version 8.1. Last change: 2019 May 05 |
2 | 2 |
3 | 3 |
4 VIM REFERENCE MANUAL by Bram Moolenaar | 4 VIM REFERENCE MANUAL by Bram Moolenaar |
5 | 5 |
6 | 6 |
7 Differences between Vim and Vi *vi-differences* | 7 Differences between Vim and Vi *vi-differences* |
8 | 8 |
9 Throughout the help files differences between Vim and Vi/Ex are given in | 9 This file lists the differences between Vim and Vi/Ex and gives an overview of |
10 curly braces, like "{not in Vi}". This file only lists what has not been | 10 what is in Vim that is not in Vi. |
11 mentioned in other files and gives an overview. | |
12 | 11 |
13 Vim is mostly POSIX 1003.2-1 compliant. The only command known to be missing | 12 Vim is mostly POSIX 1003.2-1 compliant. The only command known to be missing |
14 is ":open". There are probably a lot of small differences (either because Vim | 13 is ":open". There are probably a lot of small differences (either because Vim |
15 is missing something or because Posix is beside the mark). | 14 is missing something or because Posix is beside the mark). |
16 | 15 |
178 for this facility. | 177 for this facility. |
179 Vim can also use multiple tab pages, each with one or more windows. A | 178 Vim can also use multiple tab pages, each with one or more windows. A |
180 line with tab labels can be used to quickly switch between these pages. | 179 line with tab labels can be used to quickly switch between these pages. |
181 |tab-page| | 180 |tab-page| |
182 | 181 |
182 Terminal window. |:terminal| | |
183 Vim can create a window in which a terminal emulator runs. This can | |
184 be used to execute an arbitrary command, a shell or a debugger. | |
185 | |
183 Syntax highlighting. |:syntax| | 186 Syntax highlighting. |:syntax| |
184 Vim can highlight keywords, patterns and other things. This is | 187 Vim can highlight keywords, patterns and other things. This is |
185 defined by a number of |:syntax| commands, and can be made to | 188 defined by a number of |:syntax| commands, and can be made to |
186 highlight most languages and file types. A number of files are | 189 highlight most languages and file types. A number of files are |
187 included for highlighting the most common languages, like C, C++, | 190 included for highlighting the most common languages, like C, C++, |
191 this is using a |:colorscheme| command. | 194 this is using a |:colorscheme| command. |
192 The highlighted text can be exported as HTML. |convert-to-HTML| | 195 The highlighted text can be exported as HTML. |convert-to-HTML| |
193 Other items that can be highlighted are matches with the search string | 196 Other items that can be highlighted are matches with the search string |
194 |'hlsearch'|, matching parens |matchparen| and the cursor line and | 197 |'hlsearch'|, matching parens |matchparen| and the cursor line and |
195 column |'cursorline'| |'cursorcolumn'|. | 198 column |'cursorline'| |'cursorcolumn'|. |
199 | |
200 Text properties |textprop.txt| | |
201 Vim supports highlighting text by a plugin. Property types can be | |
202 specificed with |prop_type_add()| and properties can be placed with | |
203 |prop_add()|. | |
196 | 204 |
197 Spell checking. |spell| | 205 Spell checking. |spell| |
198 When the 'spell' option is set Vim will highlight spelling mistakes. | 206 When the 'spell' option is set Vim will highlight spelling mistakes. |
199 About 50 languages are currently supported, selected with the | 207 About 50 languages are currently supported, selected with the |
200 'spelllang' option. In source code only comments and strings are | 208 'spelllang' option. In source code only comments and strings are |
260 gq format text to 'textwidth' columns | 268 gq format text to 'textwidth' columns |
261 J join lines | 269 J join lines |
262 ~ swap case | 270 ~ swap case |
263 u make lowercase | 271 u make lowercase |
264 U make uppercase | 272 U make uppercase |
273 {Vi has no Visual mode, the name "visual" is used for Normal mode, to | |
274 distinguish it from Ex mode} | |
265 | 275 |
266 Block operators. |visual-block| | 276 Block operators. |visual-block| |
267 With Visual mode a rectangular block of text can be selected. Start | 277 With Visual mode a rectangular block of text can be selected. Start |
268 Visual mode with CTRL-V. The block can be deleted ("d"), yanked ("y") | 278 Visual mode with CTRL-V. The block can be deleted ("d"), yanked ("y") |
269 or its case can be changed ("~", "u" and "U"). A deleted or yanked | 279 or its case can be changed ("~", "u" and "U"). A deleted or yanked |
520 With the CTRL-] command, the cursor may be in the middle of the identifier. | 530 With the CTRL-] command, the cursor may be in the middle of the identifier. |
521 | 531 |
522 The used tags are remembered. Commands that can be used with the tag stack | 532 The used tags are remembered. Commands that can be used with the tag stack |
523 are CTRL-T, ":pop" and ":tag". ":tags" lists the tag stack. | 533 are CTRL-T, ":pop" and ":tag". ":tags" lists the tag stack. |
524 | 534 |
535 Vi uses 'wrapscan' when searching for a tag. When jumping to a tag Vi starts | |
536 searching in line 2 of another file. It does not find a tag in line 1 of | |
537 another file when 'wrapscan' is not set. | |
538 | |
525 The 'tags' option can be set to a list of tag file names. Thus multiple | 539 The 'tags' option can be set to a list of tag file names. Thus multiple |
526 tag files can be used. For file names that start with "./", the "./" is | 540 tag files can be used. For file names that start with "./", the "./" is |
527 replaced with the path of the current file. This makes it possible to use a | 541 replaced with the path of the current file. This makes it possible to use a |
528 tags file in the same directory as the file being edited. | 542 tags file in the same directory as the file being edited. |
529 | 543 |
793 Vim supports nearly all Vi commands and mostly in the same way. That is when | 807 Vim supports nearly all Vi commands and mostly in the same way. That is when |
794 the 'compatible' option is set and 'cpoptions' contains all flags. What the | 808 the 'compatible' option is set and 'cpoptions' contains all flags. What the |
795 effect is of resetting 'compatible' and removing flags from 'cpoptions' can be | 809 effect is of resetting 'compatible' and removing flags from 'cpoptions' can be |
796 found at the help for the specific command. | 810 found at the help for the specific command. |
797 | 811 |
798 Below is listed what features are present in Vi. Anything else has been added | 812 The help files used to mark features that are in Vim but not in Vi with {not |
799 by Vim. | 813 in Vi}. However, since these remarks cluttered the help files we now do it |
814 the other way around: Below is listed what Vi already supported. Anything | |
815 else has been added by Vim. | |
816 | |
800 | 817 |
801 The following Ex commands are supported by Vi: ~ | 818 The following Ex commands are supported by Vi: ~ |
802 | 819 |
803 TODO | 820 `:abbreviate` enter abbreviation |
804 | 821 `:append` append text |
805 `:set` but not `:set inv{option}`, `:set option&`, `:set all&`, | 822 `:args` print the argument list |
806 `:set option+=value`, | 823 `:cd` change directory; Vi: no "cd -" |
807 `:set option^=value` | 824 `:change` replace a line or series of lines |
808 `:set option-=value` | 825 `:chdir` change directory |
809 `:set option<` | 826 `:copy` copy lines |
827 `:delete` delete lines | |
828 `:edit` edit a file | |
829 `:exit` same as ":xit" | |
830 `:file` show or set the current file name; Vi: without the column number | |
831 `:global` execute commands for matching lines | |
832 `:insert` insert text | |
833 `:join` join lines; Vi: not :join! | |
834 `:k` set a mark | |
835 `:list` print lines | |
836 `:map` show or enter a mapping | |
837 `:mark` set a mark | |
838 `:move` move lines | |
839 `:Next` go to previous file in the argument list; no count or ++opt | |
840 `:next` go to next file in the argument list; no count or ++opt | |
841 `:number` print lines with line number | |
842 `:open` start open mode (not implemented in Vim) | |
843 `:pop` jump to older entry in tag stack (only in some versions) | |
844 `:preserve` write all text to swap file | |
845 `:print` print lines | |
846 `:put` insert contents of register in the text | |
847 `:quit` quit Vi | |
848 `:read` read file into the text | |
849 `:recover` recover a file from a swap file | |
850 `:rewind` go to the first file in the argument list; no ++opt | |
851 `:set` set option; but not `:set inv{option}`, `:set option&`, | |
852 `:set all&`, `:set option+=value`, `:set option^=value` | |
853 `:set option-=value` `:set option<` | |
854 `:shell` escape to a shell | |
855 `:source` read Vim or Ex commands from a file | |
856 `:stop` suspend the editor or escape to a shell | |
857 `:substitute` find and replace text; Vi: no '&', 'i', 's', 'r' or 'I' flag, | |
858 confirm prompt only supports 'y' and 'n', no highlighting | |
859 `:suspend` same as ":stop" | |
860 `:t` same as ":copy" | |
861 `:tag` jump to tag | |
862 `:unabbreviate` remove abbreviation | |
863 `:undo` undo last change {Vi: only one level} | |
864 `:unmap` remove mapping | |
865 `:vglobal` execute commands for not matching lines | |
866 `:version` print version number and other info | |
867 `:visual` same as ":edit", but turns off "Ex" mode | |
868 `:wq` write to a file and quit Vi | |
869 `:write` write to a file | |
870 `:xit` write if buffer changed and quit Vi | |
871 `:yank` yank lines into a register | |
872 `:z` print some lines {not in all versions of Vi} | |
873 `:!` filter lines or execute an external command | |
874 `:"` comment | |
875 `:#` same as ":number" | |
876 `:*` execute contents of a register | |
877 `:&` repeat last ":substitute" | |
878 `:<` shift lines one 'shiftwidth' left | |
879 `:=` print the cursor line number | |
880 `:>` shift lines one 'shiftwidth' right | |
881 `:@` execute contents of a register; but not `:@`; `:@@` only in | |
882 some versions | |
810 | 883 |
811 | 884 |
812 The following Normal mode commands are supported by Vi: ~ | 885 The following Normal mode commands are supported by Vi: ~ |
813 | 886 |
814 TODO | 887 |CTRL-B| scroll N screens Backwards |
888 |CTRL-C| interrupt current (search) command | |
889 |CTRL-D| scroll Down N lines (default: half a screen); Vim scrolls | |
890 'scroll' screen lines, Vi scrolls file lines; makes a | |
891 difference when lines wrap | |
892 |CTRL-E| scroll N lines upwards (N lines Extra) | |
893 |CTRL-F| scroll N screens Forward | |
894 |CTRL-G| display current file name and position | |
895 |<BS>| same as "h" | |
896 |CTRL-H| same as "h" | |
897 |<NL>| same as "j" | |
898 |CTRL-J| same as "j" | |
899 |CTRL-L| redraw screen | |
900 |<CR>| cursor to the first CHAR N lines lower | |
901 |CTRL-M| same as <CR> | |
902 |CTRL-N| same as "j" | |
903 |CTRL-P| same as "k" | |
904 |CTRL-R| in some Vi versions: same as CTRL-L | |
905 |CTRL-T| jump to N older Tag in tag list | |
906 |CTRL-U| N lines Upwards (default: half a screen) | |
907 |CTRL-Y| scroll N lines downwards | |
908 |CTRL-Z| suspend program (or start new shell) | |
909 |CTRL-]| :ta to ident under cursor | |
910 |CTRL-^| edit alternate file; Vi: no count | |
911 |<Space>| same as "l" | |
912 |!| filter Nmove text through the {filter} command | |
913 |!!| filter N lines through the {filter} command | |
914 " use register {a-zA-Z0-9.%#:-"} for next delete, yank or put | |
915 (uppercase to append) ({.%#:} only work with put) | |
916 |$| cursor to the end of Nth next line | |
917 |%| find the next (curly/square) bracket on this line and go to | |
918 its match, or go to matching comment bracket, or go to | |
919 matching preprocessor directive (Vi: no count supported) | |
920 |&| repeat last :s | |
921 |'| jump to mark (Vi: only lowercase marks) | |
922 |(| cursor N sentences backward | |
923 |)| cursor N sentences forward | |
924 |+| same as <CR> | |
925 |,| repeat latest f, t, F or T in opposite direction N times | |
926 |-| cursor to the first CHAR N lines higher | |
927 |.| repeat last change with count replaced with N | |
928 |/| search forward for the Nth occurrence of {pattern} | |
929 |0| cursor to the first char of the line | |
930 |:| start entering an Ex command | |
931 |;| repeat latest f, t, F or T N times | |
932 |<| shift Nmove lines one 'shiftwidth' leftwards | |
933 |<<| shift N lines one 'shiftwidth' leftwards | |
934 |=| filter Nmove lines through "indent" | |
935 |==| filter N lines through "indent" | |
936 |>| shift Nmove lines one 'shiftwidth' rightwards | |
937 |>>| shift N lines one 'shiftwidth' rightwards | |
938 |?| search backward for the Nth previous occurrence of {pattern} | |
939 |@| execute the contents of register {a-z} N times | |
940 |@@| repeat the previous @{a-z} N times | |
941 |A| append text after the end of the line N times | |
942 |B| cursor N WORDS backward | |
943 |C| change from the cursor position to the end of the line | |
944 |D| delete the characters under the cursor until the end of the | |
945 line and N-1 more lines [into register x]; synonym for "d$" | |
946 |E| cursor forward to the end of WORD N | |
947 |F| cursor to the Nth occurrence of {char} to the left | |
948 |G| cursor to line N, default last line | |
949 |H| cursor to line N from top of screen | |
950 |I| insert text before the first CHAR on the line N times | |
951 |J| Join N lines; default is 2 | |
952 |L| cursor to line N from bottom of screen | |
953 |M| cursor to middle line of screen | |
954 |N| repeat the latest '/' or '?' N times in opposite direction | |
955 |O| begin a new line above the cursor and insert text, repeat N | |
956 times | |
957 |P| put the text [from register x] before the cursor N times | |
958 |Q| switch to "Ex" mode | |
959 |R| enter replace mode: overtype existing characters, repeat the | |
960 entered text N-1 times | |
961 |S| delete N lines [into register x] and start insert; synonym for | |
962 "cc". | |
963 |T| cursor till after Nth occurrence of {char} to the left | |
964 |U| undo all latest changes on one line | |
965 |W| cursor N WORDS forward | |
966 |X| delete N characters before the cursor [into register x] | |
967 |Y| yank N lines [into register x]; synonym for "yy" | |
968 |ZZ| store current file if modified, and exit | |
969 |[[| cursor N sections backward | |
970 |]]| cursor N sections forward | |
971 |^| cursor to the first CHAR of the line | |
972 |_| cursor to the first CHAR N - 1 lines lower | |
973 |`| cursor to the mark {a-zA-Z0-9} | |
974 |a| append text after the cursor N times | |
975 |b| cursor N words backward | |
976 |c| delete Nmove text [into register x] and start insert | |
977 |cc| delete N lines [into register x] and start insert | |
978 |d| delete Nmove text [into register x] | |
979 |dd| delete N lines [into register x] | |
980 |e| cursor forward to the end of word N | |
981 |f| cursor to Nth occurrence of {char} to the right | |
982 |h| cursor N chars to the left | |
983 |i| insert text before the cursor N times | |
984 |j| cursor N lines downward | |
985 |k| cursor N lines upward | |
986 |l| cursor N chars to the right | |
987 |m| set mark {A-Za-z} at cursor position | |
988 |n| repeat the latest '/' or '?' N times | |
989 |o| begin a new line below the cursor and insert text | |
990 |p| put the text [from register x] after the cursor N times | |
991 |r| replace N chars with {char} | |
992 |s| (substitute) delete N characters [into register x] and start | |
993 insert | |
994 |t| cursor till before Nth occurrence of {char} to the right | |
995 |u| undo changes {Vi: only one level} | |
996 |w| cursor N words forward | |
997 |x| delete N characters under and after the cursor [into register | |
998 x] | |
999 |y| yank Nmove text [into register x] | |
1000 |yy| yank N lines [into register x] | |
1001 |z<CR>| current line to the top | |
1002 |z-| current line to the bottom | |
1003 |z+| cursor on line N | |
1004 |z^| cursor on line N | |
1005 |{| cursor N paragraphs backward | |
1006 | cursor to column N | |
1007 |}| cursor N paragraphs forward | |
1008 |~| switch case of N characters under the cursor; Vim: depends on | |
1009 'tildeop' | |
1010 |<Del>| same as "x" | |
1011 | |
1012 | |
1013 The following commands are supported in Insert mode by Vi: ~ | |
1014 | |
1015 CTRL-@ insert previously inserted text and stop insert | |
1016 CTRL-C quit insert mode, without checking for abbreviation, unless | |
1017 'insertmode' set. | |
1018 CTRL-D delete one shiftwidth of indent in the current line | |
1019 <BS> delete character before the cursor | |
1020 CTRL-H same as <BS> | |
1021 <Tab> insert a <Tab> character | |
1022 CTRL-I same as <Tab> | |
1023 <NL> same as <CR> | |
1024 CTRL-J same as <CR> | |
1025 <CR> begin new line | |
1026 CTRL-M same as <CR> | |
1027 CTRL-T insert one shiftwidth of indent in current line | |
1028 CTRL-V {char} insert next non-digit literally | |
1029 CTRL-W delete word before the cursor | |
1030 CTRL-Z when 'insertmode' set: suspend Vim | |
1031 <Esc> end insert mode (unless 'insertmode' set) | |
1032 CTRL-[ same as <Esc> | |
1033 0 CTRL-D delete all indent in the current line | |
1034 ^ CTRL-D delete all indent in the current line, restore it in the next | |
1035 line | |
1036 <Del> delete character under the cursor | |
815 | 1037 |
816 | 1038 |
817 The following options are supported by Vi: ~ | 1039 The following options are supported by Vi: ~ |
818 | 1040 |
819 'autoindent' 'ai' take indent for new line from previous line | 1041 'autoindent' 'ai' take indent for new line from previous line |
847 'tagstack' 'tgst' push tags onto the tag stack {not in all versions | 1069 'tagstack' 'tgst' push tags onto the tag stack {not in all versions |
848 of Vi} | 1070 of Vi} |
849 'term' name of the terminal | 1071 'term' name of the terminal |
850 'terse' shorten some messages | 1072 'terse' shorten some messages |
851 'timeout' 'to' time out on mappings and key codes | 1073 'timeout' 'to' time out on mappings and key codes |
1074 'timeoutlen' 'tm' time for 'timeout' {only in some Vi versions} | |
852 'ttytype' 'tty' alias for 'term' | 1075 'ttytype' 'tty' alias for 'term' |
853 'verbose' 'vbs' give informative messages {only in some Vi | 1076 'verbose' 'vbs' give informative messages {only in some Vi |
854 versions as a boolean option} | 1077 versions as a boolean option} |
855 'warn' warn for shell command when buffer was changed | 1078 'warn' warn for shell command when buffer was changed |
856 'window' 'wi' nr of lines to scroll for CTRL-F and CTRL-B | 1079 'window' 'wi' nr of lines to scroll for CTRL-F and CTRL-B |
1080 {Vi also uses the option to specify the number of | |
1081 displayed lines} | |
857 'wrapmargin' 'wm' chars from the right where wrapping starts | 1082 'wrapmargin' 'wm' chars from the right where wrapping starts |
858 'wrapscan' 'ws' searches wrap around the end of the file | 1083 'wrapscan' 'ws' searches wrap around the end of the file |
859 'writeany' 'wa' write to file with no need for "!" override | 1084 'writeany' 'wa' write to file with no need for "!" override |
860 | 1085 |
861 Also see |missing-options|. | 1086 Also see |missing-options|. |
966 -H Vim: start Hebrew mode (when compiled with it). | 1191 -H Vim: start Hebrew mode (when compiled with it). |
967 | 1192 |
968 -i Elvis: Start each window in Insert mode. | 1193 -i Elvis: Start each window in Insert mode. |
969 -i {viminfo} Vim: Use {viminfo} for viminfo file. | 1194 -i {viminfo} Vim: Use {viminfo} for viminfo file. |
970 | 1195 |
971 -L Vim: Same as "-r" (also in some versions of Vi). | 1196 -L Vim: Same as "-r" {only in some versions of Vi: "List |
1197 recoverable edit sessions"}. | |
972 | 1198 |
973 -l Nvi, Vi, Vim: Set 'lisp' and 'showmatch' options. | 1199 -l Nvi, Vi, Vim: Set 'lisp' and 'showmatch' options. |
974 | 1200 |
975 -m Vim: Modifications not allowed to be written, resets 'write' | 1201 -m Vim: Modifications not allowed to be written, resets 'write' |
976 option. | 1202 option. |