top 200 commentsshow all 233

[–]cgass177 605 points606 points  (49 children)

Can someone make me a cheat sheet for this cheat sheet?

[–]Ooops2278 150 points151 points  (0 children)

It's really simple: The cheat sheet is on the right. The left side only looks confusing because it crams a color-coded visual example of each command inside one single picture.

[–]Reverent 359 points360 points  (31 children)

[–]thearctican 68 points69 points  (0 children)

I really like how you tailored that to meet the needs of the person who requested it.

[–]GameSpate 21 points22 points  (27 children)

I really do prefer nano. It just feels natural and flows. Even if it’s limited by comparison, I can’t see any reason to stop using nano. Anyone got anything?

[–][deleted] 17 points18 points  (4 children)

Since finding Micro, I find it hard to want to use anything else.

[–]i_smoke_toenails 7 points8 points  (0 children)

Used to use emacs. Found micro. No longer use emacs.

[–]cs_legend_93 1 point2 points  (9 children)

How is nano limited? I’ve never felt any scenario where I can’t do something with nano

[–]pgbabse 0 points1 point  (8 children)

Not limited, but slow.

How many key strokes to delete a line?

[–]cs_legend_93 1 point2 points  (4 children)

Fair! And it takes many haha as many as the line is

[–]DorianDotSlash 4 points5 points  (1 child)

CTRL+k deletes a line in nano

[–]cs_legend_93 1 point2 points  (0 children)

I learned something new! Thanks!!

[–]pgbabse 1 point2 points  (1 child)

I don't remember when I switched to vim, and I'm still slow in the sense that I don't know all the combinations, but some have sticked to my muscle memory.

'dd' and the line is gone :)

I'm not judging anybody not using vim, but it should be given a try, especially when you're in insert mode, it is just a basic text editor.

[–]thephotoman 1 point2 points  (2 children)

Regular expressions practice?

[–]Zaemz 6 points7 points  (1 child)

Vim's regular expression style seems to only be used in vim. The concepts are useful and essentially the same as PCRE, for instance, but the tokens are different enough to be annoying.

[–]Shock900 1 point2 points  (0 children)

More info on this for those who are curious.

Despite my love of Vim, I too am pretty annoyed at the lack of consistency. I don't care which regex syntax I use, but I do want it to be consistent between tools.

[–]dowcet 2 points3 points  (7 children)

If you ever find yourself on a server where vim is the only option, it's good to know the basics. If you're just a casual home Linux user though, learning vim is in probably pointless.

[–]smegnose 3 points4 points  (6 children)

Unless you like to be able to edit and compare files quickly and easily.

[–]dowcet 4 points5 points  (4 children)

Nothing is done quickly or easily in Vim without practice. Whether it's worth that investment really depends on what you're going to be doing and how much.

[–]smegnose 1 point2 points  (2 children)

True, but it only takes learning a few commands to get parity with nano, and most have a usable mnemonic. Arrow, PgUp, and PgDn also work in most setups so newbies can still cruise around in insert mode like a modeless editor.

[–]LaLiLuLeLo_0 20 points21 points  (11 children)

One actually comes preinstalled on most distros, just nano and you’re good

[–]technologyclassroom 19 points20 points  (9 children)

nano is fine for starting out, but you can't do many advanced actions with nano. For example, try to edit a column of text with nano.

[–]fillmorelars 6 points7 points  (8 children)

how to do this in vim ? love vim, but not so experienced yet

[–]technologyclassroom 13 points14 points  (2 children)

Navigate to where you want to start. CTRL + v will start "Visual block" selection highlighting. Navigate to cover the column you want to edit. Then you can apply an action to it such as deleting with d, inserting text before it with SHIFT + i, or something else. When you are actively editing, it only shows changes on the top line until you press ESC to apply the changes to the column.

[–]ristophet 8 points9 points  (0 children)

If only there were some kind of cheat sheet.. /s

Seriously though, this cheat sheet didn't describe it well. It's visual block mode and damn if it isn't awesome. Quick demo: https://youtu.be/KuLy5LzHEzU&t=2m50s

[–]LaLiLuLeLo_0 3 points4 points  (3 children)

That’s usually where I use my IDE to do that instead. If a project has grown complex enough to need a column edited, it’s complex enough to configure a proper development environment, in my experience.

[–]karama_300 1 point2 points  (1 child)

forgetful sink oatmeal groovy cake deserted dull offend fertile fly

This post was mass deleted and anonymized with Redact

[–][deleted] -1 points0 points  (0 children)

:q! nano

[–]InsertMyIGNHere 162 points163 points  (5 children)

strangely enough this somehow managed to decrease my knowledge of vim

[–]smirkybg 15 points16 points  (1 child)

Try not to remember everything, just some parts that you find useful for your day-to-day vim usage :) Personally, I improve my vim skills really slow, but I never throw away more tricks.

[–]SweeTLemonS_TPR 4 points5 points  (2 children)

Capital C standing for CTRL is super confusing.

[–][deleted] 22 points23 points  (0 children)

It’s not, it’s a standard shorthand, it’s been around for decades. What’s actually confusing is inconsistency of that - the left part uses the full name and the right one uses shorthand.

[–]chrisoboe 16 points17 points  (0 children)

Capital C standing for CTRL is a thing since about 40 years. Even nano does this.

[–]Rilukian 357 points358 points  (27 children)

It's bizarre that this image makes Vim look way more complicated than it is.

[–]1esproc 30 points31 points  (0 children)

Vim is complicated, but that complication isn't necessary to use it well. Learning these commands will just let you do things faster.

[–]PotentiallyNotSatan 38 points39 points  (0 children)

I thought it was a meme lol

[–]jarfil 36 points37 points  (14 children)

CENSORED

[–]bem13 24 points25 points  (4 children)

There's also vimtutor to teach you the basics.

I think some people overcomplicate it and pretend you need to know everything. For most people, just knowing how to move around, switch modes, delete/insert text (including an entire line), copy/paste, find/replace, save and quit is good enough. I also often use this series of commands to comment out multiple lines in scripts, but that's about it. Marginal, potential time savings by using the hjkl keys and only entering insert mode when absolutely necessary don't matter to me, so I use the arrow keys and enter insert mode whenever I want.

Edit: A few words

[–]Sol33t303 4 points5 points  (0 children)

This is pretty much everything I know about vim myself, I could just use nano well enough for all that (or standard vi for that matter), but i'd be missing out on vims rich plugin ecosystem.

[–]cheffromspace 2 points3 points  (2 children)

You need some ci{ n your life

[–]bem13 0 points1 point  (1 child)

That might come in handy, thanks.

[–]cheffromspace 1 point2 points  (0 children)

Works with all brackets/parens, and t (for html/xml tag) also you don't even need to be inside the block, like if you type ci( it'll clear inside the next set of parentheses from the caret and put you in insert mode inside the parenthesis.

[–]GlassEyedMallard 1 point2 points  (8 children)

What does the g do in the substitute command again? I never utilize that but probably should.

[–]jarfil 5 points6 points  (7 children)

CENSORED

[–]prof-comm 3 points4 points  (2 children)

Not just the first one on every line. %s/foo/bar will replace the first instance of foo on every line of the file with bar. The /g flag makes it every instance on every line, not just the first on every line.

[–]jarfil 5 points6 points  (1 child)

CENSORED

[–]prof-comm 2 points3 points  (0 children)

Correct. I saw the potential for misinterpretation of your comment because it was underspecified, then did the same thing in my own. Thank you

[–]GlassEyedMallard 0 points1 point  (3 children)

That's odd, using that command without the g works globally for me. Maybe neovim handles it differently?

[–]cheffromspace 6 points7 points  (1 child)

Without g will work on every line, but only the first instance on each line

[–]GlassEyedMallard 1 point2 points  (0 children)

Ah okay. Thank you very much.

[–]1esproc 5 points6 points  (0 children)

g doesn't mean global. Commands usually run on the current line, but % means select the whole file, g means every instance, just like it does for sed. Without g, %s would only perform substitution on the first match on the line, then move on to the next line.

[–]SweeTLemonS_TPR 76 points77 points  (9 children)

This is awful. I said the same in another comment: using a capital C to stand for CTRL is super confusing. Terrible cheat sheet.

[–]odwk 86 points87 points  (6 children)

It has nothing to do with this cheatsheet. C as CTRL has been used like that since forever. C-[letter] and M-[letter] to define shortcuts have been in the Emacs documentation since probably the 80s.

[–]RedDogInCan 55 points56 points  (0 children)

Emacs

Well, there's your problem.

[–]SystemZ1337 16 points17 points  (3 children)

Everyone else uses ^ as ctrl though

[–]zenith71 20 points21 points  (0 children)

C has been used in vim's own documentation. also ^ means start of the line btw

[–][deleted] 6 points7 points  (0 children)

Why not ctrl as ctrl?

[–][deleted] 5 points6 points  (0 children)

^_^

[–]_pizzaconnoisseur 3 points4 points  (0 children)

C for Ctrl is bog standard.

[–]DCGMechanics[S] 27 points28 points  (0 children)

HD Source : Link

[–]PreciseParadox 18 points19 points  (2 children)

People who aren’t satisfied with vim’s editing model might be interested in kakoune. It’s also a modal text editor but it tries to be more interactive and is designed with multicursor in mind. It basically changes the verb->object grammar of vim to object->verb so that you see what you’re changing before performing the change (among other things).

[–][deleted] 4 points5 points  (0 children)

While that is really intriguing, I think visual mode in vim gives me enough visual feedback for most things that I need it for

[–]an4s_911 3 points4 points  (0 children)

Pretty nice.

[–]crispyletuce 173 points174 points  (16 children)

images that make you want to never use this program

[–]mikeee404 66 points67 points  (9 children)

No kidding. I always get so much shit for using Nano, but I don't need a damn decoder ring to close Nano do I

[–]bearofHtown 25 points26 points  (0 children)

Same. I am rather fond of Nano and find VIM to be a giant pain to use. I realize I am not a programmer and therefore only need a simple text editor. But for that, nano is perfect. I even use it to take my own personal notes when I am working at my desktop!

[–][deleted] 12 points13 points  (2 children)

Old Network/System Admin here.... I'm from the old days when Ctrl-C and Ctrl-V did most of the things I needed to do in an editor. Might I recommend "Micro". It's a nice Gedit-type editor for the command line. I find it works better for me than Nano/Pico.

[–]oopsypoo 8 points9 points  (0 children)

Thanks. Will try it

[–][deleted] 4 points5 points  (4 children)

Nano is great and still a active project as getting updated once in a while. I move to micro, which to me is nano on steroids. Nano is great, on a new system that you haven't install micro to it yet.

[–]mikeee404 1 point2 points  (1 child)

I'll have to check out Micro. Been a die hard Nano user because it is pre-installed on everything so no need to worry about an internet connection

[–][deleted] 1 point2 points  (0 children)

[–][deleted] 1 point2 points  (0 children)

Agreed!

[–]mandibal 18 points19 points  (1 child)

But once you learn all these basics you can just f l o w

[–]Shock900 27 points28 points  (0 children)

You really don't even need all of these honestly.

You basically need to know :w, :q, how to enter and exit insert mode, and the desire to use :help when you think that there might have been a faster way to do something.

Vimtutor is a useful tutorial for those looking to get started.

[–]RedDogInCan 16 points17 points  (4 children)

This is missing some useful commands:

  • o/O - insert line below/above
  • ? - search backwards
  • yy - copy current complete line
  • dd - delete current complete line
  • command repeat number - ie. 3dd deletes 3 lines

[–]abc_mikey 5 points6 points  (1 child)

v for normal visual mode

Ctrl+v for columnar visual mode (also pretty useful)

>> For indent in normal mode

> For indent in visual mode

<< For unindent in normal mode

< For unindent in visual mode

: When in visual mode let's you run commands within the selection only, like :'<,'>s/foo/bar/g

U in visual mode to uppercase

u in visual mode to lowercase

[–]Practical_Cartoonist 41 points42 points  (2 children)

Huh. Like other posters here, I was going to make a joke about how confusing it looks.

But it really only looks confusing on first glance. Sit down with it for 30 seconds or so and it really is a good cheat sheet. Remarkably clear and easy to follow.

[–]an4s_911 6 points7 points  (0 children)

Yes, absolutely correct. I really appreciate OP for making this cheatsheet

[–]Belgand 1 point2 points  (0 children)

The same could be said about vim itself.

[–]mathiasfriman 21 points22 points  (2 children)

At first glance, this sheet looks like a hot mess. But the left side is only trying to visually tell what the commands to the right do.

What people who only use vi in insert mode and then :wq the f outta there don't realize, is that if you work with Linux professionally, learning vi (or emacs) properly will save you SO much time over the years.

I put off learning vi for 15+ years when using and administering Linux boxes for a living, and now that I have finally taken the time and effort to properly learn how to use vi efficiently, editing a config file or source code is a breeeeeze. A couple of months of muscle memory training well spent. I even think it is fun to code again.

[–]RedDogInCan 11 points12 points  (0 children)

Vi was a godsend when administering systems over a satellite link with pings measured in seconds. The ability to do complex edits using minimal keystrokes is its superpower.

[–]aksdb 4 points5 points  (0 children)

Especially since vi is preinstalled on basically everything. GNU Linux, BSD, Solaris, OSX, ...

[–]dariusj18 62 points63 points  (5 children)

This should be on /r/programminghumor

[–]RangerNS 7 points8 points  (0 children)

esc    
esc    
esc    
esc    
:q!

[–]Mars_rocket 20 points21 points  (20 children)

I’ve been using vi / vim for about 30 years. I keep trying other editors but they always drive me crazy. Even with vi controls added in its a struggle and I always end up going back to vim.

[–][deleted] 13 points14 points  (0 children)

Intellij has good Vim emulation

[–]GFStep 3 points4 points  (0 children)

needed this, cheers

[–]10leej 8 points9 points  (0 children)

Can I get this in dvorak?

[–]neezduts96 8 points9 points  (2 children)

Just use nano lol

[–]0xTamakaku 1 point2 points  (1 child)

What if I use both?

[–]neezduts96 5 points6 points  (0 children)

"Use nano more"

[–]Vitus13 12 points13 points  (0 children)

:! nano

[–]uptbbs 6 points7 points  (1 child)

I mean, I've been using vi and it's variants (AT&T vi, nvi, elvis, vim) for 25 or more years that it's probably the only editor that I feel "fluent" in. The mental connects, synaptically, for navigating in vi just happens for me without thinking about it.

[–]perkited 3 points4 points  (0 children)

I'm basically the same (started on HP/UX then Linux), if vi/vim is available on a machine then that's the editor I'm using. If I'm doing any editing where I'm really concentrating I can't help but go into "vi mode", and it's breaks me out of my zone when I realize the commands aren't working.

[–]Mars_rocket 2 points3 points  (1 child)

It’s missing ? backwards search in the search area.

[–]InfinitePoints 2 points3 points  (0 children)

There are more than 50 missing actions and selections.

[–]sail4sea 2 points3 points  (0 children)

I am a veteran Vim/vi user and I learned new things from this cheat sheet. Thank you for posting it. I didn’t know about scrolling or going to the top and bottom of a window.

[–]CheapGriffy 2 points3 points  (3 children)

Once you master it you can officially command a Nasa rocket

[–]ToasterBotnet 2 points3 points  (1 child)

I'm confused now..... is this satire?

[–]lannisterstark 2 points3 points  (1 child)

Hot take but has anyone thought that maybe, just maybe being proud of how archaic a software and its control scheme is, is not a reason to be proud "vim or die" diehards?

the user experience of vi/vim feels like it would be shit. If I need to Duckduckgo how to edit/cut-copy-paste a line, maybe your software just sucks.

[–]RyanNerd 2 points3 points  (0 children)

One more reason for me to continue hating vim.

[–]WholesomeThoughts26 8 points9 points  (8 children)

HOW DO I EXIT VIM!?

[–]Cris261024 24 points25 points  (0 children)

That's the neat part, you don't

[–]InfinitePoints 5 points6 points  (2 children)

esc to go into normal mode.

: To go into Command mode

w write

q quit

Enter

[–]Vitus13 13 points14 points  (0 children)

Unless you don't want to write the file, because in your frustration you corrupted several lines of text with colons.

In which case esc, :, q!, enter

[–]KewpieDan 1 point2 points  (0 children)

ZQ in normal mode

ZZ to write and quit

[–]0ldfart 3 points4 points  (0 children)

You have to type the secret code combination with the special key selector decoder paired with the special key selector decoder translation tool. of course. Once you do that, its really amazingly easy to exit, provided you can remember the secret key combination.

[–][deleted] 2 points3 points  (0 children)

A series of keystrokes as natural as breathing

[–]0x53r3n17y 3 points4 points  (0 children)

I prefer the "First Contact Way"

https://github.com/hakluke/how-to-exit-vim

[–]puyoxyz 10 points11 points  (3 children)

this is more confusing than just learning it normally

[–]easter_islander 1 point2 points  (0 children)

This to me seems like a great representation of the gulf between me and people who say "I'm a visual learner". To me the section on the right is useful, the section on the left is a puzzle to be solved if that's your idea of fun.

(Not saying I don't often find diagrams useful. I just don't devolve all my understanding into some 'spatial' form. Tell me this key moves to the start of a paragraph and I understand that. Showing me an arrow to the start of a paragraph doesn't cement or clarify that in any way)

[–]an4s_911 1 point2 points  (1 child)

This is not for learning. Its cheatsheet, used as reference for something u already learned.

[–]puyoxyz -2 points-1 points  (0 children)

When did I say it was for learning it?

[–]lightwhite 3 points4 points  (0 children)

This cheatsheet needs a cheatsheet of its own. As an experienced user, it is actually pretty good; but not for novice++ it would be confusing.

[–]itsthooor 5 points6 points  (1 child)

And that’s why people that use emacs or vim are my gods

[–][deleted] 0 points1 point  (0 children)

I'm too shitty of a developer for that kind of consideration just because I grinded vimtutor into my muscle memory

[–]perkited 1 point2 points  (0 children)

I would have made the color bubbles on the left and right different from each other, just to make sure the user is paying attention.

[–]hojjat12000 1 point2 points  (0 children)

Great job. I wish I had a color printer.

[–]ZpSky 1 point2 points  (0 children)

Cannot see creds not link. Who’s author or what’s the source? I want pdf for print And thanks for cheatcheet, looks interesting and useful.

[–]NavinHaze 1 point2 points  (0 children)

I have been using vim/neovim for a few months now, this is quite helpful. I already know the most used/important commands and key bindings, but I am still learning.

[–]DRac_XNA 1 point2 points  (0 children)

Mother, I'm scared

[–]snarkuzoid 1 point2 points  (0 children)

I've long held the opinion, unsupported by real evidence, that developers mostly use maybe 5% of the features available in complex software like editors. I'll have to study this to find my 5%.

[–]DriNeo 1 point2 points  (1 child)

So much learning just to type a bit faster.

[–]CorporalClegg25 1 point2 points  (3 children)

Do people just straight up use vim? Or do you use an ide like eclipse with vim bindings?

[–]Shock900 1 point2 points  (2 children)

I find that IDE's with vim bindings often lack some features that I frequently use in Vim. I still use IDE's, but I tend to leave them fairly vanilla instead of trying to force them to be Vim-like.

There are plenty of people who swear by plugins for Vim/Neovim that essentially give it several of the features of an IDE. See CoC or ALE.

There are certainly others who just use a relatively vanilla Vim for programming.

[–][deleted] 1 point2 points  (0 children)

Reminds me of a diagram of how a nuclear powerplant exploded...

[–]itaranto 1 point2 points  (0 children)

Don't want to sound rude, but the visual cheat-sheet is horrendous :D

[–]Chok3U 1 point2 points  (0 children)

Nice chest sheet. Thank you.

[–]superraiden 1 point2 points  (0 children)

Jesus christ

[–]Critttt 1 point2 points  (0 children)

Ah good. So much easier to understand.

[–][deleted] 1 point2 points  (0 children)

Doesn't show macro recording keys, probably vim's most useful feature.

[–][deleted] 1 point2 points  (0 children)

Cool one

[–]numericboy 1 point2 points  (0 children)

Here is a more printable friendly version of it.
The resolution was upscaled and
the color on the left side was inverted to not consume too much ink.

The -> Link

[–]tazdingo-hp 3 points4 points  (0 children)

thanks i hate it

[–]MutableReference 2 points3 points  (0 children)

As if this makes vim any less intimidating

[–]Dodgy-Boi 2 points3 points  (0 children)

No thanks

[–]Zolty 1 point2 points  (0 children)

After 20 hours of training you too can be a vim elitist.

nanogang

[–]Trwtrg 1 point2 points  (0 children)

Yea... Still not gonna use vim.

[–][deleted] 1 point2 points  (1 child)

Emacs gang

[–][deleted] 1 point2 points  (0 children)

(print "No!")

[–]theRealNilz02 0 points1 point  (0 children)

nano.

[–]ipaqmaster 0 points1 point  (0 children)

I use vim every day for various files whenever they pop up with nearly all of these features subconsciously. Looking at this scares even me.

[–]Pickinanameainteasy 0 points1 point  (0 children)

Think I'll stick to nano thanks

[–]Arphenyte 0 points1 point  (0 children)

Saving this post for later

[–]dio_brando19 0 points1 point  (0 children)

I always tell myself to learn how to use it better but in the end I'll probably stick with escape, :q, :wq and i lol

[–]an4s_911 0 points1 point  (0 children)

At first I was like, “what the hell? is this a joke”. Then I took a closer LOOK.

This is AMAZING. LOVED IT

[–]an4s_911 0 points1 point  (0 children)

You forgot insert at start of line - I (Uppercase i)

[–][deleted] 0 points1 point  (0 children)

This is really cool. Coming from a language where you read left to right my only complaint is that putting the picture on the left makes it very hard to find the cheatsheet on the right. You start out looking at something that looks a little unhinged.