Wikia

Vim Tips Wiki

Changes: Line/word/file/whatever completion

Edit

Back to page

(yes it does work if you use the correct keys)
(adjust previous/next navigation + minor manual clean)
 
Line 3: Line 3:
 
|previous=294
 
|previous=294
 
|next=297
 
|next=297
|created=July 30, 2002
+
|created=2002
 
|complexity=intermediate
 
|complexity=intermediate
 
|author=Nopik
 
|author=Nopik
Line 11: Line 11:
 
|category2=
 
|category2=
 
}}
 
}}
In addition to [[VimTip291]] you can use whole <C-x> completion mode. It can complete whole lines (<C-X><C-L>, then <C-P>, <C-N>), filenames (<C-X><C-F>), keywords, words from custom dictionary and many, many others. During coding it usually saves a LOT of key strokes ;) This mode has many other powerful features, for example when completing word (by <C-X><C-P> or just by <C-P>) you can continue completion with another <C-X><C-P>. For example, after writing such text:
+
In addition to [[VimTip4|any word completion]] you can use whole <C-x> completion mode. It can complete whole lines (<C-X><C-L>, then <C-P>, <C-N>), filenames (<C-X><C-F>), keywords, words from custom dictionary and many, many others. This mode has many other powerful features, for example when completing word (by <C-X><C-P> or just by <C-P>) you can continue completion with another <C-X><C-P>. For example, after writing such text:
+
<pre>
this is first line
+
this is first line
second line is here
+
second line is here
  +
</pre>
   
 
Placing cursor at third line and pressing <C-X><C-L> will double last line - <C-N>, <C-P> in this moment can be used to manipulate completed line. Or, instead of completing whole line you can press 'f' and then complete by <C-P> which will result in the word, "first". After that you can <C-X><C-P> to get "line" word (since this is next word after "first"). Try yourself for other powerful combinations.
 
Placing cursor at third line and pressing <C-X><C-L> will double last line - <C-N>, <C-P> in this moment can be used to manipulate completed line. Or, instead of completing whole line you can press 'f' and then complete by <C-P> which will result in the word, "first". After that you can <C-X><C-P> to get "line" word (since this is next word after "first"). Try yourself for other powerful combinations.
   
 
==Comments==
 
==Comments==
It really does not work in most cases.
 
it used to work before in ver 6.0
 
 
:It really does work in most cases, and has worked for years. However, the tip was confused and used the wrong keystrokes. Maybe that is your problem. Or maybe your Vim is misconfigured. I have fixed it as best I can in a quick runthrough. It may need a little more work though. --[[User:Fritzophrenic|Fritzophrenic]] 18:57, March 28, 2011 (UTC)
 

Latest revision as of 10:18, April 23, 2011

Tip 295 Printable Monobook Previous Next

created 2002 · complexity intermediate · author Nopik · version 6.0


In addition to any word completion you can use whole <C-x> completion mode. It can complete whole lines (<C-X><C-L>, then <C-P>, <C-N>), filenames (<C-X><C-F>), keywords, words from custom dictionary and many, many others. This mode has many other powerful features, for example when completing word (by <C-X><C-P> or just by <C-P>) you can continue completion with another <C-X><C-P>. For example, after writing such text:

this is first line
second line is here

Placing cursor at third line and pressing <C-X><C-L> will double last line - <C-N>, <C-P> in this moment can be used to manipulate completed line. Or, instead of completing whole line you can press 'f' and then complete by <C-P> which will result in the word, "first". After that you can <C-X><C-P> to get "line" word (since this is next word after "first"). Try yourself for other powerful combinations.

CommentsEdit

Around Wikia's network

Random Wiki