Live data from Hacker News

Ask HN: Is Vim still worth learning?

news.ycombinator.com

61–70 of 93 posts

Re: Ask HN: Is Vim still worth learning?

#61
post #22

> [I] found the "hjkl" navigation difficult That's because you're doing it wrong! Hjkl are fallbacks to move a few characters, it has only a minor advantage over arrow keys are is probably not worth the effort of re-learning how to move a cursor. I would not recommend learning that as your first vim move. Just stick to cursors for moving individual characters at first. The real magic is in going back/forward words (b…

https://catonmat.net/why-vim-uses-hjkl-as-arrow-keys

Apparently the use of hjkl has to do with the fact that on some keyboards, those WERE the arrow keys!

Re: Ask HN: Is Vim still worth learning?

#62

Vim is basically the only editor you can safely assume to be available on any machine you’ll ever interact with. In my opinion, this fact makes it a requirement for virtually any developer to be able to confidently use vim during a production incident to, say, fix a broken config file while being connected to the machine through (multiple hops of) SSH, without any ability to use your editor of choice. Once this basic…

>Vim is basically the only editor you can safely assume to be available on any machine you’ll ever interact with. Windows?

Vim is available on a lot of Windows machines through WSL. I agree this would not be my go-to editor on Windows though.

Re: Ask HN: Is Vim still worth learning?

#63
40+. Have been viming since 1999-2000. SublimeText + vim mode has been my weapon of choice since like 2012-2013. It works out of the box and is the most compatible with my muscle memory (tried VSCode's vim emulation, RealVim, PyCharm's vim mode — hell, it's 120 chars per line by default). Onivim2 seemed promising but it's still not there.

What I really like in Vim is not Vim itself, but modal editing, mouse-free navigation, staying at the home row. Ideally I would like this model to be universally available across my environment. Like MacVim but everywhere. Plus, a trackpoint at the home row (really loved IBM ThinkPad).

Home row is great but it's so much addictive that you want it everywhere, but I still haven't found a universal way. I bought a UHK[1] and learn how to use it and Karabiner elements complex modifications.

Also these days I tend to think that physical navigation (characters, words, lines, paragraphs…) is really not what I should think about when working. So lately I've been exploring helix and projectional[2] (structural[3]) editors.

My younger colleagues are sometimes so awkward in terminal so I've been thinking about investing some time into setting up a well tuned and documented shell environment for them somewhere. I think I'd start with this awesome article[4].

[1] https://ultimatehackingkeyboard.com/ [2] https://www.alexeyshmalko.com/20200830010958/ [3] https://github.com/yairchu/awesome-structure-editors [4] https://www.masteringemacs.org/article/keyboard-shortcuts-ev...

Re: Ask HN: Is Vim still worth learning?

#64
post #44
post #36

Earlier quoted context omitted.

> things like S to replace the line what is this barbaric default binding, s/S shall be bound to the indispensable vim-surround! ;) built in text objects are already nice combined with modifiers (e.g cw, ciw, caw, cW, ciW, caW), ramping it up a little bit with argument (ca, cia, daa), surround (cs"', cs([, ci", ca", viWS , dst), and indent (vii>) is stupidly powerful. Once the [verb][modifier]{object} pattern clicked…

Most people I know (including many linux users) regard me as a vim pro relative to them, and I still have barely an idea what most of these do. Or what surround is. Might want to explain a little for the rest of us mortals ;)

Surround is a plugin which adds more text objects: https://github.com/tpope/vim-surround

cs"': change surrounding quotes, e.g. "foo" -> 'foo'

cs([: change surrounding brackets, e.g. (foo) -> [ foo ]

( cs]) would omit the spaces)

ci": change in quotes, e.g. "foo" -> "" (in insert mode between the quotes)

ca": change around quotes, e.g. x"foo"y -> xy (in insert mode between x and y

viWS: add tag around current word using visual mode, e.g. foo -> foo

dst: delete surrounding tag, e.g. foo -> foo

It's really good. I'm not familiar with argument.

Re: Ask HN: Is Vim still worth learning?

#65
If you subscribe to the Unix Philosophy and like to use your tools in in such ways, yes. If you want to point and click* (no hate - I just mean you just want to get things done) and composing small tools in novel, productive and repeatable ways doesn't interest you very much, I would say there's a chance you may struggle to see the benefit and motivation may drop off and your ROI may be low.

(yes Neovim supports mouse, don't @ me lol)

I started with Vim because of the modal editing (prompted by the classic in-person witnessing of a Vim user). I had just switched to the Workman KB layout so I was already slow and useless - why not be slow and useless for a while, but then have also learned Vim? I started out with the modal emulation in various editors, provided by extensions, but over the years I became more and more sick of Windows' BS and swapped to Linux for dev. This is when I encountered Neovim, and I now realise Vim is so much more than the modal editing.

As I wrote in another comment, working in code now without Vim feels like punching in a dream. I won't say I'll never leave Vim, but until there's something that allows editing as ergonomic as Vim's, startup as fast as Vim's, terminal/GUI options like Vim has, integration with basically anything like Vim can, and a lack of Big-Tech-BS like Vim has, then I'll probably just keep using it.

Re: Ask HN: Is Vim still worth learning?

#66
I use neovim. my experience is that gaining muscle memory with vim is great. Sometimes you start hiting the escape keys in websites and other places where it does not work but other that is a really nice experience. I never took too much effort to optimize every keystroke. I just learned new ways to navigate as needed. Coding in go and the plugins work very well. Things I dislike. neovim changed the plugin system a lot (they introduced lua as the preffered scripting language instead of vimscript right?) and for me that likes to rebuild the config once every 5 years or so, stumbling on a complete new way of doing things made lose a bit more time than I wanted and was a bit of a frustrating experience.

Re: Ask HN: Is Vim still worth learning?

#67

If you subscribe to the Unix Philosophy and like to use your tools in in such ways, yes. If you want to point and click* (no hate - I just mean you just want to get things done) and composing small tools in novel, productive and repeatable ways doesn't interest you very much, I would say there's a chance you may struggle to see the benefit and motivation may drop off and your ROI may be low. (yes Neovim supports mous…

I'm sure there's a much nicer, scientific way to articulate this, but one interesting observation I took away from learning Vim (in terms of bindings) and Workman simultaneously is that, at least in my mind, typing sequences are not stored how I expected; for example, 'apple' is not learned as LPinky, RRing, RRing, RIndex, RMiddle, but more like LPinkyRRingRRing, RIndexRMiddle (i.e. in bunches). I know the Workman layout now, and I can hit the same WPM as I had after 20 years of QWERTY, but if I come across a word with sequences I've not yet typed (it happens from time to time, about 6 years in), I will have to revert to the char-by-char typing until I learn those sequences. I found the same with Vim; there's multi-key commands that after some use, my brain has just filed under "indent this block" with the finger movements. The benefit of the modal editing is that sequences of commands can be chained very quickly without finger strain, and code editing starts to become as easy and nice as regular typing.

Re: Ask HN: Is Vim still worth learning?

#69
I would say basic vi skills are mandatory for anybody who is needing a console. I remember one case of having to plug in an ASCII terminal and the only tool available was vi for the console. I do notice nowadays that the dependence on VS Code means a lot of developers struggle with skills on the console so to edit a file on a remote server they need to copy it from and back to the server. This is going to be an issue in years to come.

Re: Ask HN: Is Vim still worth learning?

#70
post #29
post #15

Earlier quoted context omitted.

Maybe... but OTOH, the IDEs that come after VSCode will still follow the UI guidelines that have been established for GUI tools during the last ~40 years, e.g. having menus where you can find out which functions are available, and then memorize the shortcuts for the functions you use most often, rather than having to learn everything "up front" before being able to become productive. I suspect one reason for the long…

OTOOH, GUI tools often tie you to a specific workstation setup. VIM is already installed everywhere you need it and does not require you to have a workstation with a GUI

VIM or vi?
Post reply on HN