Ctrl-p - autocomplete
From Vim Tips Wiki
[edit] Duplicate tip
This tip is very similar to the following:
These tips need to be merged – see the merge guidelines.
Tip 1257 • Previous Tip • Next Tip
Created: June 9, 2006 Complexity: basic Author: Shailesh Dave Minimum version: 6.0 Karma: 68/40 Imported from: Tip#1257
If you have a word typed into a file then for all the future typing for the specific word, one can use autocomplete by typing first few characters (minimum 1) and keep hitting Ctrl-p till you get the word you want.
For example, I had "foodyvar" and "funnyvar" already typed once in my current file then future type can be done with "f" Ctrl-p (till you get foodyvar). To save one stroke, you can also do "fo" Ctrl-p.
[edit] Comments
See also VimTip4, VimTip11, VimTip305
It will blow your mind to find out what Ctrl-n does.
Not to mention <C-x><C-p/n>. An enormous time and error saver.
It's completion that made me unable to use Visual Studio's editor (which has some completion, but it's not as good) anymore. I get lots of use out of:
File completion: <C-X><C-F>
Line completion: <C-X><C-L>
Omni completion: <C-X><C-O>
Categories: Duplicate | Review | VimTip
