11 ms·
Vim Modes Transition Diagram
- ian-g 5y agoThis 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 5y agoI've been using a TV as screen for increased real estate and I must say I'm happy
- cosmotic 5y agoI always get trapped in record mode but I don't see that in this diagram. Am I missing something?
- acomar 5y agoq another character begins recording a macro. press q again to finish recording.
- CGamesPlay 5y agoWell, it's not a mode. It's recording, but you can freely change between modes while recording and this will be part of the recording. I believe you can even start a recording in one mode and exit it in another, although this has limited use.
- cosmotic 5y agoIt is most certainly a mode, from a usability standpoint. :q no longer works once in record mode; which fits the definition of modality.
- dvcrn 5y agoq + something else -> starts recording into buffer <something else> q again -> finish recording @ <somethinge else> -> replay recording of buffer <something else>
- alpaca128 5y agoGood summary, but minor addition: `q` is also a valid input. Hitting `qq` starts recording in the `q` buffer, and it stops when the key is pressed a third time in normal mode.
- schemathings 5y agoI recently had the happy discovery that q: puts you into the : buffer, which is your command history. You can navigate to a recent comment and just enter to execute. Bonus point for it being the opposite of :q
- hansvm 5y agoIt's the Q character. That usually happens to me when I mistype a semicolon rather than colon when trying to quit.
- oftenwrong 5y agoQ enters ex mode q is used to start a recording
- hansvm 5y agoThat was imprecision on my part. I should have said "Q key" instead -- the capitalization was to make it stand out.
- cosmotic 5y agoYeah; With basically everything using q to quit, the inconsistency is infuriating. It would be bad enough if it did nothing, but instead of changes modes that you need to explicitly escape before the real quit works.
- mjbrownie 5y agoThe best way to stop doing it accidentally is to start doing it deliberately, then the muscle memory will catch up.
- airstrike 5y agoThanks. Where can I order this as a poster-sized print for my office?
- 0x426577617265 5y agokinkos
- dredmorbius 5y agoThe diagraitself is an SVG. You can scale that to any size you like, using an SVG editor (e.g., Inkscape). Take that file to your local print shop, as suggested in another comment.
- TobTobXX 5y agoVim is weird. It is the pure opposite of user friendly design, and yet it has a huge userbase.
- CGamesPlay 5y agoI don't think it's the "pure" opposite. Notably, it's extremely stable and even all of the quirks which aren't fixed for reasons of compatibility are documented in its built-in help. I think almost all modern products focus exclusively on growth: acquiring new users. That means that it's OK to break existing behaviors if it makes something easier for a newcomer. Vim does not have this attitude, so a newcomer has a steep learning curve, but an old-timer doesn't have to worry about his platform changing from under him.
- 01100011 5y agoIt's the opposite of new-user friendly design. For some of us, it isn't that hard to learn, and gives us an entirely new way to think and interact with a computer. I think there is a powerful lesson for user-facing application developers here. Sometimes you're better off thinking of power users and enticing newcomers to put in the effort. Blender seems to follow that approach as well.
- dreamer7 5y agoI started using vim quite recently and I have a pure opposite view point as yours. With vim, I find myself editing code effortlessly, without conscious effort. This never happened when I was doing this with other text editors using keyboard shortcuts or the mouse.
- throwaway67114 5y agoHow did you get started?
- dreamer7 5y agoI was using vim mostly while working on projects with a single board computer. But at that time I only knew the basics of searching, jumping to a line and entering insert mode to edit some text. Recently I installed vim plugin for vscode and spent a little time digging deeper into vim and practiced until it got into muscle memory. One little shortcut that I've noticed even some experienced users aren't aware of is :x to save and exit. It is equivalent to :wq
- anon9001 5y agoDoes anyone actually use select mode?
- walty8 5y agoyes, it's useful to comment out a bunch of lines.
- chrismorgan 5y agoI’m pretty sure you’re talking about visual mode, not select mode.
- nick0garvey 5y agoYes. 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 5y agoYou'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.
- nick0garvey 5y agoHuh, TIL. I'm amazed I've been using Vim for this long and there are entire modes I didn't know.
- dpacmittal 5y agoYou're talking about visual mode, select mode is entered by pressing gh in normal mode.
- hoppla 5y agoAh, finally a map to escape this dreadful labyrinth
- ggm 5y agoA version for Bostic (n)vi please.
- dredmorbius 5y agoIf 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.
- Cadwhisker 5y agoI 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 5y agoThe 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 5y ago[deleted]
- em500 5y agoI 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.
- soraminazuki 5y agoI suppose this is useful for implementing Vim-like functionality, not as an usage manual.
- dredmorbius 5y agoFair 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 5y agoThat’s what I always assumed this was. You’d be nuts to show this to a beginner.
- dredmorbius 5y agoPretty much. Or you'd want to show it to a beginner as a phased reveal. That might actually make an interesting evolution of the diagram, which I'm visualising in my mind as either a set of concentric circles or regions of expanding complexity, or a set of 3D-relief "peaks" emerging from a "feature sea", where the basic elements (say, the Insert mode entry points, h/j/k/l keyboard movements, and, um, how to quit, might be covered. With more advanced functionality exposed as deeper / more remote regions of the map.
- eimrine 5y agoSo uneasy to look at this on my vertical monitor 1080x2560, all I see is a giant Insert rectangle and a horizontal scroll. But I appreciate that work anyway because all that areas are clickable and it will not be easy to rearrange that diagram for 1% users with strange looking monitor.
- adamtulinius 5y agoIt's a SVG-file, not a website, so just scroll to fit, or blame your browser.
- whatshisface 5y agoNow that everyone has smartphones vertical screens are no longer an uncommon trick for programmers who've realized that text scrolls more vertically than horizontally - they're the most common aspect ratio.
- aasasd 5y agoIt omits shift-cursor inputs, however it seems to finally answer for me the mystery of what those weird modes are that are entered by shift-selection: ‘select visual’ and ‘insert select’, if I'm not mistaken. Also apparently I forgot about ctrl-g, though it likely has a different meaning in Emacs' Evil.
- sporedro 5y agoWow this is really cool! A lot of commands are just muscle memory at this point, but seeing things visualized like this is really neat.
- jridgewell 5y agorawgit.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 https://gist.github.com/darcyparker/1886716, and it's displayable (officially) at [2]. [1]: https://rawgit.com/ https://rawgit.com/ [2]: https://gist.githubusercontent.com/darcyparker/1886716/raw/c1ee7657010278a787c6502b796a6766a40d56aa/vimModeStateDiagram.svg https://gist.githubusercontent.com/darcyparker/1886716/raw/c...
- ironmagma 5y agoDoes anyone know of a similar diagram to explain emacs?