Paste the contents of register into the command line is very useful, for example, you can edit a non-trivial command in normal vim buffer, or you can copy some text from the file. There are at least two way to do it:
The 'CTRL_R', in command mode, can be used for this [:help c_CTRL-R]
- Assume you saved some text in register 'a'
- Under command mode, press 'Ctrl-R a'
- The text in register 'a' will pasted in the command line
One powerful alternative is the command window [:help q:]
- Under normal mode, use 'q:' to enter command window
- Editing the command
- Press 'Enter' to execute, or 'Ctrl-C' to quit this mode
This two method is provided by Tim on the thread
No comments:
Post a Comment