unimpaired.txt 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. *unimpaired.txt* Pairs of handy bracket mappings
  2. Author: Tim Pope <http://tpo.pe/>
  3. License: Same terms as Vim itself (see |license|)
  4. This plugin is only available if 'compatible' is not set.
  5. INTRODUCTION *unimpaired*
  6. This plugin provides several pairs of bracket maps.
  7. NEXT AND PREVIOUS *unimpaired-next*
  8. The following maps all correspond to normal mode commands. If a count is
  9. given, it becomes an argument to the command. A mnemonic for the "a" commands
  10. is "args" and for the "q" commands is "quickfix".
  11. *[a* |:previous|
  12. *]a* |:next|
  13. *[A* |:first|
  14. *]A* |:last|
  15. *[b* |:bprevious|
  16. *]b* |:bnext|
  17. *[B* |:bfirst|
  18. *]B* |:blast|
  19. *[l* |:lprevious|
  20. *]l* |:lnext|
  21. *[L* |:lfirst|
  22. *]L* |:llast|
  23. *[<C-L>* |:lpfile|
  24. *]<C-L>* |:lnfile|
  25. *[q* |:cprevious|
  26. *]q* |:cnext|
  27. *[Q* |:cfirst|
  28. *]Q* |:clast|
  29. *[<C-Q>* |:cpfile| (Note that <C-Q> only works in a terminal if you disable
  30. *]<C-Q>* |:cnfile| flow control: stty -ixon)
  31. *[t* |:tprevious|
  32. *]t* |:tnext|
  33. *[T* |:tfirst|
  34. *]T* |:tlast|
  35. *[<C-T>* |:ptprevious|
  36. *]<C-T>* |:ptnext|
  37. *[f*
  38. [f Go to the file preceding the current one
  39. alphabetically in the current file's directory. In
  40. the quickfix window, equivalent to |:colder|.
  41. *]f*
  42. ]f Go to the file succeeding the current one
  43. alphabetically in the current file's directory. In
  44. the quickfix window, equivalent to |:cnewer|.
  45. *[n*
  46. [n Go to the previous SCM conflict marker or diff/patch
  47. hunk. Try d[n inside a conflict.
  48. *]n*
  49. ]n Go to the next SCM conflict marker or diff/patch hunk.
  50. Try d]n inside a conflict.
  51. LINE OPERATIONS *unimpaired-lines*
  52. *[<Space>*
  53. [<Space> Add [count] blank lines above the cursor.
  54. *]<Space>*
  55. ]<Space> Add [count] blank lines below the cursor.
  56. *[e* *v_[e*
  57. [e Exchange the current line with [count] lines above it.
  58. *]e* *v_]e*
  59. ]e Exchange the current line with [count] lines below it.
  60. OPTION TOGGLING *unimpaired-toggling*
  61. On Off Toggle Option
  62. *[ob* *]ob* *yob* 'background' (dark is off, light is on)
  63. *[oc* *]oc* *yoc* 'cursorline'
  64. *[od* *]od* *yod* 'diff' (actually |:diffthis| / |:diffoff|)
  65. *[oh* *]oh* *yoh* 'hlsearch'
  66. *[oi* *]oi* *yoi* 'ignorecase'
  67. *[ol* *]ol* *yol* 'list'
  68. *[on* *]on* *yon* 'number'
  69. *[or* *]or* *yor* 'relativenumber'
  70. *[os* *]os* *yos* 'spell'
  71. *[ot* *]ot* *yot* 'colorcolumn' ("+1" or last used value)
  72. *[ou* *]ou* *you* 'cursorcolumn'
  73. *[ov* *]ov* *yov* 'virtualedit'
  74. *[ow* *]ow* *yow* 'wrap'
  75. *[ox* *]ox* *yox* 'cursorline' 'cursorcolumn' (x as in crosshairs)
  76. The mnemonic for y is that if you tilt it a bit it looks like a switch.
  77. *<s* *>s* *=s*
  78. Alternative prefixes for on/off/toggle: <s, >s, =s.
  79. PASTING *unimpaired-pasting*
  80. These are experimental:
  81. *>p* Paste after linewise, increasing indent.
  82. *>P* Paste before linewise, increasing indent.
  83. *<p* Paste after linewise, decreasing indent.
  84. *<P* Paste before linewise, decreasing indent.
  85. *=p* Paste after linewise, reindenting.
  86. *=P* Paste before linewise, reindenting.
  87. |]p|, |[p|, |[P|, and |]P| have also been remapped to force linewise pasting,
  88. while preserving their usual indent matching behavior.
  89. *[op* *]op* *yop*
  90. A toggle has not been provided for 'paste' because the typical use case of
  91. wrapping of a solitary insertion is inefficient: You toggle twice, but
  92. you only paste once (YOPO). Instead, press [op, ]op, or yop to invoke |O|,
  93. |o|, or |0||C| with 'paste' already set. Leaving insert mode sets 'nopaste'
  94. automatically.
  95. ENCODING AND DECODING *unimpaired-encoding*
  96. Each of these operations has a map that takes a motion, a map that
  97. targets [count] lines, and a visual mode map. The linewise variant integrates
  98. with repeat.vim.
  99. Mnemonic: encoding always comes before decoding; "[" always comes before "]".
  100. *[x* *[xx* *v_[x*
  101. [x{motion} XML encode.
  102. [xx <foo bar="baz"> => &lt;foo bar=&quot;baz&quot;&gt;
  103. {Visual}[x
  104. *]x* *]xx* *v_]x*
  105. ]x{motion} XML decode. HTML entities are handled as well.
  106. ]xx
  107. {Visual}]x
  108. *[u* *[uu* *v_[u*
  109. [u{motion} URL encode.
  110. [uu foo bar => foo%20bar
  111. {Visual}[u
  112. *]u* *]uu* *v_]u*
  113. ]u{motion} URL decode.
  114. ]uu
  115. {Visual}]u
  116. *[y* *[yy* *v_[y* *[C* *[CC* *v_[C*
  117. [y{motion} C String encode. Backslash escape control
  118. [yy characters, quotation marks, and backslashes.
  119. {Visual}[y
  120. [C{motion}
  121. [CC
  122. {Visual}[C
  123. *]y* *]yy* *v_]y* *]C* *]CC* *v_]C*
  124. ]y{motion} C String decode.
  125. ]yy
  126. {Visual}]y
  127. ]C{motion}
  128. ]CC
  129. {Visual}]C
  130. vim:tw=78:et:ft=help:norl: