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.
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!
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].
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.
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.
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.
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.
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.
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.
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.
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!
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.
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.
[1]: https://rawgit.com/ [2]: https://gist.githubusercontent.com/darcyparker/1886716/raw/c...
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.
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.
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.
I just wish I had a big enough screen to read this all without zooming out
Thanks for posting this; bookmarked.
(*) apart from :q!
Deleted Comment