Vim: Capitalize the words you just wrote and define the words

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.