From 24dd537c5e0af78b51645d529b39332264710979 Mon Sep 17 00:00:00 2001 From: rebornix Date: Mon, 15 Aug 2016 13:16:14 +0800 Subject: [PATCH] add part of missing sections in vim quickref --- ROADMAP.md | 309 +++++++++++++++++++++++++++++++++-------------------- 1 file changed, 195 insertions(+), 114 deletions(-) diff --git a/ROADMAP.md b/ROADMAP.md index 0d246a4c..a7e3632d 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -105,6 +105,44 @@ Status | Command | Description :arrow_down: | :1234: [* | N times back to start of a C comment "/*" :arrow_down: | :1234: ]* | N times forward to end of a C comment "*/" +## Pattern searches + +Status | Command | Description +---|--------|------------------------------ +:warning: | :1234: /{pattern}[/[offset]] | search forward for the Nth occurrence of {pattern} +:warning: | :1234: ?{pattern}[?[offset]] | search backward for the Nth occurrence of {pattern} + | :1234: / | repeat last search, in the forward direction + | :1234: ? | repeat last search, in the backward direction +:warning: | :1234: n | repeat last search +:warning: | :1234: N | repeat last search, in opposite direction +:white_check_mark: | :1234: * | search forward for the identifier under the cursor +:white_check_mark: | :1234: # | search backward for the identifier under the cursor + | :1234: g* | like "*", but also find partial matches + | :1234: g# | like "#", but also find partial matches +:white_check_mark: | gd | goto local declaration of identifier under the cursor + | gD | goto global declaration of identifier under the cursor + +## Marks and motions + +Status | Command | Description +---|--------|------------------------------ +:white_check_mark: | m{a-zA-Z} | mark current position with mark {a-zA-Z} + | `{a-z} | go to mark {a-z} within current file + | `{A-Z} | go to mark {A-Z} in any file + | `{0-9} | go to the position where Vim was previously exited + | `` | go to the position before the last jump + | `" | go to the position when last editing this file + | `[ | go to the start of the previously operated or put text + | `] | go to the end of the previously operated or put text + | `< | go to the start of the (previous) Visual area + | `> | go to the end of the (previous) Visual area + | `. | go to the position of the last change in this file + | '{a-zA-Z0-9[]'"<>.} | same as `, but on the first non-blank in the line + | :marks | print the active marks + | :1234: CTRL-O | go to Nth older position in jump list + | :1234: CTRL-I | go to Nth newer position in jump list + | :ju[mps] | print the jump list + ## Various motions Status | Command | Description @@ -116,6 +154,44 @@ Status | Command | Description |:1234: go | go to Nth byte in the buffer |:[range]go[to] [off] | go to [off] byte in the buffer +## Using tags + +Status | Command | Description +---|--------|------------------------------ +| :ta[g][!] {tag} | jump to tag {tag} +| :[count]ta[g][!] | jump to [count]'th newer tag in tag list +| CTRL-] | jump to the tag under cursor, unless changes have been made +| :ts[elect][!] [tag] | list matching tags and select one to jump to +| :tj[ump][!] [tag] | jump to tag [tag] or select from list when there are multiple matches +| :lt[ag][!] [tag] | jump to tag [tag] and add matching tags to the location list +| :tagsa | print tag list +| :1234: CTRL-T | jump back from Nth older tag in tag list +| :[count]po[p][!] | jump back from [count]'th older tag in tag list +| :[count]tn[ext][!] | jump to [count]'th next matching tag +| :[count]tp[revious][!] | jump to [count]'th previous matching tag +| :[count]tr[ewind][!] | jump to [count]'th matching tag +| :tl[ast][!] | jump to last matching tag +| :pt[ag] {tag} | open a preview window to show tag {tag} +| CTRL-W } | like CTRL-] but show tag in preview window +| :pts[elect] | like ":tselect" but show tag in preview window +| :ptj[ump] | like ":tjump" but show tag in preview window +| :pc[lose] | close tag preview window +| CTRL-W z | close tag preview window` + +## Scrolling + +Status | Command | Description +---|--------|------------------------------ +:x: | :1234: CTRL-E | window N lines downwards (default: 1) +:warning: | :1234: CTRL-D | window N lines Downwards (default: 1/2 window) +:x: | :1234: CTRL-F | window N pages Forwards (downwards) + :x: | :1234: CTRL-Y | window N lines upwards (default: 1) +:warning: | :1234: CTRL-U | window N lines Upwards (default: 1/2 window) +:x: | :1234: CTRL-B | window N pages Backwards (upwards) +:x: | z CR or zt | redraw, current line at top of window +:warning: | z. or zz | redraw, current line at center of window +:x: | z- or zb | redraw, current line at bottom of window + These only work when 'wrap' is off: Status | Command | Description @@ -164,6 +240,43 @@ Status | Command | Description :white_check_mark: | End | cursor after last character in the line :white_check_mark: | Home | cursor to first character in the line +## Special keys in Insert mode + +Status | Command | Description +---|--------|------------------------------ + | CTRL-V {char}.. | insert character literally, or enter decimal byte value +:warning: | NL or CR or CTRL-M or CTRL-J | begin new line + | CTRL-E | insert the character from below the cursor + | CTRL-Y | insert the character from above the cursor + | CTRL-A | insert previously inserted text + | CTRL-@ | insert previously inserted text and stop Insert mode + | CTRL-R {0-9a-z%#:.-="} | insert the contents of a register + | CTRL-N | insert next match of identifier before the cursor + | CTRL-P | insert previous match of identifier before the cursor + | CTRL-X ... | complete the word before the cursor in various ways + | BS or CTRL-H | delete the character before the cursor +:white_check_mark: | Del | delete the character under the cursor +:white_check_mark: | CTRL-W | delete word before the cursor + | CTRL-U | delete all entered characters in the current line + | CTRL-T | insert one shiftwidth of indent in front of the current line + | CTRL-D | delete one shiftwidth of indent in front of the current line + | 0 CTRL-D | delete all indent in the current line + | ^ CTRL-D | delete all indent in the current line, restore indent in next line + +## Digraphs + +Status | Command | Description +---|--------|------------------------------ +:arrow_down: | :dig[raphs] | show current list of digraphs +:arrow_down: | :dig[raphs] {char1}{char2} {number} ... | add digraph(s) to the list + +## Special inserts + +Status | Command | Description +---|--------|------------------------------ + | :r [file] | insert the contents of [file] below the cursor + | :r! {command} | insert the standard output of {command} below the cursor + ## Deleting text Status | Command | Description @@ -242,6 +355,22 @@ Status | Command | Description | :[range]le[ft] [indent] | left-align the lines in [range] (with [indent]) | :[range]ri[ght] [width] | right-align the lines in [range] +## Complex changes + +Status | Command | Description +---|--------|------------------------------ + | :1234: !{motion}{command} | filter the lines that are moved over through {command} + | :1234: !!{command} | filter N lines through {command} + | {visual}!{command} | filter the highlighted lines through {command} + | :[range]! {command} | filter [range] lines through {command} +:white_check_mark: | :1234: ={motion} | filter the lines that are moved over through 'equalprg' + | :1234: == | filter N lines through 'equalprg' +:white_check_mark: | {visual}= | filter the highlighted lines through 'equalprg' +:warning: | :[range]s[ubstitute]/{pattern}/{string}/[g][c] | substitute {pattern} by {string} in [range] lines; with [g], replace all occurrences of {pattern}; with [c], confirm each replacement + | :[range]s[ubstitute] [g][c] | repeat previous ":s" with new range and options + | & | Repeat previous ":s" on current line without options + :arrow_down: | :[range]ret[ab][!] [tabstop] | set 'tabstop' to new value and adjust white space accordingly + ## Visual mode Status | Command | Description @@ -301,94 +430,80 @@ Status | Command | Description :arrow_down: | :sl[eep] [sec] | don't do anything for [sec] seconds :arrow_down: | :1234: gs | goto Sleep for N seconds - -## Marks and motions +## options Status | Command | Description ---|--------|------------------------------ -:white_check_mark: | m{a-zA-Z} | mark current position with mark {a-zA-Z} - | `{a-z} | go to mark {a-z} within current file - | `{A-Z} | go to mark {A-Z} in any file - | `{0-9} | go to the position where Vim was previously exited - | `` | go to the position before the last jump - | `" | go to the position when last editing this file - | `[ | go to the start of the previously operated or put text - | `] | go to the end of the previously operated or put text - | `< | go to the start of the (previous) Visual area - | `> | go to the end of the (previous) Visual area - | `. | go to the position of the last change in this file - | '{a-zA-Z0-9[]'"<>.} | same as `, but on the first non-blank in the line - | :marks | print the active marks - | :1234: CTRL-O | go to Nth older position in jump list - | :1234: CTRL-I | go to Nth newer position in jump list - | :ju[mps] | print the jump list + | :se[t] | show all modified options + | :se[t] all | show all non-termcap options + | :se[t] termcap | show all termcap options +:white_check_mark: | :se[t] {option} | set boolean option (switch it on), show string or number option +:white_check_mark: | :se[t] no{option} | reset boolean option (switch it off) + | :se[t] inv{option} |invert boolean option +:white_check_mark: | :se[t] {option}={value} | set string/number option to {value} + | :se[t] {option}+={value} | append {value} to string option, add {value} to number option + | :se[t] {option}-={value} | remove {value} to string option, subtract {value} from number option + | :se[t] {option}? | show value of {option} + | :se[t] {option}& | reset {option} to its default value + | :setl[ocal] | like ":set" but set the local value for options that have one + | :setg[lobal] | like ":set" but set the global value of a local option + | :fix[del] | set value of 't_kD' according to value of 't_kb' + | :opt[ions] | open a new window to view and set options, grouped by functionality, a one line explanation and links to the help -## Complex changes +Since the list is too long, now we just put those already supported options here. + +Status | Command | Default Value | Description +---|--------|-------|------------------------------ +:white_check_mark:| tabstop (ts) | 4. we use Code's default value `tabSize` instead of Vim | number of spaces that in file uses +:white_check_mark:| :white_check_mark:| hlsearch (hls) | false | When there is a previous search pattern, highlight all its matches. +:white_check_mark:| ignorecase (ic) | false | Ignore case in search patterns. +:white_check_mark:| smartcase (scs) | false | Override the 'ignorecase' option if the search pattern contains upper case characters. +:white_check_mark:| iskeyword (isk) | `@,48-57,_,128-167,224-235` | keywords contain alphanumeric characters and '_'. If there is no user setting for `iskeyword`, we use `editor.wordSeparators` properties. +:white_check_mark:| scroll (scr) | 20 | Number of lines to scroll with CTRL-U and CTRL-D commands. +:white_check_mark:| expandtab (et) | True. we use Code's default value `inserSpaces` instead of Vim | use spaces when is inserted + +--- + +## Undo/Redo commands + +Status | Command | Default Value | Description +---|--------|-------|------------------------------ +:warning: | :1234: u | undo last N changes +:warning: | :1234: CTRL-R | redo last N undone changes +| U | restore last changed line + +## External commands + +Status | Command | Default Value | Description +---|--------|-------|------------------------------ +:arrow_down: | :sh[ell] | start a shell +:arrow_down: | :!{command} | execute {command} with a shell +:arrow_down: | K | lookup keyword under the cursor with 'keywordprg' program (default: "man") + +## Ex rangs + +Status | Command | Default Value | Description +---|--------|-------|------------------------------ +:white_check_mark: | , | separates two line numbers +| ; | idem, set cursor to the first line number before interpreting the second one +:white_check_mark: | {number} | an absolute line number +:white_check_mark: | . | the current line +:white_check_mark: | $ | the last line in the file +:white_check_mark: | % | equal to 1,$ (the entire file) +| * | equal to '<,'> (visual area) +| 't | position of mark t +| /{pattern}[/] | the next line where {pattern} matches +| ?{pattern}[?] | the previous line where {pattern} matches +:white_check_mark: | +[num] | add [num] to the preceding line number (default: 1) +:white_check_mark: | -[num] | subtract [num] from the preceding line number (default: 1) + +## Editing a file Status | Command | Description ---|--------|------------------------------ - | :1234: !{motion}{command} | filter the lines that are moved over through {command} - | :1234: !!{command} | filter N lines through {command} - | {visual}!{command} | filter the highlighted lines through {command} - | :[range]! {command} | filter [range] lines through {command} -:white_check_mark: | :1234: ={motion} | filter the lines that are moved over through 'equalprg' - | :1234: == | filter N lines through 'equalprg' -:white_check_mark: | {visual}= | filter the highlighted lines through 'equalprg' -:warning: | :[range]s[ubstitute]/{pattern}/{string}/[g][c] | substitute {pattern} by {string} in [range] lines; with [g], replace all occurrences of {pattern}; with [c], confirm each replacement - | :[range]s[ubstitute] [g][c] | repeat previous ":s" with new range and options - | & | Repeat previous ":s" on current line without options - :arrow_down: | :[range]ret[ab][!] [tabstop] | set 'tabstop' to new value and adjust white space accordingly +:warning: | :e[dit] {file} | Edit {file}. We will open file in a new Tab of current Grouped Editor instead of opening in current tab. - -## Special keys in Insert mode - -Status | Command | Description ----|--------|------------------------------ - | CTRL-V {char}.. | insert character literally, or enter decimal byte value -:warning: | NL or CR or CTRL-M or CTRL-J | begin new line - | CTRL-E | insert the character from below the cursor - | CTRL-Y | insert the character from above the cursor - | CTRL-A | insert previously inserted text - | CTRL-@ | insert previously inserted text and stop Insert mode - | CTRL-R {0-9a-z%#:.-="} | insert the contents of a register - | CTRL-N | insert next match of identifier before the cursor - | CTRL-P | insert previous match of identifier before the cursor - | CTRL-X ... | complete the word before the cursor in various ways - | BS or CTRL-H | delete the character before the cursor -:white_check_mark: | Del | delete the character under the cursor -:white_check_mark: | CTRL-W | delete word before the cursor - | CTRL-U | delete all entered characters in the current line - | CTRL-T | insert one shiftwidth of indent in front of the current line - | CTRL-D | delete one shiftwidth of indent in front of the current line - | 0 CTRL-D | delete all indent in the current line - | ^ CTRL-D | delete all indent in the current line, restore indent in next line - - - -## Scrolling - -Status | Command | Description ----|--------|------------------------------ -:x: | :1234: CTRL-E | window N lines downwards (default: 1) -:warning: | :1234: CTRL-D | window N lines Downwards (default: 1/2 window) -:x: | :1234: CTRL-F | window N pages Forwards (downwards) - :x: | :1234: CTRL-Y | window N lines upwards (default: 1) -:warning: | :1234: CTRL-U | window N lines Upwards (default: 1/2 window) -:x: | :1234: CTRL-B | window N pages Backwards (upwards) -:x: | z CR or zt | redraw, current line at top of window -:warning: | z. or zz | redraw, current line at center of window -:x: | z- or zb | redraw, current line at bottom of window - - -## Special inserts - -Status | Command | Description ----|--------|------------------------------ - | :r [file] | insert the contents of [file] below the cursor - | :r! {command} | insert the standard output of {command} below the cursor - - -## Window +## Multi-window commands Status | Command | Description ---|--------|------------------------------ @@ -399,7 +514,6 @@ Status | Command | Description :x: | :new | Create a new window horizontally and start editing an empty file in it. | :vne[w] | Create a new window vertically and start editing an empty file in it. - ## Tabs Status | Command | Description @@ -421,39 +535,6 @@ Status | Command | Description :x: | :tabs | List the tab pages and the windows they contain. | :tabd[o] {cmd} | Execute {cmd} in each tab page. -## options -### Commands -Status | Command | Description ----|--------|------------------------------ - | :se[t] | show all modified options - | :se[t] all | show all non-termcap options - | :se[t] termcap | show all termcap options -:white_check_mark: | :se[t] {option} | set boolean option (switch it on), show string or number option -:white_check_mark: | :se[t] no{option} | reset boolean option (switch it off) - | :se[t] inv{option} |invert boolean option -:white_check_mark: | :se[t] {option}={value} | set string/number option to {value} - | :se[t] {option}+={value} | append {value} to string option, add {value} to number option - | :se[t] {option}-={value} | remove {value} to string option, subtract {value} from number option - | :se[t] {option}? | show value of {option} - | :se[t] {option}& | reset {option} to its default value - | :setl[ocal] | like ":set" but set the local value for options that have one - | :setg[lobal] | like ":set" but set the global value of a local option - | :fix[del] | set value of 't_kD' according to value of 't_kb' - | :opt[ions] | open a new window to view and set options, grouped by functionality, a one line explanation and links to the help - -### Option list -Since the list is too long, now we just put those already supported options here. - -Status | Command | Default Value | Description ----|--------|-------|------------------------------ -:white_check_mark:| tabstop (ts) | 4. we use Code's default value `tabSize` instead of Vim | number of spaces that in file uses -:white_check_mark:| :white_check_mark:| hlsearch (hls) | false | When there is a previous search pattern, highlight all its matches. -:white_check_mark:| ignorecase (ic) | false | Ignore case in search patterns. -:white_check_mark:| smartcase (scs) | false | Override the 'ignorecase' option if the search pattern contains upper case characters. -:white_check_mark:| iskeyword (isk) | `@,48-57,_,128-167,224-235` | keywords contain alphanumeric characters and '_'. If there is no user setting for `iskeyword`, we use `editor.wordSeparators` properties. -:white_check_mark:| scroll (scr) | 20 | Number of lines to scroll with CTRL-U and CTRL-D commands. ->expandtab (et) | True. we use Code's default value `inserSpaces` instead of Vim | use spaces when is inserted - ## Folding ### Fold methods The folding method can be set with the 'foldmethod' option. This is currently not possible as we are relying on Code's Fold logic.