2. Normal mode *normal-index* LEGEND FOR THE FIRST COLUMN: " " works "e" works if platform support, eg an IDE "." future support, may be partial "x" not supported or planned (but plans change) It may be possible to block user specified keys from jVi, in which case it will be handled by the platform. CHAR any non-blank character WORD any sequences of non-blank characters N a number entered before the command {motion} a cursor movement command Nmove the text that is moved over with a {motion} SECTION a section that possibly starts with '}' instead of '{' note: 1 = cursor movement command; 2 = can be undone/redone tag char note action in Normal mode ~ ------------------------------------------------------------------------------ CTRL-@ not used .|CTRL-A| CTRL-A 2 add N to number at/after cursor |CTRL-B| CTRL-B 1 scroll N screens Backwards .|CTRL-C| CTRL-C interrupt current (search) command |CTRL-D| CTRL-D scroll Down N lines (default: half a screen) |CTRL-E| CTRL-E scroll N lines upwards (N lines Extra) |CTRL-F| CTRL-F 1 scroll N screens Forward |CTRL-G| CTRL-G display current file name and position || 1 same as "h" |CTRL-H| CTRL-H 1 same as "h" e|| 1 go to N newer entry in jump list e|CTRL-I| CTRL-I 1 same as || 1 same as "j" |CTRL-J| CTRL-J 1 same as "j" CTRL-K not used x|CTRL-L| CTRL-L redraw screen || 1 cursor to the first CHAR N lines lower |CTRL-M| CTRL-M> 1 same as |CTRL-N| CTRL-N 1 same as "j" e|CTRL-O| CTRL-O 1 go to N older entry in jump list |CTRL-P| CTRL-P 1 cursor N lines upward CTRL-Q (used for terminal control flow) |CTRL-R| CTRL-R 2 redo changes which were undone with 'u' CTRL-S (used for terminal control flow) e|CTRL-T| CTRL-T jump to N older Tag in tag list |CTRL-U| CTRL-U scroll N lines Upwards (default: half a screen) |CTRL-V| CTRL-V start blockwise Visual mode e|CTRL-W| CTRL-W {char} window commands, see |CTRL-W| .|CTRL-X| CTRL-X 2 subtract N from number at/after cursor |CTRL-Y| CTRL-Y scroll N lines downwards x|CTRL-Z| CTRL-Z suspend program (or start new shell) CTRL-[ not used x|CTRL-\_CTRL-N| CTRL-\ CTRL-N go to Normal mode (no-op) CTRL-\ not_CTRL-N not used e|CTRL-]| CTRL-] :ta to ident under cursor .|CTRL-^| CTRL-^ edit Nth alternate file (equivalent to ":e #N") CTRL-_ not used || 1 same as "l" |!| !{motion}{filter} 2 filter Nmove text through the {filter} command |!!| !!{filter} 2 filter N lines through the {filter} command |quote| "{a-zA-Z0-9.%#:-"} use buffer {a-zA-Z0-9.%#:-"} for next delete, yank or put (upper case to append) ({.%#:} only work with put) |#| # 1 search backward for the Nth occurrence of the ident under the cursor |$| $ 1 cursor to the end of Nth next line |%| % 1 find the next (curly/square) bracket on this line and go to its match, or go to matching comment bracket, or go to matching preprocessor directive. |N%| {count}% 1 go to N percentage in the file x|&| & 2 repeat last :s |'| '{a-zA-Z0-9} 1 cursor to the first CHAR on the line with mark {a-zA-Z0-9} |''| '' 1 cursor to the first CHAR of the line where the cursor was before the latest jump. |'<| '< 1 cursor to the first CHAR of the line where highlighted area starts/started in the current buffer. |'>| '> 1 cursor to the first CHAR of the line where highlighted area ends/ended in the current buffer. |'[| '[ 1 cursor to the first CHAR on the line of the start of last operated text or start of putted text |']| '] 1 cursor to the first CHAR on the line of the end of last operated text or end of putted text |(| ( 1 cursor N sentences backward |)| ) 1 cursor N sentences forward |star| * 1 search forward for the Nth occurrence of the ident under the cursor |+| + 1 cursor to the first CHAR N lines lower |,| , 1 repeat latest f, t, F or T in opposite direction N times |-| - 1 cursor to the first CHAR N lines higher |.| . 2 repeat last change with count replaced with N |/| /{pattern} 1 search forward for the Nth occurrence of {pattern} |/| / 1 search forward for {pattern} of last search |count| 0 1 cursor to the first char of the line |count| 1 prepend to command to give a count |count| 2 " |count| 3 " |count| 4 " |count| 5 " |count| 6 " |count| 7 " |count| 8 " |count| 9 " |:| : start entering an Ex command |N:| {count}: start entering an Ex command with range from current line to N lines down |;| ; 1 repeat latest f, t, F or T N times |<| <{motion} 2 shift Nmove lines one 'shiftwidth' leftwards |<<| << 2 shift N lines one 'shiftwidth' leftwards |=| ={motion} 2 filter Nmove lines through "indent" |==| == 2 filter N lines through "indent" |>| >{motion} 2 shift Nmove lines one 'shiftwidth' rightwards |>>| >> 2 shift N lines one 'shiftwidth' rightwards |?| ?{pattern} 1 search backward for the Nth previous occurrence of {pattern} |?| ? 1 search backward for {pattern} of last search |@| @{a-z} 2 execute the contents of named buffer {a-z} N times x|@:| @: repeat the previous ":" command N times |@@| @@ 2 repeat the previous @{a-z} N times |A| A 2 append text after the end of the line N times |B| B 1 cursor N WORDS backward |C| ["x]C 2 change from the cursor position to the end of the line, and N-1 more lines [into buffer x]; synonym for "c$" |D| ["x]D 2 delete the characters under the cursor until the end of the line and N-1 more lines [into buffer x]; synonym for "d$" |E| E 1 cursor forward to the end of WORD N |F| F{char} 1 cursor to the Nth occurrence of {char} to the left |G| G 1 cursor to line N, default last line |H| H 1 cursor to line N from top of screen |I| I 2 insert text before the first CHAR on the line N times |J| J 2 Join N lines; default is 2 x|K| K lookup Keyword under the cursor with 'keywordprg' |L| L 1 cursor to line N from bottom of screen |M| M 1 cursor to middle line of screen |N| N 1 repeat the latest '/' or '?' N times in opposite direction |O| O 2 begin a new line above the cursor and insert text, repeat N times |P| ["x]P 2 put the text [from buffer x] before the cursor N times |Q| Q format Nmove text |R| R 2 enter replace mode: overtype existing characters, repeat the entered text N-1 times |S| ["x]S 2 delete N lines [into buffer x] and start insert; synonym for "^cc" or "0cc", depending on autoindent |T| T{char} 1 cursor till after Nth occurrence of {char} to the left x|U| U 2 undo all latest changes on one line |V| V start linewise Visual mode |W| W 1 cursor N WORDS forward |X| ["x]X 2 delete N characters before the cursor [into buffer x] |Y| ["x]Y yank N lines [into buffer x]; synonym for "yy" .|ZZ| ZZ store current file if modified, and exit .|ZQ| ZQ exit current file always |[| [{char} square bracket command (see below) \ not used |]| ]{char} square bracket command (see below) |^| ^ 1 cursor to the first CHAR of the line |_| _ 1 cursor to the first CHAR N - 1 lines lower |`| `{a-zA-Z0-9} 1 cursor to the mark {a-zA-Z0-9} |`<| `< 1 cursor to the start of the highlighted area |`>| `> 1 cursor to the end of the highlighted area |`[| `[ 1 cursor to the start of last operated text or start of putted text |`]| `] 1 cursor to the end of last operated text or end of putted text |``| `` 1 cursor to the position before latest jump |a| a 2 append text after the cursor N times |b| b 1 cursor N words backward |c| ["x]c{motion} 2 delete Nmove text [into buffer x] and start insert |cc| ["x]cc 2 delete N lines [into buffer x] and start insert |d| ["x]d{motion} 2 delete Nmove text [into buffer x] |dd| ["x]dd 2 delete N lines [into buffer x] |e| e 1 cursor forward to the end of word N |f| f{char} 1 cursor to Nth occurrence of {char} to the right |g| g{char} extended commands, see below |h| h 1 cursor N chars to the left |i| i 2 insert text before the cursor N times |j| j 1 cursor N lines downward |k| k 1 cursor N lines upward |l| l 1 cursor N chars to the right |m| m{A-Za-z} set mark {A-Za-z} at cursor position e m{.<>} anonymous mark {toggle, previous, next} |n| n 1 repeat the latest '/' or '?' N times |o| o 2 begin a new line below the cursor and insert text, repeat N times |p| ["x]p 2 put the text [from register x] after the cursor N times |q| q{0-9a-zA-Z"} record typed characters into named register {0-9a-zA-Z"} (upper case to append) |q| q (while recording) stops recording |r| r{char} 2 replace N chars with {char} |s| ["x]s 2 (substitute) delete N characters [into buffer x] and start insert |t| t{char} 1 cursor till before Nth occurrence of {char} to the right |u| u 2 undo changes |v| v start characterwise Visual mode |w| w 1 cursor N words forward |x| ["x]x 2 delete N characters under and after the cursor [into buffer x] |y| ["x]y{motion} yank Nmove text [into buffer x] |yy| ["x]yy yank N lines [into buffer x] |z| z redraw, cursor line to top of window, cursor on first non-blank .|zN| z{height} redraw, make window {height} lines high |z.| z. redraw, cursor line to center of window, cursor on first non-blank |z-| z- redraw, cursor line at bottom of window, cursor on first non-blank |zb| zb redraw, cursor line at bottom of window .|ze| ze when 'wrap' off scroll horizontally to position the cursor at the end (right side) of the screen .|zh| zh when 'wrap' off scroll screen N characters to the right .|zl| zl when 'wrap' off scroll screen N characters to the left .|zs| zs when 'wrap' off scroll horizontally to position the cursor at the start (left side) of the screen |zt| zt redraw, cursor line at top of window |zz| zz redraw, cursor line at center of window .|z| z same as "zh" .|z| z same as "zl" |{| { 1 cursor N paragraphs backward |bar| | 1 cursor to column N |}| } 1 cursor N paragraphs forward |~| ~ 2 'tildeop' off: switch case of N characters under cursor and move the cursor N characters to the right |~| ~{motion} 'tildeop' on: switch case of Nmove text || 1 same as "G" || 1 same as "gg" || 1 same as "b" x|| ":ta" to the keyword at the mouse click || 1 same as "w" x|| same as "CTRL-T" || ["x] 2 same as "x" x|N| {count} remove the last digit from {count} || 1 same as "j" || 1 same as "$" x|| same as x|| open a help window || 1 same as "0" || 2 same as "i" || 1 same as "h" || 1 move cursor to the mouse click position x|| 2 same as "P" at the mouse click position || same as CTRL-F || same as CTRL-B || 1 same as "l" x|| start Visual mode, move cursor to the mouse click position || 1 same as CTRL-F || 1 same as "b" x|| same as "*" at the mouse click position || 1 same as "w" x|| same as "#" at the mouse click position || 1 same as CTRL-B || 2 same as "u" || 1 same as "k" ============================================================================== 2.3 Square bracket commands *[* *]* A few are proposed, generally depend on platform environment tag char note action in Normal mode ~ ------------------------------------------------------------------------------ .|[m| [m 1 cursor N times back to start of member function .|]m| ]m 1 cursor N times forward to end of member function ============================================================================== 2.4 Commands starting with 'g' *g* A few are proposed, generally depend on platform environment tag char note action in Normal mode ~ ------------------------------------------------------------------------------ gg Goto line [count], default first line, on the first non-blank character |linewise|. If 'startofline' not set, keep the same column. ["x]gp 2 put the text [from register x] after the cursor N times, leave the cursor after it ["x]gP 2 put the text [from register x] before the cursor N times, leave the cursor after it e :tabn[ext] e gt e x Go to the next tab page. Wraps around from the last to the first one. e :tabp[revious] e :tabN[ext] e gT e Go to the previous tab page. Wraps around from the first one to the last one. gq{motion} 2 format Nmove text gv reselect the previous Visual area . g; Go to Nth older position in change list jump list feature. . g, Go to Nth newer position in change list jump list feature. ============================================================================== 3. Visual mode *visual-index* Most commands in Visual mode are the same as in Normal mode. The ones listed here are those that are different. tag command note action in Visual mode ~ ------------------------------------------------------------------------------ .|v_CTRL-\_CTRL-N| CTRL-\ CTRL-N stop Visual mode .|v_CTRL-G| CTRL-G toggle between Visual mode and Select mode .|v_| 2 Select mode: delete highlighted area |v_CTRL-H| CTRL-H 2 same as .|v_CTRL-O| CTRL-O switch from Select to Visual mode for one command |v_CTRL-V| CTRL-V make Visual mode blockwise or stop Visual mode .|v_CTRL-]| CTRL-] jump to highlighted tag |v_!| !{filter} 2 filter the highlighted lines through the external command {filter} |v_:| : start a command-line with the highlighted lines as a range .|v_<| < 2 shift the highlighted lines one 'shiftwidth' left |v_=| = 2 filter the highlighted lines through the external program given with the 'equalprg' option .|v_>| > 2 shift the highlighted lines one 'shiftwidth' right |v_b_A| A 2 block mode: append same text in all lines, after the highlighted area |v_C| C 2 delete the highlighted lines and start insert |v_D| D 2 delete the highlighted lines |v_b_I| I 2 block mode: insert same text in all lines, before the highlighted area |v_J| J 2 join the highlighted lines |v_K| K run 'keywordprg' on the highlighted area |v_O| O Move horizontally to other corner of area. Q does not start Ex mode |v_R| R 2 delete the highlighted lines and start insert |v_S| S 2 delete the highlighted lines and start insert |v_U| U 2 make highlighted area uppercase |v_V| V make Visual mode linewise or stop Visual mode |v_X| X 2 delete the highlighted lines |v_Y| Y yank the highlighted lines .|v_a(| a( same as ab .|v_a)| a) same as ab .|v_a<| a< extend highlighted area with a <> block .|v_a>| a> same as a< .|v_aB| aB extend highlighted area with a {} block .|v_aW| aW extend highlighted area with "a WORD" .|v_a[| a[ extend highlighted area with a [] block .|v_a]| a] same as a[ .|v_ab| ab extend highlighted area with a () block |v_ap| ap extend highlighted area with a paragraph .|v_as| as extend highlighted area with a sentence .|v_aw| aw extend highlighted area with "a word" .|v_a{| a{ same as aB .|v_a}| a} same as aB |v_c| c 2 delete highlighted area and start insert |v_d| d 2 delete highlighted area |v_gJ| gJ 2 join the highlighted lines without inserting spaces |v_gq| gq 2 format the highlighted lines |v_gv| gv exchange current and previous highlighted area .|v_i(| i( same as ib .|v_i)| i) same as ib .|v_i<| i< extend highlighted area with inner <> block .|v_i>| i> same as i< .|v_iB| iB extend highlighted area with inner {} block .|v_iW| iW extend highlighted area with "inner WORD" .|v_i[| i[ extend highlighted area with inner [] block .|v_i]| i] same as i[ .|v_ib| ib extend highlighted area with inner () block |v_ip| ip extend highlighted area with inner paragraph .|v_is| is extend highlighted area with inner sentence .|v_iw| iw extend highlighted area with "inner word" .|v_i{| i{ same as iB .|v_i}| i} same as iB |v_o| o move cursor to other corner of area |v_r| r 2 delete highlighted area and start insert |v_s| s 2 delete highlighted area and start insert |v_u| u 2 make highlighted area lowercase |v_v| v make Visual mode characterwise or stop Visual mode |v_x| x 2 delete the highlighted area |v_y| y yank the highlighted area |v_~| ~ 2 swap case for the highlighted area