Wikia

Vim Tips Wiki

Changes: Quickly change word or line

Edit

Back to page

(Change <tt> to <code>, perhaps also minor tweak.)
 
Line 3: Line 3:
 
|previous=1008
 
|previous=1008
 
|next=1010
 
|next=1010
|created=October 5, 2005
+
|created=2005
 
|complexity=basic
 
|complexity=basic
 
|author=Anupam
 
|author=Anupam
Line 11: Line 11:
 
|category2=
 
|category2=
 
}}
 
}}
To quickly change a word you can use <tt>cw</tt>,<tt>caw</tt> or <tt>ciw</tt>. Use <tt>c$</tt> or just <tt>C</tt> to quickly change from the cursor to the end of a line, <tt>cc</tt> to change an entire line, or <tt>cis</tt> for a sentence.
+
To quickly change a word you can use <code>cw</code>,<code>caw</code> or <code>ciw</code>. Use <code>c$</code> or just <code>C</code> to quickly change from the cursor to the end of a line, <code>cc</code> to change an entire line, or <code>cis</code> for a sentence.
   
The standard ''change word'' command requires you to type <tt>cw</tt>, then a new word, then press Escape. Using the version below, you would type <tt>pw</tt>, then a new word, then press Space to exit back to normal mode. Or, you would type <tt>p$</tt>, then a new line, then press Enter.
+
The standard ''change word'' command requires you to type <code>cw</code>, then a new word, then press Escape. Using the version below, you would type <code>pw</code>, then a new word, then press Space to exit back to normal mode. Or, you would type <code>p$</code>, then a new line, then press Enter.
   
 
<pre>
 
<pre>

Latest revision as of 06:03, July 13, 2012

Tip 1009 Printable Monobook Previous Next

created 2005 · complexity basic · author Anupam · version 5.7


To quickly change a word you can use cw,caw or ciw. Use c$ or just C to quickly change from the cursor to the end of a line, cc to change an entire line, or cis for a sentence.

The standard change word command requires you to type cw, then a new word, then press Escape. Using the version below, you would type pw, then a new word, then press Space to exit back to normal mode. Or, you would type p$, then a new line, then press Enter.

nmap pw :inoremap <lt>Space> <lt>Space><lt>Esc>:iunmap <lt>lt>Space><lt>CR><CR> cw

nmap p$ :inoremap <lt>CR> <lt>CR><lt>Esc>:iunmap <lt>lt>CR><lt>CR><CR> c$

See alsoEdit

CommentsEdit

Around Wikia's network

Random Wiki