(Fix typos) |
(Remove html character entities) |
||
Line 15: | Line 15: | ||
#Select the first block: <tt>ctrl-v move "ay</tt> |
#Select the first block: <tt>ctrl-v move "ay</tt> |
||
− | #Select the second block: <tt>ctrl-v move c ctrl-o "aP |
+ | #Select the second block: <tt>ctrl-v move c ctrl-o "aP <Esc></tt> |
==Comments== |
==Comments== |
||
Based on the current tip, I've added a little extension to visswap.vim which allows one to |
Based on the current tip, I've added a little extension to visswap.vim which allows one to |
||
*Select a region using ctrl-v + motion (visual block) |
*Select a region using ctrl-v + motion (visual block) |
||
− | *Hit |
+ | *Hit <escape> |
− | *Move cursor to another location, hit \vr (the backslash is actually |
+ | *Move cursor to another location, hit \vr (the backslash is actually <Leader>, so folks may customize that easily) |
That sequence will replace the text in a visual-block fashion below the cursor. One may repeat the |
That sequence will replace the text in a visual-block fashion below the cursor. One may repeat the |
||
Line 31: | Line 31: | ||
---- |
---- |
||
− | To make second block exactly same size as first instead of |
+ | To make second block exactly same size as first instead of <Ctrl-v>move hit 1<Ctrv-V> |
This will make a rectangular selection of exactly same size as previous one using current cursor position as top left corner. Unfortunately it does not (always? yet?) work with multibyte encodings, so be careful if you use them. |
This will make a rectangular selection of exactly same size as previous one using current cursor position as top left corner. Unfortunately it does not (always? yet?) work with multibyte encodings, so be careful if you use them. |
Revision as of 09:28, 29 September 2008
created October 24, 2004 · complexity intermediate · author Chip Campbell · version 5.7
One may overwrite a visual-block of text with another visual-block of text by:
- Select the first block: ctrl-v move "ay
- Select the second block: ctrl-v move c ctrl-o "aP <Esc>
Comments
Based on the current tip, I've added a little extension to visswap.vim which allows one to
- Select a region using ctrl-v + motion (visual block)
- Hit <escape>
- Move cursor to another location, hit \vr (the backslash is actually <Leader>, so folks may customize that easily)
That sequence will replace the text in a visual-block fashion below the cursor. One may repeat the \vr multiple times for additional replacements.
For visswap.vim, see (under "Visual Mode Based Swapping"):
http://mysite.verizon.net/astronaut/vim/index.html#VimFuncs
To make second block exactly same size as first instead of <Ctrl-v>move hit 1<Ctrv-V>
This will make a rectangular selection of exactly same size as previous one using current cursor position as top left corner. Unfortunately it does not (always? yet?) work with multibyte encodings, so be careful if you use them.