Shortcut for Automatic completion in VIM

Source: Internet
Author: User
ArticleDirectory
    • 1. Using Ctrl-x Ctrl-N to automatically complete word
    • 2. CTRL-x Ctrl-L to automatically complete the line
    • 3. the Ctrl-x Ctrl-F file name is automatically completed.
    • 4. Thesaurus word completion
    • 5. Use Ctrl-x Ctrl-K to automatically complete the dictionary.

This article mainly describes the following automatic operations of VIM:

    1. Word/pattern automatically completed
    2. Automatic row completion
    3. Dictionary word completion
    4. File Name completion
    5. Filling up words with similar meaning (Thesaurus word completion ).

These operations are related to Ctrl-X.

1. Using Ctrl-x Ctrl-N to automatically complete word
    • CTRL-x Ctrl-N: Word completion-forward
    • CTRL-x Ctrl-P: Word completion-backward


Fig:Keyword completion in VI/Vim using Ctrl-x Ctrl-n

2. CTRL-x Ctrl-L to automatically complete the line


Fig:Vim whole line completion using Ctrl-x Ctrl-l

Typical usage for a programmers and administrators:

    • Repeat an existing line quickly in your file.
    • Automatically fill first line of the Function Definition, when the function is already declared elsewhere in the same file.
3. the Ctrl-x Ctrl-F file name is automatically completed.

 


Fig:Vim file name completion using Ctrl-x Ctrl-F

 

4. Thesaurus word completion

Using this feature you can choose alternate words with the same meaning for the word that you 've just typed. Our previous article explains aboutThe thesaurus features for your vim Editor.

5. Use Ctrl-x Ctrl-K to automatically complete the dictionary.

Modify ~ /. Add a dictionary to vimrc.

 
$ Cat ~ /. Vimrc
Set dictionary + =/usr/share/dict/words

 

Fig:Vim dictionary word completion using Ctrl-x Ctrl-K

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.