Readit News logoReadit News
em500 · 5 years ago
I appreciate the effort that went into this, but I think it actually makes learning vim appear more complicated than it is.

The approach to vi(m) that really worked for me is to regard the different modes (especially insert mode) as commands rather than "modes". Entering text is a single command, usually starting with 'i' or 'a', terminated with <esc>. For each command you learn, get in the habbit to initiate and to terminate it, just like in primary school you learned the habbit of finishing your sentences with a punctuation mark. Then you don't "get stuck" in different modes anymore.

dredmorbius · 5 years ago
Fair point, though I'd argue that's not its function.

Documentation is a technology, and all technology serves a goal-oriented process.[1]

What you're looking for is a Quick Start Guide. These exist. Vimtutor would be an excellent example.

This ... is a map of the landscape. It doesn't tell you where to go, or what the highlights are. But if you happen to be in one part of the landscape, or want to know what's in some remote part, this shows you both what's where and how to get there. And links to a detailed description for closer inspection.

And in that process and to that goal, it really is quite good.

________________________________

Notes:

1. That is a bald statement proposed as but not presumed true. Change my mind!

sodapopcan · 5 years ago
That’s what I always assumed this was. You’d be nuts to show this to a beginner.
soraminazuki · 5 years ago
I suppose this is useful for implementing Vim-like functionality, not as an usage manual.
dredmorbius · 5 years ago
If you've not realised this yet, the diagram is clickable, and links through to the Vim manual section corresponding to the feature in question.

This is quite excelently done, thank you darcyparker!

Note that this doesn't include all features. Digraphs (Ctrl-K from Insert mode) are missing, e.g.

jbrnh · 5 years ago
yes, it's great!

It doesn't have alt<char> to enter normal commands from insert mode (double the number of lines).

It doesn't have (Vim 8) terminal mode.

Snarwin · 5 years ago
Alt+char in terminal Vim is just another way of typing Esc+char.
jridgewell · 5 years ago
rawgit.com is sunsetted[1], so this URL may die any day now. It's simply a proxy server for content hosted on GitHub. In this case, the real source is https://gist.github.com/darcyparker/1886716, and it's displayable (officially) at [2].

[1]: https://rawgit.com/ [2]: https://gist.githubusercontent.com/darcyparker/1886716/raw/c...

anon9001 · 5 years ago
Does anyone actually use select mode?
chrismorgan · 5 years ago
If I recall correctly, it’s more or less enabled by default in gVim on Windows for mouse selection (see ':behave'). I’ve never seen anyone deliberately invoke it, and I’ve definitely seen people avoid that behaviour on Windows.

I would definitely consider it a misfeature, given how it complicates things, muddying modes when invoked, and when a simple c or s from any visual mode has roughly the same effect.

nick0garvey · 5 years ago
Yes.

I use normal select when:

- I want to apply a regex to a specific area, e.g. a single function (vjjjjj:s/my_function/my_new_function/g<enter>)

- I want to cut some text and I don't want to count how many words out it is (vwwwwx)

I use block select when:

- I want to delete a section of fixed width formatted text (Vjjjlllx). Useful for manipulating logs with a fixed width prefix.

- I want to append text to the start of a line. (VjjjjjjI# <esc>). Useful for commenting out lines.

CGamesPlay · 5 years ago
You're actually talking about visual and visual block (although V is visual line and <C-V> is visual block in your examples). Select is a weird mode where typing will overwrite your selection, similar to how it works in a modeless editor like notepad or the HTML textarea.
dpacmittal · 5 years ago
You're talking about visual mode, select mode is entered by pressing gh in normal mode.
mFixman · 5 years ago
I use it every once in a while to truncate aligned text in tables. It's not very useful, but I'm glad it's there.

The big question for me is whether anyone knew of virtual select mode, enabled by `gR`.

It's like select mode except that it replaces screen state instead of characters, so pressing `<Tab>` will replace `tabstop` characters instead of just one.

thewakalix · 5 years ago
Select mode is actually exactly what I was looking for a few days ago. I had a visual block selected and wanted to replace it, but all I know how to do was delete, reselect, and add.
strogonoff · 5 years ago
I usually hit “c” in visual block mode, and re-type. How does select mode work by comparison?
walty8 · 5 years ago
yes, it's useful to comment out a bunch of lines.
chrismorgan · 5 years ago
I’m pretty sure you’re talking about visual mode, not select mode.
ian-g · 5 years ago
This looks super handy as a reference. I love a nice organized diagram when I'm sort of ok enough at something already.

I just wish I had a big enough screen to read this all without zooming out

cerved · 5 years ago
I've been using a TV as screen for increased real estate and I must say I'm happy
sporedro · 5 years ago
Wow this is really cool! A lot of commands are just muscle memory at this point, but seeing things visualized like this is really neat.
hoppla · 5 years ago
Ah, finally a map to escape this dreadful labyrinth
majewsky · 5 years ago

  <ESC><ESC>:q!
There you go.

berikv · 5 years ago
:q twice, when vim is recording.
Cadwhisker · 5 years ago
I never learned Vim commands (*) because I couldn't get past how different it is to use compared to everything else. I found the selection of editor modes confusing because I'm used to just typing where the cursor is. This is the first diagram/cheat sheet which has made some sense of what's going on.

Thanks for posting this; bookmarked.

(*) apart from :q!

aasasd · 5 years ago
The most useful command, in my experience, is ‘:s’—it alone justified the use of Vim for me. I occasionally drop some lines in Vim, use ‘:s’ and paste the result into the terminal—simply because it's much easier to edit multiple shell commands this way than to figure out how to do it with sed or whatnot.

Deleted Comment