Previous blog 《Copy content in VIM to system clipboardThis section describes how to copy the content in VIM to the system clipboard. It can be seen that a copy requires many keys, so I want to define a shortcut key to simplify the operation. The process is very simple. For example, if I want to set the shortcut key for copying the full text to Ca (meaning copy all), the process is as follows:
1. test whether the CA is in use. Enter CA in normal mode to check whether there is any response. If not, the Ca is not in use.
2 edit ~ /. Vimrc file, add
Map ca {ggvg "+ y}
3. Open a file and press CA in normal mode. The message "Copied ** line" is displayed.
In the insert mode, if you want to switch to normal mode, press the ESC key. Because the distance is too long and the operation is inconvenient, a keyboard ing is usually performed.
Edit ~ /. Vimrc file, add
Imap jj <ESC>
In this way, in the insert mode, it is too convenient to press JJ twice consecutively, not only does not input two j s, but also switches to the normal mode!