Live data from Hacker News

Learn Vim (2021)

github.com

161–170 of 215 posts

Re: Learn Vim (2021)

#161

Earlier quoted context omitted.

> would involve 10 minutes of drudge work in their simplistic editors, instead opting for "deploy & pray" when the task was totally doable in a couple of seconds with a Vim macro. I really very much doubt this. Sounds like an application of rose-tinted glasses and wishful thinking to some one-off task that then is extrapolated to all tasks.

Hey, I didn't say I do this every day. But I've had enough of these conversations that I can assure you that this low a bar is needed for some people to skip important jobs. If your doubt applies to the usefulness of knowing the system, I don't really know what to tell you -- if you can't take someone's word for it, I don't think anything less than you experiencing it yourself would convince you, anyway. As for one-o…

> But I've had enough of these conversations that I can assure you that this low a bar is needed for some people to skip important jobs. If your doubt applies to the usefulness of knowing the system

No. My doubt extends to "omg vim is so amazing that these tedious tasks take seconds unlike in these primitive text editors".

Because my experience at work has been consistently the exact opposite: vim users routinely take longer time for most tasks precisely because it's a rather primitive text editor, and not a code assist tool.

Re: Learn Vim (2021)

#162
I can use vim, but I still find it easier to just open a file in nano and write.

I feel like I should be able to use a tool without thinking and without having to learn how the tool works, at least in regards to text editing.

And I feel that nano or pretty much any other editor except vim can be used the same way, just like a notepad on Windows or gedit or geany, you open a file and you start editing or you move to the desired location using the arrow keys or a mouse and start editing.

The very joke of "How to exit vim" feels like a good example of bad user experience and poorly developed tools.

Crude example: Imagine if you couldn't drop a hammer and it was just stuck to your hand just because you didn't know that you had to type :q!.

But since I know how to use it at least the basics it is somewhat comforting knowing that pretty much any machine I'll touch will probably have vim pre-installed, so I don't have to spend time searching what is the name of the program to edit files. I have seen that some have an alias 'edit' to whichever is the default one, but thus far 'edit' hasn't worked on any of the machines I've tried.

Yes, vim can do a lot more then just edit files, but at the end of the day...

I just want to edit, compile, fix, repeat. (https://youtu.be/wBoRkg5-Ieg)

Re: Learn Vim (2021)

#163

Earlier quoted context omitted.

Hey, I didn't say I do this every day. But I've had enough of these conversations that I can assure you that this low a bar is needed for some people to skip important jobs. If your doubt applies to the usefulness of knowing the system, I don't really know what to tell you -- if you can't take someone's word for it, I don't think anything less than you experiencing it yourself would convince you, anyway. As for one-o…

> But I've had enough of these conversations that I can assure you that this low a bar is needed for some people to skip important jobs. If your doubt applies to the usefulness of knowing the system No. My doubt extends to "omg vim is so amazing that these tedious tasks take seconds unlike in these primitive text editors". Because my experience at work has been consistently the exact opposite: vim users routinely tak…

Well, I'm not really sure if we're talking about the same thing. If you're talking about language integration, I've got no quarrel with that (see my earlier comment). The experiences I was referring to are more along the lines of text manipulation in general, not "rename class", "extract method" and the like. If you're talking about features like that, I'd readily agree with you: Trying to do the same thing with Vim macros is just picking the wrong tool for the job.

I won't beleive your assertion, however, that this invalidates the benefits of learning Vim bindings (especially since respective emulation layers are at least passable in pretty much any editor or IDE worth its salt).

If you're talking about normal minute-to-minute text handling and creation of text files without language assist (scripts, cucumber tests, any programming task not blessed by your IDE's refactoring integration) on the other hand, we're at the point where I have trouble believing you.

Re: Learn Vim (2021)

#164
post #100

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…

What vim can do that emacs often is a little too slow for and IDE:s can't is to have finished even quite complicated incisions and changes to your text before you've become conscious that you asked it to do the thing. This means it can help keep out intrusions about editor maneuvering from your mind at work. Some people see no value to this and fill their vim bundle with plugins that slow everything down a lot, but s…

I agree with all except that Emacs is a bit too slow or a little off for these tasks. Emacs is rather easy to extend and modify to make exactly fit your task if you want to. Out of the box search is decent and very easy to make better than fzf. Ripgrep is cool and when used within Emacs you can also edit the search results and save them back to all files at once if you want to.

Re: Learn Vim (2021)

#165

Earlier quoted context omitted.

> But I've had enough of these conversations that I can assure you that this low a bar is needed for some people to skip important jobs. If your doubt applies to the usefulness of knowing the system No. My doubt extends to "omg vim is so amazing that these tedious tasks take seconds unlike in these primitive text editors". Because my experience at work has been consistently the exact opposite: vim users routinely tak…

Well, I'm not really sure if we're talking about the same thing. If you're talking about language integration, I've got no quarrel with that (see my earlier comment). The experiences I was referring to are more along the lines of text manipulation in general, not "rename class", "extract method" and the like. If you're talking about features like that, I'd readily agree with you: Trying to do the same thing with Vim…

> If you're talking about language integration, I've got no quarrel with that

I am. Because we are talking about these mythical Java programmers who couldn't do something that Vim would have done in seconds

> I won't beleive your assertion, however, that this invalidates the benefits of learning Vim bindings

And the reason to learn them is because there's a fairy tale of some programmers not doing the job that we're led to believe could be solved in seconds in vim.

> If you're talking about normal minute-to-minute text handling and creation of text files

Are we? Let me remind you: "I have quite some anecdotes about e.g. creating integration tests where my colleagues wouldn't test something properly just because doing so would involve 10 minutes of drudge work in their simplistic editors, instead opting for "deploy & pray" when the task was totally doable in a couple of seconds with a Vim macro."

Oh look. We're literally talking about programming.

> we're at the point where I have trouble believing you.

Let's start with your fairy-tales before we come to believing or disbelieving what I wrote.

Re: Learn Vim (2021)

#166
post #100

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…

What vim can do that emacs often is a little too slow for and IDE:s can't is to have finished even quite complicated incisions and changes to your text before you've become conscious that you asked it to do the thing. This means it can help keep out intrusions about editor maneuvering from your mind at work. Some people see no value to this and fill their vim bundle with plugins that slow everything down a lot, but s…

If you already have Caps Lock remapped to Control, why not just use Ctrl-[ to get back to normal mode?

Ctrl-[ is the same keycode as escape in terminals, and it's much easier to reach. For me, remapping jk in insert mode results in lag after typing 'j'.

Re: Learn Vim (2021)

#167

Earlier quoted context omitted.

Ctrl+G + line number Ctrl+F + what you are looking for PgUp PgDown plus visual scan Home, End, arrows (plus potentially control) for pinpointing the exact spot. Shift for block marking. Ctrl+C (or X), Ctrl+V for moving stuff around. No reason to touch mouse or learn cryptic shortcuts.

Only after learning vim you realize how clumsy and slow this is.

I used vim for 5 years, afterwards I switched over to Emacs, and I couldn't disagree with you more. What's clumsy and slow is having to switch between insert mode, normal mode, and visual mode hundreds of times while working rather than just using modifier keys for special actions.

Re: Learn Vim (2021)

#168

Earlier quoted context omitted.

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…

Ctrl+G + line number Ctrl+F + what you are looking for PgUp PgDown plus visual scan Home, End, arrows (plus potentially control) for pinpointing the exact spot. Shift for block marking. Ctrl+C (or X), Ctrl+V for moving stuff around. No reason to touch mouse or learn cryptic shortcuts.

vim equivalents:

20g line number

/ find what you are looking for

same for pgup and pgdown

i think what you're describing sounds a bit like visual mode which is just v

d and p for cut and paste if moving stuff around needs to be done (dd for whole line, 5dd for 5 lines, v and then j a few times in visual mode before d or y for yank (copy), etc...)

Note how you don't have to strain your pinky to hit ctrl for any of these?

Re: Learn Vim (2021)

#169
post #112

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'm definitely not a vim master but I've made an active choice to avoid 4j style movement. The main benefit of vim, for me, is the mind-body connection. Commands are either muscle memory or like saying a short phrase in my head so it flows out naturally. Counting lines before executing breaks that natural flow

What if you use relative line numbers though?

Re: Learn Vim (2021)

#170

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…

For 1, I use https://github.com/ja-ford/delaytrain.nvim (for nvim only); it basically stops repeated navigation keys from working for a short while.

Awesome, I might try that!
Post reply on HN