quickref.txt 71 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475
  1. *quickref.txt* For Vim version 9.0. Last change: 2022 Nov 23
  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_st| Starting Vim
  18. |Q_di| insert: Digraphs |Q_ed| Editing a file
  19. |Q_si| insert: Special inserts |Q_fl| Using the argument list
  20. |Q_de| change: Deleting text |Q_wq| Writing and quitting
  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. ------------------------------------------------------------------------------
  28. N is used to indicate an optional count that can be given before the command.
  29. ------------------------------------------------------------------------------
  30. *Q_lr* Left-right motions
  31. |h| N h left (also: CTRL-H, <BS>, or <Left> key)
  32. |l| N l right (also: <Space> or <Right> key)
  33. |0| 0 to first character in the line (also: <Home> key)
  34. |^| ^ to first non-blank character in the line
  35. |$| N $ to the last character in the line (N-1 lines lower)
  36. (also: <End> key)
  37. |g0| g0 to first character in screen line (differs from "0"
  38. when lines wrap)
  39. |g^| g^ to first non-blank character in screen line (differs
  40. from "^" when lines wrap)
  41. |g$| N g$ to last character in screen line (differs from "$"
  42. when lines wrap)
  43. |gm| gm to middle of the screen line
  44. |gM| gM to middle of the line
  45. |bar| N | to column N (default: 1)
  46. |f| N f{char} to the Nth occurrence of {char} to the right
  47. |F| N F{char} to the Nth occurrence of {char} to the left
  48. |t| N t{char} till before the Nth occurrence of {char} to the right
  49. |T| N T{char} till before the Nth occurrence of {char} to the left
  50. |;| N ; repeat the last "f", "F", "t", or "T" N times
  51. |,| N , repeat the last "f", "F", "t", or "T" N times in
  52. opposite direction
  53. ------------------------------------------------------------------------------
  54. *Q_ud* Up-down motions
  55. |k| N k up N lines (also: CTRL-P and <Up>)
  56. |j| N j down N lines (also: CTRL-J, CTRL-N, <NL>, and <Down>)
  57. |-| N - up N lines, on the first non-blank character
  58. |+| N + down N lines, on the first non-blank character (also:
  59. CTRL-M and <CR>)
  60. |_| N _ down N-1 lines, on the first non-blank character
  61. |G| N G goto line N (default: last line), on the first
  62. non-blank character
  63. |gg| N gg goto line N (default: first line), on the first
  64. non-blank character
  65. |N%| N % goto line N percentage down in the file; N must be
  66. given, otherwise it is the |%| command
  67. |gk| N gk up N screen lines (differs from "k" when line wraps)
  68. |gj| N gj down N screen lines (differs from "j" when line wraps)
  69. ------------------------------------------------------------------------------
  70. *Q_tm* Text object motions
  71. |w| N w N words forward
  72. |W| N W N blank-separated |WORD|s forward
  73. |e| N e forward to the end of the Nth word
  74. |E| N E forward to the end of the Nth blank-separated |WORD|
  75. |b| N b N words backward
  76. |B| N B N blank-separated |WORD|s backward
  77. |ge| N ge backward to the end of the Nth word
  78. |gE| N gE backward to the end of the Nth blank-separated |WORD|
  79. |)| N ) N sentences forward
  80. |(| N ( N sentences backward
  81. |}| N } N paragraphs forward
  82. |{| N { N paragraphs backward
  83. |]]| N ]] N sections forward, at start of section
  84. |[[| N [[ N sections backward, at start of section
  85. |][| N ][ N sections forward, at end of section
  86. |[]| N [] N sections backward, at end of section
  87. |[(| N [( N times back to unclosed '('
  88. |[{| N [{ N times back to unclosed '{'
  89. |[m| N [m N times back to start of method (for Java)
  90. |[M| N [M N times back to end of method (for Java)
  91. |])| N ]) N times forward to unclosed ')'
  92. |]}| N ]} N times forward to unclosed '}'
  93. |]m| N ]m N times forward to start of method (for Java)
  94. |]M| N ]M N times forward to end of method (for Java)
  95. |[#| N [# N times back to unclosed "#if" or "#else"
  96. |]#| N ]# N times forward to unclosed "#else" or "#endif"
  97. |[star| N [* N times back to start of comment "/*"
  98. |]star| N ]* N times forward to end of comment "*/"
  99. ------------------------------------------------------------------------------
  100. *Q_pa* Pattern searches
  101. |/| N /{pattern}[/[offset]]<CR>
  102. search forward for the Nth occurrence of {pattern}
  103. |?| N ?{pattern}[?[offset]]<CR>
  104. search backward for the Nth occurrence of {pattern}
  105. |/<CR>| N /<CR> repeat last search, in the forward direction
  106. |?<CR>| N ?<CR> repeat last search, in the backward direction
  107. |n| N n repeat last search
  108. |N| N N repeat last search, in opposite direction
  109. |star| N * search forward for the identifier under the cursor
  110. |#| N # search backward for the identifier under the cursor
  111. |gstar| N g* like "*", but also find partial matches
  112. |g#| N g# like "#", but also find partial matches
  113. |gd| gd goto local declaration of identifier under the cursor
  114. |gD| gD goto global declaration of identifier under the cursor
  115. |pattern| Special characters in search patterns
  116. meaning magic nomagic ~
  117. matches any single character . \.
  118. matches start of line ^ ^
  119. matches <EOL> $ $
  120. matches start of word \< \<
  121. matches end of word \> \>
  122. matches a single char from the range [a-z] \[a-z]
  123. matches a single char not in the range [^a-z] \[^a-z]
  124. matches an identifier char \i \i
  125. idem but excluding digits \I \I
  126. matches a keyword character \k \k
  127. idem but excluding digits \K \K
  128. matches a file name character \f \f
  129. idem but excluding digits \F \F
  130. matches a printable character \p \p
  131. idem but excluding digits \P \P
  132. matches a white space character \s \s
  133. matches a non-white space character \S \S
  134. matches <Esc> \e \e
  135. matches <Tab> \t \t
  136. matches <CR> \r \r
  137. matches <BS> \b \b
  138. matches 0 or more of the preceding atom * \*
  139. matches 1 or more of the preceding atom \+ \+
  140. matches 0 or 1 of the preceding atom \= \=
  141. matches 2 to 5 of the preceding atom \{2,5} \{2,5}
  142. separates two alternatives \| \|
  143. group a pattern into an atom \(\) \(\)
  144. |search-offset| Offsets allowed after search command
  145. [num] [num] lines downwards, in column 1
  146. +[num] [num] lines downwards, in column 1
  147. -[num] [num] lines upwards, in column 1
  148. e[+num] [num] characters to the right of the end of the match
  149. e[-num] [num] characters to the left of the end of the match
  150. s[+num] [num] characters to the right of the start of the match
  151. s[-num] [num] characters to the left of the start of the match
  152. b[+num] [num] identical to s[+num] above (mnemonic: begin)
  153. b[-num] [num] identical to s[-num] above (mnemonic: begin)
  154. ;{search-command} execute {search-command} next
  155. ------------------------------------------------------------------------------
  156. *Q_ma* Marks and motions
  157. |m| m{a-zA-Z} mark current position with mark {a-zA-Z}
  158. |`a| `{a-z} go to mark {a-z} within current file
  159. |`A| `{A-Z} go to mark {A-Z} in any file
  160. |`0| `{0-9} go to the position where Vim was previously exited
  161. |``| `` go to the position before the last jump
  162. |`quote| `" go to the position when last editing this file
  163. |`[| `[ go to the start of the previously operated or put text
  164. |`]| `] go to the end of the previously operated or put text
  165. |`<| `< go to the start of the (previous) Visual area
  166. |`>| `> go to the end of the (previous) Visual area
  167. |`.| `. go to the position of the last change in this file
  168. |'| '{a-zA-Z0-9[]'"<>.}
  169. same as `, but on the first non-blank in the line
  170. |:marks| :marks print the active marks
  171. |CTRL-O| N CTRL-O go to Nth older position in jump list
  172. |CTRL-I| N CTRL-I go to Nth newer position in jump list
  173. |:ju| :ju[mps] print the jump list
  174. ------------------------------------------------------------------------------
  175. *Q_vm* Various motions
  176. |%| % find the next brace, bracket, comment, or "#if"/
  177. "#else"/"#endif" in this line and go to its match
  178. |H| N H go to the Nth line in the window, on the first
  179. non-blank
  180. |M| M go to the middle line in the window, on the first
  181. non-blank
  182. |L| N L go to the Nth line from the bottom, on the first
  183. non-blank
  184. |go| N go go to Nth byte in the buffer
  185. |:go| :[range]go[to] [off] go to [off] byte in the buffer
  186. ------------------------------------------------------------------------------
  187. *Q_ta* Using tags
  188. |:ta| :ta[g][!] {tag} jump to tag {tag}
  189. |:ta| :[count]ta[g][!] jump to [count]'th newer tag in tag list
  190. |CTRL-]| CTRL-] jump to the tag under cursor, unless changes
  191. have been made
  192. |:ts| :ts[elect][!] [tag] list matching tags and select one to jump to
  193. |:tjump| :tj[ump][!] [tag] jump to tag [tag] or select from list when
  194. there are multiple matches
  195. |:ltag| :lt[ag][!] [tag] jump to tag [tag] and add matching tags to the
  196. location list
  197. |:tags| :tags print tag list
  198. |CTRL-T| N CTRL-T jump back from Nth older tag in tag list
  199. |:po| :[count]po[p][!] jump back from [count]'th older tag in tag list
  200. |:tnext| :[count]tn[ext][!] jump to [count]'th next matching tag
  201. |:tp| :[count]tp[revious][!] jump to [count]'th previous matching tag
  202. |:tr| :[count]tr[ewind][!] jump to [count]'th matching tag
  203. |:tl| :tl[ast][!] jump to last matching tag
  204. |:ptag| :pt[ag] {tag} open a preview window to show tag {tag}
  205. |CTRL-W_}| CTRL-W } like CTRL-] but show tag in preview window
  206. |:pts| :pts[elect] like ":tselect" but show tag in preview window
  207. |:ptjump| :ptj[ump] like ":tjump" but show tag in preview window
  208. |:pclose| :pc[lose] close tag preview window
  209. |CTRL-W_z| CTRL-W z close tag preview window
  210. ------------------------------------------------------------------------------
  211. *Q_sc* Scrolling
  212. |CTRL-E| N CTRL-E window N lines downwards (default: 1)
  213. |CTRL-D| N CTRL-D window N lines Downwards (default: 1/2 window)
  214. |CTRL-F| N CTRL-F window N pages Forwards (downwards)
  215. |CTRL-Y| N CTRL-Y window N lines upwards (default: 1)
  216. |CTRL-U| N CTRL-U window N lines Upwards (default: 1/2 window)
  217. |CTRL-B| N CTRL-B window N pages Backwards (upwards)
  218. |z<CR>| z<CR> or zt redraw, current line at top of window
  219. |z.| z. or zz redraw, current line at center of window
  220. |z-| z- or zb redraw, current line at bottom of window
  221. These only work when 'wrap' is off:
  222. |zh| N zh scroll screen N characters to the right
  223. |zl| N zl scroll screen N characters to the left
  224. |zH| N zH scroll screen half a screenwidth to the right
  225. |zL| N zL scroll screen half a screenwidth to the left
  226. ------------------------------------------------------------------------------
  227. *Q_in* Inserting text
  228. |a| N a append text after the cursor (N times)
  229. |A| N A append text at the end of the line (N times)
  230. |i| N i insert text before the cursor (N times) (also: <Insert>)
  231. |I| N I insert text before the first non-blank in the line (N times)
  232. |gI| N gI insert text in column 1 (N times)
  233. |o| N o open a new line below the current line, append text (N times)
  234. |O| N O open a new line above the current line, append text (N times)
  235. |:startinsert| :star[tinsert][!] start Insert mode, append when [!] used
  236. |:startreplace| :startr[eplace][!] start Replace mode, at EOL when [!] used
  237. in Visual block mode:
  238. |v_b_I| I insert the same text in front of all the selected lines
  239. |v_b_A| A append the same text after all the selected lines
  240. ------------------------------------------------------------------------------
  241. *Q_ai* Insert mode keys
  242. |insert-index| alphabetical index of Insert mode commands
  243. leaving Insert mode:
  244. |i_<Esc>| <Esc> end Insert mode, back to Normal mode
  245. |i_CTRL-C| CTRL-C like <Esc>, but do not use an abbreviation
  246. |i_CTRL-O| CTRL-O {command} execute {command} and return to Insert mode
  247. moving around:
  248. |i_<Up>| cursor keys move cursor left/right/up/down
  249. |i_<S-Left>| shift-left/right one word left/right
  250. |i_<S-Up>| shift-up/down one screenful backward/forward
  251. |i_<End>| <End> cursor after last character in the line
  252. |i_<Home>| <Home> cursor to first character in the line
  253. ------------------------------------------------------------------------------
  254. *Q_ss* Special keys in Insert mode
  255. |i_CTRL-V| CTRL-V {char}.. insert character literally, or enter decimal
  256. byte value
  257. |i_<NL>| <NL> or <CR> or CTRL-M or CTRL-J
  258. begin new line
  259. |i_CTRL-E| CTRL-E insert the character from below the cursor
  260. |i_CTRL-Y| CTRL-Y insert the character from above the cursor
  261. |i_CTRL-A| CTRL-A insert previously inserted text
  262. |i_CTRL-@| CTRL-@ insert previously inserted text and stop
  263. Insert mode
  264. |i_CTRL-R| CTRL-R {register} insert the contents of a register
  265. |i_CTRL-N| CTRL-N insert next match of identifier before the
  266. cursor
  267. |i_CTRL-P| CTRL-P insert previous match of identifier before
  268. the cursor
  269. |i_CTRL-X| CTRL-X ... complete the word before the cursor in
  270. various ways
  271. |i_<BS>| <BS> or CTRL-H delete the character before the cursor
  272. |i_<Del>| <Del> delete the character under the cursor
  273. |i_CTRL-W| CTRL-W delete word before the cursor
  274. |i_CTRL-U| CTRL-U delete all entered characters in the current
  275. line
  276. |i_CTRL-T| CTRL-T insert one shiftwidth of indent in front of
  277. the current line
  278. |i_CTRL-D| CTRL-D delete one shiftwidth of indent in front of
  279. the current line
  280. |i_0_CTRL-D| 0 CTRL-D delete all indent in the current line
  281. |i_^_CTRL-D| ^ CTRL-D delete all indent in the current line,
  282. restore indent in next line
  283. ------------------------------------------------------------------------------
  284. *Q_di* Digraphs
  285. |:dig| :dig[raphs] show current list of digraphs
  286. |:dig| :dig[raphs] {char1}{char2} {number} ...
  287. add digraph(s) to the list
  288. In Insert or Command-line mode:
  289. |i_CTRL-K| CTRL-K {char1} {char2}
  290. enter digraph
  291. |i_digraph| {char1} <BS> {char2}
  292. enter digraph if 'digraph' option set
  293. ------------------------------------------------------------------------------
  294. *Q_si* Special inserts
  295. |:r| :r [file] insert the contents of [file] below the cursor
  296. |:r!| :r! {command} insert the standard output of {command} below the
  297. cursor
  298. ------------------------------------------------------------------------------
  299. *Q_de* Deleting text
  300. |x| N x delete N characters under and after the cursor
  301. |<Del>| N <Del> delete N characters under and after the cursor
  302. |X| N X delete N characters before the cursor
  303. |d| N d{motion} delete the text that is moved over with {motion}
  304. |v_d| {visual}d delete the highlighted text
  305. |dd| N dd delete N lines
  306. |D| N D delete to the end of the line (and N-1 more lines)
  307. |J| N J join N-1 lines (delete <EOL>s)
  308. |v_J| {visual}J join the highlighted lines
  309. |gJ| N gJ like "J", but without inserting spaces
  310. |v_gJ| {visual}gJ like "{visual}J", but without inserting spaces
  311. |:d| :[range]d [x] delete [range] lines [into register x]
  312. ------------------------------------------------------------------------------
  313. *Q_cm* Copying and moving text
  314. |quote| "{char} use register {char} for the next delete, yank, or put
  315. |:reg| :reg show the contents of all registers
  316. |:reg| :reg {arg} show the contents of registers mentioned in {arg}
  317. |y| N y{motion} yank the text moved over with {motion} into a register
  318. |v_y| {visual}y yank the highlighted text into a register
  319. |yy| N yy yank N lines into a register
  320. |Y| N Y yank N lines into a register
  321. |p| N p put a register after the cursor position (N times)
  322. |P| N P put a register before the cursor position (N times)
  323. |]p| N ]p like p, but adjust indent to current line
  324. |[p| N [p like P, but adjust indent to current line
  325. |gp| N gp like p, but leave cursor after the new text
  326. |gP| N gP like P, but leave cursor after the new text
  327. ------------------------------------------------------------------------------
  328. *Q_ch* Changing text
  329. |r| N r{char} replace N characters with {char}
  330. |gr| N gr{char} replace N characters without affecting layout
  331. |R| N R enter Replace mode (repeat the entered text N times)
  332. |gR| N gR enter virtual Replace mode: Like Replace mode but
  333. without affecting layout
  334. |v_b_r| {visual}r{char}
  335. in Visual block mode: Replace each char of the
  336. selected text with {char}
  337. (change = delete text and enter Insert mode)
  338. |c| N c{motion} change the text that is moved over with {motion}
  339. |v_c| {visual}c change the highlighted text
  340. |cc| N cc change N lines
  341. |S| N S change N lines
  342. |C| N C change to the end of the line (and N-1 more lines)
  343. |s| N s change N characters
  344. |v_b_c| {visual}c in Visual block mode: Change each of the selected
  345. lines with the entered text
  346. |v_b_C| {visual}C in Visual block mode: Change each of the selected
  347. lines until end-of-line with the entered text
  348. |~| N ~ switch case for N characters and advance cursor
  349. |v_~| {visual}~ switch case for highlighted text
  350. |v_u| {visual}u make highlighted text lowercase
  351. |v_U| {visual}U make highlighted text uppercase
  352. |g~| g~{motion} switch case for the text that is moved over with
  353. {motion}
  354. |gu| gu{motion} make the text that is moved over with {motion}
  355. lowercase
  356. |gU| gU{motion} make the text that is moved over with {motion}
  357. uppercase
  358. |v_g?| {visual}g? perform rot13 encoding on highlighted text
  359. |g?| g?{motion} perform rot13 encoding on the text that is moved over
  360. with {motion}
  361. |CTRL-A| N CTRL-A add N to the number at or after the cursor
  362. |CTRL-X| N CTRL-X subtract N from the number at or after the cursor
  363. |<| N <{motion} move the lines that are moved over with {motion} one
  364. shiftwidth left
  365. |<<| N << move N lines one shiftwidth left
  366. |>| N >{motion} move the lines that are moved over with {motion} one
  367. shiftwidth right
  368. |>>| N >> move N lines one shiftwidth right
  369. |gq| N gq{motion} format the lines that are moved over with {motion} to
  370. 'textwidth' length
  371. |:ce| :[range]ce[nter] [width]
  372. center the lines in [range]
  373. |:le| :[range]le[ft] [indent]
  374. left-align the lines in [range] (with [indent])
  375. |:ri| :[range]ri[ght] [width]
  376. right-align the lines in [range]
  377. ------------------------------------------------------------------------------
  378. *Q_co* Complex changes
  379. |!| N !{motion}{command}<CR>
  380. filter the lines that are moved over through {command}
  381. |!!| N !!{command}<CR>
  382. filter N lines through {command}
  383. |v_!| {visual}!{command}<CR>
  384. filter the highlighted lines through {command}
  385. |:range!| :[range]! {command}<CR>
  386. filter [range] lines through {command}
  387. |=| N ={motion}
  388. filter the lines that are moved over through 'equalprg'
  389. |==| N == filter N lines through 'equalprg'
  390. |v_=| {visual}=
  391. filter the highlighted lines through 'equalprg'
  392. |:s| :[range]s[ubstitute]/{pattern}/{string}/[g][c]
  393. substitute {pattern} by {string} in [range] lines;
  394. with [g], replace all occurrences of {pattern};
  395. with [c], confirm each replacement
  396. |:s| :[range]s[ubstitute] [g][c]
  397. repeat previous ":s" with new range and options
  398. |&| & Repeat previous ":s" on current line without options
  399. |:ret| :[range]ret[ab][!] [tabstop]
  400. set 'tabstop' to new value and adjust white space
  401. accordingly
  402. ------------------------------------------------------------------------------
  403. *Q_vi* Visual mode
  404. |visual-index| list of Visual mode commands.
  405. |v| v start highlighting characters } move cursor and use
  406. |V| V start highlighting linewise } operator to affect
  407. |CTRL-V| CTRL-V start highlighting blockwise } highlighted text
  408. |v_o| o exchange cursor position with start of highlighting
  409. |gv| gv start highlighting on previous visual area
  410. |v_v| v highlight characters or stop highlighting
  411. |v_V| V highlight linewise or stop highlighting
  412. |v_CTRL-V| CTRL-V highlight blockwise or stop highlighting
  413. ------------------------------------------------------------------------------
  414. *Q_to* Text objects (only in Visual mode or after an operator)
  415. |v_aw| N aw Select "a word"
  416. |v_iw| N iw Select "inner word"
  417. |v_aW| N aW Select "a |WORD|"
  418. |v_iW| N iW Select "inner |WORD|"
  419. |v_as| N as Select "a sentence"
  420. |v_is| N is Select "inner sentence"
  421. |v_ap| N ap Select "a paragraph"
  422. |v_ip| N ip Select "inner paragraph"
  423. |v_ab| N ab Select "a block" (from "[(" to "])")
  424. |v_ib| N ib Select "inner block" (from "[(" to "])")
  425. |v_aB| N aB Select "a Block" (from "[{" to "]}")
  426. |v_iB| N iB Select "inner Block" (from "[{" to "]}")
  427. |v_a>| N a> Select "a <> block"
  428. |v_i>| N i> Select "inner <> block"
  429. |v_at| N at Select "a tag block" (from <aaa> to </aaa>)
  430. |v_it| N it Select "inner tag block" (from <aaa> to </aaa>)
  431. |v_a'| N a' Select "a single quoted string"
  432. |v_i'| N i' Select "inner single quoted string"
  433. |v_aquote| N a" Select "a double quoted string"
  434. |v_iquote| N i" Select "inner double quoted string"
  435. |v_a`| N a` Select "a backward quoted string"
  436. |v_i`| N i` Select "inner backward quoted string"
  437. ------------------------------------------------------------------------------
  438. *Q_re* Repeating commands
  439. |.| N . repeat last change (with count replaced with N)
  440. |q| q{a-z} record typed characters into register {a-z}
  441. |q| q{A-Z} record typed characters, appended to register {a-z}
  442. |q| q stop recording
  443. |@| N @{a-z} execute the contents of register {a-z} (N times)
  444. |@@| N @@ repeat previous @{a-z} (N times)
  445. |:@| :@{a-z} execute the contents of register {a-z} as an Ex
  446. command
  447. |:@@| :@@ repeat previous :@{a-z}
  448. |:g| :[range]g[lobal]/{pattern}/[cmd]
  449. execute Ex command [cmd] (default: ":p") on the lines
  450. within [range] where {pattern} matches
  451. |:g| :[range]g[lobal]!/{pattern}/[cmd]
  452. execute Ex command [cmd] (default: ":p") on the lines
  453. within [range] where {pattern} does NOT match
  454. |:so| :so[urce] {file}
  455. read Ex commands from {file}
  456. |:so| :so[urce]! {file}
  457. read Vim commands from {file}
  458. |:sl| :sl[eep] [sec]
  459. don't do anything for [sec] seconds
  460. |gs| N gs goto Sleep for N seconds
  461. ------------------------------------------------------------------------------
  462. *Q_km* Key mapping
  463. |:map| :ma[p] {lhs} {rhs} map {lhs} to {rhs} in Normal and Visual mode
  464. |:map!| :ma[p]! {lhs} {rhs} map {lhs} to {rhs} in Insert and Command-line
  465. mode
  466. |:noremap| :no[remap][!] {lhs} {rhs}
  467. same as ":map", no remapping for this {rhs}
  468. |:unmap| :unm[ap] {lhs} remove the mapping of {lhs} for Normal and
  469. Visual mode
  470. |:unmap!| :unm[ap]! {lhs} remove the mapping of {lhs} for Insert and
  471. Command-line mode
  472. |:map_l| :ma[p] [lhs] list mappings (starting with [lhs]) for
  473. Normal and Visual mode
  474. |:map_l!| :ma[p]! [lhs] list mappings (starting with [lhs]) for
  475. Insert and Command-line mode
  476. |:cmap| :cmap/:cunmap/:cnoremap
  477. like ":map!"/":unmap!"/":noremap!" but for
  478. Command-line mode only
  479. |:imap| :imap/:iunmap/:inoremap
  480. like ":map!"/":unmap!"/":noremap!" but for
  481. Insert mode only
  482. |:nmap| :nmap/:nunmap/:nnoremap
  483. like ":map"/":unmap"/":noremap" but for
  484. Normal mode only
  485. |:vmap| :vmap/:vunmap/:vnoremap
  486. like ":map"/":unmap"/":noremap" but for
  487. Visual mode only
  488. |:omap| :omap/:ounmap/:onoremap
  489. like ":map"/":unmap"/":noremap" but only for
  490. when an operator is pending
  491. |:mapc| :mapc[lear] remove mappings for Normal and Visual mode
  492. |:mapc| :mapc[lear]! remove mappings for Insert and Cmdline mode
  493. |:imapc| :imapc[lear] remove mappings for Insert mode
  494. |:vmapc| :vmapc[lear] remove mappings for Visual mode
  495. |:omapc| :omapc[lear] remove mappings for Operator-pending mode
  496. |:nmapc| :nmapc[lear] remove mappings for Normal mode
  497. |:cmapc| :cmapc[lear] remove mappings for Cmdline mode
  498. |:mkexrc| :mk[exrc][!] [file] write current mappings, abbreviations, and
  499. settings to [file] (default: ".exrc";
  500. use ! to overwrite)
  501. |:mkvimrc| :mkv[imrc][!] [file]
  502. same as ":mkexrc", but with default ".vimrc"
  503. |:mksession| :mks[ession][!] [file]
  504. like ":mkvimrc", but store current files,
  505. windows, etc. too, to be able to continue
  506. this session later
  507. ------------------------------------------------------------------------------
  508. *Q_ab* Abbreviations
  509. |:abbreviate| :ab[breviate] {lhs} {rhs} add abbreviation for {lhs} to {rhs}
  510. |:abbreviate| :ab[breviate] {lhs} show abbr's that start with {lhs}
  511. |:abbreviate| :ab[breviate] show all abbreviations
  512. |:unabbreviate| :una[bbreviate] {lhs} remove abbreviation for {lhs}
  513. |:noreabbrev| :norea[bbrev] [lhs] [rhs] like ":ab", but don't remap [rhs]
  514. |:iabbrev| :iab/:iunab/:inoreab like ":ab", but only for Insert mode
  515. |:cabbrev| :cab/:cunab/:cnoreab like ":ab", but only for
  516. Command-line mode
  517. |:abclear| :abc[lear] remove all abbreviations
  518. |:cabclear| :cabc[lear] remove all abbr's for Cmdline mode
  519. |:iabclear| :iabc[lear] remove all abbr's for Insert mode
  520. ------------------------------------------------------------------------------
  521. *Q_op* Options
  522. |:set| :se[t] show all modified options
  523. |:set| :se[t] all show all non-termcap options
  524. |:set| :se[t] termcap show all termcap options
  525. |:set| :se[t] {option} set boolean option (switch it on),
  526. show string or number option
  527. |:set| :se[t] no{option} reset boolean option (switch it off)
  528. |:set| :se[t] inv{option} invert boolean option
  529. |:set| :se[t] {option}={value} set string/number option to {value}
  530. |:set| :se[t] {option}+={value} append {value} to string option, add
  531. {value} to number option
  532. |:set| :se[t] {option}-={value} remove {value} to string option,
  533. subtract {value} from number option
  534. |:set| :se[t] {option}? show value of {option}
  535. |:set| :se[t] {option}& reset {option} to its default value
  536. |:setlocal| :setl[ocal] like ":set" but set the local value
  537. for options that have one
  538. |:setglobal| :setg[lobal] like ":set" but set the global value
  539. of a local option
  540. |:fix| :fix[del] set value of 't_kD' according to
  541. value of 't_kb'
  542. |:options| :opt[ions] open a new window to view and set
  543. options, grouped by functionality,
  544. a one line explanation and links to
  545. the help
  546. Short explanation of each option: *option-list*
  547. 'aleph' 'al' ASCII code of the letter Aleph (Hebrew)
  548. 'allowrevins' 'ari' allow CTRL-_ in Insert and Command-line mode
  549. 'altkeymap' 'akm' obsolete option for Farsi
  550. 'ambiwidth' 'ambw' what to do with Unicode chars of ambiguous width
  551. 'antialias' 'anti' Mac OS X: use smooth, antialiased fonts
  552. 'autochdir' 'acd' change directory to the file in the current window
  553. 'autoshelldir' 'asd' change directory to the shell's current directory
  554. 'arabic' 'arab' for Arabic as a default second language
  555. 'arabicshape' 'arshape' do shaping for Arabic characters
  556. 'autoindent' 'ai' take indent for new line from previous line
  557. 'autoread' 'ar' autom. read file when changed outside of Vim
  558. 'autowrite' 'aw' automatically write file if changed
  559. 'autowriteall' 'awa' as 'autowrite', but works with more commands
  560. 'background' 'bg' "dark" or "light", used for highlight colors
  561. 'backspace' 'bs' how backspace works at start of line
  562. 'backup' 'bk' keep backup file after overwriting a file
  563. 'backupcopy' 'bkc' make backup as a copy, don't rename the file
  564. 'backupdir' 'bdir' list of directories for the backup file
  565. 'backupext' 'bex' extension used for the backup file
  566. 'backupskip' 'bsk' no backup for files that match these patterns
  567. 'balloondelay' 'bdlay' delay in mS before a balloon may pop up
  568. 'ballooneval' 'beval' switch on balloon evaluation in the GUI
  569. 'balloonevalterm' 'bevalterm' switch on balloon evaluation in the terminal
  570. 'balloonexpr' 'bexpr' expression to show in balloon
  571. 'belloff' 'bo' do not ring the bell for these reasons
  572. 'binary' 'bin' read/write/edit file in binary mode
  573. 'bioskey' 'biosk' MS-DOS: use bios calls for input characters
  574. 'bomb' prepend a Byte Order Mark to the file
  575. 'breakat' 'brk' characters that may cause a line break
  576. 'breakindent' 'bri' wrapped line repeats indent
  577. 'breakindentopt' 'briopt' settings for 'breakindent'
  578. 'browsedir' 'bsdir' which directory to start browsing in
  579. 'bufhidden' 'bh' what to do when buffer is no longer in window
  580. 'buflisted' 'bl' whether the buffer shows up in the buffer list
  581. 'buftype' 'bt' special type of buffer
  582. 'casemap' 'cmp' specifies how case of letters is changed
  583. 'cdhome' 'cdh' change directory to the home directory by ":cd"
  584. 'cdpath' 'cd' list of directories searched with ":cd"
  585. 'cedit' key used to open the command-line window
  586. 'charconvert' 'ccv' expression for character encoding conversion
  587. 'cindent' 'cin' do C program indenting
  588. 'cinkeys' 'cink' keys that trigger indent when 'cindent' is set
  589. 'cinoptions' 'cino' how to do indenting when 'cindent' is set
  590. 'cinwords' 'cinw' words where 'si' and 'cin' add an indent
  591. 'cinscopedecls' 'cinsd' words that are recognized by 'cino-g'
  592. 'clipboard' 'cb' use the clipboard as the unnamed register
  593. 'cmdheight' 'ch' number of lines to use for the command-line
  594. 'cmdwinheight' 'cwh' height of the command-line window
  595. 'colorcolumn' 'cc' columns to highlight
  596. 'columns' 'co' number of columns in the display
  597. 'comments' 'com' patterns that can start a comment line
  598. 'commentstring' 'cms' template for comments; used for fold marker
  599. 'compatible' 'cp' behave Vi-compatible as much as possible
  600. 'complete' 'cpt' specify how Insert mode completion works
  601. 'completefunc' 'cfu' function to be used for Insert mode completion
  602. 'completeopt' 'cot' options for Insert mode completion
  603. 'completepopup' 'cpp' options for the Insert mode completion info popup
  604. 'completeslash' 'csl' like 'shellslash' for completion
  605. 'concealcursor' 'cocu' whether concealable text is hidden in cursor line
  606. 'conceallevel' 'cole' whether concealable text is shown or hidden
  607. 'confirm' 'cf' ask what to do about unsaved/read-only files
  608. 'conskey' 'consk' get keys directly from console (MS-DOS only)
  609. 'copyindent' 'ci' make 'autoindent' use existing indent structure
  610. 'cpoptions' 'cpo' flags for Vi-compatible behavior
  611. 'cryptmethod' 'cm' type of encryption to use for file writing
  612. 'cscopepathcomp' 'cspc' how many components of the path to show
  613. 'cscopeprg' 'csprg' command to execute cscope
  614. 'cscopequickfix' 'csqf' use quickfix window for cscope results
  615. 'cscoperelative' 'csre' Use cscope.out path basename as prefix
  616. 'cscopetag' 'cst' use cscope for tag commands
  617. 'cscopetagorder' 'csto' determines ":cstag" search order
  618. 'cscopeverbose' 'csverb' give messages when adding a cscope database
  619. 'cursorbind' 'crb' move cursor in window as it moves in other windows
  620. 'cursorcolumn' 'cuc' highlight the screen column of the cursor
  621. 'cursorline' 'cul' highlight the screen line of the cursor
  622. 'cursorlineopt' 'culopt' settings for 'cursorline'
  623. 'debug' set to "msg" to see all error messages
  624. 'define' 'def' pattern to be used to find a macro definition
  625. 'delcombine' 'deco' delete combining characters on their own
  626. 'dictionary' 'dict' list of file names used for keyword completion
  627. 'diff' use diff mode for the current window
  628. 'diffexpr' 'dex' expression used to obtain a diff file
  629. 'diffopt' 'dip' options for using diff mode
  630. 'digraph' 'dg' enable the entering of digraphs in Insert mode
  631. 'directory' 'dir' list of directory names for the swap file
  632. 'display' 'dy' list of flags for how to display text
  633. 'eadirection' 'ead' in which direction 'equalalways' works
  634. 'edcompatible' 'ed' toggle flags of ":substitute" command
  635. 'emoji' 'emo' emoji characters are considered full width
  636. 'encoding' 'enc' encoding used internally
  637. 'endoffile' 'eof' write CTRL-Z at end of the file
  638. 'endofline' 'eol' write <EOL> for last line in file
  639. 'equalalways' 'ea' windows are automatically made the same size
  640. 'equalprg' 'ep' external program to use for "=" command
  641. 'errorbells' 'eb' ring the bell for error messages
  642. 'errorfile' 'ef' name of the errorfile for the QuickFix mode
  643. 'errorformat' 'efm' description of the lines in the error file
  644. 'esckeys' 'ek' recognize function keys in Insert mode
  645. 'eventignore' 'ei' autocommand events that are ignored
  646. 'expandtab' 'et' use spaces when <Tab> is inserted
  647. 'exrc' 'ex' read .vimrc and .exrc in the current directory
  648. 'fileencoding' 'fenc' file encoding for multibyte text
  649. 'fileencodings' 'fencs' automatically detected character encodings
  650. 'fileformat' 'ff' file format used for file I/O
  651. 'fileformats' 'ffs' automatically detected values for 'fileformat'
  652. 'fileignorecase' 'fic' ignore case when using file names
  653. 'filetype' 'ft' type of file, used for autocommands
  654. 'fillchars' 'fcs' characters to use for displaying special items
  655. 'fixendofline' 'fixeol' make sure last line in file has <EOL>
  656. 'fkmap' 'fk' obsolete option for Farsi
  657. 'foldclose' 'fcl' close a fold when the cursor leaves it
  658. 'foldcolumn' 'fdc' width of the column used to indicate folds
  659. 'foldenable' 'fen' set to display all folds open
  660. 'foldexpr' 'fde' expression used when 'foldmethod' is "expr"
  661. 'foldignore' 'fdi' ignore lines when 'foldmethod' is "indent"
  662. 'foldlevel' 'fdl' close folds with a level higher than this
  663. 'foldlevelstart' 'fdls' 'foldlevel' when starting to edit a file
  664. 'foldmarker' 'fmr' markers used when 'foldmethod' is "marker"
  665. 'foldmethod' 'fdm' folding type
  666. 'foldminlines' 'fml' minimum number of lines for a fold to be closed
  667. 'foldnestmax' 'fdn' maximum fold depth
  668. 'foldopen' 'fdo' for which commands a fold will be opened
  669. 'foldtext' 'fdt' expression used to display for a closed fold
  670. 'formatexpr' 'fex' expression used with "gq" command
  671. 'formatlistpat' 'flp' pattern used to recognize a list header
  672. 'formatoptions' 'fo' how automatic formatting is to be done
  673. 'formatprg' 'fp' name of external program used with "gq" command
  674. 'fsync' 'fs' whether to invoke fsync() after file write
  675. 'gdefault' 'gd' the ":substitute" flag 'g' is default on
  676. 'grepformat' 'gfm' format of 'grepprg' output
  677. 'grepprg' 'gp' program to use for ":grep"
  678. 'guicursor' 'gcr' GUI: settings for cursor shape and blinking
  679. 'guifont' 'gfn' GUI: Name(s) of font(s) to be used
  680. 'guifontset' 'gfs' GUI: Names of multibyte fonts to be used
  681. 'guifontwide' 'gfw' list of font names for double-wide characters
  682. 'guiheadroom' 'ghr' GUI: pixels room for window decorations
  683. 'guiligatures' 'gli' GTK GUI: ASCII characters that can form shapes
  684. 'guioptions' 'go' GUI: Which components and options are used
  685. 'guipty' GUI: try to use a pseudo-tty for ":!" commands
  686. 'guitablabel' 'gtl' GUI: custom label for a tab page
  687. 'guitabtooltip' 'gtt' GUI: custom tooltip for a tab page
  688. 'helpfile' 'hf' full path name of the main help file
  689. 'helpheight' 'hh' minimum height of a new help window
  690. 'helplang' 'hlg' preferred help languages
  691. 'hidden' 'hid' don't unload buffer when it is |abandon|ed
  692. 'highlight' 'hl' sets highlighting mode for various occasions
  693. 'history' 'hi' number of command-lines that are remembered
  694. 'hkmap' 'hk' Hebrew keyboard mapping
  695. 'hkmapp' 'hkp' phonetic Hebrew keyboard mapping
  696. 'hlsearch' 'hls' highlight matches with last search pattern
  697. 'icon' let Vim set the text of the window icon
  698. 'iconstring' string to use for the Vim icon text
  699. 'ignorecase' 'ic' ignore case in search patterns
  700. 'imactivatefunc' 'imaf' function to enable/disable the X input method
  701. 'imactivatekey' 'imak' key that activates the X input method
  702. 'imcmdline' 'imc' use IM when starting to edit a command line
  703. 'imdisable' 'imd' do not use the IM in any mode
  704. 'iminsert' 'imi' use :lmap or IM in Insert mode
  705. 'imsearch' 'ims' use :lmap or IM when typing a search pattern
  706. 'imstatusfunc' 'imsf' function to obtain X input method status
  707. 'imstyle' 'imst' specifies the input style of the input method
  708. 'include' 'inc' pattern to be used to find an include file
  709. 'includeexpr' 'inex' expression used to process an include line
  710. 'incsearch' 'is' highlight match while typing search pattern
  711. 'indentexpr' 'inde' expression used to obtain the indent of a line
  712. 'indentkeys' 'indk' keys that trigger indenting with 'indentexpr'
  713. 'infercase' 'inf' adjust case of match for keyword completion
  714. 'insertmode' 'im' start the edit of a file in Insert mode
  715. 'isfname' 'isf' characters included in file names and pathnames
  716. 'isident' 'isi' characters included in identifiers
  717. 'iskeyword' 'isk' characters included in keywords
  718. 'isprint' 'isp' printable characters
  719. 'joinspaces' 'js' two spaces after a period with a join command
  720. 'key' encryption key
  721. 'keymap' 'kmp' name of a keyboard mapping
  722. 'keymodel' 'km' enable starting/stopping selection with keys
  723. 'keyprotocol' 'kpc' what keyboard protocol to use for what terminal
  724. 'keywordprg' 'kp' program to use for the "K" command
  725. 'langmap' 'lmap' alphabetic characters for other language mode
  726. 'langmenu' 'lm' language to be used for the menus
  727. 'langnoremap' 'lnr' do not apply 'langmap' to mapped characters
  728. 'langremap' 'lrm' do apply 'langmap' to mapped characters
  729. 'laststatus' 'ls' tells when last window has status lines
  730. 'lazyredraw' 'lz' don't redraw while executing macros
  731. 'linebreak' 'lbr' wrap long lines at a blank
  732. 'lines' number of lines in the display
  733. 'linespace' 'lsp' number of pixel lines to use between characters
  734. 'lisp' automatic indenting for Lisp
  735. 'lispoptions' 'lop' changes how Lisp indenting is done
  736. 'lispwords' 'lw' words that change how lisp indenting works
  737. 'list' show <Tab> and <EOL>
  738. 'listchars' 'lcs' characters for displaying in list mode
  739. 'loadplugins' 'lpl' load plugin scripts when starting up
  740. 'luadll' name of the Lua dynamic library
  741. 'macatsui' Mac GUI: use ATSUI text drawing
  742. 'magic' changes special characters in search patterns
  743. 'makeef' 'mef' name of the errorfile for ":make"
  744. 'makeencoding' 'menc' encoding of external make/grep commands
  745. 'makeprg' 'mp' program to use for the ":make" command
  746. 'matchpairs' 'mps' pairs of characters that "%" can match
  747. 'matchtime' 'mat' tenths of a second to show matching paren
  748. 'maxcombine' 'mco' maximum nr of combining characters displayed
  749. 'maxfuncdepth' 'mfd' maximum recursive depth for user functions
  750. 'maxmapdepth' 'mmd' maximum recursive depth for mapping
  751. 'maxmem' 'mm' maximum memory (in Kbyte) used for one buffer
  752. 'maxmempattern' 'mmp' maximum memory (in Kbyte) used for pattern search
  753. 'maxmemtot' 'mmt' maximum memory (in Kbyte) used for all buffers
  754. 'menuitems' 'mis' maximum number of items in a menu
  755. 'mkspellmem' 'msm' memory used before |:mkspell| compresses the tree
  756. 'modeline' 'ml' recognize modelines at start or end of file
  757. 'modelineexpr' 'mle' allow setting expression options from a modeline
  758. 'modelines' 'mls' number of lines checked for modelines
  759. 'modifiable' 'ma' changes to the text are not possible
  760. 'modified' 'mod' buffer has been modified
  761. 'more' pause listings when the whole screen is filled
  762. 'mouse' enable the use of mouse clicks
  763. 'mousefocus' 'mousef' keyboard focus follows the mouse
  764. 'mousehide' 'mh' hide mouse pointer while typing
  765. 'mousemodel' 'mousem' changes meaning of mouse buttons
  766. 'mousemoveevent' 'mousemev' report mouse moves with <MouseMove>
  767. 'mouseshape' 'mouses' shape of the mouse pointer in different modes
  768. 'mousetime' 'mouset' max time between mouse double-click
  769. 'mzquantum' 'mzq' the interval between polls for MzScheme threads
  770. 'mzschemedll' name of the MzScheme dynamic library
  771. 'mzschemegcdll' name of the MzScheme dynamic library for GC
  772. 'nrformats' 'nf' number formats recognized for CTRL-A command
  773. 'number' 'nu' print the line number in front of each line
  774. 'numberwidth' 'nuw' number of columns used for the line number
  775. 'omnifunc' 'ofu' function for filetype-specific completion
  776. 'opendevice' 'odev' allow reading/writing devices on MS-Windows
  777. 'operatorfunc' 'opfunc' function to be called for |g@| operator
  778. 'osfiletype' 'oft' no longer supported
  779. 'packpath' 'pp' list of directories used for packages
  780. 'paragraphs' 'para' nroff macros that separate paragraphs
  781. 'paste' allow pasting text
  782. 'pastetoggle' 'pt' key code that causes 'paste' to toggle
  783. 'patchexpr' 'pex' expression used to patch a file
  784. 'patchmode' 'pm' keep the oldest version of a file
  785. 'path' 'pa' list of directories searched with "gf" et.al.
  786. 'perldll' name of the Perl dynamic library
  787. 'preserveindent' 'pi' preserve the indent structure when reindenting
  788. 'previewheight' 'pvh' height of the preview window
  789. 'previewpopup' 'pvp' use popup window for preview
  790. 'previewwindow' 'pvw' identifies the preview window
  791. 'printdevice' 'pdev' name of the printer to be used for :hardcopy
  792. 'printencoding' 'penc' encoding to be used for printing
  793. 'printexpr' 'pexpr' expression used to print PostScript for :hardcopy
  794. 'printfont' 'pfn' name of the font to be used for :hardcopy
  795. 'printheader' 'pheader' format of the header used for :hardcopy
  796. 'printmbcharset' 'pmbcs' CJK character set to be used for :hardcopy
  797. 'printmbfont' 'pmbfn' font names to be used for CJK output of :hardcopy
  798. 'printoptions' 'popt' controls the format of :hardcopy output
  799. 'prompt' 'prompt' enable prompt in Ex mode
  800. 'pumheight' 'ph' maximum height of the popup menu
  801. 'pumwidth' 'pw' minimum width of the popup menu
  802. 'pythondll' name of the Python 2 dynamic library
  803. 'pythonhome' name of the Python 2 home directory
  804. 'pythonthreedll' name of the Python 3 dynamic library
  805. 'pythonthreehome' name of the Python 3 home directory
  806. 'pyxversion' 'pyx' Python version used for pyx* commands
  807. 'quickfixtextfunc' 'qftf' function for the text in the quickfix window
  808. 'quoteescape' 'qe' escape characters used in a string
  809. 'readonly' 'ro' disallow writing the buffer
  810. 'redrawtime' 'rdt' timeout for 'hlsearch' and |:match| highlighting
  811. 'regexpengine' 're' default regexp engine to use
  812. 'relativenumber' 'rnu' show relative line number in front of each line
  813. 'remap' allow mappings to work recursively
  814. 'renderoptions' 'rop' options for text rendering on Windows
  815. 'report' threshold for reporting nr. of lines changed
  816. 'restorescreen' 'rs' Win32: restore screen when exiting
  817. 'revins' 'ri' inserting characters will work backwards
  818. 'rightleft' 'rl' window is right-to-left oriented
  819. 'rightleftcmd' 'rlc' commands for which editing works right-to-left
  820. 'rubydll' name of the Ruby dynamic library
  821. 'ruler' 'ru' show cursor line and column in the status line
  822. 'rulerformat' 'ruf' custom format for the ruler
  823. 'runtimepath' 'rtp' list of directories used for runtime files
  824. 'scroll' 'scr' lines to scroll with CTRL-U and CTRL-D
  825. 'scrollbind' 'scb' scroll in window as other windows scroll
  826. 'scrollfocus' 'scf' scroll wheel applies to window under pointer
  827. 'scrolljump' 'sj' minimum number of lines to scroll
  828. 'scrolloff' 'so' minimum nr. of lines above and below cursor
  829. 'scrollopt' 'sbo' how 'scrollbind' should behave
  830. 'sections' 'sect' nroff macros that separate sections
  831. 'secure' secure mode for reading .vimrc in current dir
  832. 'selection' 'sel' what type of selection to use
  833. 'selectmode' 'slm' when to use Select mode instead of Visual mode
  834. 'sessionoptions' 'ssop' options for |:mksession|
  835. 'shell' 'sh' name of shell to use for external commands
  836. 'shellcmdflag' 'shcf' flag to shell to execute one command
  837. 'shellpipe' 'sp' string to put output of ":make" in error file
  838. 'shellquote' 'shq' quote character(s) for around shell command
  839. 'shellredir' 'srr' string to put output of filter in a temp file
  840. 'shellslash' 'ssl' use forward slash for shell file names
  841. 'shelltemp' 'stmp' whether to use a temp file for shell commands
  842. 'shelltype' 'st' Amiga: influences how to use a shell
  843. 'shellxescape' 'sxe' characters to escape when 'shellxquote' is (
  844. 'shellxquote' 'sxq' like 'shellquote', but include redirection
  845. 'shiftround' 'sr' round indent to multiple of shiftwidth
  846. 'shiftwidth' 'sw' number of spaces to use for (auto)indent step
  847. 'shortmess' 'shm' list of flags, reduce length of messages
  848. 'shortname' 'sn' Filenames assumed to be 8.3 chars
  849. 'showbreak' 'sbr' string to use at the start of wrapped lines
  850. 'showcmd' 'sc' show (partial) command in status line
  851. 'showfulltag' 'sft' show full tag pattern when completing tag
  852. 'showmatch' 'sm' briefly jump to matching bracket if insert one
  853. 'showmode' 'smd' message on status line to show current mode
  854. 'showtabline' 'stal' tells when the tab pages line is displayed
  855. 'sidescroll' 'ss' minimum number of columns to scroll horizontal
  856. 'sidescrolloff' 'siso' min. nr. of columns to left and right of cursor
  857. 'signcolumn' 'scl' when to display the sign column
  858. 'smartcase' 'scs' no ignore case when pattern has uppercase
  859. 'smartindent' 'si' smart autoindenting for C programs
  860. 'smarttab' 'sta' use 'shiftwidth' when inserting <Tab>
  861. 'smoothscroll' 'sms' scroll by screen lines when 'wrap' is set
  862. 'softtabstop' 'sts' number of spaces that <Tab> uses while editing
  863. 'spell' enable spell checking
  864. 'spellcapcheck' 'spc' pattern to locate end of a sentence
  865. 'spellfile' 'spf' files where |zg| and |zw| store words
  866. 'spelllang' 'spl' language(s) to do spell checking for
  867. 'spelloptions' 'spo' options for spell checking
  868. 'spellsuggest' 'sps' method(s) used to suggest spelling corrections
  869. 'splitbelow' 'sb' new window from split is below the current one
  870. 'splitkeep' 'spk' determines scroll behavior for split windows
  871. 'splitright' 'spr' new window is put right of the current one
  872. 'startofline' 'sol' commands move cursor to first non-blank in line
  873. 'statusline' 'stl' custom format for the status line
  874. 'suffixes' 'su' suffixes that are ignored with multiple match
  875. 'suffixesadd' 'sua' suffixes added when searching for a file
  876. 'swapfile' 'swf' whether to use a swapfile for a buffer
  877. 'swapsync' 'sws' how to sync the swap file
  878. 'switchbuf' 'swb' sets behavior when switching to another buffer
  879. 'synmaxcol' 'smc' maximum column to find syntax items
  880. 'syntax' 'syn' syntax to be loaded for current buffer
  881. 'tabline' 'tal' custom format for the console tab pages line
  882. 'tabpagemax' 'tpm' maximum number of tab pages for |-p| and "tab all"
  883. 'tabstop' 'ts' number of spaces that <Tab> in file uses
  884. 'tagbsearch' 'tbs' use binary searching in tags files
  885. 'tagcase' 'tc' how to handle case when searching in tags files
  886. 'tagfunc' 'tfu' function to get list of tag matches
  887. 'taglength' 'tl' number of significant characters for a tag
  888. 'tagrelative' 'tr' file names in tag file are relative
  889. 'tags' 'tag' list of file names used by the tag command
  890. 'tagstack' 'tgst' push tags onto the tag stack
  891. 'tcldll' name of the Tcl dynamic library
  892. 'term' name of the terminal
  893. 'termbidi' 'tbidi' terminal takes care of bi-directionality
  894. 'termencoding' 'tenc' character encoding used by the terminal
  895. 'termguicolors' 'tgc' use GUI colors for the terminal
  896. 'termwinkey' 'twk' key that precedes a Vim command in a terminal
  897. 'termwinscroll' 'twsl' max number of scrollback lines in a terminal window
  898. 'termwinsize' 'tws' size of a terminal window
  899. 'termwintype' 'twt' MS-Windows: type of pty to use for terminal window
  900. 'terse' shorten some messages
  901. 'textauto' 'ta' obsolete, use 'fileformats'
  902. 'textmode' 'tx' obsolete, use 'fileformat'
  903. 'textwidth' 'tw' maximum width of text that is being inserted
  904. 'thesaurus' 'tsr' list of thesaurus files for keyword completion
  905. 'thesaurusfunc' 'tsrfu' function to be used for thesaurus completion
  906. 'tildeop' 'top' tilde command "~" behaves like an operator
  907. 'timeout' 'to' time out on mappings and key codes
  908. 'timeoutlen' 'tm' time out time in milliseconds
  909. 'title' let Vim set the title of the window
  910. 'titlelen' percentage of 'columns' used for window title
  911. 'titleold' old title, restored when exiting
  912. 'titlestring' string to use for the Vim window title
  913. 'toolbar' 'tb' GUI: which items to show in the toolbar
  914. 'toolbariconsize' 'tbis' size of the toolbar icons (for GTK 2 only)
  915. 'ttimeout' time out on mappings
  916. 'ttimeoutlen' 'ttm' time out time for key codes in milliseconds
  917. 'ttybuiltin' 'tbi' use built-in termcap before external termcap
  918. 'ttyfast' 'tf' indicates a fast terminal connection
  919. 'ttymouse' 'ttym' type of mouse codes generated
  920. 'ttyscroll' 'tsl' maximum number of lines for a scroll
  921. 'ttytype' 'tty' alias for 'term'
  922. 'undodir' 'udir' where to store undo files
  923. 'undofile' 'udf' save undo information in a file
  924. 'undolevels' 'ul' maximum number of changes that can be undone
  925. 'undoreload' 'ur' max nr of lines to save for undo on a buffer reload
  926. 'updatecount' 'uc' after this many characters flush swap file
  927. 'updatetime' 'ut' after this many milliseconds flush swap file
  928. 'varsofttabstop' 'vsts' a list of number of spaces when typing <Tab>
  929. 'vartabstop' 'vts' a list of number of spaces for <Tab>s
  930. 'verbose' 'vbs' give informative messages
  931. 'verbosefile' 'vfile' file to write messages in
  932. 'viewdir' 'vdir' directory where to store files with :mkview
  933. 'viewoptions' 'vop' specifies what to save for :mkview
  934. 'viminfo' 'vi' use .viminfo file upon startup and exiting
  935. 'viminfofile' 'vif' file name used for the viminfo file
  936. 'virtualedit' 've' when to use virtual editing
  937. 'visualbell' 'vb' use visual bell instead of beeping
  938. 'warn' warn for shell command when buffer was changed
  939. 'weirdinvert' 'wiv' for terminals that have weird inversion method
  940. 'whichwrap' 'ww' allow specified keys to cross line boundaries
  941. 'wildchar' 'wc' command-line character for wildcard expansion
  942. 'wildcharm' 'wcm' like 'wildchar' but also works when mapped
  943. 'wildignore' 'wig' files matching these patterns are not completed
  944. 'wildignorecase' 'wic' ignore case when completing file names
  945. 'wildmenu' 'wmnu' use menu for command line completion
  946. 'wildmode' 'wim' mode for 'wildchar' command-line expansion
  947. 'wildoptions' 'wop' specifies how command line completion is done
  948. 'winaltkeys' 'wak' when the windows system handles ALT keys
  949. 'wincolor' 'wcr' window-local highlighting
  950. 'window' 'wi' nr of lines to scroll for CTRL-F and CTRL-B
  951. 'winheight' 'wh' minimum number of lines for the current window
  952. 'winfixheight' 'wfh' keep window height when opening/closing windows
  953. 'winfixwidth' 'wfw' keep window width when opening/closing windows
  954. 'winminheight' 'wmh' minimum number of lines for any window
  955. 'winminwidth' 'wmw' minimal number of columns for any window
  956. 'winptydll' name of the winpty dynamic library
  957. 'winwidth' 'wiw' minimal number of columns for current window
  958. 'wrap' long lines wrap and continue on the next line
  959. 'wrapmargin' 'wm' chars from the right where wrapping starts
  960. 'wrapscan' 'ws' searches wrap around the end of the file
  961. 'write' writing to a file is allowed
  962. 'writeany' 'wa' write to file with no need for "!" override
  963. 'writebackup' 'wb' make a backup before overwriting a file
  964. 'writedelay' 'wd' delay this many msec for each char (for debug)
  965. 'xtermcodes' request terminal codes from an xterm
  966. ------------------------------------------------------------------------------
  967. *Q_ur* Undo/Redo commands
  968. |u| N u undo last N changes
  969. |CTRL-R| N CTRL-R redo last N undone changes
  970. |U| U restore last changed line
  971. ------------------------------------------------------------------------------
  972. *Q_et* External commands
  973. |:shell| :sh[ell] start a shell
  974. |:!| :!{command} execute {command} with a shell
  975. |K| K lookup keyword under the cursor with
  976. 'keywordprg' program (default: "man")
  977. ------------------------------------------------------------------------------
  978. *Q_qf* Quickfix commands
  979. |:cc| :cc [nr] display error [nr] (default is the same again)
  980. |:cnext| :cn display the next error
  981. |:cprevious| :cp display the previous error
  982. |:clist| :cl list all errors
  983. |:cfile| :cf read errors from the file 'errorfile'
  984. |:cgetbuffer| :cgetb like :cbuffer but don't jump to the first error
  985. |:cgetfile| :cg like :cfile but don't jump to the first error
  986. |:cgetexpr| :cgete like :cexpr but don't jump to the first error
  987. |:caddfile| :caddf add errors from the error file to the current
  988. quickfix list
  989. |:caddexpr| :cad add errors from an expression to the current
  990. quickfix list
  991. |:cbuffer| :cb read errors from text in a buffer
  992. |:cexpr| :cex read errors from an expression
  993. |:cquit| :cq quit without writing and return error code (to
  994. the compiler)
  995. |:make| :make [args] start make, read errors, and jump to first
  996. error
  997. |:grep| :gr[ep] [args] execute 'grepprg' to find matches and jump to
  998. the first one
  999. ------------------------------------------------------------------------------
  1000. *Q_vc* Various commands
  1001. |CTRL-L| CTRL-L clear and redraw the screen
  1002. |CTRL-G| CTRL-G show current file name (with path) and cursor
  1003. position
  1004. |ga| ga show ascii value of character under cursor in
  1005. decimal, hex, and octal
  1006. |g8| g8 for utf-8 encoding: show byte sequence for
  1007. character under cursor in hex
  1008. |g_CTRL-G| g CTRL-G show cursor column, line, and character
  1009. position
  1010. |CTRL-C| CTRL-C during searches: Interrupt the search
  1011. |dos-CTRL-Break| CTRL-Break MS-Windows: during searches: Interrupt the
  1012. search
  1013. |<Del>| <Del> while entering a count: delete last character
  1014. |:version| :ve[rsion] show version information
  1015. |:mode| :mode N set screen mode to N (obsolete)
  1016. |:normal| :norm[al][!] {commands}
  1017. execute Normal mode commands
  1018. |Q| Q switch to "Ex" mode
  1019. |:redir| :redir >{file} redirect messages to {file}
  1020. |:silent| :silent[!] {command} execute {command} silently
  1021. |:confirm| :confirm {command} quit, write, etc., asking about
  1022. unsaved changes or read-only files
  1023. |:browse| :browse {command} open/read/write file, using a
  1024. file selection dialog
  1025. ------------------------------------------------------------------------------
  1026. *Q_ce* Command-line editing
  1027. |c_<Esc>| <Esc> abandon command-line (if 'wildchar' is
  1028. <Esc>, type it twice)
  1029. |c_CTRL-V| CTRL-V {char} insert {char} literally
  1030. |c_CTRL-V| CTRL-V {number} enter decimal value of character (up to
  1031. three digits)
  1032. |c_CTRL-K| CTRL-K {char1} {char2}
  1033. enter digraph (See |Q_di|)
  1034. |c_CTRL-R| CTRL-R {register} insert the contents of a register
  1035. |c_<Left>| <Left>/<Right> cursor left/right
  1036. |c_<S-Left>| <S-Left>/<S-Right> cursor one word left/right
  1037. |c_CTRL-B| CTRL-B/CTRL-E cursor to beginning/end of command-line
  1038. |c_<BS>| <BS> delete the character in front of the cursor
  1039. |c_<Del>| <Del> delete the character under the cursor
  1040. |c_CTRL-W| CTRL-W delete the word in front of the cursor
  1041. |c_CTRL-U| CTRL-U remove all characters
  1042. |c_<Up>| <Up>/<Down> recall older/newer command-line that starts
  1043. with current command
  1044. |c_<S-Up>| <S-Up>/<S-Down> recall older/newer command-line from history
  1045. |c_CTRL-G| CTRL-G next match when 'incsearch' is active
  1046. |c_CTRL-T| CTRL-T previous match when 'incsearch' is active
  1047. |:history| :his[tory] show older command-lines
  1048. Context-sensitive completion on the command-line:
  1049. |c_wildchar| 'wildchar' (default: <Tab>)
  1050. do completion on the pattern in front of the
  1051. cursor; if there are multiple matches,
  1052. beep and show the first one; further
  1053. 'wildchar' will show the next ones
  1054. |c_CTRL-D| CTRL-D list all names that match the pattern in
  1055. front of the cursor
  1056. |c_CTRL-A| CTRL-A insert all names that match pattern in front
  1057. of cursor
  1058. |c_CTRL-L| CTRL-L insert longest common part of names that
  1059. match pattern
  1060. |c_CTRL-N| CTRL-N after 'wildchar' with multiple matches: go
  1061. to next match
  1062. |c_CTRL-P| CTRL-P after 'wildchar' with multiple matches: go
  1063. to previous match
  1064. ------------------------------------------------------------------------------
  1065. *Q_ra* Ex ranges
  1066. |:range| , separates two line numbers
  1067. |:range| ; idem, set cursor to the first line number
  1068. before interpreting the second one
  1069. |:range| {number} an absolute line number
  1070. |:range| . the current line
  1071. |:range| $ the last line in the file
  1072. |:range| % equal to 1,$ (the entire file)
  1073. |:range| * equal to '<,'> (visual area)
  1074. |:range| 't position of mark t
  1075. |:range| /{pattern}[/] the next line where {pattern} matches
  1076. |:range| ?{pattern}[?] the previous line where {pattern} matches
  1077. |:range| +[num] add [num] to the preceding line number
  1078. (default: 1)
  1079. |:range| -[num] subtract [num] from the preceding line
  1080. number (default: 1)
  1081. ------------------------------------------------------------------------------
  1082. *Q_ex* Special Ex characters
  1083. |:bar| | separates two commands (not for ":global" and ":!")
  1084. |:quote| " begins comment
  1085. |:_%| % current file name (only where a file name is expected)
  1086. |:_#| #[num] alternate file name [num] (only where a file name is
  1087. expected)
  1088. Note: The next seven are typed literally; these are not special keys!
  1089. |:<abuf>| <abuf> buffer number, for use in an autocommand (only where a
  1090. file name is expected)
  1091. |:<afile>| <afile> file name, for use in an autocommand (only where a
  1092. file name is expected)
  1093. |:<amatch>| <amatch> what matched with the pattern, for use in an
  1094. autocommand (only where a file name is expected)
  1095. |:<cword>| <cword> word under the cursor (only where a file name is
  1096. expected)
  1097. |:<cWORD>| <cWORD> WORD under the cursor (only where a file name is
  1098. expected) (see |WORD|)
  1099. |:<cfile>| <cfile> file name under the cursor (only where a file name is
  1100. expected)
  1101. |:<sfile>| <sfile> file name of a ":source"d file, within that file (only
  1102. where a file name is expected)
  1103. After "%", "#", "<cfile>", "<sfile>" or "<afile>"
  1104. |::p| :p full path
  1105. |::h| :h head (file name removed)
  1106. |::t| :t tail (file name only)
  1107. |::r| :r root (extension removed)
  1108. |::e| :e extension
  1109. |::s| :s/{pat}/{repl}/ substitute {pat} with {repl}
  1110. ------------------------------------------------------------------------------
  1111. *Q_st* Starting Vim
  1112. |-vim| vim [options] start editing with an empty buffer
  1113. |-file| vim [options] {file} .. start editing one or more files
  1114. |--| vim [options] - read file from stdin
  1115. |-tag| vim [options] -t {tag} edit the file associated with {tag}
  1116. |-qf| vim [options] -q [fname] start editing in QuickFix mode,
  1117. display the first error
  1118. Most useful Vim arguments (for full list see |startup-options|)
  1119. |-gui| -g start GUI (also allows other options)
  1120. |-+| +[num] put the cursor at line [num] (default: last line)
  1121. |-+c| +{command} execute {command} after loading the file
  1122. |-+/| +/{pat} {file} .. put the cursor at the first occurrence of {pat}
  1123. |-v| -v Vi mode, start ex in Normal mode
  1124. |-e| -e Ex mode, start vim in Ex mode
  1125. |-R| -R Read-only mode, implies -n
  1126. |-m| -m modifications not allowed (resets 'write' option)
  1127. |-d| -d diff mode |diff|
  1128. |-b| -b binary mode
  1129. |-l| -l lisp mode
  1130. |-A| -A Arabic mode ('arabic' is set)
  1131. |-F| -F Farsi mode ('fkmap' and 'rightleft' are set)
  1132. |-H| -H Hebrew mode ('hkmap' and 'rightleft' are set)
  1133. |-V| -V Verbose, give informative messages
  1134. |-C| -C Compatible, set the 'compatible' option
  1135. |-N| -N Nocompatible, reset the 'compatible' option
  1136. |-r| -r give list of swap files
  1137. |-r| -r {file} .. recover aborted edit session
  1138. |-n| -n do not create a swap file
  1139. |-o| -o [num] open [num] windows (default: one for each file)
  1140. |-f| -f GUI: foreground process, don't fork
  1141. Amiga: do not restart Vim to open a window (for
  1142. e.g., mail)
  1143. |-s| -s {scriptin} first read commands from the file {scriptin}
  1144. |-w| -w {scriptout} write typed chars to file {scriptout} (append)
  1145. |-W| -W {scriptout} write typed chars to file {scriptout} (overwrite)
  1146. |-T| -T {terminal} set terminal name
  1147. |-d| -d {device} Amiga: open {device} to be used as a console
  1148. |-u| -u {vimrc} read inits from {vimrc} instead of other inits
  1149. |-U| -U {gvimrc} idem, for when starting the GUI
  1150. |-i| -i {viminfo} read info from {viminfo} instead of other files
  1151. |---| -- end of options, other arguments are file names
  1152. |--help| --help show list of arguments and exit
  1153. |--version| --version show version info and exit
  1154. |--| - read file from stdin
  1155. ------------------------------------------------------------------------------
  1156. *Q_ed* Editing a file
  1157. Without !: Fail if changes have been made to the current buffer.
  1158. With !: Discard any changes to the current buffer.
  1159. |:edit_f| :e[dit][!] {file} edit {file}
  1160. |:edit| :e[dit][!] reload the current file
  1161. |:enew| :ene[w][!] edit a new, unnamed buffer
  1162. |:find| :fin[d][!] {file} find {file} in 'path' and edit it
  1163. |CTRL-^| N CTRL-^ edit alternate file N (equivalent to ":e #N")
  1164. |gf| gf or ]f edit the file whose name is under the cursor
  1165. |:pwd| :pwd print the current directory name
  1166. |:cd| :cd [path] change the current directory to [path]
  1167. |:cd-| :cd - back to previous current directory
  1168. |:file| :f[ile] print the current file name and the cursor
  1169. position
  1170. |:file| :f[ile] {name} set the current file name to {name}
  1171. |:files| :files show alternate file names
  1172. ------------------------------------------------------------------------------
  1173. *Q_fl* Using the argument list |argument-list|
  1174. |:args| :ar[gs] print the argument list, with the current file
  1175. in "[]"
  1176. |:all| :all or :sall open a window for every file in the arg list
  1177. |:wn| :wn[ext][!] write file and edit next file
  1178. |:wn| :wn[ext][!] {file} write to {file} and edit next file, unless
  1179. {file} exists; With !, overwrite existing
  1180. file
  1181. |:wN| :wN[ext][!] [file] write file and edit previous file
  1182. in current window in new window ~
  1183. |:argument| :argu[ment] N :sar[gument] N edit file N
  1184. |:next| :n[ext] :sn[ext] edit next file
  1185. |:next_f| :n[ext] {arglist} :sn[ext] {arglist} define new arg list
  1186. and edit first file
  1187. |:Next| :N[ext] :sN[ext] edit previous file
  1188. |:first| :fir[st] :sfir[st] edit first file
  1189. |:last| :la[st] :sla[st] edit last file
  1190. ------------------------------------------------------------------------------
  1191. *Q_wq* Writing and quitting
  1192. |:w| :[range]w[rite][!] write to the current file
  1193. |:w_f| :[range]w[rite] {file} write to {file}, unless it already
  1194. exists
  1195. |:w_f| :[range]w[rite]! {file} write to {file}. Overwrite an existing
  1196. file
  1197. |:w_a| :[range]w[rite][!] >> append to the current file
  1198. |:w_a| :[range]w[rite][!] >> {file} append to {file}
  1199. |:w_c| :[range]w[rite] !{cmd} execute {cmd} with [range] lines as
  1200. standard input
  1201. |:up| :[range]up[date][!] write to current file if modified
  1202. |:wall| :wa[ll][!] write all changed buffers
  1203. |:q| :q[uit] quit current buffer, unless changes have been
  1204. made; Exit Vim when there are no other
  1205. non-help buffers
  1206. |:q| :q[uit]! quit current buffer always, discard any
  1207. changes. Exit Vim when there are no other
  1208. non-help buffers
  1209. |:qa| :qa[ll] exit Vim, unless changes have been made
  1210. |:qa| :qa[ll]! exit Vim always, discard any changes
  1211. |:cq| :cq quit without writing and return error code
  1212. |:wq| :wq[!] write the current file and exit
  1213. |:wq| :wq[!] {file} write to {file} and exit
  1214. |:xit| :x[it][!] [file] like ":wq" but write only when changes have
  1215. been made
  1216. |ZZ| ZZ same as ":x"
  1217. |ZQ| ZQ same as ":q!"
  1218. |:xall| :xa[ll][!] or :wqall[!]
  1219. write all changed buffers and exit
  1220. |:stop| :st[op][!] suspend Vim or start new shell; if 'aw' option
  1221. is set and [!] not given write the buffer
  1222. |CTRL-Z| CTRL-Z same as ":stop"
  1223. ------------------------------------------------------------------------------
  1224. *Q_ac* Automatic Commands
  1225. |viminfo-file| read registers, marks, history at startup, save when exiting.
  1226. |:rviminfo| :rv[iminfo] [file] read info from viminfo file [file]
  1227. |:rviminfo| :rv[iminfo]! [file] idem, overwrite existing info
  1228. |:wviminfo| :wv[iminfo] [file] add info to viminfo file [file]
  1229. |:wviminfo| :wv[iminfo]! [file] write info to viminfo file [file]
  1230. |modeline| Automatic option setting when editing a file
  1231. |modeline| vim:{set-arg}: .. In the first and last lines of the
  1232. file (see 'ml' option), {set-arg} is
  1233. given as an argument to ":set"
  1234. |autocommand| Automatic execution of commands on certain events.
  1235. |:autocmd| :au list all autocommands
  1236. |:autocmd| :au {event} list all autocommands for {event}
  1237. |:autocmd| :au {event} {pat} list all autocommands for {event}
  1238. with {pat}
  1239. |:autocmd| :au {event} {pat} {cmd} enter new autocommands for {event}
  1240. with {pat}
  1241. |:autocmd| :au! remove all autocommands
  1242. |:autocmd| :au! {event} remove all autocommands for {event}
  1243. |:autocmd| :au! * {pat} remove all autocommands for {pat}
  1244. |:autocmd| :au! {event} {pat} remove all autocommands for {event}
  1245. with {pat}
  1246. |:autocmd| :au! {event} {pat} {cmd} remove all autocommands for {event}
  1247. with {pat} and enter new one
  1248. ------------------------------------------------------------------------------
  1249. *Q_wi* Multi-window commands
  1250. |CTRL-W_s| CTRL-W s or :split split window into two parts
  1251. |:split_f| :split {file} split window and edit {file} in one of
  1252. them
  1253. |:vsplit| :vsplit {file} same, but split vertically
  1254. |:vertical| :vertical {cmd} make {cmd} split vertically
  1255. |:sfind| :sf[ind] {file} split window, find {file} in 'path'
  1256. and edit it
  1257. |:terminal| :terminal {cmd} open a terminal window
  1258. |CTRL-W_]| CTRL-W ] split window and jump to tag under
  1259. cursor
  1260. |CTRL-W_f| CTRL-W f split window and edit file name under
  1261. the cursor
  1262. |CTRL-W_^| CTRL-W ^ split window and edit alternate file
  1263. |CTRL-W_n| CTRL-W n or :new create new empty window
  1264. |CTRL-W_q| CTRL-W q or :q[uit] quit editing and close window
  1265. |CTRL-W_c| CTRL-W c or :clo[se] make buffer hidden and close window
  1266. |CTRL-W_o| CTRL-W o or :on[ly] make current window only one on the
  1267. screen
  1268. |CTRL-W_j| CTRL-W j move cursor to window below
  1269. |CTRL-W_k| CTRL-W k move cursor to window above
  1270. |CTRL-W_CTRL-W| CTRL-W CTRL-W move cursor to window below (wrap)
  1271. |CTRL-W_W| CTRL-W W move cursor to window above (wrap)
  1272. |CTRL-W_t| CTRL-W t move cursor to top window
  1273. |CTRL-W_b| CTRL-W b move cursor to bottom window
  1274. |CTRL-W_p| CTRL-W p move cursor to previous active window
  1275. |CTRL-W_r| CTRL-W r rotate windows downwards
  1276. |CTRL-W_R| CTRL-W R rotate windows upwards
  1277. |CTRL-W_x| CTRL-W x exchange current window with next one
  1278. |CTRL-W_=| CTRL-W = make all windows equal height & width
  1279. |CTRL-W_-| CTRL-W - decrease current window height
  1280. |CTRL-W_+| CTRL-W + increase current window height
  1281. |CTRL-W__| CTRL-W _ set current window height (default:
  1282. very high)
  1283. |CTRL-W_<| CTRL-W < decrease current window width
  1284. |CTRL-W_>| CTRL-W > increase current window width
  1285. |CTRL-W_bar| CTRL-W | set current window width (default:
  1286. widest possible)
  1287. ------------------------------------------------------------------------------
  1288. *Q_bu* Buffer list commands
  1289. |:buffers| :buffers or :files list all known buffer and file names
  1290. |:ball| :ball or :sball edit all args/buffers
  1291. |:unhide| :unhide or :sunhide edit all loaded buffers
  1292. |:badd| :badd {fname} add file name {fname} to the list
  1293. |:bunload| :bunload[!] [N] unload buffer [N] from memory
  1294. |:bdelete| :bdelete[!] [N] unload buffer [N] and delete it from
  1295. the buffer list
  1296. in current window in new window ~
  1297. |:buffer| :[N]buffer [N] :[N]sbuffer [N] to arg/buf N
  1298. |:bnext| :[N]bnext [N] :[N]sbnext [N] to Nth next arg/buf
  1299. |:bNext| :[N]bNext [N] :[N]sbNext [N] to Nth previous arg/buf
  1300. |:bprevious| :[N]bprevious [N] :[N]sbprevious [N] to Nth previous arg/buf
  1301. |:bfirst| :bfirst :sbfirst to first arg/buf
  1302. |:blast| :blast :sblast to last arg/buf
  1303. |:bmodified| :[N]bmod [N] :[N]sbmod [N] to Nth modified buf
  1304. ------------------------------------------------------------------------------
  1305. *Q_sy* Syntax Highlighting
  1306. |:syn-on| :syntax on start using syntax highlighting
  1307. |:syn-off| :syntax off stop using syntax highlighting
  1308. |:syn-keyword| :syntax keyword {group-name} {keyword} ..
  1309. add a syntax keyword item
  1310. |:syn-match| :syntax match {group-name} {pattern} ...
  1311. add syntax match item
  1312. |:syn-region| :syntax region {group-name} {pattern} ...
  1313. add syntax region item
  1314. |:syn-sync| :syntax sync [ccomment | lines {N} | ...]
  1315. tell syntax how to sync
  1316. |:syntax| :syntax [list] list current syntax items
  1317. |:syn-clear| :syntax clear clear all syntax info
  1318. |:highlight| :highlight clear clear all highlight info
  1319. |:highlight| :highlight {group-name} {key}={arg} ..
  1320. set highlighting for {group-name}
  1321. |:filetype| :filetype on switch on file type detection, without
  1322. syntax highlighting
  1323. |:filetype| :filetype plugin indent on
  1324. switch on file type detection, with
  1325. automatic indenting and settings
  1326. ------------------------------------------------------------------------------
  1327. *Q_gu* GUI commands
  1328. |:gui| :gui UNIX: start the GUI
  1329. |:gui| :gui {fname} .. idem, and edit {fname} ..
  1330. |:menu| :menu list all menus
  1331. |:menu| :menu {mpath} list menus starting with {mpath}
  1332. |:menu| :menu {mpath} {rhs} add menu {mpath}, giving {rhs}
  1333. |:menu| :menu {pri} {mpath} {rhs}
  1334. idem, with priorities {pri}
  1335. |:menu| :menu ToolBar.{name} {rhs}
  1336. add toolbar item, giving {rhs}
  1337. |:tmenu| :tmenu {mpath} {text} add tooltip to menu {mpath}
  1338. |:unmenu| :unmenu {mpath} remove menu {mpath}
  1339. ------------------------------------------------------------------------------
  1340. *Q_fo* Folding
  1341. |'foldmethod'| set foldmethod=manual manual folding
  1342. set foldmethod=indent folding by indent
  1343. set foldmethod=expr folding by 'foldexpr'
  1344. set foldmethod=syntax folding by syntax regions
  1345. set foldmethod=marker folding by 'foldmarker'
  1346. |zf| zf{motion} operator: Define a fold manually
  1347. |:fold| :{range}fold define a fold for {range} lines
  1348. |zd| zd delete one fold under the cursor
  1349. |zD| zD delete all folds under the cursor
  1350. |zo| zo open one fold under the cursor
  1351. |zO| zO open all folds under the cursor
  1352. |zc| zc close one fold under the cursor
  1353. |zC| zC close all folds under the cursor
  1354. |zm| zm fold more: decrease 'foldlevel'
  1355. |zM| zM close all folds: make 'foldlevel' zero
  1356. |zr| zr reduce folding: increase 'foldlevel'
  1357. |zR| zR open all folds: make 'foldlevel' max.
  1358. |zn| zn fold none: reset 'foldenable'
  1359. |zN| zN fold normal set 'foldenable'
  1360. |zi| zi invert 'foldenable'
  1361. vim:tw=78:ts=8:noet:ft=help:norl: