View Full Version : CHEAT SHEET: vim
TimL
February 3rd, 2006, 08:16 PM
Hi,
I've just recently created a vim cheat sheet (in PDF format) to help me keep track of all the commands that there are available in this editor. I just thought I'd share it with anyone here who may find vim a bit daunting or just difficult to use!
You can get a copy here: http://www.tjl2.com/sysadmin/vim-cheat-sheet.html
Let me know if you find any errors or typos in it (I think I've found them all).
Cheers,
Tim
sunwave
February 6th, 2006, 05:26 AM
hi !
very useful - thanks a lot!
:cool:
TimL
February 8th, 2006, 02:59 PM
Glad you like it.
I was hoping to include info about the macro/command recording functionality of vim, but I couldn't get it to work properly following the instructions I'd got down!
maulattu
February 8th, 2006, 04:14 PM
Nice one :)
void_false
February 8th, 2006, 04:22 PM
Of course it is an excelent job but what I miss is how to compile and execute program with vim. :(
endersshadow
February 8th, 2006, 04:33 PM
You forgot a very important one!
:set nu! = show line numbers
Otherwise, fantastic quick ref!
Quirky
February 8th, 2006, 04:36 PM
:make
That compiles things. I have it mapped to F5, with mappings to jump the the next and previous errors. Similarly for :grep.
I also recommend reading ":help completion" and adding the CleverTab function to your ~/.vimrc - Tab then "autocompletes" things (variable names, functions, etc). Also, don't forget to use ctags. g] is a life saver when you have to maintain someone else's spaghetti code.
Koybe
February 8th, 2006, 05:05 PM
Nice one! I also get it.
Caboto
February 9th, 2006, 01:49 PM
:make
That compiles things. I have it mapped to F5, with mappings to jump the the next and previous errors. Similarly for :grep.
I also recommend reading ":help completion" and adding the CleverTab function to your ~/.vimrc - Tab then "autocompletes" things (variable names, functions, etc). Also, don't forget to use ctags. g] is a life saver when you have to maintain someone else's spaghetti code.
Very nice guide... Will be a great guide for me.
I'm not yet into vim, but is there a file, where the mapped keys are stored? Would be great, to have a configured vim and some examples of mapped keys.
matthew
February 9th, 2006, 01:56 PM
Thank you!
void_false
February 9th, 2006, 06:26 PM
If I type :make then I get
make: *** No targets specified and no makefile found. Stop.
Hit ENTER or type command to continue
I want to know how to preform "g++ myfile.cpp" and "./a.out" from vim's command line.
caffinide
February 9th, 2006, 11:19 PM
awesome
marcw
February 9th, 2006, 11:44 PM
I've just recently created a vim cheat sheet (in PDF format) to help me keep track of all the commands that there are available in this editor. I just thought I'd share it with anyone here who may find vim a bit daunting or just difficult to use!
Tim
Very nice. Thanks!
(now if I could only find something similar for awk and sed...)
Quirky
February 10th, 2006, 11:53 AM
If I type :make then I get
make: *** No targets specified and no makefile found. Stop.
Hit ENTER or type command to continue
I want to know how to preform "g++ myfile.cpp" and "./a.out" from vim's command line.
That's because you have no Makefile. For really basic compilation, you can just do this:
:!g++ myfile.cpp
:!./a.out
You ought to use a Makefile, since it is easier in the long run. The vim combination :! calls an external program but doesn't capture the output, unlike the built in :make command.
NeTo
February 10th, 2006, 02:13 PM
The cheat sheet is excellent! Thank you TimL! Now I can feel confident while using vim :KS
void_false
February 10th, 2006, 02:32 PM
Quirky
OMG thanks a lot! That is the thing that I missed so much! :-D
TimL
March 6th, 2006, 06:16 PM
Thanks for the kind comments! I didn't realise there had been this many responses to this thread, as I haven't been getting the email notifications.
endersshadow - thanks for the ':set nu' advice, I didn't know about that one! I've just added it in and it'll be uploaded in the next few minutes.
Cheers,
Tim
rayburn
March 6th, 2006, 07:00 PM
Just downloaded pdf, very good, many thanks!
IYY
March 6th, 2006, 07:48 PM
Very nice. How about you post the source of that PDF too? (Tex? OO?)
TimL
March 7th, 2006, 04:59 PM
Very nice. How about you post the source of that PDF too? (Tex? OO?)
Nice idea. I've added a link to the OpenOffice Draw .odg source file on the page now. http://tjl2.com/sysadmin/vim-cheat-sheet.html
I've also licensed it under the Creative Commons Attribution2.5 License so that people know they can freely make changes to it.
Cheers,
Tim
IYY
March 7th, 2006, 05:42 PM
Thanks!
sapo
March 12th, 2006, 11:35 AM
Very nice, i was looking for a good one and now i found it! :mrgreen:
thanx a lot!
TimL
March 12th, 2006, 08:08 PM
Hi all,
Just a quick update: if you have bookmarked the link to my vim cheat sheet page at tjl2.com/sysadmin/personal.html#vim, please update your bookmark to http://tjl2.com/sysadmin/vim-cheat-sheet.html
I thought my pages were getting a bit long, so I've started restructuring my site a bit. The link to the #vim anchor still works and will do for a while, but there doesn't seem to be a way to make mod_rewrite handle page anchors (I think they are just handled by the browser once the page has loaded), so I will eventually have to break that link.
If you have just bookmarked the PDF, that will still work.
Cheers,
Tim
vBulletin® v3.8.7, Copyright ©2000-2012, vBulletin Solutions, Inc.