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:
- Word/pattern automatically completed
- Automatic row completion
- Dictionary word completion
- File Name completion
- 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