Live data from Hacker News

History and effective use of Vim (2019)

begriffs.com

81–90 of 98 posts

Re: History and effective use of Vim (2019)

#81

Earlier quoted context omitted.

This is me all the time. The worst is “kkk”. I can’t remember why I type it in vim (it’s muscle memory, and I’m not at a computer to try it out), but it has really bad connotations here in the US south, so… no bueno.

Unsolicited advice for scrolling without spamming j and k: - C-u and C-d to jump up/down - [ and ] to go prev/next empty line (I have a macro to clear empty spaces at the end of lines so this works well for jumping functions in code) - from the article: 50% to go the halfway point of a document - 100gg to go to line 100 - 100k to go 100 lines down Are there any more good ones? Edit: occurs to me that you might have r…

{ / } jump to start/end of the block.

Between that and 20j and (blasphemy probably) just using the scroll wheel, that handles most of my scrolling needs.

Re: History and effective use of Vim (2019)

#82
post #33
post #15

Earlier quoted context omitted.

What's wrong with the way it handles long lines? It can either wrap or not wrap depending on your configuration. Personally, I disable wrapping in every editor I use because I find it extremely off putting. I'm curious which behavior you desire and if you have any examples of editors that you think handle long lines well.

Another issue is scrolling visual lines one by one that have been wrapped. (N)vim can only scroll by literal lines, so if a line is longer than the screen and wrapped, there is no way to step through line by visual line. https://github.com/neovim/neovim/issues/8715

As that issue points out, "gj" and "gk" will step through by visual lines.

The complaint in that ticket is that you can't make it the default for all the other ways of scrolling

Re: History and effective use of Vim (2019)

#83
post #80

Earlier quoted context omitted.

Many IDE's have a VIM editor plugin, so you can have the best of both worlds :)

In my experience it's rarely the best of both worlds, it's more of a case where the IDE becomes more tolerable. The problem comes in when the IDE struggles to keep up, or is busy trying to move my cursor somewhere that I don't want it to be. IntelliJ is really bad about this, I'll often type something and hit esc to go back to normal mode. Mentally I'm moving to another line using a Vim motion, but IntelliJ lags, and…

> The problem comes in when the IDE struggles to keep up, or is busy trying to move my cursor somewhere that I don't want it to be.

Agree completely. Even completely common Vim actions are often just way too sluggish. Not to mention I've remapped "" to "jj", which is often unsupported by Vim extensions.

This is before even mentioning all the "helpful" features like parenthesis-completion that IDEs like to foist on me. Word processors don't try to insert matching double-quotes, why do I want an IDE to insert matched parens?

Re: History and effective use of Vim (2019)

#85
post #3

I love vim. I am not one of those users who has a huge number of plugins and takes part in an extended eco-system that they perhaps do not fully understand -- for the last ~20 years of my life I have been trying to learn a little more vim each time I use it. I often don't, but it just has so many surprises that when I feel frustrated, I try to work out the "vimmish" way of doing things. Occasionally I give into tempt…

> You can only imagine how, in command mode, he effectively summons the textual equivalent of the Nine Hells of Ba'ator upon my open documents if I am not quick enough... There's always [u]ndo. Or you can use :earlier 2m to go back 2 minutes in time.

> go back 2 minutes in time.

Honestly this is single-handed my favorite thing about vim.

Not the ability to fluently traverse through text (and apparently time).

But that you can use it for a almost decade, and still have a stranger on the internet blow your mind with simple features you didn't know existed. There's so many of those one-off commands that are so useful, yet you've somehow never heard of them?

Re: History and effective use of Vim (2019)

#86

I’ve used vim for decades and have utterly failed at switching away every time I tried to. I miss everything about it too much. My only real complaint is I have a hard time using IDEs, because my vim muscle memory is too strong and despite many offering vim key bindings they never offer all the features/keys I typically use. Often missing are recording/playback, visual mode, anchors, vim’s (unique) regex syntax, buff…

If you don't mind dark magic, you can use SpaceVim to get that IDE feeling with Vim.

Re: History and effective use of Vim (2019)

#87
post #3

Earlier quoted context omitted.

> You can only imagine how, in command mode, he effectively summons the textual equivalent of the Nine Hells of Ba'ator upon my open documents if I am not quick enough... There's always [u]ndo. Or you can use :earlier 2m to go back 2 minutes in time.

> to go back 2 minutes in time. Wut. ~27 years of using vim, you just blew my mind.

crazy thing with vim is every person I've seen uses a different subset of functionality, which always contains a few things I've never seen before. Which is also pretty cool in my book. No two people use vim the same way.

Re: History and effective use of Vim (2019)

#88
post #53
post #9

If Vim was a GUI application (and could smoothly handle long lines), it would the perfect editor for me. Alas, the best I've seen so far is Neovim's discontinued GUI frontends.

It's probably not what you're looking for but I find vim bindings for VSCode is a good balance between vanilla vim and an IDE.

for the chaotic evil play I was going to suggest Emacs with vim bindings. But you outdid me there.

Re: History and effective use of Vim (2019)

#89
I don't use many plugins. But there's 2 plugins I find very useful.

* Use an LSP client plugin, whichever you prefer. It's better than any ctags circus you can do. coc.nvim is more feature rich but also heavier. Vim-lsc if you prefer more barebones.

* FZF.vim; fuzzy searching files as well as lines in same file.

On a related note, does anyone know proper parenthesis / bracket completion plugin? I never got that functionality to work as good as IntelliJ.

Re: History and effective use of Vim (2019)

#90
post #3

Earlier quoted context omitted.

> You can only imagine how, in command mode, he effectively summons the textual equivalent of the Nine Hells of Ba'ator upon my open documents if I am not quick enough... There's always [u]ndo. Or you can use :earlier 2m to go back 2 minutes in time.

me Monday morning: :later 8h One can dream...

> still blank

Fair enough

Post reply on HN