Vous êtes sur la page 1sur 49

100 Vim commands every programmer should know | CatsWhoCode.

com

http://www.catswhocode.com/blog/100-vim-commands-every-programme...

Home (http://www.catswhocode.com/blog)

About (http://www.catswhocode.com/blog/about) Categories Hire me (http://www.webdevcat.com ) (http://www.catswhocode.com )

Contact (http://www.catswhocode.com/blog/contact)

100 Vim commands 12000+ every programmer should know (http://www.catswhocode.com /blog/100vim-commandsevery-programmershould-know)
Published on June 30th, 2008 by Jean-Baptiste Jung. 120 Comments (http://www.catswhocode.com/blog/100-vim-commands-everyprogrammer-should-know#comments) -

RSS READERS

12100+
FOLLOWERS

(http://feeds.feedburner.com (http://www.twitter.com /catswhocode) /catswhocode)

(http://stats.buysellads.com (http://stats.buysellads.com /click.go?z=1238342& /click.go?z=1238342& b=756358& b=599358& g=&s=&sw=1024& g=&s=&sw=1024& sh=768& sh=768& br=firefox,8,win& br=firefox,8,win& r=0.7696730845715581& r=0.9173387399892146& link=http: link=http: //www.efrogthemes.com //www.templatesold.com

Since the 70s, Vi is one of the programmers best friend. Nevermind youre new to Vi or not, heres a big list of 100 useful commands, organized by topic, which will make your coder life better.

Basics
:e filename :w :q :w! Open filename for edition Save file Exit Vim Exit Vim without saving

(http://stats.buysellads.com (http://stats.buysellads.com /click.go?z=1238342& /click.go?z=1238342& b=1668936& b=1730708& g=&s=&sw=1024& g=&s=&sw=1024& sh=768& sh=768& br=firefox,8,win& br=firefox,8,win& r=0.6632932082641763& r=0.33144532385909786& link=http: link=http: //dolcepixel.com //www.cozmoslabs.com /classified/wordpressads-wordpressprofile-builder/) theme/)

Search
/word ?word /jo[ha]n /\< the /the\> Search word from top to bottom Search word from bottom to top Search john or joan Search the, theatre or then Search the or breathe
(http://stats.buysellads.com /click.go?z=1238342&

1 of 49

11/23/2011 3:15 PM

100 Vim commands every programmer should know | CatsWhoCode.com

http://www.catswhocode.com/blog/100-vim-commands-every-programme...

/\< the\> Search the 2008 - 2011 CatsWhoCode.com (http://www.catswhocode.com) /\< .\> Search all words of 4 letters /\/ Search fred but not alfred or frederick /fred\|joe Search fred or joe /\<\d\d\d\d\> Search exactly 4 digits /^\n\{3} Find 3 empty lines :bufdo /searchstr/ Search in all open files

b=1676842& g=&s=&sw=1024& sh=768& (http://feeds2.feedburner.com/Catswhocode) br=firefox,8,win& r=0.6747788593250581& link=http: //www.usertesting.com /?utm_source=buysellads& utm_medium=125banner& utm_campaign=bannerads (http://stats.buysellads.com /click.go?z=1238342& b=1094017& g=&s=&sw=1024& sh=768& br=firefox,8,win& r=0.14042767984370608& link=http: //themefuse.com /wp-themesshop/?ad=bsa& type=125x125& site=catswhocodecomblog

Replace
:%s/old/new/g :%s/old/new/gw :2,35s/old/new/g :5,$s/old/new/g :%s/^/hello/g :%s/$/Harry/g :%s/onward /forward/gi :%s/ *$//g :g/string/d :v/string/d :s/Bill/Steve/ :s/Bill/Steve/g :%s/Bill/Steve/g :%s/\r//g :%s/\r/\r/g :%s#<[^>]\+>##g :%s/^\(.*\)\n\1$/\1/ Ctrl+a Ctrl+x ggVGg? Replace all occurences of old by new in file Replace all occurences with confirmation Replace all occurences between lines 2 and 35 Replace all occurences from line 5 to EOF Replace the begining of each line by hello Replace the end of each line by Harry Replace onward by forward, case unsensitive Delete all white spaces Delete all lines containing string Delete all lines containing which didnt contain string Replace the first occurence of Bill by Steve in current line Replace Bill by Steve in current line Replace Bill by Steve in all the file Delete DOS carriage returns (^M) Transform DOS carriage returns in returns Delete HTML tags but keeps text Delete lines which appears twice Increment number under the cursor Decrement number under cursor Change text to Rot13

(http://stats.buysellads.com (http://stats.buysellads.com /click.go?z=1238342& /click.go?z=1238342& b=1705353& b=1216896& g=&s=&sw=1024& g=&s=&sw=1024& sh=768& sh=768& br=firefox,8,win& br=firefox,8,win& r=0.036281562888673236& r=0.5003900626649365& link=http: link=http: //sproutsocial.com?utm_source=CatsW //www.pagelines.com utm_medium=Banner& /themes utm_campaign=BuySellAds.com& /platformpro utm_content=125x125_S2Product /video /?utm_source=BuySellAds& utm_medium=Banner& utm_campaign=CatsWhoCode3

Search

Case
Vu VU g~~ vEU vE~ ggguG Lowercase line Uppercase line Invert case Switch word to uppercase Modify word case Set all text to lowercase

(http://stats.buysellads.com (http://stats.buysellads.com /click.go?z=1239978& /click.go?z=1239978& b=1626899& b=1722405& g=&s=&sw=1024& g=&s=&sw=1024& sh=768& sh=768& br=firefox,8,win& br=firefox,8,win& r=0.9502864437748689& r=0.8031773023346365& link=http: link=http: //wpsalesletter.com //www.firehost.com /x.php?af=421959) /?utm_campaign=catscode&utm_medium=banner& utm_source=catscode&utm_content=125

2 of 49

11/23/2011 3:15 PM

100 Vim commands every programmer should know | CatsWhoCode.com

http://www.catswhocode.com/blog/100-vim-commands-every-programme...

:set Ignore case in searches ignorecase :set Ignore case in searches excepted if an smartcase uppercase letter is used :%s/\<./\u&/g Sets first letter of each word to uppercase :%s/\<./\l&/g Sets first letter of each word to lowercase :%s/.*/\u& Sets first letter of each line to uppercase :%s/.*/\l& Sets first letter of each line to lowercase

Read/Write files
:1,10 w outfile :1,10 w >> outfile :r infile :23r infile Saves lines 1 to 10 in outfile Appends lines 1 to 10 to outfile Insert the content of infile Insert the content of infile under line 23

(http://stats.buysellads.com (http://stats.buysellads.com /click.go?z=1239978& /click.go?z=1239978& b=1025359& b=1744039& g=&s=&sw=1024& g=&s=&sw=1024& sh=768& sh=768& br=firefox,8,win& br=firefox,8,win& r=0.39926388415856917& r=0.8325831788392254& link=http: link=http: //mediatemple.net //www.formstack.com /?utm_source=catswhocode& /ba-jswd?ba=cwc& utm_medium=banner& utm_source=cwc& utm_content=125x125bug& utm_medium=banner& utm_campaign=branding utm_campaign=cwc)

Blogroll

File explorer
:e . :Sex :browse e :ls :cd .. :args :args *.php :grep expression *.php gf Open integrated file explorer Split window and open integrated file explorer Graphical file explorer List buffers Move to parent directory List files Open file list Returns a list of .php files contening expression Open file name under cursor

Cats Who Blog (http://www.catswhoblog.com) Coupons for Bloggers (http://couponsforbloggers.com) Custard Media Solutions (http://www.custardmedia.co.uk/ Custom Logo Design (http://www.logobee.com/) diezjietal webdesign (http://www.diezjietal.be) Eglise Evanglique de Binche (http://epebinche.be/) Free Website (http://www.wix.com /?utm_campaign=se_catswhocode.com& experiment_id=WB) Photoshop tutorials (http://psdvibe.com) seo (http://www.biteus.net) Visiter New York (http://www.visiter-newyork.com)

Interact with Unix


:!pwdExecute the pwd unix command, then returns to Vi !!pwdExecute the pwd unix command and insert output in file :sh Temporary returns to Unix $exit Retourns to Vi

(http://www.smashingmagazine.com /the-smashing-network/)

Alignment
:%!fmt !}fmt 5!!fmt Align all lines Align all lines at the current position Align the next 5 lines

Tabs

3 of 49

11/23/2011 3:15 PM

100 Vim commands every programmer should know | CatsWhoCode.com

http://www.catswhocode.com/blog/100-vim-commands-every-programme...

:tabnew gt :tabfirst :tablast :tabm n(position) :tabdo %s/foo/bar/g :tab ball

Creates a new tab Show next tab Show first tab Show last tab Rearrange tabs Execute a command in all tabs Puts all open files in tabs

Window spliting
:e filename :split filename ctrl-w up arrow ctrl-w ctrl-w ctrl-w_ ctrl-w= 10 ctrl-w+ :vsplit file :sview file :hide :nly :b 2 Edit filename in current window Split the window and open filename Puts cursor in top window Puts cursor in next window Maximise current window Gives the same size to all windows Add 10 lines to current window Split window vertically Same as :split in readonly mode Close current window Close all windows, excepted current Open #2 in this window

Auto-completion
Ctrl+n Ctrl+p (in insert mode) Complete word Ctrl+x Ctrl+l Complete line :set dictionary=dict Define dict as a dictionnary Ctrl+x Ctrl+k Complete with dictionnary

Marks
mk k dk Marks current position as k Moves cursor to mark k Delete all until mark k

Abbreviations
:ab mail mail@provider.org Define mail as abbreviation of mail@provider.org

Text indent
:set autoindent :set smartindent :set shiftwidth=4 Turn on auto-indent Turn on intelligent auto-indent Defines 4 spaces as indent size

4 of 49

11/23/2011 3:15 PM

100 Vim commands every programmer should know | CatsWhoCode.com

http://www.catswhocode.com/blog/100-vim-commands-every-programme...

ctrl-t, ctrl-d >> <<

Indent/un-indent in insert mode Indent Un-indent

Syntax highlighting
:syntax on :syntax off :set syntax=perl Turn on syntax highlighting Turn off syntax highlighting Force syntax highlighting

More posts about Web development


10+ .htaccess snippets to optimize your website (http://www.catswhocode.com /blog/10-htaccess-snippets-to-optimize-your-website) 7 new techniques every web developer should know (http://www.catswhocode.com/blog/7-new-techniques-every-web-developershould-know) Google website optimizer. Whats that all about? (http://www.catswhocode.com /blog/google-website-optimizer-tutorial) Mootools Tutorial: Text fading effect on links (http://www.catswhocode.com /blog/mootools-tutorial-text-fading-effect-on-links) Speed Up your Website, Quick! (http://www.catswhocode.com/blog/speedup-your-website-quick) How spammers spams your blog comments (http://www.catswhocode.com /blog/how-spammers-spams-your-blog-comments)

Share this article


tweets

105

ENPAQ@SaankhyaLabs-HQ

retweet

(http://stats.buysellads.com /click.go?z=1244474&b=1462106&g=&s=& sw=1024&sh=768&br=firefox,8,win& r=0.4256705813015954&link=http: //designerthemes.com/themes /?ap_id=bsa_cats)

Comments (120) - Leave yours (#reply-title)


5 of 49

11/23/2011 3:15 PM

100 Vim commands every programmer should know | CatsWhoCode.com

http://www.catswhocode.com/blog/100-vim-commands-every-programme...

YRU2L8 said: June 30, 2008 at 10:10 pm (http://www.catswhocode.com/blog/100vim-commands-every-programmershould-know#comment-140) /\/ Search fred but not alfred or frederick huh? Search exactly 4 numbers digits Reply (/blog/100-vim-commands-everyprogrammer-shouldknow?replytocom=140#respond)

jbj (http://www.lyxia.org) said: June 30, 2008 at 10:20 pm (http://www.catswhocode.com/blog/100vim-commands-every-programmershould-know#comment-141) Thanks for correcting my mistakes! Reply (/blog/100-vim-commands-everyprogrammer-shouldknow?replytocom=141#respond)

Sander said: June 30, 2008 at 11:58 pm (http://www.catswhocode.com/blog/100vim-commands-every-programmershould-know#comment-144) Excellent! A very useful list. Thanks a lot. Reply (/blog/100-vim-commands-everyprogrammer-shouldknow?replytocom=144#respond)

MarkL said: July 1, 2008 at 12:08 am (http://www.catswhocode.com/blog/100vim-commands-every-programmershould-know#comment-145) I see a typo: Alignement >> Alignment Reply (/blog/100-vim-commands-everyprogrammer-shouldknow?replytocom=145#respond)

jbj (http://www.lyxia.org) said: July 1, 2008 at 12:14 am (http://www.catswhocode.com/blog/100-

6 of 49

11/23/2011 3:15 PM

100 Vim commands every programmer should know | CatsWhoCode.com

http://www.catswhocode.com/blog/100-vim-commands-every-programme...

vim-commands-every-programmershould-know#comment-146) Corrected. Thanks, Mark! Reply (/blog/100-vim-commands-everyprogrammer-shouldknow?replytocom=146#respond)

Informacin de TecnologasArchivo del blog 100 comandos de VIM que todo programador debe conocer (http://blog.clsoporte.co.cc/2008/06 /30/100-comandos-de-vim-que-todoprogramador-debe-conocer/) said: July 1, 2008 at 2:22 am (http://www.catswhocode.com/blog/100vim-commands-every-programmershould-know#comment-150) [...] siguiente es una gran lista de comandos VIM que debes conocer, ya seas programador u administrador. Cada comando est [...] Reply (/blog/100-vim-commands-everyprogrammer-shouldknow?replytocom=150#respond)

Jon Keating (http://www.thejon.org) said: July 1, 2008 at 2:39 am (http://www.catswhocode.com/blog/100vim-commands-every-programmershould-know#comment-151) In search /\/ Search fred but alfred or frederick not

There is no text here to indiciate a search for fred. In replace :%s/old/new/gw Replace all occurences with confirmation There is no w flag, I believe you mean c. See help :s_flags In interact with unix

7 of 49

11/23/2011 3:15 PM

100 Vim commands every programmer should know | CatsWhoCode.com

http://www.catswhocode.com/blog/100-vim-commands-every-programme...

I think CTRL-Z and the fg command work better than :sh and exit. At least they are much easier to type. In text indenting << Desindent I believe Un-indent would be a better word. Or in fact, it is not indenting, it is shifting. Didnt check all, but those are what stood out. Jon Reply (/blog/100-vim-commands-everyprogrammer-shouldknow?replytocom=151#respond)

Billco (http://billsmind.com) said: July 1, 2008 at 6:49 am (http://www.catswhocode.com/blog/100vim-commands-every-programmershould-know#comment-153) Most important command ever: :q! cd /usr/ports/editors/nano make install I really dont understand why people still use VI. At least Emacs has its own operating system Reply (/blog/100-vim-commands-everyprogrammer-shouldknow?replytocom=153#respond)

Russia said: July 1, 2008 at 7:41 am (http://www.catswhocode.com/blog/100vim-commands-every-programmershould-know#comment-155) Stupid american Reply (/blog/100-vim-commands-everyprogrammer-shouldknow?replytocom=155#respond)

/designeronduty

8 of 49

11/23/2011 3:15 PM

100 Vim commands every programmer should know | CatsWhoCode.com

http://www.catswhocode.com/blog/100-vim-commands-every-programme...

said: November 13, 2010 at 4:58 am (http://www.catswhocode.com /blog/100-vim-commands-everyprogrammer-shouldknow#comment-138632) This person is either a scam, pretending to write on behalf of a Russian so others continue to think all Russians are like this, or a typical representative of Proudto-be-a-jerk Community of Russia. Im sorry for this off-topic rant I only want people to know that there is a black sheep in every family. Reply (/blog/100-vim-commandsevery-programmer-shouldknow?replytocom=138632#respond)

jbj (http://www.lyxia.org) said: July 1, 2008 at 8:19 am (http://www.catswhocode.com/blog/100vim-commands-every-programmershould-know#comment-157) @Jon Keating: Thanks @Russia: I may be stupid, but a sure thing is that Im not American: I live in Belgium and come from France Reply (/blog/100-vim-commands-everyprogrammer-shouldknow?replytocom=157#respond)

9 of 49

11/23/2011 3:15 PM

100 Vim commands every programmer should know | CatsWhoCode.com

http://www.catswhocode.com/blog/100-vim-commands-every-programme...

Modifier les couleurs du thme OpenBook (http://www.lyxia.org /blog/ressources/wordpress-ressources /modifier-les-couleurs-du-themeopenbook-308) said: July 1, 2008 at 9:22 am (http://www.catswhocode.com /blog/100-vim-commands-everyprogrammer-should-know#comment-159) [...] peu, Vi(m) est un diteur de texte trs puissant. Je vous invite dailleurs aller lire cet article qui vous donnera un bon aperu des possibilits offertes par [...] Reply (/blog/100-vim-commands-everyprogrammer-shouldknow?replytocom=159#respond)

Naveed said: July 1, 2008 at 9:47 am (http://www.catswhocode.com/blog/100vim-commands-every-programmershould-know#comment-160) Great list. Here is one of my favorite tricks: map j map k map gt map gT This will let you switch between tabs and windows by using a combination of the control key and h,j,k, and l. For example, to move to the top window, you can press ctrl-k. To move to the tab on the right, you can press ctrl-l. Reply (/blog/100-vim-commands-everyprogrammer-shouldknow?replytocom=160#respond)

10 of 49

11/23/2011 3:15 PM

100 Vim commands every programmer should know | CatsWhoCode.com

http://www.catswhocode.com/blog/100-vim-commands-every-programme...

should-know#comment-147300) I like this idea. Can you elaborate on what was mangled? I could google it but why not ask here because the mapping sounds very intuitive and I would like to try it out. Thanks. Reply (/blog/100-vim-commandsevery-programmer-shouldknow?replytocom=147300#respond)

Naveed said: July 1, 2008 at 9:49 am (http://www.catswhocode.com/blog/100vim-commands-every-programmershould-know#comment-161) Ignore my previous comment, since it seems like the comment system mangled up my text because it had less-than and greater-than characters in it. Reply (/blog/100-vim-commands-everyprogrammer-shouldknow?replytocom=161#respond)

jbj (http://www.lyxia.org) said: July 1, 2008 at 9:59 am (http://www.catswhocode.com/blog/100vim-commands-every-programmershould-know#comment-162) @Naveed: Yeah, sadly WordPress comments system always break code and/or commands. I didnt knew the tips you submitted, so Im going to check it out. Reply (/blog/100-vim-commands-everyprogrammer-shouldknow?replytocom=162#respond)

11 of 49

11/23/2011 3:15 PM

100 Vim commands every programmer should know | CatsWhoCode.com

http://www.catswhocode.com/blog/100-vim-commands-every-programme...

Anon said: July 1, 2008 at 10:51 am (http://www.catswhocode.com/blog/100vim-commands-every-programmershould-know#comment-163) Interesting list but how can you not mention the awesome * or some of the tips on http://www.vim.org/tips/tip.php?tip_id=305 ? :) Reply (/blog/100-vim-commands-everyprogrammer-shouldknow?replytocom=163#respond)

jbj (http://www.lyxia.org) said: July 1, 2008 at 11:11 am (http://www.catswhocode.com/blog/100vim-commands-every-programmershould-know#comment-164) @Anon: The vim.org tips are indeed very helpful, but for this list, I didnt wanted to re-use 75% of these tips. Though, I should have gave the link just as you did. Thanks! Reply (/blog/100-vim-commands-everyprogrammer-shouldknow?replytocom=164#respond)

Pdraig Brady (http://www.pixelbeat.org/) said: July 1, 2008 at 12:44 pm (http://www.catswhocode.com/blog/100vim-commands-every-programmershould-know#comment-166) Heres the list I created when learning vim: http://www.pixelbeat.org/vim.tips.html Reply (/blog/100-vim-commands-everyprogrammer-shouldknow?replytocom=166#respond)

12 of 49

11/23/2011 3:15 PM

100 Vim commands every programmer should know | CatsWhoCode.com

http://www.catswhocode.com/blog/100-vim-commands-every-programme...

jbj (http://www.lyxia.org) said: July 1, 2008 at 12:49 pm (http://www.catswhocode.com/blog/100vim-commands-every-programmershould-know#comment-167) Nice list Pdraig, thanks for sharing! Reply (/blog/100-vim-commands-everyprogrammer-shouldknow?replytocom=167#respond)

100vim WEB (http://www.ooso.net/du/?p=172) said: July 1, 2008 at 1:30 pm (http://www.catswhocode.com/blog/100vim-commands-every-programmershould-know#comment-168) [...] [...] Reply (/blog/100-vim-commands-everyprogrammer-shouldknow?replytocom=168#respond)

Aaron said: July 1, 2008 at 3:53 pm (http://www.catswhocode.com/blog/100vim-commands-every-programmershould-know#comment-170) @Bill Nano over VIM? I love VIM, mostly because of the syntax highlighting on the myriad of different file types as they are being edited, I can quickly spot any syntax typos I may have fat-fingered in. Thanks for sharing this. =] Reply (/blog/100-vim-commands-everyprogrammer-shouldknow?replytocom=170#respond)

13 of 49

11/23/2011 3:15 PM

100 Vim commands every programmer should know | CatsWhoCode.com

http://www.catswhocode.com/blog/100-vim-commands-every-programme...

dummy said: July 1, 2008 at 4:12 pm (http://www.catswhocode.com/blog/100vim-commands-every-programmershould-know#comment-172) I liked the :Sex part. Youll want if youre trying to peek at some other files. Reply (/blog/100-vim-commands-everyprogrammer-shouldknow?replytocom=172#respond)

Jan Slupski (http://juljas.net/) said: July 1, 2008 at 4:16 pm (http://www.catswhocode.com/blog/100vim-commands-every-programmershould-know#comment-173) s/Delete \zsall\ze white spaces/trailing/

Reply (/blog/100-vim-commands-everyprogrammer-shouldknow?replytocom=173#respond)

carl said: July 1, 2008 at 4:36 pm (http://www.catswhocode.com/blog/100vim-commands-every-programmershould-know#comment-175) what no mention of dot? (repeats the last edit you made) Its actually one of my favourite commands. Reply (/blog/100-vim-commands-everyprogrammer-shouldknow?replytocom=175#respond)

jbj (http://www.lyxia.org) said: July 1, 2008 at 4:45 pm (http://www.catswhocode.com/blog/100vim-commands-every-programmershould-know#comment-177) @carl: I didnt know that one! thanks for sharing. Reply (/blog/100-vim-commands-everyprogrammer-shouldknow?replytocom=177#respond)

14 of 49

11/23/2011 3:15 PM

100 Vim commands every programmer should know | CatsWhoCode.com

http://www.catswhocode.com/blog/100-vim-commands-every-programme...

stephen said: July 1, 2008 at 5:10 pm (http://www.catswhocode.com/blog/100vim-commands-every-programmershould-know#comment-178) Really love the t + char pattern For instance hi I am foo line with the cursor on the first , c+t+ gives you and leaves you in insert mode between the Reply (/blog/100-vim-commands-everyprogrammer-shouldknow?replytocom=178#respond)

Jan Slupski (http://juljas.net/) said: July 1, 2008 at 5:56 pm (http://www.catswhocode.com/blog/100vim-commands-every-programmershould-know#comment-180) I would probably add next dozen of my favorites, but at least some esp. useful for programmers: % jump to matching parenthesis =% indent the code between parenthesis [[ jump to function start [{ jump to block start * search the word under cursor :new abc.txt edit abc.txt in new window Reply (/blog/100-vim-commands-everyprogrammer-shouldknow?replytocom=180#respond)

15 of 49

11/23/2011 3:15 PM

100 Vim commands every programmer should know | CatsWhoCode.com

http://www.catswhocode.com/blog/100-vim-commands-every-programme...

new vim command =%, thank you. Reply (/blog/100-vim-commandsevery-programmer-shouldknow?replytocom=142271#respond)

jbj (http://www.lyxia.org) said: July 1, 2008 at 6:15 pm (http://www.catswhocode.com/blog/100vim-commands-every-programmershould-know#comment-181) @Jan: Great ones! I should think about creating a second list with all commands submitted by readers Reply (/blog/100-vim-commands-everyprogrammer-shouldknow?replytocom=181#respond)

Raffy (http://raffy.ch/blog) said: July 1, 2008 at 6:21 pm (http://www.catswhocode.com/blog/100vim-commands-every-programmershould-know#comment-182) I have some more things that you might find useful on my VIM (http://raffy.ch/projects /vim.html) site. Reply (/blog/100-vim-commands-everyprogrammer-shouldknow?replytocom=182#respond)

sileNT (http://wpkg.org) said: July 1, 2008 at 7:24 pm (http://www.catswhocode.com /blog/100-vim-commands-everyprogrammer-should-know#comment-184) And what does: :emacs do? Reply (/blog/100-vim-commands-everyprogrammer-shouldknow?replytocom=184#respond)

16 of 49

11/23/2011 3:15 PM

100 Vim commands every programmer should know | CatsWhoCode.com

http://www.catswhocode.com/blog/100-vim-commands-every-programme...

jbj (http://www.lyxia.org) said: July 1, 2008 at 7:40 pm (http://www.catswhocode.com/blog/100vim-commands-every-programmershould-know#comment-185) @Raffy: Excellent website! I havent the time to check it all, but I really liked what I saw. Reply (/blog/100-vim-commands-everyprogrammer-shouldknow?replytocom=185#respond)

Reid said: July 1, 2008 at 8:51 pm (http://www.catswhocode.com/blog/100vim-commands-every-programmershould-know#comment-186) ggguG is wrong, that makes the file lowercase. gggUG makes the file uppercase. However, why you should know this command combo over the separate commands gg, gu/U, and G, I dont know. Reply (/blog/100-vim-commands-everyprogrammer-shouldknow?replytocom=186#respond)

Erewhon (http://krzysztofglaz.eu.org) said: July 1, 2008 at 9:04 pm (http://www.catswhocode.com/blog/100vim-commands-every-programmershould-know#comment-187) Great list. Thanks. [:wq] Reply (/blog/100-vim-commands-everyprogrammer-shouldknow?replytocom=187#respond)

17 of 49

11/23/2011 3:15 PM

100 Vim commands every programmer should know | CatsWhoCode.com

http://www.catswhocode.com/blog/100-vim-commands-every-programme...

jbj (http://www.lyxia.org) said: July 1, 2008 at 9:05 pm (http://www.catswhocode.com/blog/100vim-commands-every-programmershould-know#comment-188) @Reid: Youre right. Sorry for the mistake! I just corrected it, thanks for telling me. Reply (/blog/100-vim-commands-everyprogrammer-shouldknow?replytocom=188#respond)

Alex said: July 2, 2008 at 3:54 am (http://www.catswhocode.com/blog/100vim-commands-every-programmershould-know#comment-193) gg=G indent all lines in the file shift-v curlybracket control-v shift i # escape adds #s in front of all of the lines in that chunk of code let @a=@* copies the contents of register a to the systemwide paste bin bufdo %s/something/somethingelse/g changes something to somethingelse in all the open buffers :tabnew opens a new tab Vim rocks. Reply (/blog/100-vim-commands-everyprogrammer-shouldknow?replytocom=193#respond)

ProjectX Blog Blog Archive Xlinks - 2 / 7 / 2008 (http://blog.projectxtech.com /2008/07/02/xlinks-2-7-2008/) said: July 2, 2008 at 4:07 am (http://www.catswhocode.com/blog/100vim-commands-every-programmershould-know#comment-194) [...] 100 vim commands every programmer should know: Ahh vi Editor of champions insane Added on 07/02/2008 at 01:35PM [...] Reply (/blog/100-vim-commands-everyprogrammer-shouldknow?replytocom=194#respond)

18 of 49

11/23/2011 3:15 PM

100 Vim commands every programmer should know | CatsWhoCode.com

http://www.catswhocode.com/blog/100-vim-commands-every-programme...

Skitzots Blog 100 Vim commands every programmer should know (http://www.skitzot.com/?p=9) said: July 2, 2008 at 6:27 am (http://www.catswhocode.com/blog/100vim-commands-every-programmershould-know#comment-195) [...] From: http://www.catswhocode.com /blog/web-development/100-vim-commandsevery-programmer-should-know-11 [...] Reply (/blog/100-vim-commands-everyprogrammer-shouldknow?replytocom=195#respond)

bobbydigital said: July 2, 2008 at 7:14 am (http://www.catswhocode.com/blog/100vim-commands-every-programmershould-know#comment-196) I find :Hex more useful than :Sex, even though I like sex :p Reply (/blog/100-vim-commands-everyprogrammer-shouldknow?replytocom=196#respond)

fiedor said: July 2, 2008 at 10:33 am (http://www.catswhocode.com/blog/100vim-commands-every-programmershould-know#comment-197) :%s/\r/\r/g Transform DOS carriage returns in returns doesnt miss anything here? replaces all x0d with x0d It simply

Reply (/blog/100-vim-commands-everyprogrammer-shouldknow?replytocom=197#respond)

links for 2008-07-03 My Weblog (http://greencrab.wordpress.com/2008/07 /02/links-for-2008-07-03/) said: July 3, 2008 at 6:30 am (http://www.catswhocode.com/blog/100vim-commands-every-programmershould-know#comment-202) [...] 100 Vim commands every programmer

19 of 49

11/23/2011 3:15 PM

100 Vim commands every programmer should know | CatsWhoCode.com

http://www.catswhocode.com/blog/100-vim-commands-every-programme...

should know (tags: linux) [...] Reply (/blog/100-vim-commands-everyprogrammer-shouldknow?replytocom=202#respond)

Wordpress How to: Customize OpenBook theme color scheme (http://www.catswhocode.com /blog/blogging/wordpress/wordpresshow-to-customize-openbook-theme-colorscheme-24) said: July 3, 2008 at 8:07 am (http://www.catswhocode.com/blog/100vim-commands-every-programmershould-know#comment-204) [...] Of course, you can manually edit OpenBook files to modify the color values, but having to change each value by hand is in my opinion, very boring. Happilly, Vi is here to help. For those who doesnt know, Vi (or Vim) is a powerful modal text editor. If you want to learn more aboout Vim, I recently posted an article about 100 very usefull Vim commands. [...] Reply (/blog/100-vim-commands-everyprogrammer-shouldknow?replytocom=204#respond)

shoban (http://www.crankup.net) said: July 3, 2008 at 8:49 am (http://www.catswhocode.com/blog/100vim-commands-every-programmershould-know#comment-206) Excellent list.. I have used vi.. but never realised it had so many commands. Reply (/blog/100-vim-commands-everyprogrammer-shouldknow?replytocom=206#respond)

20 of 49

11/23/2011 3:15 PM

100 Vim commands every programmer should know | CatsWhoCode.com

http://www.catswhocode.com/blog/100-vim-commands-every-programme...

jbj (http://www.lyxia.org) said: July 3, 2008 at 9:13 am (http://www.catswhocode.com/blog/100vim-commands-every-programmershould-know#comment-207) Thanks, shoban. Vi have much more commands than only theses ones Reply (/blog/100-vim-commands-everyprogrammer-shouldknow?replytocom=207#respond)

Bernhard said: July 3, 2008 at 4:27 pm (http://www.catswhocode.com/blog/100vim-commands-every-programmershould-know#comment-210) The pattern to get rid of d part of DOS line-feeds in an entire document is :%s/^M//g Where you must input the ^M pattern by holding down Ctrl while typing vm If you often exchange text files with Macs then this replacement comes in handy :%s/^M/\r/g Reply (/blog/100-vim-commands-everyprogrammer-shouldknow?replytocom=210#respond)

jbj (http://www.lyxia.org) said: July 3, 2008 at 4:50 pm (http://www.catswhocode.com/blog/100vim-commands-every-programmershould-know#comment-211) @Bernhard: Thank you for theses useful contributions! Reply (/blog/100-vim-commands-everyprogrammer-shouldknow?replytocom=211#respond)

links for 2008-07-03 that dismal science (http://dismalsci.wordpress.com/2008/07 /03/links-for-2008-07-03/) said: July 3, 2008 at 5:50 pm (http://www.catswhocode.com/blog/100vim-commands-every-programmer-

21 of 49

11/23/2011 3:15 PM

100 Vim commands every programmer should know | CatsWhoCode.com

http://www.catswhocode.com/blog/100-vim-commands-every-programme...

should-know#comment-212) [...] 100 Vim commands every programmer should know (tags: 2008 cheatsheet code vim vi unix development geek guide hacks programming reference resources technology text tools top100 toread tricks tutorial) [...] Reply (/blog/100-vim-commands-everyprogrammer-shouldknow?replytocom=212#respond)

its about time Blog Archive links for 2008-07-04 (http://timelady.com/blog/2008 /07/04/links-for-2008-07-04/) said: July 4, 2008 at 2:33 am (http://www.catswhocode.com/blog/100vim-commands-every-programmershould-know#comment-213) [...] 100 Vim commands every programmer should know Love My Vim. (tags: vim reference cheatsheet cli command editing editor vi guide geek howto shortcuts tutorial tricks useful commands) [...] Reply (/blog/100-vim-commands-everyprogrammer-shouldknow?replytocom=213#respond)

Kiril Minanov (http://minanov.com) said: July 5, 2008 at 9:22 pm (http://www.catswhocode.com/blog/100vim-commands-every-programmershould-know#comment-233) Very nice I would add set wrap and set nowrap commands. With those commands you can enable and disable text wrapping on vi editor Great work man Reply (/blog/100-vim-commands-everyprogrammer-shouldknow?replytocom=233#respond)

barf (http://none) said: July 5, 2008 at 10:08 pm (http://www.catswhocode.com /blog/100-vim-commands-every-

22 of 49

11/23/2011 3:15 PM

100 Vim commands every programmer should know | CatsWhoCode.com

http://www.catswhocode.com/blog/100-vim-commands-every-programme...

programmer-should-know#comment-235) and what about copy/paste? Reply (/blog/100-vim-commands-everyprogrammer-shouldknow?replytocom=235#respond)

jbj (http://www.lyxia.org) said: July 5, 2008 at 10:11 pm (http://www.catswhocode.com/blog/100vim-commands-every-programmershould-know#comment-236) Kiril, Im glad you liked the list! And thanks for submiting more commands! Reply (/blog/100-vim-commands-everyprogrammer-shouldknow?replytocom=236#respond)

jbj (http://www.lyxia.org) said: July 6, 2008 at 12:22 am (http://www.catswhocode.com/blog/100vim-commands-every-programmershould-know#comment-239) @barf: Youre right, I should have inclued at least basic copy/paste functions (y and p) Reply (/blog/100-vim-commands-everyprogrammer-shouldknow?replytocom=239#respond)

shopping cart (http://www.artologics.com/) said: July 15, 2008 at 2:27 pm (http://www.catswhocode.com/blog/100vim-commands-every-programmershould-know#comment-478) Hi, That is really a very useful list. Thanks for the list. Reply (/blog/100-vim-commands-everyprogrammer-shouldknow?replytocom=478#respond)

L'ineptocide said: July 30, 2008 at 9:26 am (http://www.catswhocode.com/blog/100-

23 of 49

11/23/2011 3:15 PM

100 Vim commands every programmer should know | CatsWhoCode.com

http://www.catswhocode.com/blog/100-vim-commands-every-programme...

vim-commands-every-programmershould-know#comment-928) Thanks, thats pretty usefull. But actually: ctrl-w_ maximize vertically and ctrl-w| maximize horizontally. Reply (/blog/100-vim-commands-everyprogrammer-shouldknow?replytocom=928#respond)

blog.masuran.org Blog Archive 100 Vim commands every programmer should know (http://blog.masuran.org/2008/07 /30/100-vim-commands-everyprogrammer-should-know/) said: July 30, 2008 at 9:35 am (http://www.catswhocode.com/blog/100vim-commands-every-programmershould-know#comment-929) [...] posibilities, super fast editing and looking cool as hell when other people see you work. Here are 100 Vim commands [every programmer] should [...] Reply (/blog/100-vim-commands-everyprogrammer-shouldknow?replytocom=929#respond)

Adolfssons blog Blog Archive Bookmarks for July 30, 2008 (http://adma7.org/2008/07/bookmarksfor-july-30-2008) said: July 30, 2008 at 2:04 pm (http://www.catswhocode.com /blog/100-vim-commands-everyprogrammer-should-know#comment-939) [...] 100 Vim commands every programmer should know Since the 70s, Vi is one of the programmers best friend. Nevermind youre new to Vi or not, heres a big list of 100 useful commands, organized by topic, which will make your coder life better. [...] Reply (/blog/100-vim-commands-everyprogrammer-shouldknow?replytocom=939#respond)

24 of 49

11/23/2011 3:15 PM

100 Vim commands every programmer should know | CatsWhoCode.com

http://www.catswhocode.com/blog/100-vim-commands-every-programme...

100 Vim commands every programmer should know : HowtoMatrix (http://howtomatrix.com/node/1904) said: July 30, 2008 at 5:22 pm (http://www.catswhocode.com/blog/100vim-commands-every-programmershould-know#comment-945) [...] Since the 70s, Vi is one of the programmers best friend. Nevermind youre new to Vi or not, heres a big list of 100 useful commands, organized by topic, which will make your coder life better. Read more at http://www.catswhocode.com/blog [...] Reply (/blog/100-vim-commands-everyprogrammer-shouldknow?replytocom=945#respond)

The best VIM command reference ever Markus Feilners Blog (http://mfeilner.wordpress.com/2008/07 /30/the-best-vim-command-referenceever/) said: July 30, 2008 at 8:58 pm (http://www.catswhocode.com/blog/100vim-commands-every-programmershould-know#comment-953) [...] The best VIM command reference ever Cats who code have published the ultimate and probably best ever list of vim commands. Go and get it here. [...] Reply (/blog/100-vim-commands-everyprogrammer-shouldknow?replytocom=953#respond)

25 of 49

11/23/2011 3:15 PM

100 Vim commands every programmer should know | CatsWhoCode.com

http://www.catswhocode.com/blog/100-vim-commands-every-programme...

Apurv said: August 1, 2008 at 8:13 am (http://www.catswhocode.com/blog/100vim-commands-every-programmershould-know#comment-1001) Wonderful list I must say specially the Explorer commands. I have been using vi for a long time but didnt know. Thanks a lot. Reply (/blog/100-vim-commands-everyprogrammer-shouldknow?replytocom=1001#respond)

Steve (http://spf13.com) said: August 13, 2008 at 4:09 pm (http://www.catswhocode.com/blog/100vim-commands-every-programmershould-know#comment-1419) I have posted a customize vim guide which can be found here Customizing Vim (http://spf13.com/content/my-customvimrc-file-vim) . It goes the next step beyond usage, which is customizing VIM for a better experience. Reply (/blog/100-vim-commands-everyprogrammer-shouldknow?replytocom=1419#respond)

aXine~D (http://www.kremlin.ru/) said: August 26, 2008 at 5:31 pm (http://www.catswhocode.com/blog/100vim-commands-every-programmershould-know#comment-1937) vim is the best editor Ive ever used. Thanks for this really usefull list. Reply (/blog/100-vim-commands-everyprogrammer-shouldknow?replytocom=1937#respond)

Jamie Souef (http://jamielesouef.com) said: August 30, 2008 at 7:34 am (http://www.catswhocode.com/blog/100vim-commands-every-programmershould-know#comment-2061) i cant stand vi.. but one of the servers i

26 of 49

11/23/2011 3:15 PM

100 Vim commands every programmer should know | CatsWhoCode.com

http://www.catswhocode.com/blog/100-vim-commands-every-programme...

manage doesnt have anything else on it so its all i can use. Thanks for the list, would you mind if i re-blogged this over at my blog? (linking to the source natural) Reply (/blog/100-vim-commands-everyprogrammer-shouldknow?replytocom=2061#respond)

jbj (http://www.lyxia.org) said: August 30, 2008 at 8:34 am (http://www.catswhocode.com/blog/100vim-commands-every-programmershould-know#comment-2067) @Jamie: No problem! Reply (/blog/100-vim-commands-everyprogrammer-shouldknow?replytocom=2067#respond)

sudha said: September 1, 2008 at 8:16 am (http://www.catswhocode.com/blog/100vim-commands-every-programmershould-know#comment-2492) Great BLog. I am taking a print of this. Thanks 4 sharing it on web. Reply (/blog/100-vim-commands-everyprogrammer-shouldknow?replytocom=2492#respond)

Suganthi (http://sugahere.blogspot.com) said: September 5, 2008 at 8:16 am (http://www.catswhocode.com/blog/100vim-commands-every-programmershould-know#comment-5172) Very useful. It will come handy when searching for Commands Reply (/blog/100-vim-commands-everyprogrammer-shouldknow?replytocom=5172#respond)

CTS (http://www.cts-media.eu) said: October 8, 2008 at 8:41 pm (http://www.catswhocode.com/blog/100vim-commands-every-programmershould-know#comment-10480)

27 of 49

11/23/2011 3:15 PM

100 Vim commands every programmer should know | CatsWhoCode.com

http://www.catswhocode.com/blog/100-vim-commands-every-programme...

Thanks for my new bookmark! One of the best commands is certainly ggVGg? Reply (/blog/100-vim-commands-everyprogrammer-shouldknow?replytocom=10480#respond)

debil said: November 2, 2008 at 11:19 am (http://www.catswhocode.com/blog/100vim-commands-every-programmershould-know#comment-12355) Good list. BTW, you can rot13 whole buffer also with ggg?G. No need for V, one step less Reply (/blog/100-vim-commands-everyprogrammer-shouldknow?replytocom=12355#respond)

debil said: November 2, 2008 at 11:55 am (http://www.catswhocode.com/blog/100vim-commands-every-programmershould-know#comment-12356) Digraphs are a great feature in Vim. To type a special character, hit ctrl-k in insert mode and type two-character code. Check out the list of availale characters with :digraphs. Reply (/blog/100-vim-commands-everyprogrammer-shouldknow?replytocom=12356#respond)

28 of 49

11/23/2011 3:15 PM

100 Vim commands every programmer should know | CatsWhoCode.com

http://www.catswhocode.com/blog/100-vim-commands-every-programme...

/* */ vim tips (http://ptaxotep.wordpress.com/2008/11 /04/vim/) said: November 4, 2008 at 10:51 pm (http://www.catswhocode.com /blog/100-vim-commands-everyprogrammer-should-know#comment12520) [...] : 100 vim commands every programmer should know [...] Reply (/blog/100-vim-commands-everyprogrammer-shouldknow?replytocom=12520#respond)

proft.com.ua Blog Archive Vim ! (http://www.proft.com.ua/vim-nashe-vse/) said: November 20, 2008 at 2:30 am (http://www.catswhocode.com/blog/100vim-commands-every-programmershould-know#comment-13421) [...] 100 Vim commands every programmer should know [...] Reply (/blog/100-vim-commands-everyprogrammer-shouldknow?replytocom=13421#respond)

<will-bloggs-too> Blog Archive useful vim commands (http://willsani.com /2009/01/04/useful-vim-commands/) said: January 5, 2009 at 7:14 am (http://www.catswhocode.com/blog/100vim-commands-every-programmershould-know#comment-16761) [...] This is a nice reference. [...] Reply (/blog/100-vim-commands-everyprogrammer-shouldknow?replytocom=16761#respond)

www.redips.net (http://www.redips.net/) said: January 5, 2009 at 12:34 pm (http://www.catswhocode.com/blog/100vim-commands-every-programmer-

29 of 49

11/23/2011 3:15 PM

100 Vim commands every programmer should know | CatsWhoCode.com

http://www.catswhocode.com/blog/100-vim-commands-every-programme...

should-know#comment-16782) This was very useful. I searched for command to convert text to lower case and I found it here. You can also set all text to the upper case with gggUG. Cheers! Reply (/blog/100-vim-commands-everyprogrammer-shouldknow?replytocom=16782#respond)

S A P O R R A ! ! ! Blog Archive Linux > Nerd > VIM, vi e venci (http://saporra.com.br/2009/01/linuxnerd-vim-vi-e-venci/) said: January 15, 2009 at 1:50 am (http://www.catswhocode.com/blog/100vim-commands-every-programmershould-know#comment-17502) [...] Para quem usa muito o VIM, 100 comando teis esto nesse site. [...] Reply (/blog/100-vim-commands-everyprogrammer-shouldknow?replytocom=17502#respond)

[OT] 100 przydatnych komend vim-a | hilpers (http://www.hilpers.pl/463924ot-100-przydatnych-komend-vim) said: January 18, 2009 at 5:25 pm (http://www.catswhocode.com/blog/100vim-commands-every-programmershould-know#comment-17745) [...] list Reply (/blog/100-vim-commands-everyprogrammer-shouldknow?replytocom=17745#respond)

TuxZ 100 comandos do VIM que todo programador deveria saber (http://www.tuxz.com.br/2009/01/22/100comandos-do-vim-que-todo-programadordeveria-saber/) said: January 22, 2009 at 10:29 pm (http://www.catswhocode.com /blog/100-vim-commands-everyprogrammer-should-know#comment18024) [...] Fonte: http://www.catswhocode.com

30 of 49

11/23/2011 3:15 PM

100 Vim commands every programmer should know | CatsWhoCode.com

http://www.catswhocode.com/blog/100-vim-commands-every-programme...

/blog/100-vim-commands-everyprogrammer-should-know [...] Reply (/blog/100-vim-commands-everyprogrammer-shouldknow?replytocom=18024#respond)

[Dica] VI - 100 Comandos (http://ubuntugeek.com.br/?p=53) said: January 25, 2009 at 8:09 pm (http://www.catswhocode.com/blog/100vim-commands-every-programmershould-know#comment-18348) [...] Para quem usa muito o VIM, 100 comando teis esto nesse site. [...] Reply (/blog/100-vim-commands-everyprogrammer-shouldknow?replytocom=18348#respond)

Tim (http://gurka.se/) said: January 28, 2009 at 3:13 pm (http://www.catswhocode.com/blog/100vim-commands-every-programmershould-know#comment-18681) Very helpful. Thanks! Reply (/blog/100-vim-commands-everyprogrammer-shouldknow?replytocom=18681#respond)

31 of 49

11/23/2011 3:15 PM

100 Vim commands every programmer should know | CatsWhoCode.com

http://www.catswhocode.com/blog/100-vim-commands-every-programme...

Jake Ache (http://superobscure.com) said: February 1, 2009 at 3:04 pm (http://www.catswhocode.com/blog/100vim-commands-every-programmershould-know#comment-18940) Let me be the next to say: this is a very nice list. I love vi (and vim, too) and there were several tricks that I didnt know about on the list. Thanks for posting. (I came in via Hacker News) Reply (/blog/100-vim-commands-everyprogrammer-shouldknow?replytocom=18940#respond)

alexandru said: February 1, 2009 at 6:08 pm (http://www.catswhocode.com /blog/100-vim-commands-everyprogrammer-should-know#comment18952) every once in a while I see a cheat sheet of vi(m) commands. unfortunately most of them forget to teach the basics: motion. for example: ggguG is not a random key combination (as begginers tend to believe), its gg (goes to begin of file), gu changes to lowercase, G goes to end of file. so long, alexandru Reply (/blog/100-vim-commands-everyprogrammer-shouldknow?replytocom=18952#respond)

32 of 49

11/23/2011 3:15 PM

100 Vim commands every programmer should know | CatsWhoCode.com

http://www.catswhocode.com/blog/100-vim-commands-every-programme...

should-know#comment-147302) Thanks for that. Makes sense now. Reply (/blog/100-vim-commandsevery-programmer-shouldknow?replytocom=147302#respond)

Basque said: February 1, 2009 at 11:15 pm (http://www.catswhocode.com/blog/100vim-commands-every-programmershould-know#comment-18966) Im almost newbie in the church of Vim and Im enjoining it by learning new things every day. Nice post. Thanks. Reply (/blog/100-vim-commands-everyprogrammer-shouldknow?replytocom=18966#respond)

Pascal (http://www.it-blog.net) said: February 1, 2009 at 11:41 pm (http://www.catswhocode.com/blog/100vim-commands-every-programmershould-know#comment-18967) Thank you so much for this command list. Its very helpful! Regards, Pascal Reply (/blog/100-vim-commands-everyprogrammer-shouldknow?replytocom=18967#respond)

links for 2009-02-02 jasonmcdermott.net (http://jasonmcdermott.wordpress.com /2009/02/02/links-for-2009-02-02/) said: February 2, 2009 at 2:02 pm (http://www.catswhocode.com/blog/100vim-commands-every-programmershould-know#comment-18992) [...] 100 Vim commands every programmer should know heres a big list of 100 useful commands, organized by topic, which

33 of 49

11/23/2011 3:15 PM

100 Vim commands every programmer should know | CatsWhoCode.com

http://www.catswhocode.com/blog/100-vim-commands-every-programme...

will make your coder life better. (tags: code programming) [...] Reply (/blog/100-vim-commands-everyprogrammer-shouldknow?replytocom=18992#respond)

Azones Blog 100 Vim commands every programmer should know (http://www.firestudio.cn/2009/02 /04/83.html) said: February 4, 2009 at 5:07 am (http://www.catswhocode.com /blog/100-vim-commands-everyprogrammer-should-know#comment19117) [...] http://www.catswhocode.com /blog/100-vim-commands-everyprogrammer-should-know [...] Reply (/blog/100-vim-commands-everyprogrammer-shouldknow?replytocom=19117#respond)

Kedar Mhaswade said: February 10, 2009 at 8:02 pm (http://www.catswhocode.com /blog/100-vim-commands-everyprogrammer-should-know#comment19637) Since the 70s, Vi is one of the programmers best friends, not friend. Reply (/blog/100-vim-commands-everyprogrammer-shouldknow?replytocom=19637#respond)

grgfg said: February 19, 2009 at 4:54 pm (http://www.catswhocode.com/blog/100vim-commands-every-programmershould-know#comment-20236) Vim is sh it. How many command u MUST know for ONLY editing? Commands like: %$#%$#% 4354 543543543543 54rt5^%$^%$^$ ^%$ for change some words?! BULLSHIT! Reply (/blog/100-vim-commands-every-

34 of 49

11/23/2011 3:15 PM

100 Vim commands every programmer should know | CatsWhoCode.com

http://www.catswhocode.com/blog/100-vim-commands-every-programme...

programmer-shouldknow?replytocom=20236#respond)

35 of 49

11/23/2011 3:15 PM

100 Vim commands every programmer should know | CatsWhoCode.com

http://www.catswhocode.com/blog/100-vim-commands-every-programme...

lines of toolbars with pictures of who knows what meaning god knows what. There are no more vi commands than there are conceptual needs. And, at least, when you learn concepts, they can have a logical flow, and they can be built upon with a logical continuity. Not really so for clickable blocks with pictures on them. If you gave vi a chance, you would find a real beauty in its design. And would come to appreciate it for what it can do for you. But, sadly it is not for those too impatient to pay the dues to get there. Reply (/blog/100-vim-commandsevery-programmer-shouldknow?replytocom=147306#respond)

(http://www.fofo-vb.com/vb) said: February 28, 2009 at 3:02 pm (http://www.catswhocode.com/blog/100vim-commands-every-programmershould-know#comment-20795) Im almost newbie in the church of Vim and Im enjoining it by learning new things every day. Reply (/blog/100-vim-commands-everyprogrammer-shouldknow?replytocom=20795#respond)

36 of 49

11/23/2011 3:15 PM

100 Vim commands every programmer should know | CatsWhoCode.com

http://www.catswhocode.com/blog/100-vim-commands-every-programme...

We programmers (http://web.bizbangladesh.com /website_design_development.html) said: March 5, 2009 at 8:51 am (http://www.catswhocode.com/blog/100vim-commands-every-programmershould-know#comment-21209) Great list. i print it. Really useful for programmers. Thanks for sharing this information Reply (/blog/100-vim-commands-everyprogrammer-shouldknow?replytocom=21209#respond)

Danilo De Martin said: March 8, 2009 at 11:50 am (http://www.catswhocode.com /blog/100-vim-commands-everyprogrammer-should-know#comment21496) :%s/old/new/gw Replace all occurences with confirmation I think the right way is :%s/old/new/gc Great list. Thanks Jean-Baptiste. Danilo De Martin Reply (/blog/100-vim-commands-everyprogrammer-shouldknow?replytocom=21496#respond)

37 of 49

11/23/2011 3:15 PM

100 Vim commands every programmer should know | CatsWhoCode.com

http://www.catswhocode.com/blog/100-vim-commands-every-programme...

10 code snippets to interact with Twitter Doeasyway (http://www.doeasyway.com/archives/23) said: September 24, 2009 at 9:16 am (http://www.catswhocode.com/blog/100vim-commands-every-programmershould-know#comment-45767) [...] The Vim editor is one of the most powerful and complete text editor available. This command, allowing you to update your Twitter status, is just one more proof. Oh and dont forget to check out our list of 100 Vim commands that every developer should know [...] Reply (/blog/100-vim-commands-everyprogrammer-shouldknow?replytocom=45767#respond)

vim or not vim? thats the question. all-IT (http://www.k-oo.de/blog/2009/09 /30/vim-or-not-vim-thats-the-question/) said: September 30, 2009 at 8:09 am (http://www.catswhocode.com/blog/100vim-commands-every-programmershould-know#comment-46728) [...] habe gerade einen Artikel ber die 100 vim Befehle gelesen, die jeder Programmierer kennen sollte. Den vim (Vi IMproved) habe ich hier im Blog schon [...] Reply (/blog/100-vim-commands-everyprogrammer-shouldknow?replytocom=46728#respond)

10 code snippets to interact with Twitter | Cosmos Blog -- Internet News,Life,Culture,Polices,Resource,Make Money (http://www.cosmos-blog.com /10-code-snippets-to-interact-with-twitter) said: October 6, 2009 at 5:56 am (http://www.catswhocode.com/blog/100vim-commands-every-programmershould-know#comment-47464) [...] The Vim editor is one of the most powerful and complete text editor available. This command, allowing you to update your Twitter status, is just one more proof. Oh and dont forget to check out our list of 100

38 of 49

11/23/2011 3:15 PM

100 Vim commands every programmer should know | CatsWhoCode.com

http://www.catswhocode.com/blog/100-vim-commands-every-programme...

Vim commands that every developer should know [...] Reply (/blog/100-vim-commands-everyprogrammer-shouldknow?replytocom=47464#respond)

10+ WordPress plugins for developers | eBookTM | Download eBook, Wordpress Tips (http://www.ebooktm.com/website /wordpress/10-wordpress-pluginsfor-developers.html) said: October 24, 2009 at 3:53 pm (http://www.catswhocode.com/blog/100vim-commands-every-programmershould-know#comment-50105) [...] module of the same name, Vimcolor highlights your code in many different formats. VIM is a common programmers text editor for (usually) unix based systems. Out of the box VIM can color [...] Reply (/blog/100-vim-commands-everyprogrammer-shouldknow?replytocom=50105#respond)

10 code snippets to interact with Twitter | meshdairy (http://meshdiary.co.cc/?p=65) said: October 29, 2009 at 9:09 am (http://www.catswhocode.com/blog/100vim-commands-every-programmershould-know#comment-51100) [...] The Vim editor is one of the most powerful and complete text editor available. This command, allowing you to update your Twitter status, is just one more proof. Oh and dont forget to check out our list of 100 Vim commands that every developer should know [...] Reply (/blog/100-vim-commands-everyprogrammer-shouldknow?replytocom=51100#respond)

Sean (endersyrinx) 's status on Friday, 30-Oct-09 19:04:08 UTC - Identi.ca (http://identi.ca/notice/13339340) said: October 30, 2009 at 9:04 pm

39 of 49

11/23/2011 3:15 PM

100 Vim commands every programmer should know | CatsWhoCode.com

http://www.catswhocode.com/blog/100-vim-commands-every-programme...

(http://www.catswhocode.com/blog/100vim-commands-every-programmershould-know#comment-51390) [...] "100 Vim commands every programmer should know" http://www.catswhocode.com /blog/100-vim-commands-everyprogrammer-should-know [...] Reply (/blog/100-vim-commands-everyprogrammer-shouldknow?replytocom=51390#respond)

Maryam said: December 29, 2009 at 7:48 pm (http://www.catswhocode.com /blog/100-vim-commands-everyprogrammer-should-know#comment62120) Hi. your blog was very useful to me. Ive just started to learn linux and Vi. I found it much enjoyable and interesting. Your list can help me so much. truly yours, Thank you. Reply (/blog/100-vim-commands-everyprogrammer-shouldknow?replytocom=62120#respond)

Read This Link 100 Vim commands every programmer should know (http://readthislink.com /6950/100_vim_commands_every_programmer_should_know.htm said: January 10, 2010 at 2:51 am (http://www.catswhocode.com/blog/100vim-commands-every-programmershould-know#comment-63859) [...] 100 Vim commands every programmer should know [...] Reply (/blog/100-vim-commands-everyprogrammer-shouldknow?replytocom=63859#respond)

valtert said: February 21, 2010 at 9:37 pm (http://www.catswhocode.com/blog/100vim-commands-every-programmershould-know#comment-69214) /\cstring -> find SRING or string (case

40 of 49

11/23/2011 3:15 PM

100 Vim commands every programmer should know | CatsWhoCode.com

http://www.catswhocode.com/blog/100-vim-commands-every-programme...

insensitive) Reply (/blog/100-vim-commands-everyprogrammer-shouldknow?replytocom=69214#respond)

Josay said: March 5, 2010 at 1:46 pm (http://www.catswhocode.com/blog/100vim-commands-every-programmershould-know#comment-70753) :w! Exit Vim without saving Isnt the ! used to force the saving? Mixed up with :q! Reply (/blog/100-vim-commands-everyprogrammer-shouldknow?replytocom=70753#respond)

Nick said: May 3, 2010 at 3:20 pm (http://www.catswhocode.com/blog/100vim-commands-every-programmershould-know#comment-80959) There would be nice if your website had a PRINT button. nice list Thank you Reply (/blog/100-vim-commands-everyprogrammer-shouldknow?replytocom=80959#respond)

santosh mishra said: May 5, 2010 at 4:52 am (http://www.catswhocode.com /blog/100-vim-commands-everyprogrammer-should-know#comment81223) It is really good collection . but i want to know that where i can open a new tab in a file with diffrent file location ? Reply (/blog/100-vim-commands-everyprogrammer-shouldknow?replytocom=81223#respond)

ricky (http://rickydoesit.com) said: May

41 of 49

11/23/2011 3:15 PM

100 Vim commands every programmer should know | CatsWhoCode.com

http://www.catswhocode.com/blog/100-vim-commands-every-programme...

26, 2010 at 3:17 am (http://www.catswhocode.com/blog/100vim-commands-every-programmershould-know#comment-84480) You need to add the shortcuts for how to move to the next file once you have the file browser open in the CLI using :e . command. Its impossible for us to know Reply (/blog/100-vim-commands-everyprogrammer-shouldknow?replytocom=84480#respond)

ChrisR said: May 28, 2010 at 10:14 am (http://www.catswhocode.com/blog/100vim-commands-every-programmershould-know#comment-84845) I didnt see my all-time favorite commandthe one that keeps me from moving to any other editor, the period . command. It redoes the last command. I use it all the time. Reply (/blog/100-vim-commands-everyprogrammer-shouldknow?replytocom=84845#respond)

Arun said: May 31, 2010 at 3:22 am (http://www.catswhocode.com/blog/100vim-commands-every-programmershould-know#comment-85267) Hi..is there any command for searching a string in between two line numbers. Say, I want to search a string develop in between line numbers 10 and 100..Please help.. Reply (/blog/100-vim-commands-everyprogrammer-shouldknow?replytocom=85267#respond)

42 of 49

11/23/2011 3:15 PM

100 Vim commands every programmer should know | CatsWhoCode.com

http://www.catswhocode.com/blog/100-vim-commands-every-programme...

every-programmer-shouldknow#comment-86366) @Arun, put these lines in your .vimrc set incsearch find as you type search set hlsearch highlight search terms set ignorecase case insensitive search set number turns on line numbering then Id simply10G (Goto line 10) hit /string and it will jump to the next occurrence of string (with all others highlighted) you can use n to jump to the (n)ext occurrence until the line numbers show youre at or past line 100. Then :noh highlighting. removes the

Reply (/blog/100-vim-commandsevery-programmer-shouldknow?replytocom=86366#respond)

Guillermo Amaral (http://webbaverse.com/) said: September 27, 2010 at 3:07 am (http://www.catswhocode.com/blog/100vim-commands-every-programmershould-know#comment-107907) I think you have :w! as exit without saving, but Im sure that is force save. :q! should close without saving and :qa! exit without saving (if more than one buffer is open) Cheers Reply (/blog/100-vim-commands-everyprogrammer-shouldknow?replytocom=107907#respond)

43 of 49

11/23/2011 3:15 PM

100 Vim commands every programmer should know | CatsWhoCode.com

http://www.catswhocode.com/blog/100-vim-commands-every-programme...

18, 2010 at 9:50 am (http://www.catswhocode.com /blog/100-vim-commands-everyprogrammer-shouldknow#comment-142613) @GAmaral is right. Close w/o save is :q! :w! will overwrite a write-protected file without asking! Please fix this before some newbie has a HORRIBLE experience! Reply (/blog/100-vim-commandsevery-programmer-shouldknow?replytocom=142613#respond)

will

write-

44 of 49

11/23/2011 3:15 PM

100 Vim commands every programmer should know | CatsWhoCode.com

http://www.catswhocode.com/blog/100-vim-commands-every-programme...

normal user wont be able to force-write over /etc/passwd since they cant change the permissions on the file. Reply (/blog/100-vim-commandsevery-programmer-shouldknow?replytocom=142897#respond)

Paul said: November 17, 2010 at 6:31 pm (http://www.catswhocode.com/blog/100vim-commands-every-programmershould-know#comment-142057) How do I do this command in your list: dk Delete all until mark k ? wheres the TM button? Reply (/blog/100-vim-commands-everyprogrammer-shouldknow?replytocom=142057#respond)

45 of 49

11/23/2011 3:15 PM

100 Vim commands every programmer should know | CatsWhoCode.com

http://www.catswhocode.com/blog/100-vim-commands-every-programme...

(if you want to delete whole lines) or the backwards apostrophe (to delete chars) 3. the letter of the mark Reply (/blog/100-vim-commandsevery-programmer-shouldknow?replytocom=142607#respond)

Dan said: December 4, 2010 at 1:36 pm (http://www.catswhocode.com/blog/100vim-commands-every-programmershould-know#comment-155790) Great List! Thank you. Using gg=G to indent the whole file is very nice, but afterwords the cursor is allways in the first line. Is there any way I can indent the whole file and still stay in the line I am currently in? If anyone knows a nmap or something to solve this, Id be very interested! Thanks Reply (/blog/100-vim-commands-everyprogrammer-shouldknow?replytocom=155790#respond)

46 of 49

11/23/2011 3:15 PM

100 Vim commands every programmer should know | CatsWhoCode.com

http://www.catswhocode.com/blog/100-vim-commands-every-programme...

or may not be quite what youre looking for: gi will take you back to point of last editing and leave you in insert mode which, assuming your had just completed an edit prior to whole of file indenting, would bring you back to the line you were currently in. Reply (/blog/100-vim-commandsevery-programmer-shouldknow?replytocom=158189#respond)

steve said: March 29, 2011 at 5:06 am (http://www.catswhocode.com /blog/100-vim-commands-everyprogrammer-shouldknow#comment-303033) marks will also do what you want (sorry it took me a while to remember) In normal mode type mx (where x is any letter you want e.g. ma). Later either `a or a will return you to the line (`a backtick+a takes you to the exact position, +a takes you to the beginning of line). Reply (/blog/100-vim-commandsevery-programmer-shouldknow?replytocom=303033#respond)

Daniel said: January 4, 2011 at 2:18 pm (http://www.catswhocode.com/blog/100vim-commands-every-programmershould-know#comment-191949) Not sure if it was mentioned, but hitting J will move the next line to the end of the current line. I find it useful sometimes when coding. Reply (/blog/100-vim-commands-everyprogrammer-shouldknow?replytocom=191949#respond)

47 of 49

11/23/2011 3:15 PM

100 Vim commands every programmer should know | CatsWhoCode.com

http://www.catswhocode.com/blog/100-vim-commands-every-programme...

Markandey Singh (http://www.markandey.com) said: March 28, 2011 at 1:34 am (http://www.catswhocode.com/blog/100vim-commands-every-programmershould-know#comment-301078) AWESOME Thanks man! Reply (/blog/100-vim-commands-everyprogrammer-shouldknow?replytocom=301078#respond)

Leandro (http://www.leandrouti.net) said: June 11, 2011 at 11:12 pm (http://www.catswhocode.com/blog/100vim-commands-every-programmershould-know#comment-388410) Nice article. Started to use VIM very long ago, but just to edit some basic files. Just open, press i and modify some text and then press ESC and wq =) Recently can see the power of the vim! Your list is very useful for me. Thanks Reply (/blog/100-vim-commands-everyprogrammer-shouldknow?replytocom=388410#respond)

2husher said: August 12, 2011 at 7:48 am (http://www.catswhocode.com/blog/100vim-commands-every-programmershould-know#comment-461252) You made a mistake in one of the most important command. To exit Vi without saving you must type :q! If you type :w! as in your post, you simply save changes to the file. Correct it please. Reply (/blog/100-vim-commands-everyprogrammer-shouldknow?replytocom=461252#respond)

48 of 49

11/23/2011 3:15 PM

100 Vim commands every programmer should know | CatsWhoCode.com

http://www.catswhocode.com/blog/100-vim-commands-every-programme...

trong.tran said: November 1, 2011 at 1:46 am (http://www.catswhocode.com /blog/100-vim-commands-everyprogrammer-should-know#comment539002) How can :w! quit vim without saving file? The command should be `:q!` Reply (/blog/100-vim-commands-everyprogrammer-shouldknow?replytocom=539002#respond)

Leave a Reply
Your email address will not be published. Required fields are marked * Name *

Email *

Website

Comment

Please respect the following rules: No advertising, no spam, no keyword in name field. Thank you!

Notify me of followup comments via e-mail

49 of 49

11/23/2011 3:15 PM

Vous aimerez peut-être aussi