LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 4108|回复: 0

VIM速查手册

 关闭 [复制链接]
发表于 2004-8-13 20:14:24 | 显示全部楼层 |阅读模式
QUICKREF


  1. *quickref.txt*  For Vim version 6.2.  Last change: 2003 May 11


  2.   VIM REFERENCE MANUAL    by Bram Moolenaar

  3.     Quick reference guide

  4. *quickref* *Contents*
  5. tag  subject tag  subject
  6. |Q_ct|  list of help files|Q_re|Repeating commands
  7. |Q_lr|motion: Left-right|Q_km|Key mapping
  8. |Q_ud|motion: Up-down|Q_ab|Abbreviations
  9. |Q_tm|motion: Text object|Q_op|Options
  10. |Q_pa|motion: Pattern searches|Q_ur|Undo/Redo commands
  11. |Q_ma|motion: Marks|Q_et|External commands
  12. |Q_vm|motion: Various|Q_qf|Quickfix commands
  13. |Q_ta|motion: Using tags|Q_vc|Various commands
  14. |Q_sc|Scrolling|Q_ce|Ex: Command-line editing
  15. |Q_in|insert: Inserting text|Q_ra|Ex: Ranges
  16. |Q_ai|insert: Keys|Q_ex|Ex: Special characters
  17. |Q_ss|insert: Special keys|Q_ed|Editing a file
  18. |Q_di|insert: Digraphs|Q_fl|Using the argument list
  19. |Q_si|insert: Special inserts|Q_wq|Writing and quitting
  20. |Q_de|change: Deleting text|Q_st|Starting VIM
  21. |Q_cm|change: Copying and moving|Q_ac|Automatic commands
  22. |Q_ch|change: Changing text|Q_wi|Multi-window commands
  23. |Q_co|change: Complex|Q_bu|Buffer list commands
  24. |Q_vi|Visual mode|Q_sy|Syntax highlighting
  25. |Q_to|Text objects|Q_gu|GUI commands
  26. |Q_fo|  Folding


  27. N is used to indicate an optional count that can be given before the command.

  28. *Q_lr*Left-right motions

  29. |h|N  hleft (also: CTRL-H, <BS>, or <Left> key)
  30. |l|N  lright (also: <Space> or <Right> key)
  31. |0|   0to first character in the line (also: <Home> key)
  32. |^|   ^to first non-blank character in the line
  33. |$|N  $to the last character in the line (N-1 lines lower)
  34.    (also: <End> key)
  35. |g0|N  g0to first character in screen line (differs from "0"
  36.    when lines wrap)
  37. |g^|N  g^to first non-blank character in screen line (differs
  38.    from "^" when lines wrap)
  39. |g$|N  g$to last character in screen line (differs from "$"
  40.    when lines wrap)
  41. |gm|N  gmto middle of the screen line
  42. |bar|N  |to column N (default: 1)
  43. |f|N  f{char}to the Nth occurrence of {char} to the right
  44. |F|N  F{char}to the Nth occurrence of {char} to the left
  45. |t|N  t{char}till before the Nth occurrence of {char} to the right
  46. |T|N  T{char}till before the Nth occurrence of {char} to the left
  47. |;|N  ;repeat the last "f", "F", "t", or "T" N times
  48. |,|N  ,repeat the last "f", "F", "t", or "T" N times in
  49.    opposite direction

  50. *Q_ud*Up-down motions

  51. |k|N  kup N lines (also: CTRL-P and <Up>)
  52. |j|N  jdown N lines (also: CTRL-J, CTRL-N, <NL>, and <Down>)
  53. |-|N  -up N lines, on the first non-blank character
  54. |+|N  +down N lines, on the first non-blank character (also:
  55.    CTRL-M and <CR>)
  56. |_|N  _down N-1 lines, on the first non-blank character
  57. |G|N  Ggoto line N (default: last line), on the first
  58.    non-blank character
  59. |gg|N  gggoto line N (default: first line), on the first
  60.    non-blank character
  61. |N%|N  %goto line N percentage down in the file.  N must be
  62.    given, otherwise it is the |%| command.
  63. |gk|N  gkup N screen lines (differs from "k" when line wraps)
  64. |gj|N  gjdown N screen lines (differs from "j" when line wraps)

  65. *Q_tm*Text object motions

  66. |w|N  wN words forward
  67. |W|N  WN blank-separated |WORD|s forward
  68. |e|N  eforward to the end of the Nth word
  69. |E|N  Eforward to the end of the Nth blank-separated |WORD|
  70. |b|N  bN words backward
  71. |B|N  BN blank-separated |WORD|s backward
  72. |ge|N  gebackward to the end of the Nth word
  73. |gE|N  gEbackward to the end of the Nth blank-separated |WORD|

  74. |)|N  )N sentences forward
  75. |(|N  (N sentences backward
  76. |}|N  }N paragraphs forward
  77. |{|N  {N paragraphs backward
  78. |]]|N  ]]N sections forward, at start of section
  79. |[[|N  [[N sections backward, at start of section
  80. |][|N  ][N sections forward, at end of section
  81. |[]|N  []N sections backward, at end of section
  82. |[(|N  [(N times back to unclosed '('
  83. |[{|N  [{N times back to unclosed '{'
  84. |[m|N  [mN times back to start of method (for Java)
  85. |[M|N  [MN times back to end of method (for Java)
  86. |])|N  ])N times forward to unclosed ')'
  87. |]}|N  ]}N times forward to unclosed '}'
  88. |]m|N  ]mN times forward to start of method (for Java)
  89. |]M|N  ]MN times forward to end of method (for Java)
  90. |[#|N  [#N times back to unclosed "#if" or "#else"
  91. |]#|N  ]#N times forward to unclosed "#else" or "#endif"
  92. |[star|N  [*N times back to start of comment "/*"
  93. |]star|N  ]*N times forward to end of comment "*/"

  94. *Q_pa*Pattern searches

  95. |/|N  /{pattern}[/[offset]]<CR>
  96. search forward for the Nth occurrence of {pattern}
  97. |?|N  ?{pattern}[?[offset]]<CR>
  98. search backward for the Nth occurrence of {pattern}
  99. |/<CR>|N  /<CR>repeat last search, in the forward direction
  100. |?<CR>|N  ?<CR>repeat last search, in the backward direction
  101. |n|N  nrepeat last search
  102. |N|N  Nrepeat last search, in opposite direction
  103. |star|N  *search forward for the identifier under the cursor
  104. |#|N  #search backward for the identifier under the cursor
  105. |gstar|N  g*like "*", but also find partial matches
  106. |g#|N  g#like "#", but also find partial matches
  107. |gd|   gdgoto local declaration of identifier under the cursor
  108. |gD|   gDgoto global declaration of identifier under the cursor

  109. |pattern|Special characters in search patterns

  110. meaning      magic   nomagic
  111. matches any single character.\.
  112.        matches start of line^^
  113.        matches <EOL>$$
  114.        matches start of word\<\<
  115. matches end of word\>\>
  116. matches a single char from the range[a-z]\[a-z]
  117.       matches a single char not in the range[^a-z]\[^a-z]
  118.   matches an identifier char\i\i
  119.    idem but excluding digits\I\I
  120. matches a keyword character\k\k
  121.    idem but excluding digits\K\K
  122.        matches a file name character\f\f
  123.    idem but excluding digits\F\F
  124.        matches a printable character\p\p
  125.    idem but excluding digits\P\P
  126.      matches a white space character\s\s
  127. matches a non-white space character\S\S

  128.        matches <Esc>\e\e
  129.        matches <Tab>\t\t
  130. matches <CR>\r\r
  131. matches <BS>\b\b

  132.      matches 0 or more of the preceding atom*\*
  133.      matches 1 or more of the preceding atom\+\+
  134. matches 0 or 1 of the preceding atom\=\=
  135. matches 2 to 5 of the preceding atom\{2,5}  \{2,5}
  136.   separates two alternatives\|\|
  137. group a pattern into an atom\(\)\(\)

  138. |search-offset|Offsets allowed after search command

  139.     [num][num] lines downwards, in column 1
  140.     +[num][num] lines downwards, in column 1
  141.     -[num][num] lines upwards, in column 1
  142.     e[+num][num] characters to the right of the end of the match
  143.     e[-num][num] characters to the left of the end of the match
  144.     s[+num][num] characters to the right of the start of the match
  145.     s[-num][num] characters to the left of the start of the match
  146.     b[+num][num] characters to the right of the start (begin) of the match
  147.     b[-num][num] characters to the left of the start (begin) of the match
  148.     ;{search-command}execute {search-command} next

  149. *Q_ma*Marks and motions

  150. |m|   m{a-zA-Z}mark current position with mark {a-zA-Z}
  151. |`a|   `{a-z}go to mark {a-z} within current file
  152. |`A|   `{A-Z}go to mark {A-Z} in any file
  153. |`0|   `{0-9}go to the position where Vim was previously exited
  154. |``|   ``go to the position before the last jump
  155. |`quote|   `"go to the position when last editing this file
  156. |`[|   `[go to the start of the previously operated or put text
  157. |`]|   `]go to the end of the previously operated or put text
  158. |`<|   `<go to the start of the (previous) Visual area
  159. |`>|   `>go to the end of the (previous) Visual area
  160. |`.|   `.go to the position of the last change in this file
  161. |'|   '{a-zA-Z0-9[]'"<>.}
  162. same as `, but on the first non-blank in the line
  163. |:marks|  :marksprint the active marks
  164. |CTRL-O|  N  CTRL-Ogo to Nth older position in jump list
  165. |CTRL-I|  N  CTRL-Igo to Nth newer position in jump list
  166. |:ju|  :ju[mps]print the jump list

  167. *Q_vm*Various motions

  168. |%|   %find the next brace, bracket, comment, or "#if"/
  169.    "#else"/"#endif" in this line and go to its match
  170. |H|N  Hgo to the Nth line in the window, on the first
  171.    non-blank
  172. |M|   Mgo to the middle line in the window, on the first
  173.    non-blank
  174. |L|N  Lgo to the Nth line from the bottom, on the first
  175.    non-blank

  176. |go|N  gogo to Nth byte in the buffer
  177. |:go|:[range]go[to] [off]go to [off] byte in the buffer

  178. *Q_ta*Using tags

  179. |:ta|   :ta[g][!] {tag}Jump to tag {tag}
  180. |:ta|   :[count]ta[g][!]Jump to [count]'th newer tag in tag list
  181. |CTRL-]|      CTRL-]Jump to the tag under cursor, unless changes
  182.    have been made
  183. |:ts|   :ts[elect][!] [tag]List matching tags and select one to jump to
  184. |:tjump|   :tj[ump][!] [tag]Jump to tag [tag] or select from list when
  185.    there are multiple matches

  186. |:tags|   :tagsPrint tag list
  187. |CTRL-T|   N  CTRL-TJump back from Nth older tag in tag list
  188. |:po|   :[count]po[p][!]Jump back from [count]'th older tag in tag list
  189. |:tnext|   :[count]tn[ext][!]Jump to [count]'th next matching tag
  190. |:tp|      :[count]tp[revious][!] Jump to [count]'th previous matching tag
  191. |:tr|   :[count]tr[ewind][!] Jump to [count]'th matching tag
  192. |:tl|   :tl[ast][!]Jump to last matching tag

  193. |:ptag|   :pt[ag] {tag}open a preview window to show tag {tag}
  194. |CTRL-W_}|     CTRL-W }like CTRL-] but show tag in preview window
  195. |:pts|     :pts[elect]like ":tselect" but show tag in preview window
  196. |:ptjump|  :ptj[ump]like ":tjump" but show tag in preview window
  197. |:pclose|  :pc[lose]close tag preview window
  198. |CTRL-W_z|     CTRL-W zclose tag preview window

  199. *Q_sc*Scrolling

  200. |CTRL-E|N  CTRL-Ewindow N lines downwards (default: 1)
  201. |CTRL-D|N  CTRL-Dwindow N lines Downwards (default: 1/2 window)
  202. |CTRL-F|N  CTRL-Fwindow N pages Forwards (downwards)
  203. |CTRL-Y|N  CTRL-Ywindow N lines upwards (default: 1)
  204. |CTRL-U|N  CTRL-Uwindow N lines Upwards (default: 1/2 window)
  205. |CTRL-B|N  CTRL-Bwindow N pages Backwards (upwards)
  206. |z<CR>|   z<CR> or ztredraw, current line at top of window
  207. |z.|   z. or zzredraw, current line at center of window
  208. |z-|   z- or zbredraw, current line at bottom of window

  209. These only work when 'wrap' is off:
  210. |zh|N  zhscroll screen N characters to the right
  211. |zl|N  zlscroll screen N characters to the left
  212. |zH|N  zHscroll screen half a screenwidth to the right
  213. |zL|N  zLscroll screen half a screenwidth to the left

  214. *Q_in*Inserting text

  215. |a|N  aappend text after the cursor (N times)
  216. |A|N  Aappend text at the end of the line (N times)
  217. |i|N  iinsert text before the cursor (N times) (also: <Insert>)
  218. |I|N  Iinsert text before the first non-blank in the line (N times)
  219. |gI|N  gIinsert text in column 1 (N times)
  220. |o|N  oopen a new line below the current line, append text (N times)
  221. |O|N  Oopen a new line above the current line, append text (N times)
  222. |:startinsert|  :star[tinsert][!]  start Insert mode, append when [!] used

  223. in Visual block mode:
  224. |v_b_I|    Iinsert the same text in front of all the selected lines
  225. |v_b_A|   Aappend the same text after all the selected lines

  226. *Q_ai*Insert mode keys

  227. |insert-index|alphabetical index of Insert mode commands

  228. leaving Insert mode:
  229. |i_<Esc>|<Esc>  end Insert mode, back to Normal mode
  230. |i_CTRL-C|CTRL-C  like <Esc>, but do not use an abbreviation
  231. |i_CTRL-O|CTRL-O {command}  execute {command} and return to Insert mode

  232. moving around:
  233. |i_<Up>|cursor keys  move cursor left/right/up/down
  234. |i_<S-Left>|shift-left/right  one word left/right
  235. |i_<S-Up>|shift-up/down  one screenful backward/forward
  236. |i_<End>|<End>  cursor after last character in the line
  237. |i_<Home>|<Home>  cursor to first character in the line

  238. *Q_ss*Special keys in Insert mode

  239. |i_CTRL-V|CTRL-V {char}..  insert character literally, or enter decimal
  240.      byte value
  241. |i_<NL>|<NL> or <CR> or CTRL-M or CTRL-J
  242.   begin new line
  243. |i_CTRL-E|CTRL-E  insert the character from below the cursor
  244. |i_CTRL-Y|CTRL-Y  insert the character from above the cursor

  245. |i_CTRL-A|CTRL-A  insert previously inserted text
  246. |i_CTRL-@|CTRL-@  insert previously inserted text and stop
  247.      Insert mode
  248. |i_CTRL-R|CTRL-R {0-9a-z%#:.-="}  insert the contents of a register

  249. |i_CTRL-N|CTRL-N  insert next match of identifier before the
  250.      cursor
  251. |i_CTRL-P|CTRL-P  insert previous match of identifier before
  252.      the cursor
  253. |i_CTRL-X|CTRL-X ...  complete the word before the cursor in
  254.      various ways

  255. |i_<BS>|<BS> or CTRL-H  delete the character before the cursor
  256. |i_<Del>|<Del>  delete the character under the cursor
  257. |i_CTRL-W|CTRL-W  delete word before the cursor
  258. |i_CTRL-U|CTRL-U  delete all entered characters in the current
  259.      line
  260. |i_CTRL-T|CTRL-T  insert one shiftwidth of indent in front of
  261.        the current line
  262. |i_CTRL-D|CTRL-D  delete one shiftwidth of indent in front of
  263.      the current line
  264. |i_0_CTRL-D|0 CTRL-D  delete all indent in the current line
  265. |i_^_CTRL-D|^ CTRL-D  delete all indent in the current line,
  266.      restore indent in next line

  267. *Q_di*Digraphs

  268. |:dig|   :dig[raphs]show current list of digraphs
  269. |:dig|   :dig[raphs] {char1}{char2} {number} ...
  270. add digraph(s) to the list

  271. In Insert or Command-line mode:
  272. |i_CTRL-K|CTRL-K {char1} {char2}
  273.   enter digraph
  274. |i_digraph|{char1} <BS> {char2}
  275.   enter digraph if 'digraph' option set

  276. *Q_si*Special inserts

  277. |:r|   :r [file]   insert the contents of [file] below the cursor
  278. |:r!|   :r! {command}   insert the standard output of {command} below the
  279.       cursor

  280. *Q_de*Deleting text

  281. |x|N  xdelete N characters under and after the cursor
  282. |<Del>| N  <Del>delete N characters under and after the cursor
  283. |X|N  Xdelete N characters before the cursor
  284. |d|N  d{motion}delete the text that is moved over with {motion}
  285. |v_d|{visual}ddelete the highlighted text
  286. |dd|N  dddelete N lines
  287. |D|N  Ddelete to the end of the line (and N-1 more lines)
  288. |J|N  Jjoin N-1 lines (delete <EOL>s)
  289. |v_J|{visual}Jjoin the highlighted lines
  290. |gJ|N  gJlike "J", but without inserting spaces
  291. |v_gJ|{visual}gJlike "{visual}J", but without inserting spaces
  292. |:d|:[range]d [x]delete [range] lines [into register x]

  293. *Q_cm*Copying and moving text

  294. |quote|  "{char}use register {char} for the next delete, yank, or put
  295. |:reg|  :regshow the contents of all registers
  296. |:reg|  :reg {arg}show the contents of registers mentioned in {arg}
  297. |y|  N  y{motion}yank the text moved over with {motion} into a register
  298. |v_y|     {visual}yyank the highlighted text into a register
  299. |yy|  N  yyyank N lines into a register
  300. |Y|  N  Yyank N lines into a register
  301. |p|  N  pput a register after the cursor position (N times)
  302. |P|  N  Pput a register before the cursor position (N times)
  303. |]p|  N  ]plike p, but adjust indent to current line
  304. |[p|  N  [plike P, but adjust indent to current line
  305. |gp|  N  gplike p, but leave cursor after the new text
  306. |gP|  N  gPlike P, but leave cursor after the new text

  307. *Q_ch*Changing text

  308. |r|  N  r{char}replace N characters with {char}
  309. |gr|  N  gr{char}replace N characters without affecting layout
  310. |R|  N  Renter Replace mode (repeat the entered text N times)
  311. |gR|  N  gRenter virtual Replace mode: Like Replace mode but
  312.    without affecting layout
  313. |v_b_r|  {visual}r{char}
  314. in Visual block mode: Replace each char of the
  315.    selected text with {char}

  316. (change = delete text and enter Insert mode)
  317. |c|  N  c{motion}change the text that is moved over with {motion}
  318. |v_c|     {visual}cchange the highlighted text
  319. |cc|  N  ccchange N lines
  320. |S|  N  Schange N lines
  321. |C|  N  Cchange to the end of the line (and N-1 more lines)
  322. |s|  N  schange N characters
  323. |v_b_c|     {visual}cin Visual block mode: Change each of the selected
  324.    lines with the entered text
  325. |v_b_C|     {visual}Cin Visual block mode: Change each of the selected
  326.    lines until end-of-line with the entered text

  327. |~|  N  ~switch case for N characters and advance cursor
  328. |v_~|     {visual}~switch case for highlighted text
  329. |v_u|     {visual}umake highlighted text lowercase
  330. |v_U|     {visual}Umake highlighted text uppercase
  331. |g~|     g~{motion} switch case for the text that is moved over with
  332.    {motion}
  333. |gu|     gu{motion} make the text that is moved over with {motion}
  334.    lowercase
  335. |gU|     gU{motion} make the text that is moved over with {motion}
  336.    uppercase
  337. |v_g?|     {visual}g? perform rot13 encoding on highlighted text
  338. |g?|     g?{motion} perform rot13 encoding on the text that is moved over
  339.    with {motion}

  340. |CTRL-A|  N  CTRL-Aadd N to the number at or after the cursor
  341. |CTRL-X|  N  CTRL-Xsubtract N from the number at or after the cursor

  342. |<|  N  <{motion}move the lines that are moved over with {motion} one
  343.    shiftwidth left
  344. |<<|  N  <<move N lines one shiftwidth left
  345. |>|  N  >{motion}move the lines that are moved over with {motion} one
  346.    shiftwidth right
  347. |>>|  N  >>move N lines one shiftwidth right
  348. |gq|  N  gq{motion}format the lines that are moved over with {motion} to
  349.    'textwidth' length
  350. |:ce|  :[range]ce[nter] [width]
  351. center the lines in [range]
  352. |:le|  :[range]le[ft] [indent]
  353. left-align the lines in [range] (with [indent])
  354. |:ri|  :[range]ri[ght] [width]
  355. right-align the lines in [range]

  356. *Q_co*Complex changes

  357. |!|   N  !{motion}{command}<CR>
  358. filter the lines that are moved over through {command}
  359. |!!|   N  !!{command}<CR>
  360. filter N lines through {command}
  361. |v_!|      {visual}!{command}<CR>
  362. filter the highlighted lines through {command}
  363. |:range!|  :[range]! {command}<CR>
  364. filter [range] lines through {command}
  365. |=|   N  ={motion}
  366. filter the lines that are moved over through 'equalprg'
  367. |==|   N  ==filter N lines through 'equalprg'
  368. |v_=|      {visual}=
  369. filter the highlighted lines through 'equalprg'
  370. |:s|   :[range]s[ubstitute]/{pattern}/{string}/[g][c]
  371. substitute {pattern} by {string} in [range] lines;
  372.    with [g], replace all occurrences of {pattern};
  373.    with [c], confirm each replacement
  374. |:s|   :[range]s[ubstitute] [g][c]
  375. repeat previous ":s" with new range and options
  376. |&|      &Repeat previous ":s" on current line without options
  377. |:ret|   :[range]ret[ab][!] [tabstop]
  378. set 'tabstop' to new value and adjust white space
  379.    accordingly

  380. *Q_vi*Visual mode

  381. |visual-index|list of Visual mode commands.

  382. |v|   vstart highlighting characters  }  move cursor and use
  383. |V|   Vstart highlighting linewise    }  operator to affect
  384. |CTRL-V|   CTRL-Vstart highlighting blockwise   }  highlighted text
  385. |v_o|   oexchange cursor position with start of highlighting
  386. |gv|   gvstart highlighting on previous visual area
  387. |v_v|   vhighlight characters or stop highlighting
  388. |v_V|   Vhighlight linewise or stop highlighting
  389. |v_CTRL-V| CTRL-Vhighlight blockwise or stop highlighting

  390. *Q_to*Text objects (only in Visual mode or after an operator)

  391. |v_aw|N  awSelect "a word"
  392. |v_iw|N  iwSelect "inner word"
  393. |v_aW|N  aWSelect "a |WORD|"
  394. |v_iW|N  iWSelect "inner |WORD|"
  395. |v_as|N  asSelect "a sentence"
  396. |v_is|N  isSelect "inner sentence"
  397. |v_ap|N  apSelect "a paragraph"
  398. |v_ip|N  ipSelect "inner paragraph"
  399. |v_ab|N  abSelect "a block" (from "[(" to "])")
  400. |v_ib|N  ibSelect "inner block" (from "[(" to "])")
  401. |v_aB|N  aBSelect "a Block" (from "[{" to "]}")
  402. |v_iB|N  iBSelect "inner Block" (from "[{" to "]}")

  403. *Q_re*Repeating commands

  404. |.|   N  .repeat last change (with count replaced with N)
  405. |q|      q{a-z}record typed characters into register {a-z}
  406. |q|      q{A-Z}record typed characters, appended to register {a-z}
  407. |q|      qstop recording
  408. |@|   N  @{a-z}execute the contents of register {a-z} (N times)
  409. |@@|   N  @@   repeat previous @{a-z} (N times)
  410. |:@|   :@{a-z}execute the contents of register {a-z} as an Ex
  411.    command
  412. |:@@|   :@@repeat previous :@{a-z}
  413. |:g|   :[range]g[lobal]/{pattern}/[cmd]
  414. Execute Ex command [cmd] (default: ":p") on the lines
  415.    within [range] where {pattern} matches.
  416. |:g|   :[range]g[lobal]!/{pattern}/[cmd]
  417. Execute Ex command [cmd] (default: ":p") on the lines
  418.    within [range] where {pattern} does NOT match.
  419. |:so|   :so[urce] {file}
  420. Read Ex commands from {file}.
  421. |:so|   :so[urce]! {file}
  422. Read Vim commands from {file}.
  423. |:sl|   :sl[eep] [sec]
  424. don't do anything for [sec] seconds
  425. |gs|   N  gsGoto Sleep for N seconds

  426. *Q_km*Key mapping

  427. |:map|     :ma[p] {lhs} {rhs}  Map {lhs} to {rhs} in Normal and Visual
  428.      mode.
  429. |:map!|     :ma[p]! {lhs} {rhs}  Map {lhs} to {rhs} in Insert and Command-line
  430.      mode.
  431. |:noremap|   :no[remap][!] {lhs} {rhs}
  432.   Same as ":map", no remapping for this {rhs}
  433. |:unmap|     :unm[ap] {lhs}  Remove the mapping of {lhs} for Normal and
  434.      Visual mode.
  435. |:unmap!|    :unm[ap]! {lhs}  Remove the mapping of {lhs} for Insert and
  436.      Command-line mode.
  437. |:map_l|     :ma[p] [lhs]  List mappings (starting with [lhs]) for
  438.      Normal and Visual mode.
  439. |:map_l!|    :ma[p]! [lhs]  List mappings (starting with [lhs]) for
  440.      Insert and Command-line mode.
  441. |:cmap|     :cmap/:cunmap/:cnoremap
  442.   like ":map!"/":unmap!"/":noremap!" but for
  443.      Command-line mode only
  444. |:imap|     :imap/:iunmap/:inoremap
  445.   like ":map!"/":unmap!"/":noremap!" but for
  446.      Insert mode only
  447. |:nmap|     :nmap/:nunmap/:nnoremap
  448.   like ":map"/":unmap"/":noremap" but for
  449.      Normal mode only
  450. |:vmap|     :vmap/:vunmap/:vnoremap
  451.   like ":map"/":unmap"/":noremap" but for
  452.      Visual mode only
  453. |:omap|     :omap/:ounmap/:onoremap
  454.   like ":map"/":unmap"/":noremap" but only for
  455.      when an operator is pending
  456. |:mapc|      :mapc[lear]  remove mappings for Normal and Visual mode
  457. |:mapc|      :mapc[lear]!  remove mappings for Insert and Cmdline mode
  458. |:imapc|     :imapc[lear]  remove mappings for Insert mode
  459. |:vmapc|     :vmapc[lear]  remove mappings for Visual mode
  460. |:omapc|     :omapc[lear]  remove mappings for Operator-pending mode
  461. |:nmapc|     :nmapc[lear]  remove mappings for Normal mode
  462. |:cmapc|     :cmapc[lear]  remove mappings for Cmdline mode
  463. |:mkexrc|    :mk[exrc][!] [file]  write current mappings, abbreviations, and
  464.      settings to [file] (default: ".exrc";
  465.      use ! to overwrite)
  466. |:mkvimrc|   :mkv[imrc][!] [file]
  467.   same as ":mkexrc", but with default ".vimrc"
  468. |:mksession| :mks[ession][!] [file]
  469.   like ":mkvimrc", but store current files,
  470.      windows, etc. too, to be able to continue
  471.      this session later.

  472. *Q_ab*Abbreviations

  473. |:abbreviate|:ab[breviate] {lhs} {rhs}  add abbreviation for {lhs} to {rhs}
  474. |:abbreviate|:ab[breviate] {lhs}   show abbr's that start with {lhs}
  475. |:abbreviate|:ab[breviate]   show all abbreviations
  476. |:unabbreviate|:una[bbreviate] {lhs}   remove abbreviation for {lhs}
  477. |:noreabbrev|:norea[bbrev] [lhs] [rhs]  like ":ab", but don't remap [rhs]
  478. |:iabbrev|:iab/:iunab/:inoreab   like ":ab", but only for Insert mode
  479. |:cabbrev|:cab/:cunab/:cnoreab   like ":ab", but only for
  480. Command-line mode
  481. |:abclear|:abc[lear]   remove all abbreviations
  482. |:cabclear|:cabc[lear]   remove all abbr's for Cmdline mode
  483. |:iabclear|:iabc[lear]   remove all abbr's for Insert mode

  484. *Q_op*Options

  485. |:set|:se[t]  Show all modified options.
  486. |:set|:se[t] all  Show all non-termcap options.
  487. |:set|:se[t] termcap  Show all termcap options.
  488. |:set|:se[t] {option}  Set boolean option (switch it on),
  489.   show string or number option.
  490. |:set|:se[t] no{option}  Reset boolean option (switch it off).
  491. |:set|:se[t] inv{option}  invert boolean option.
  492. |:set|:se[t] {option}={value}  Set string/number option to {value}.
  493. |:set|:se[t] {option}+={value}  append {value} to string option, add
  494.   {value} to number option
  495. |:set|:se[t] {option}-={value}  remove {value} to string option,
  496.   subtract {value} from number option
  497. |:set|:se[t] {option}?  Show value of {option}.
  498. |:set|:se[t] {option}&  Reset {option} to its default value.

  499. |:setlocal|:setl[ocal]  like ":set" but set the local value
  500.   for options that have one
  501. |:setglobal|:setg[lobal]  like ":set" but set the global value
  502.   of a local option

  503. |:fix|:fix[del]  Set value of 't_kD' according to
  504.   value of 't_kb'.
  505. |:options|:opt[ions]  Open a new window to view and set
  506.   options, grouped by functionality,
  507.   a one line explanation and links to
  508.   the help.

  509. Short explanation of each option:*option-list*
  510. |'aleph'|  |'al'|     ASCII code of the letter Aleph (Hebrew)
  511. |'allowrevins'|  |'ari'|    allow CTRL-_ in Insert and Command-line mode
  512. |'altkeymap'|  |'akm'|    for default second language (Farsi/Hebrew)
  513. |'arabic'|  |'arab'|   for Arabic as a default second language
  514. |'autoindent'|  |'ai'|     take indent for new line from previous line
  515. |'autoread'|  |'ar'|     autom. read file when changed outside of Vim
  516. |'autowrite'|  |'aw'|     automatically write file if changed
  517. |'autowriteall'|  |'awa'|    as 'autowrite', but works with more commands
  518. |'background'|  |'bg'|     "dark" or "light", used for highlight colors
  519. |'backspace'|  |'bs'|     how backspace works at start of line
  520. |'backup'|  |'bk'|     keep backup file after overwriting a file
  521. |'backupcopy'|  |'bkc'|    make backup as a copy, don't rename the file
  522. |'backupdir'|  |'bdir'|   list of directories for the backup file
  523. |'backupext'|  |'bex'|    extension used for the backup file
  524. |'backupskip'|  |'bsk'|    no backup for files that match these patterns
  525. |'balloondelay'|  |'bdlay'|  delay in mS before a balloon may pop up
  526. |'ballooneval'|   |'beval'|  switch on balloon evaluation
  527. |'binary'|  |'bin'|    read/write/edit file in binary mode
  528. |'bioskey'|  |'biosk'|  MS-DOS: use bios calls for input characters
  529. |'bomb'|     prepend a Byte Order Mark to the file
  530. |'breakat'|  |'brk'|    characters that may cause a line break
  531. |'browsedir'|  |'bsdir'|  which directory to start browsing in
  532. |'bufhidden'|  |'bh'|     what to do when buffer is no longer in window
  533. |'buflisted'|  |'bl'|     whether the buffer shows up in the buffer list
  534. |'buftype'|  |'bt'|     special type of buffer
  535. |'cdpath'|  |'cd'|     list of directories searched with ":cd"
  536. |'cedit'|     key used to open the command-line window
  537. |'charconvert'|   |'ccv'|    expression for character encoding conversion
  538. |'cindent'|  |'cin'|    do C program indenting
  539. |'cinkeys'|  |'cink'|   keys that trigger indent when 'cindent' is set
  540. |'cinoptions'|  |'cino'|   how to do indenting when 'cindent' is set
  541. |'cinwords'|  |'cinw'|   words where 'si' and 'cin' add an indent
  542. |'clipboard'|  |'cb'|     use the clipboard as the unnamed register
  543. |'cmdheight'|  |'ch'|     number of lines to use for the command-line
  544. |'cmdwinheight'|  |'cwh'|    height of the command-line window
  545. |'columns'|  |'co'|     number of columns in the display
  546. |'comments'|  |'com'|    patterns that can start a comment line
  547. |'commentstring'| |'cms'|    template for comments; used for fold marker
  548. |'compatible'|  |'cp'|     behave Vi-compatible as much as possible
  549. |'complete'|  |'cpt'|    specify how Insert mode completion works
  550. |'confirm'|  |'cf'|     ask what to do about unsaved/read-only files
  551. |'conskey'|  |'consk'|  get keys directly from console (MS-DOS only)
  552. |'copyindent'|    |'ci'|     make 'autoindent' use existing indent structure
  553. |'cpoptions'|  |'cpo'|    flags for Vi-compatible behavior
  554. |'cscopepathcomp'| |'cspc'|  how many components of the path to show
  555. |'cscopeprg'|  |'csprg'|  command to execute cscope
  556. |'cscopetag'|  |'cst'|    use cscope for tag commands
  557. |'cscopetagorder'| |'csto'|  determines ":cstag" search order
  558. |'cscopeverbose'| |'csverb'| give messages when adding a cscope database
  559. |'debug'|     set to "msg" to see all error messages
  560. |'define'|  |'def'|    pattern to be used to find a macro definition
  561. |'delcombine'|  |'deco'|   delete combining characters on their own
  562. |'dictionary'|  |'dict'|   list of file names used for keyword completion
  563. |'diff'|     use diff mode for the current window
  564. |'diffexpr'|  |'dex'|    expression used to obtain a diff file
  565. |'diffopt'|  |'dip'|    options for using diff mode
  566. |'digraph'|  |'dg'|     enable the entering of digraphs in Insert mode
  567. |'directory'|  |'dir'|    list of directory names for the swap file
  568. |'display'|  |'dy'|     list of flags for how to display text
  569. |'edcompatible'|  |'ed'|     toggle flags of ":substitute" command
  570. |'eadirection'|   |'ead'|    in which direction 'equalalways' works
  571. |'encoding'|  |'enc'|    encoding used internally
  572. |'endofline'|  |'eol'|    write <EOL> for last line in file
  573. |'equalalways'|   |'ea'|     windows are automatically made the same size
  574. |'equalprg'|  |'ep'|     external program to use for "=" command
  575. |'errorbells'|  |'eb'|     ring the bell for error messages
  576. |'errorfile'|  |'ef'|     name of the errorfile for the QuickFix mode
  577. |'errorformat'|   |'efm'|    description of the lines in the error file
  578. |'esckeys'|  |'ek'|     recognize function keys in Insert mode
  579. |'eventignore'|  |'ei'|     autocommand events that are ignored
  580. |'expandtab'|  |'et'|     use spaces when <Tab> is inserted
  581. |'exrc'|  |'ex'|     read .vimrc and .exrc in the current directory
  582. |'fileencoding'|  |'fenc'|   file encoding for multi-byte text
  583. |'fileencodings'| |'fencs'|  automatically detected character encodings
  584. |'fileformat'|  |'ff'|     file format used for file I/O
  585. |'fileformats'|  |'ffs'|    automatically detected values for 'fileformat'
  586. |'filetype'|  |'ft'|     type of file, used for autocommands
  587. |'fillchars'|  |'fcs'|    characters to use for displaying special items
  588. |'fkmap'|  |'fk'|     Farsi keyboard mapping
  589. |'foldclose'|  |'fcl'|    close a fold when the cursor leaves it
  590. |'foldcolumn'|  |'fdc'|    width of the column used to indicate folds
  591. |'foldenable'|  |'fen'|    set to display all folds open
  592. |'foldexpr'|  |'fde'|    expression used when 'foldmethod' is "expr"
  593. |'foldignore'|  |'fdi'|    ignore lines when 'foldmethod' is "indent"
  594. |'foldlevel'|  |'fdl'|    close folds with a level higher than this
  595. |'foldlevelstart'| |'fdls'|  'foldlevel' when starting to edit a file
  596. |'foldmarker'|  |'fmr'|    markers used when 'foldmethod' is "marker"
  597. |'foldmethod'|  |'fdm'|    folding type
  598. |'foldminlines'|  |'fml'|    minimum number of lines for a fold to be closed
  599. |'foldnestmax'|   |'fdn'|    maximum fold depth
  600. |'foldopen'|  |'fdo'|    for which commands a fold will be opened
  601. |'foldtext'|  |'fdt'|    expression used to display for a closed fold
  602. |'formatoptions'| |'fo'|     how automatic formatting is to be done
  603. |'formatprg'|  |'fp'|     name of external program used with "gq" command
  604. |'gdefault'|  |'gd'|     the ":substitute" flag 'g' is default on
  605. |'grepformat'|  |'gfm'|    format of 'grepprg' output
  606. |'grepprg'|  |'gp'|     program to use for ":grep"
  607. |'guicursor'|  |'gcr'|    GUI: settings for cursor shape and blinking
  608. |'guifont'|  |'gfn'|    GUI: Name(s) of font(s) to be used
  609. |'guifontset'|  |'gfs'|    GUI: Names of multi-byte fonts to be used
  610. |'guifontwide'|   |'gfw'|    list of font names for double-wide characters
  611. |'guiheadroom'|  |'ghr'|    GUI: pixels room for window decorations
  612. |'guioptions'|  |'go'|     GUI: Which components and options are used
  613. |'guipty'|     GUI: try to use a pseudo-tty for ":!" commands
  614. |'helpfile'|  |'hf'|     name of this help file
  615. |'helpheight'|  |'hh'|     minimum height of a new help window
  616. |'hidden'|  |'hid'|    don't unload buffer when it is |abandon|ed
  617. |'highlight'|  |'hl'|     sets highlighting mode for various occasions
  618. |'hlsearch'|  |'hls'|    highlight matches with last search pattern
  619. |'history'|  |'hi'|     number of command-lines that are remembered
  620. |'hkmap'|  |'hk'|     Hebrew keyboard mapping
  621. |'hkmapp'|  |'hkp'|    phonetic Hebrew keyboard mapping
  622. |'icon'|     let Vim set the text of the window icon
  623. |'iconstring'|     string to use for the Vim icon text
  624. |'ignorecase'|  |'ic'|     ignore case in search patterns
  625. |'imactivatekey'| |'imak'|   key that activates the X input method
  626. |'imcmdline'|  |'imc'|    use IM when starting to edit a command line
  627. |'iminsert'|  |'imi'|    use :lmap or IM in Insert mode
  628. |'imsearch'|  |'ims'|    use :lmap or IM when typing a search pattern
  629. |'include'|  |'inc'|    pattern to be used to find an include file
  630. |'includeexpr'|   |'inex'|   expression used to process an include line
  631. |'incsearch'|  |'is'|     highlight match while typing search pattern
  632. |'indentexpr'|  |'inde'|   expression used to obtain the indent of a line
  633. |'indentkeys'|  |'indk'|   keys that trigger indenting with 'indentexpr'
  634. |'infercase'|  |'inf'|    adjust case of match for keyword completion
  635. |'insertmode'|  |'im'|     start the edit of a file in Insert mode
  636. |'isfname'|  |'isf'|    characters included in file names and pathnames
  637. |'isident'|  |'isi'|    characters included in identifiers
  638. |'iskeyword'|  |'isk'|    characters included in keywords
  639. |'isprint'|  |'isp'|    printable characters
  640. |'joinspaces'|  |'js'|     two spaces after a period with a join command
  641. |'key'|     encryption key
  642. |'keymap'|  |'kmp'|    name of a keyboard mapping
  643. |'keymodel'|  |'km'|     enable starting/stopping selection with keys
  644. |'keywordprg'|  |'kp'|     program to use for the "K" command
  645. |'langmap'|  |'lmap'|   alphabetic characters for other language mode
  646. |'langmenu'|  |'lm'|     language to be used for the menus
  647. |'laststatus'|  |'ls'|     tells when last window has status lines
  648. |'lazyredraw'|  |'lz'|     don't redraw while executing macros
  649. |'linebreak'|  |'lbr'|    wrap long lines at a blank
  650. |'lines'|     number of lines in the display
  651. |'linespace'|  |'lsp'|    number of pixel lines to use between characters
  652. |'lisp'|     automatic indenting for Lisp
  653. |'lispwords'|  |'lw'|     words that change how lisp indenting works
  654. |'list'|     show <Tab> and <EOL>
  655. |'listchars'|  |'lcs'|    characters for displaying in list mode
  656. |'loadplugins'|   |'lpl'|    load plugin scripts when starting up
  657. |'magic'|     changes special characters in search patterns
  658. |'makeef'|  |'mef'|    name of the errorfile for ":make"
  659. |'makeprg'|  |'mp'|     program to use for the ":make" command
  660. |'matchpairs'|  |'mps'|    pairs of characters that "%" can match
  661. |'matchtime'|  |'mat'|    tenths of a second to show matching paren
  662. |'maxfuncdepth'|  |'mfd'|    maximum recursive depth for user functions
  663. |'maxmapdepth'|   |'mmd'|    maximum recursive depth for mapping
  664. |'maxmem'|  |'mm'|     maximum memory (in Kbyte) used for one buffer
  665. |'maxmemtot'|  |'mmt'|    maximum memory (in Kbyte) used for all buffers
  666. |'menuitems'|  |'mis'|    maximum number of items in a menu
  667. |'modeline'|  |'ml'|     recognize modelines at start or end of file
  668. |'modelines'|  |'mls'|    number of lines checked for modelines
  669. |'modifiable'|  |'ma'|     changes to the text are not possible
  670. |'modified'|  |'mod'|    buffer has been modified
  671. |'more'|     pause listings when the whole screen is filled
  672. |'mouse'|     enable the use of mouse clicks
  673. |'mousefocus'|  |'mousef'| keyboard focus follows the mouse
  674. |'mousehide'|  |'mh'|     hide mouse pointer while typing
  675. |'mousemodel'|  |'mousem'| changes meaning of mouse buttons
  676. |'mouseshape'|  |'mouses'| shape of the mouse pointer in different modes
  677. |'mousetime'|  |'mouset'| max time between mouse double-click
  678. |'nrformats'|  |'nf'|     number formats recognized for CTRL-A command
  679. |'number'|  |'nu'|     print the line number in front of each line
  680. |'osfiletype'|  |'oft'|    operating system-specific filetype information
  681. |'paragraphs'|  |'para'|   nroff macros that separate paragraphs
  682. |'paste'|     allow pasting text
  683. |'pastetoggle'|  |'pt'|     key code that causes 'paste' to toggle
  684. |'patchexpr'|  |'pex'|    expression used to patch a file
  685. |'patchmode'|  |'pm'|     keep the oldest version of a file
  686. |'path'|  |'pa'|     list of directories searched with "gf" et.al.
  687. |'preserveindent'| |'pi'|    preserve the indent structure when reindenting
  688. |'previewheight'| |'pvh'|    height of the preview window
  689. |'previewwindow'| |'pvw'|    identifies the preview window
  690. |'printdevice'|   |'pdev'|   name of the printer to be used for :hardcopy
  691. |'printfont'|  |'pfn'|    name of the font to be used for :hardcopy
  692. |'printheader'|   |'pheader'| format of the header used for :hardcopy
  693. |'printoptions'|  |'popt'|   controls the format of :hardcopy output
  694. |'readonly'|  |'ro'|     disallow writing the buffer
  695. |'remap'|     allow mappings to work recursively
  696. |'report'|     threshold for reporting nr. of lines changed
  697. |'restorescreen'| |'rs'|     Win32: restore screen when exiting
  698. |'revins'|  |'ri'|     inserting characters will work backwards
  699. |'rightleft'|  |'rl'|     window is right-to-left oriented
  700. |'ruler'|  |'ru'|     show cursor line and column in the status line
  701. |'rulerformat'|  |'ruf'|    custom format for the ruler
  702. |'runtimepath'|   |'rtp'|    list of directories used for runtime files
  703. |'scroll'|  |'scr'|    lines to scroll with CTRL-U and CTRL-D
  704. |'scrollbind'|  |'scb'|    scroll in window as other windows scroll
  705. |'scrolljump'|  |'sj'|     minimum number of lines to scroll
  706. |'scrolloff'|  |'so'|     minimum nr. of lines above and below cursor
  707. |'scrollopt'|  |'sbo'|    how 'scrollbind' should behave
  708. |'sections'|  |'sect'|   nroff macros that separate sections
  709. |'secure'|     secure mode for reading .vimrc in current dir
  710. |'selection'|  |'sel'|    what type of selection to use
  711. |'selectmode'|  |'slm'|    when to use Select mode instead of Visual mode
  712. |'sessionoptions'| |'ssop'|  options for |:mksession|
  713. |'shell'|  |'sh'|     name of shell to use for external commands
  714. |'shellcmdflag'|  |'shcf'|   flag to shell to execute one command
  715. |'shellpipe'|  |'sp'|     string to put output of ":make" in error file
  716. |'shellquote'|  |'shq'|    quote character(s) for around shell command
  717. |'shellredir'|  |'srr'|    string to put output of filter in a temp file
  718. |'shellslash'|  |'ssl'|    use forward slash for shell file names
  719. |'shelltype'|  |'st'|     Amiga: influences how to use a shell
  720. |'shellxquote'|  |'sxq'|    like 'shellquote', but include redirection
  721. |'shiftround'|  |'sr'|     round indent to multiple of shiftwidth
  722. |'shiftwidth'|  |'sw'|     number of spaces to use for (auto)indent step
  723. |'shortmess'|  |'shm'|    list of flags, reduce length of messages
  724. |'shortname'|  |'sn'|     non-MS-DOS: Filenames assumed to be 8.3 chars
  725. |'showbreak'|  |'sbr'|    string to use at the start of wrapped lines
  726. |'showcmd'|  |'sc'|     show (partial) command in status line
  727. |'showfulltag'|  |'sft'|    show full tag pattern when completing tag
  728. |'showmatch'|  |'sm'|     briefly jump to matching bracket if insert one
  729. |'showmode'|  |'smd'|    message on status line to show current mode
  730. |'sidescroll'|  |'ss'|     minimum number of columns to scroll horizontal
  731. |'sidescrolloff'| |'siso'|   min. nr. of columns to left and right of cursor
  732. |'smartcase'|  |'scs'|    no ignore case when pattern has uppercase
  733. |'smartindent'|   |'si'|     smart autoindenting for C programs
  734. |'smarttab'|  |'sta'|    use 'shiftwidth' when inserting <Tab>
  735. |'softtabstop'|  |'sts'|    number of spaces that <Tab> uses while editing
  736. |'splitbelow'|  |'sb'|     new window from split is below the current one
  737. |'splitright'|  |'spr'|    new window is put right of the current one
  738. |'startofline'|   |'sol'|    commands move cursor to first blank in line
  739. |'statusline'|  |'stl'|    custom format for the status line
  740. |'suffixes'|  |'su'|     suffixes that are ignored with multiple match
  741. |'suffixesadd'|   |'sua'|    suffixes added when searching for a file
  742. |'swapfile'|  |'swf'|    whether to use a swapfile for a buffer
  743. |'swapsync'|  |'sws'|    how to sync the swap file
  744. |'switchbuf'|  |'swb'|    sets behavior when switching to another buffer
  745. |'syntax'|  |'syn'|    syntax to be loaded for current buffer
  746. |'tabstop'|  |'ts'|     number of spaces that <Tab> in file uses
  747. |'tagbsearch'|  |'tbs'|    use binary searching in tags files
  748. |'taglength'|  |'tl'|     number of significant characters for a tag
  749. |'tagrelative'|   |'tr'|     file names in tag file are relative
  750. |'tags'|  |'tag'|    list of file names used by the tag command
  751. |'tagstack'|  |'tgst'|   push tags onto the tag stack
  752. |'term'|     name of the terminal
  753. |'termencoding'|  |'tenc'|   character encoding used by the terminal
  754. |'terse'|     shorten some messages
  755. |'textauto'|  |'ta'|     obsolete, use 'fileformats'
  756. |'textmode'|  |'tx'|     obsolete, use 'fileformat'
  757. |'textwidth'|  |'tw'|     maximum width of text that is being inserted
  758. |'thesaurus'|  |'tsr'|    list of thesaurus files for keyword completion
  759. |'tildeop'|  |'top'|    tilde command "~" behaves like an operator
  760. |'timeout'|  |'to'|     time out on mappings and key codes
  761. |'timeoutlen'|  |'tm'|     time out time in milliseconds
  762. |'title'|     let Vim set the title of the window
  763. |'titlelen'|     percentage of 'columns' used for window title
  764. |'titleold'|     old title, restored when exiting
  765. |'titlestring'|     string to use for the Vim window title
  766. |'toolbar'|  |'tb'|     GUI: which items to show in the toolbar
  767. |'ttimeout'|     time out on mappings
  768. |'ttimeoutlen'|  |'ttm'|    time out time for key codes in milliseconds
  769. |'ttybuiltin'|  |'tbi'|    use built-in termcap before external termcap
  770. |'ttyfast'|  |'tf'|     indicates a fast terminal connection
  771. |'ttymouse'|  |'ttym'|   type of mouse codes generated
  772. |'ttyscroll'|  |'tsl'|    maximum number of lines for a scroll
  773. |'ttytype'|  |'tty'|    alias for 'term'
  774. |'undolevels'|  |'ul'|     maximum number of changes that can be undone
  775. |'updatecount'|   |'uc'|     after this many characters flush swap file
  776. |'updatetime'|  |'ut'|     after this many milliseconds flush swap file
  777. |'verbose'|  |'vbs'|    give informative messages
  778. |'viewdir'|  |'vdir'|   directory where to store files with :mkview
  779. |'viewoptions'|   |'vop'|    specifies what to save for :mkview
  780. |'viminfo'|  |'vi'|     use .viminfo file upon startup and exiting
  781. |'virtualedit'|   |'ve'|     when to use virtual editing
  782. |'visualbell'|  |'vb'|     use visual bell instead of beeping
  783. |'warn'|     warn for shell command when buffer was changed
  784. |'weirdinvert'|   |'wi'|     for terminals that have weird inversion method
  785. |'whichwrap'|  |'ww'|     allow specified keys to cross line boundaries
  786. |'wildchar'|  |'wc'|     command-line character for wildcard expansion
  787. |'wildcharm'|  |'wcm'|    like 'wildchar' but also works when mapped
  788. |'wildignore'|  |'wig'|    files matching these patterns are not completed
  789. |'wildmenu'|  |'wmnu'|   use menu for command line completion
  790. |'wildmode'|  |'wim'|    mode for 'wildchar' command-line expansion
  791. |'winaltkeys'|  |'wak'|    when the windows system handles ALT keys
  792. |'winheight'|  |'wh'|     minimum number of lines for the current window
  793. |'winminheight'|  |'wmh'|    minimum number of lines for any window
  794. |'winminwidth'|   |'wmw'|    minimal number of columns for any window
  795. |'winwidth'|  |'wiw'|    minimal number of columns for current window
  796. |'wrap'|     long lines wrap and continue on the next line
  797. |'wrapmargin'|  |'wm'|     chars from the right where wrapping starts
  798. |'wrapscan'|  |'ws'|     searches wrap around the end of the file
  799. |'write'|     writing to a file is allowed
  800. |'writeany'|  |'wa'|     write to file with no need for "!" override
  801. |'writebackup'|   |'wb'|     make a backup before overwriting a file
  802. |'writedelay'|  |'wd'|     delay this many msec for each char (for debug)

  803. *Q_ur*Undo/Redo commands

  804. |u|  N  uundo last N changes
  805. |CTRL-R|  N  CTRL-Rredo last N undone changes
  806. |U|     Urestore last changed line

  807. *Q_et*External commands

  808. |:shell|:sh[ell]start a shell
  809. |:!|:!{command}execute {command} with a shell
  810. |K|   Klookup keyword under the cursor with
  811.    'keywordprg' program (default: "man")

  812. *Q_qf*Quickfix commands

  813. |:cc|:cc [nr]display error [nr] (default is the same again)
  814. |:cnext|:cndisplay the next error
  815. |:cprevious|:cpdisplay the previous error
  816. |:clist|:cllist all errors
  817. |:cfile|:cfread errors from the file 'errorfile'
  818. |:cquit|:cqquit without writing and return error code (to
  819.    the compiler)
  820. |:make|:make [args]start make, read errors, and jump to first
  821.    error
  822. |:grep|:gr[ep] [args]execute 'grepprg' to find matches and jump to
  823.    the first one.

  824. *Q_vc*Various commands

  825. |CTRL-L|   CTRL-LClear and redraw the screen.
  826. |CTRL-G|   CTRL-Gshow current file name (with path) and cursor
  827.    position
  828. |ga|   gashow ascii value of character under cursor in
  829.    decimal, hex, and octal
  830. |g_CTRL-G|   g CTRL-Gshow cursor column, line, and character
  831.    position
  832. |CTRL-C|   CTRL-Cduring searches: Interrupt the search
  833. |dos-CTRL-Break|   CTRL-BreakMS-DOS: during searches: Interrupt the search
  834. |<Del>|   <Del>while entering a count: delete last character
  835. |:version|:ve[rsion]show version information
  836. |:mode|:mode NMS-DOS: set screen mode to N (number, C80,
  837.    C4350, etc.)
  838. |:normal|:norm[al][!] {commands}
  839. Execute Normal mode commands.
  840. |Q|Qswitch to "Ex" mode

  841. |:redir|:redir >{file}redirect messages to {file}
  842. |:silent|:silent[!] {command}execute {command} silently
  843. |:confirm|:confirm {command}quit, write, etc., asking about
  844. unsaved changes or read-only files.
  845. |:browse|:browse {command}open/read/write file, using a
  846. file selection dialog

  847. *Q_ce*Command-line editing

  848. |c_<Esc>|<Esc>   abandon command-line (if 'wildchar' is
  849.       <Esc>, type it twice)

  850. |c_CTRL-V|CTRL-V {char}   insert {char} literally
  851. |c_CTRL-V|CTRL-V {number}    enter decimal value of character (up to
  852.       three digits)
  853. |c_CTRL-K|CTRL-K {char1} {char2}
  854.    enter digraph (See |Q_di|)
  855. |c_CTRL-R|CTRL-R {0-9a-z"%#:-=}
  856.    insert the contents of a register

  857. |c_<Left>|<Left>/<Right>   cursor left/right
  858. |c_<S-Left>|<S-Left>/<S-Right> cursor one word left/right
  859. |c_CTRL-B|CTRL-B/CTRL-E   cursor to beginning/end of command-line

  860. |c_<BS>|<BS>   delete the character in front of the cursor
  861. |c_<Del>|<Del>   delete the character under the cursor
  862. |c_CTRL-W|CTRL-W   delete the word in front of the cursor
  863. |c_CTRL-U|CTRL-U   remove all characters

  864. |c_<Up>|<Up>/<Down>   recall older/newer command-line that starts
  865.       with current command
  866. |c_<S-Up>|<S-Up>/<S-Down>   recall older/newer command-line from history
  867. |:history|:his[tory]   show older command-lines

  868. Context-sensitive completion on the command-line:

  869. |c_wildchar|'wildchar'  (default: <Tab>)
  870. do completion on the pattern in front of the
  871.    cursor.  If there are multiple matches,
  872.    beep and show the first one; further
  873.    'wildchar' will show the next ones.
  874. |c_CTRL-D|CTRL-Dlist all names that match the pattern in
  875.    front of the cursor
  876. |c_CTRL-A|CTRL-Ainsert all names that match pattern in front
  877.    of cursor
  878. |c_CTRL-L|CTRL-Linsert longest common part of names that
  879.    match pattern
  880. |c_CTRL-N|CTRL-Nafter 'wildchar' with multiple matches: go
  881.    to next match
  882. |c_CTRL-P|CTRL-Pafter 'wildchar' with multiple matches: go
  883.    to previous match

  884. *Q_ra*Ex ranges

  885. |:range|,separates two line numbers
  886. |:range|;idem, set cursor to the first line number
  887. before interpreting the second one

  888. |:range|{number}an absolute line number
  889. |:range|.the current line
  890. |:range|$the last line in the file
  891. |:range|%equal to 1,$ (the entire file)
  892. |:range|*equal to '<,'> (visual area)
  893. |:range|'tposition of mark t
  894. |:range|/{pattern}[/]the next line where {pattern} matches
  895. |:range|?{pattern}[?]the previous line where {pattern} matches

  896. |:range|+[num]add [num] to the preceding line number
  897.    (default: 1)
  898. |:range|-[num]subtract [num] from the preceding line
  899.    number (default: 1)

  900. *Q_ex*Special Ex characters

  901. |:bar|    |separates two commands (not for ":global" and ":!")
  902. |:quote|    "begins comment

  903. |:_%|    %current file name (only where a file name is expected)
  904. |:_#|    #[num]alternate file name [num] (only where a file name is
  905.    expected)
  906. Note: The next four are typed literally; these are not special keys!
  907. |:<cword>|  <cword>word under the cursor (only where a file name is
  908.    expected)
  909. |:<cWORD>|  <cWORD>WORD under the cursor (only where a file name is
  910.    expected) (see |WORD|)
  911. |:<cfile>|  <cfile>file name under the cursor (only where a file name is
  912.    expected)
  913. |:<afile>|  <afile>file name for autocommand (only where a file name is
  914.    expected)
  915. |:<sfile>|  <sfile>file name of a ":source"d file, within that file (only
  916.    where a file name is expected)

  917. After "%", "#", "<cfile>", "<sfile>" or "<afile>"
  918. |::p|    :pfull path
  919. |::h|    :hhead (file name removed)
  920. |::t|    :ttail (file name only)
  921. |::r|    :rroot (extension removed)
  922. |::e|    :eextension
  923. |::s|    :s/{pat}/{repl}/substitute {pat} with {repl}

  924. *Q_ed*Editing a file

  925.    Without !: Fail if changes has been made to the current buffer.
  926.       With !: Discard any changes to the current buffer.
  927. |:edit_f|  :e[dit][!] {file}Edit {file}.
  928. |:edit|   :e[dit][!]Reload the current file.
  929. |:enew|   :ene[w][!]Edit a new, unnamed buffer.
  930. |:find|    :fin[d][!] {file}Find {file} in 'path' and edit it.

  931. |CTRL-^|   N   CTRL-^Edit alternate file N (equivalent to ":e #N").
  932. |gf|       gf  or ]fEdit the file whose name is under the cursor
  933. |:pwd|   :pwdPrint the current directory name.
  934. |:cd|   :cd [path]Change the current directory to [path].
  935. |:cd-|   :cd -Back to previous current directory.
  936. |:file|   :f[ile]Print the current file name and the cursor
  937.    position.
  938. |:file|   :f[ile] {name}Set the current file name to {name}.
  939. |:files|   :filesShow alternate file names.

  940. *Q_fl*Using the argument list|argument-list|

  941. |:args|   :ar[gs]Print the argument list, with the current file
  942.    in "[]".
  943. |:all|   :all  or :sallOpen a window for every file in the arg list.
  944. |:wn|   :wn[ext][!]Write file and edit next file.
  945. |:wn|   :wn[ext][!] {file}Write to {file} and edit next file, unless
  946.    {file} exists.  With !, overwrite existing
  947.    file.
  948. |:wN|   :wN[ext][!] [file]Write file and edit previous file.

  949.      in current window    in new window
  950. |:argument|  :argu[ment] N  :sar[gument] NEdit file N
  951. |:next|     :n[ext]  :sn[ext]Edit next file
  952. |:next_f|    :n[ext] {arglist}  :sn[ext] {arglist}define new arg list
  953.    and edit first file
  954. |:Next|     :N[ext]  :sN[ext]Edit previous file
  955. |:first|     :fir[st]  :sfir[st]Edit first file
  956. |:last|     :la[st]  :sla[st]Edit last file

  957. *Q_wq*Writing and quitting

  958. |:w|  :[range]w[rite][!]Write to the current file.
  959. |:w_f|  :[range]w[rite] {file}Write to {file}, unless it already
  960.    exists.
  961. |:w_f|  :[range]w[rite]! {file}Write to {file}.  Overwrite an existing
  962.    file.
  963. |:w_a|  :[range]w[rite][!] >>Append to the current file.
  964. |:w_a|  :[range]w[rite][!] >> {file}Append to {file}.
  965. |:w_c|  :[range]w[rite] !{cmd}Execute {cmd} with [range] lines as
  966.    standard input.
  967. |:up|  :[range]up[date][!]write to current file if modified
  968. |:wall|  :wa[ll][!]write all changed buffers

  969. |:q|  :q[uit]Quit current buffer, unless changes have been
  970.    made.  Exit Vim when there are no other
  971.    non-help buffers
  972. |:q|  :q[uit]!Quit current buffer always, discard any
  973.    changes.  Exit Vim when there are no other
  974.    non-help buffers
  975. |:qa|  :qa[ll]Exit Vim, unless changes have been made.
  976. |:qa|  :qa[ll]!Exit Vim always, discard any changes.
  977. |:cq|  :cqQuit without writing and return error code.

  978. |:wq|  :wq[!]Write the current file and exit.
  979. |:wq|  :wq[!] {file}Write to {file} and exit.
  980. |:xit|  :x[it][!] [file]Like ":wq" but write only when changes have
  981.    been made
  982. |ZZ|     ZZSame as ":x".
  983. |ZQ|     ZQSame as ":q!".
  984. |:xall|  :xa[ll][!]  or :wqall[!]
  985. Write all changed buffers and exit

  986. |:stop|  :st[op][!]Suspend VIM or start new shell. If 'aw' option
  987.    is set and [!] not given write the buffer.
  988. |CTRL-Z|     CTRL-ZSame as ":stop"

  989. *Q_st*Starting VIM

  990. |-vim|   vim [options]start editing with an empty buffer
  991. |-file|   vim [options] {file} ..start editing one or more files
  992. |--|   vim [options] -read file from stdin
  993. |-tag|   vim [options] -t {tag}edit the file associated with {tag}
  994. |-qf|   vim [options] -q [fname]start editing in QuickFix mode,
  995.    display the first error

  996. Vim arguments:

  997. |-gui|-g    start GUI (also allows other options)

  998. |-+|+[num]    put the cursor at line [num] (default: last line)
  999. |-+c|+{command}    execute {command} after loading the file
  1000. |-+/|+/{pat} {file} ..   put the cursor at the first occurrence of {pat}
  1001. |-v|-v    Vi mode, start ex in Normal mode
  1002. |-e|-e    Ex mode, start vim in Ex mode
  1003. |-R|-R    Read-only mode, implies -n
  1004. |-m|-m    modifications not allowed (resets 'write' option)
  1005. |-b|-b    binary mode
  1006. |-l|-l    lisp mode
  1007. |-A|-A    Arabic mode ('arabic' is set)
  1008. |-F|-F    Farsi mode ('fkmap' and 'rightleft' are set)
  1009. |-H|-H    Hebrew mode ('hkmap' and 'rightleft' are set)
  1010. |-V|-V    Verbose, give informative messages
  1011. |-C|-C    Compatible, set the 'compatible' option
  1012. |-N|-N    Nocompatible, reset the 'compatible' option
  1013. |-r|-r    give list of swap files
  1014. |-r|-r {file} ..    recover aborted edit session
  1015. |-n|-n    do not create a swap file
  1016. |-o|-o [num]    open [num] windows (default: one for each file)
  1017. |-f|-f    GUI: foreground process, don't fork
  1018.     Amiga: do not restart VIM to open a window (for
  1019. e.g., mail)
  1020. |-s|-s {scriptin}    first read commands from the file {scriptin}
  1021. |-w|-w {scriptout}    write typed chars to file {scriptout} (append)
  1022. |-W|-W {scriptout}    write typed chars to file {scriptout} (overwrite)
  1023. |-T|-T {terminal}    set terminal name
  1024. |-d|-d {device}    Amiga: open {device} to be used as a console
  1025. |-u|-u {vimrc}    read inits from {vimrc} instead of other inits
  1026. |-U|-U {gvimrc}    idem, for when starting the GUI
  1027. |-i|-i {viminfo}    read info from {viminfo} instead of other files
  1028. |---|--    end of options, other arguments are file names
  1029. |--help|    --help    show list of arguments and exit
  1030. |--version| --version    show version info and exit
  1031. |--|-    Read file from stdin.

  1032. *Q_ac*Automatic Commands

  1033. |viminfo-file|Read registers, marks, history at startup, save when exiting.

  1034. |:rviminfo|:rv[iminfo] [file]Read info from viminfo file [file]
  1035. |:rviminfo|:rv[iminfo]! [file]idem, overwrite existing info
  1036. |:wviminfo|:wv[iminfo] [file]Add info to viminfo file [file]
  1037. |:wviminfo|:wv[iminfo]! [file]Write info to viminfo file [file]

  1038. |modeline|Automatic option setting when editing a file

  1039. |modeline|vim:{set-arg}: ..In the first and last lines of the
  1040. file (see 'ml' option), {set-arg} is
  1041. given as an argument to ":set"

  1042. |autocommand|Automatic execution of commands on certain events.

  1043. |:autocmd|:auList all autocommands
  1044. |:autocmd|:au {event}List all autocommands for {event}
  1045. |:autocmd|:au {event} {pat}List all autocommands for {event} with
  1046. {pat}
  1047. |:autocmd|:au {event} {pat} {cmd}Enter new autocommands for {event}
  1048. with {pat}
  1049. |:autocmd|:au!Remove all autocommands
  1050. |:autocmd|:au! {event}Remove all autocommands for {event}
  1051. |:autocmd|:au! * {pat}Remove all autocommands for {pat}
  1052. |:autocmd|:au! {event} {pat}Remove all autocommands for {event}
  1053. with {pat}
  1054. |:autocmd|:au! {event} {pat} {cmd}  Remove all autocommands for {event}
  1055. with {pat} and enter new one

  1056. *Q_wi*Multi-window commands

  1057. |CTRL-W_s|CTRL-W s  or  :splitSplit window into two parts
  1058. |:split_f|:split {file}Split window and edit {file} in one of
  1059.    them
  1060. |:sfind|:sf[ind] {file}Split window, find {file} in 'path'
  1061.    and edit it.
  1062. |CTRL-W_]|CTRL-W ]Split window and jump to tag under
  1063.    cursor
  1064. |CTRL-W_f|CTRL-W fSplit window and edit file name under
  1065.    the cursor
  1066. |CTRL-W_CTRL-^| CTRL-W CTRL-^Split window and edit alternate file
  1067. |CTRL-W_n|CTRL-W n  or  :newCreate new empty window
  1068. |CTRL-W_q|CTRL-W q  or  :q[uit]Quit editing and close window
  1069. |CTRL-W_c|CTRL-W c  or  :cl[ose]Make buffer hidden and close window
  1070. |CTRL-W_o|CTRL-W o  or  :on[ly]Make current window only one on the
  1071.    screen

  1072. |CTRL-W_j|CTRL-W jMove cursor to window below
  1073. |CTRL-W_k|CTRL-W kMove cursor to window above
  1074. |CTRL-W_CTRL-W|CTRL-W CTRL-WMove cursor to window below (wrap)
  1075. |CTRL-W_W|CTRL-W WMove cursor to window above (wrap)
  1076. |CTRL-W_t|CTRL-W tMove cursor to top window
  1077. |CTRL-W_b|CTRL-W bMove cursor to bottom window
  1078. |CTRL-W_p|CTRL-W pMove cursor to previous active window

  1079. |CTRL-W_r|CTRL-W rRotate windows downwards
  1080. |CTRL-W_R|CTRL-W RRotate windows upwards
  1081. |CTRL-W_x|CTRL-W xExchange current window with next one

  1082. |CTRL-W_=|CTRL-W =Make all windows equal height
  1083. |CTRL-W_-|CTRL-W -Decrease current window height
  1084. |CTRL-W_+|CTRL-W +Increase current window height
  1085. |CTRL-W__|CTRL-W _Set current window height (default:
  1086.    very high)

  1087. *Q_bu*Buffer list commands

  1088. |:buffers|:buffers  or  :fileslist all known buffer and file names

  1089. |:ball|:ball  or  :sballedit all args/buffers
  1090. |:unhide|:unhide   or  :sunhideedit all loaded buffers

  1091. |:badd|:badd {fname}add file name {fname} to the list
  1092. |:bunload|:bunload[!] [N]unload buffer [N] from memory
  1093. |:bdelete|:bdelete[!] [N]unload buffer [N] and delete it from
  1094.    the buffer list

  1095.       in current window   in new window
  1096. |:buffer|     :[N]buffer [N]  :[N]sbuffer [N]     to arg/buf N
  1097. |:bnext|      :[N]bnext [N]  :[N]sbnext [N]      to Nth next arg/buf
  1098. |:bNext|      :[N]bNext [N]  :[N]sbNext [N]      to Nth previous arg/buf
  1099. |:bprevious|  :[N]bprevious [N]   :[N]sbprevious [N]  to Nth previous arg/buf
  1100. |:bfirst|     :bfirst  :sbfirst      to first arg/buf
  1101. |:blast|      :blast  :sblast      to last arg/buf
  1102. |:bmodified|  :[N]bmod [N]  :[N]sbmod [N]      to Nth modified buf

  1103. *Q_sy*Syntax Highlighting

  1104. |:syn-on|:syntax onstart using syntax highlighting
  1105. |:syn-off|:syntax offstop using syntax highlighting

  1106. |:syn-keyword|:syntax keyword {group-name} {keyword} ..
  1107. add a syntax keyword item
  1108. |:syn-match|:syntax match {group-name} {pattern} ...
  1109. add syntax match item
  1110. |:syn-region|:syntax region {group-name} {pattern} ...
  1111. add syntax region item
  1112. |:syn-sync|:syntax sync [ccomment | lines {N} | ...]
  1113. tell syntax how to sync
  1114. |:syntax|:syntax [list]list current syntax items
  1115. |:syn-clear|:syntax clearclear all syntax info

  1116. |:highlight|:highlight clearclear all highlight info
  1117. |:highlight|:highlight {group-name} {key}={arg} ..
  1118. set highlighting for {group-name}

  1119. |:filetype|:filetype onswitch on file type detection, without
  1120. syntax highlighting
  1121. |:filetype|:filetype plugin indent on
  1122. switch on file type detection, with
  1123. automatic indenting and settings

  1124. *Q_gu*GUI commands

  1125. |:gui|:guiUNIX: start the GUI
  1126. |:gui|:gui {fname} ..idem, and edit {fname} ..

  1127. |:menu|:menulist all menus
  1128. |:menu|:menu {mpath}list menus starting with {mpath}
  1129. |:menu|:menu {mpath} {rhs}add menu {mpath}, giving {lhs}
  1130. |:menu|:menu {pri} {mpath} {rhs}
  1131. idem, with priorities {pri}
  1132. |:menu|:menu ToolBar.{name} {rhs}
  1133. add toolbar item, giving {lhs}
  1134. |:tmenu|:tmenu {mpath} {text}add tooltip to menu {mpath}
  1135. |:unmenu|:unmenu {mpath}remove menu {mpath}


  1136. *Q_fo*Folding

  1137. |'foldmethod'|set foldmethod=manualmanual folding
  1138. set foldmethod=indentfolding by indent
  1139. set foldmethod=exprfolding by 'foldexpr'
  1140. set foldmethod=syntaxfolding by syntax regions
  1141. set foldmethod=markerfolding by 'foldmarkers'

  1142. |zf|zf{motion}operator: Define a fold manually
  1143. |:fold|:{range}folddefine a fold for {range} lines
  1144. |zd|zddelete one fold under the cursor
  1145. |zD|zDdelete all folds under the cursor

  1146. |zo|zoopen one fold under the cursor
  1147. |zO|zOopen all folds under the cursor
  1148. |zc|zcclose one fold under the cursor
  1149. |zC|zCclose all folds under the cursor

  1150. |zm|zmfold more: decrease 'foldlevel'
  1151. |zM|zMclose all folds: make 'foldlevel' zero
  1152. |zr|zrreduce folding: increase 'foldlevel'
  1153. |zR|zRopen all folds: make 'foldlevel' max.

  1154. |zn|znfold none: reset 'foldenable'
  1155. |zN|zNfold normal set 'foldenable'
  1156. |zi|ziinvert 'foldenable'

  1157. vim:tw=78:ts=8:ft=help:norl:
复制代码

Generated by vim2html on Thu Jun 17 12:17:02 CEST 2004
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表