Recently intends to map caps lock into a <esc> button, it is more cool to press, now there is a small problem, how to quickly enter capital letters,
Use this keyboard mapping to get it done.
Inoremap <c-u> <esc>guiwa
You have a chance to test this combination, regardless of where your cursor is in the word, capitalize the whole word directly.
Explain:
<esc> Enter Normal mode
GU Caps
IW inner Word shorthand, this is the focus, according to the official explanation, it is used in visual mode or after an operator.
With regard to Word, in vim, a word consists of letters, numbers, and underscores, and the sides of the word are surrounded by spaces or tab tabs.
So for IW, word_press Help_user is a word. Word-press Help&man not forget.
For example: GUIW this wor|d-press cursor in the | place, the word will become word-press
GUIW the word wor|d_press the cursor at |, the word will change to word_press
Vim: Capitalize the words you just wrote and define the words