Live data from Hacker News

Learn Vim (2021)

github.com

101–110 of 215 posts

Re: Learn Vim (2021)

#101

I dunno, I never sat down to learn vim, just used it every day for a couple years. I’m not one of those wizards who is, like, answering stack overflow questions or writing wiki articles, but I get the job done. Is it necessary to learn Vim? Seems like a chore. Is the text editor really a bottleneck for anyone? I find that no matter how slow I type, I need to spend more time thinking of what to type anyway, if I’m doi…

In the past I was mostly the same, but then I realized that I was doing myself a disservice by not fully knowing my tools.

Every month or two I'd read a manpage for something and really experiment with using all the facilities - most of them wouldn't stick, but every now and again some would.

Just pick something like "less" or "bash", read the manpage, and try using something you've not done before. It's very helpful.

For Vim I went through the tutorial a few times a long time ago, and that really helps. (For twenty years I used emacs for "everything", and vim solely for email, via mutt and later my own client.)

Re: Learn Vim (2021)

#102

I'm using vim for 10 years and I know I have a lot of "bad" habits that I'm trying to eliminate, but it's hard. For example: 1. instead of doing 4j I might do jjjj 2. if I'm in the middle of a word and want to change it, I'll do bcw instead if ciw 3. if I want to copy 3 lines, I'll do Shift-V+jjj+ESC, instead of just 3yy 4. (possibly other 100 items here...) But I find it very hard to change those habits. Anyone else…

I don't have any answers.

I've got an Emacs plugin installed that's kinda like easy-motion, and actually have started to use that.. but I think I'll be sticking to eg. `hhjjjj` for the rest of my life.

I write a lot of Lisp, so I wonder of learning more structural editing commands (eg. something like `jump-to-sibling-sexp`) could help me map my intents more cleanly, but wouldnt be able to carry that into other languages and expect I'd fall right back into my old ways.

Maybe it just isn't so bad. When your findger is on a key, there's a lot of value in not moving at all. Counting is taxing and lacks feedback, which is why I hate resizing terminal panes. Maybe there's more power in learning and integrating new habits, like easy-motion or search-forward (even for short distances), than in eliminating old ones.

As an aside, the most jarring thing about going back to Vim from Emacs (which I do multiple times a day) is not having nornal-mode & co. in the mini-buffer / command-line. Love how emacs treats it as just another buffer, so even eg. visual-mode works in there.

Re: Learn Vim (2021)

#103
post #23

I've re-built my neovim config like 3 times this year as I have played with several 'distributions' and styles. SpaceVim, LunarVim, AstroVim, and NVChad to name a few. This last weekend I gave LazyVim a try and it is by far the most sane config setup I have used and I will now be sticking with it. There is a starter repo where you clone it, delete the .git directory and start customizing. https://github.com/LazyVim/L…

https://github.com/helix-editor/helix is the answer mate

I would love to use helix, if only it hadn't decided to come up with new keymappings

Re: Learn Vim (2021)

#104

I'm using vim for 10 years and I know I have a lot of "bad" habits that I'm trying to eliminate, but it's hard. For example: 1. instead of doing 4j I might do jjjj 2. if I'm in the middle of a word and want to change it, I'll do bcw instead if ciw 3. if I want to copy 3 lines, I'll do Shift-V+jjj+ESC, instead of just 3yy 4. (possibly other 100 items here...) But I find it very hard to change those habits. Anyone else…

Unconsciousness is not good at doing even simple math like counting, so habits like 4j or 3yy are hard to form.

It may even be counterproductive as non-trivial efforts to establish such habits will have cost. Less efforts will be spent on forming habits of spotting bugs in the code.

Re: Learn Vim (2021)

#105

Earlier quoted context omitted.

I'd honestly point folks towards Helix[0] these days if they don't already have something keeping them on neovim/vim. There's very little in the ways of needing to configure Helix; it has built-in most functionality that you'd find with batteries-included vim "distributions" and it works out of the box with the installed LSP servers on your system. [0]: https://github.com/helix-editor/helix

Helix itself looks amazing, but the keybindings make me stay away from it. Even if they are better than the original, I don't want to learn another set of "non-standard" keybindings that I need to switch between only to use an editor.

Exactly. Vim keybinding are used in so many other places, it seems like a waste to learn a bespoke set of mapping just for a vim like editor.

Re: Learn Vim (2021)

#106
post #26
post #12

Earlier quoted context omitted.

I learned vim when I picked up linux, now I work at a company with a customized emacs tool we have to use. Doh it never ends...

If you develop RSI from emacs, you could have the employer make reasonable accommodations, i.e. let you use Vim :)

I am a big Emacs user, and I just move my hand to hit certain keys.

I don't get why there is so much talk about RSI. Speed is nice, but it is not the end-all be-all as far as I am concerned.

Re: Learn Vim (2021)

#107

I can handle basic editing in vim and I have given real tries to use it as my main text editor but I just cannot find a way to get as comfortable in vim as I can in VS Code.

I don't really "get" using vim as an editor, but I love using vim bindings in vs-code. I've been using vim bindings for maybe a year now? Didn't really keep track of when I started. I definitely consider myself a novice, and maybe am using vim to 10% of it's potential, but the little bit I do use is nice.

On the other hand, I've never considered typing speed or editing speed the bottleneck in programming, it's usually debugging, solving problems, or reading files with 10k+ LOC and multi-hundred line files figuring out what they are doing.

Re: Learn Vim (2021)

#108

I'm using vim for 10 years and I know I have a lot of "bad" habits that I'm trying to eliminate, but it's hard. For example: 1. instead of doing 4j I might do jjjj 2. if I'm in the middle of a word and want to change it, I'll do bcw instead if ciw 3. if I want to copy 3 lines, I'll do Shift-V+jjj+ESC, instead of just 3yy 4. (possibly other 100 items here...) But I find it very hard to change those habits. Anyone else…

I often use jjj and don't plan to change that. Forty years ago, when working on slow terminals, it may have made sense to optimize movement but not today. For small movements, I tend to spam keys. For larger jumps, I use an easy-motion like plugin such as Svart. Counting lines and words simply makes no sense to me for frequent operations.

Re: Learn Vim (2021)

#109
post #78

Earlier quoted context omitted.

I don't understand this attitude. It's clearly more conducive to solving problems to be able to move around our environment more quickly. It's extremely useful (compared to a beginner who only knows insert and write quit) to understand the different vim modalities as well as a few commands to jump around a file or to perform regex or to call an external command. When you're not proficient with the necessary tools, yo…

I feel like at a certain point of efficiency there are diminishing returns. A good analogy is typing speed. You don't need to have 200 wpm to be productive. Everybody adapts to how efficient they need to be at what they do. Vim is not a requirement for being productive. If it was, it would be the most popular editor. I also don't think the person you are replying to is saying that it isn't important to "master" your…

VS Code with vim keybindings is extremely popular. If you don't know how to use vim, you just don't realize how much of a time/effort saver it is. I can't imagine not having wrist pain if I had to use the mouse every time I wanted to move my cursor around for more than a few characters/lines. Trying to not use vim feels like going back to the stone age whenever I can't use it. I like to use vim bindings even when I'm editing english.

Re: Learn Vim (2021)

#110
post #97

Earlier quoted context omitted.

I don't understand this attitude. It's clearly more conducive to solving problems to be able to move around our environment more quickly. It's extremely useful (compared to a beginner who only knows insert and write quit) to understand the different vim modalities as well as a few commands to jump around a file or to perform regex or to call an external command. When you're not proficient with the necessary tools, yo…

It is not about only Vim as editor but Vim as keybindings too. Nowdays, most of all modern IDEs support Vim keybindings along well integrated IDE features.

Even a lot of web-based IDE type things have VIM bindings available!
Post reply on HN