4 ms·
Hi, great work releasing this! Trying to explain vim concisely is always an interesting challenge and I had a great time reading your attempt in this book. I al
by doix 5y ago
Hi, great work releasing this! Trying to explain vim concisely is always an interesting challenge and I had a great time reading your attempt in this book. I always find it really interesting on how people try to group certain vim functions in a way that makes sense to people that don't use vim.
Whenever I try to explain vim to other people, I always start super abstract, i.e 'vim grammar is all (count)? verb then object. Learn actions and then the movements to apply the action where you want'. I think you cover that idea pretty well in your 'Vim philosophy and features' section whilst not making it overly abstract and keeping it relatable.
Some things I noticed, you mention registers in the insert mode section before explaining what they are. It seemed odd to me that you used the word before explaining what it meant, but maybe it is unavoidable?
I also noticed you completely left out folds (z, :help fold). Personally, I aggressively fold code I'm not working on so I think they are super important :D. There was a plugin posted recently thats a cool alternative to folding though (similar to emacs narrow) [0] [1].
[0] https://github.com/hoschi/yode-nvim https://github.com/hoschi/yode-nvim
[1] https://news.ycombinator.com/item?id=30305011 https://news.ycombinator.com/item?id=30305011
- asicsp 5y agoThanks for your feedback. And your point about 'Vim philosophy and features' section is interesting. I find it difficult to explain abstractly and I wondered if I should copy-paste some sections from the famous "you don't grok vi" answer (https://stackoverflow.com/a/1220118 https://stackoverflow.com/a/1220118). >Some things I noticed, you mention registers in the insert mode section before explaining what they are. It seemed odd to me that you used the word before explaining what it meant, but maybe it is unavoidable? Yeah, my chapter structuring ended up in many cases like that. For example, I mention how to modify behavior of left/right arrow keys to move across lines using a setting. But, Command-line mode chapter comes later and use of vimrc comes even later. For cases like registers in Insert mode chapter, I linked to the Normal mode section after the bullet points (may be I could move it to the start of section). >I also noticed you completely left out folds I knew that there's a fold feature but haven't used them. I think I cover only about three commands with `z` in Normal mode chapter. I don't use multiple buffers in same window, tags, third-party packages, etc - so details on them are light too (or entirely missing).
- doix 5y agoOh yeah, I just realized you completely left that stuff out. That's one of my favorite parts of vim and what I find lacking in 'vim mode' plugins. They get the hotkeys right, but they lack the abstractions of tabs/buffers/windows. What most editors call 'tabs' are windows in vim, and they lack the concept of a vim tab. I use them all the time when I'm doing refactoring work. Being able to organize 'views' in a way that makes sense, then switch between them rapidly is so awesome. You're refactoring some code across 3 files (all open in splits), then you want to look up some other part of the code base for reference. :tabe browse around, read whatever with 100% of the screen devoted to what you're trying to read, then gT and you're back on your old view with 3 buffers open. I have to constantly build up and then destroy these views in other editors. Or just accept that half my screen is cluttered up with irrelevant stuff. Also the fact that everything in vim is a buffer inside a window means that everything is super consistent! You can switch focus between your plugin windows and your files with the same hotkeys! And unless the plugin writer intentionally changed stuff, the plugin buffer works just like a normal buffer, so all the hotkeys you learned before still apply. It's what I really miss in IntelliJ IDE's. I can see all the different panels, but I cannot switch focus to them without memorizing panel-specific hotkeys! I can see the bloody panel is left of my current focus, let me switch focus by just pressing ctrl+h instead of alt+shift+3. Anyway, vim is very vast and trying to explain everything is a daunting task. I think you've made a good attempt :).