sponsor Vim development Vim logo Vim Book Ad

basic Tip #834: Word-wise cut, copy & paste

 tip karma   Rating 0/6, Viewed by 1045 

created:   December 15, 2004 18:55      complexity:   basic
author:   andyf      as of Vim:   6.0

Word-wise cut, copy & paste over the current word. There's nothing special or magical about these bindings, just that I find them really useful for coding, and I thought I'd share.

Add the following lines to _vimrc:

map <A-v> viw"+gPb
map <A-c> viw"+y
map <A-x> viw"+x

These bindings follow the Windows-style keys of control-V, control-C, and control-X; except using alt instead of control. Adjust to your preference.

 rate this tip  Life Changing Helpful Unfulfilling 

<<Google lookup as a contextual spell check and phrase verifier. | Get Intellisense for C++ to search CWD/PWD >>

Additional Notes

Anonymous, December 20, 2004 18:37
I think <ESC>yiw is more convenient
[email protected], January 31, 2005 11:18
Thanks a lot. Exactly what I was searching for. (:
If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to [email protected] after searching the archive. Help Bram help Uganda.
Sponsored by Web Concept Group Inc. SourceForge Logo