Live data from Hacker News

History and Effective Use of Vim

begriffs.com

81–90 of 226 posts

Re: History and Effective Use of Vim

#81
post #10

Earlier quoted context omitted.

Just a quick note, you can use Ctrl +[ rather than Escape. Saves your fingers from constantly having to reach for that corner.

I bind my CAPSLOCK to ECAPE that way instead of the escape key killing my hand my left pinky finger can just naturally get me out of insert mode by hitting CAPSLOCK.

Do yourself a favor and figure out how to bind caps lock to press for escape, hold for control. I use a programmable keyboard (web search for QMK if you're interested) but there are software options too. You'll never look back and you'll be baffled how you ever lived without it.

Re: History and Effective Use of Vim

#82

After years of a love/hate relationship with Vim (I love what it does, but have configuring it), I had an epiphany: by sticking with the defaults, whether they are my preferred choices or not, I can instantly understand how to use Vim in any environment. Once you get used to biting the bullet and hitting escape instead of jj, or ctrl+c, it just works, everywhere. If you abandon the urge to pimp out your Vim with a bi…

I try to keep it minimal as well, but some plugins are too good not to install for my daily work. TabNine, Auto Pairs, Vim Surround, Endwise, and CtrlP are a few that come to mind.

Re: History and Effective Use of Vim

#83
post #43

I rarely ever use actual vim, mostly when I'm in the terminal. But I have vim plugins for most IDEs I use (VS code, intellij, XCode). It makes editing so much faster. When I have to get by without it I feel as if someone put weights around my wrists. The reason I don't use Vim is because it's frankly not a smooth experience for most languages (unless you fiddle around a lot, and even then I found Ide+vim plug-in supe…

After a several month effort to learn vim bindings and use them full-time, I eventually ended up weaning myself back off because the plugins for the editors I actually use all seemed to come with considerable downsides. vscode-vim caused odd performance issues, and I encountered significant bugs with the undo stack (namely hitting 'u' would sometimes take out the last 10-15 changes instead of just one). IDEAvim would…

I experienced issues with the VS Code plugin as well, though not as severe as you described. If I had the same issues, I wouldn't use it as well. I haven't experienced any issues ever with IDEA vim. I haven't used XCode in a while, so I can't chime in on the current state of the plugin. My ranking for most stable to least stable plugins I've used would be the following (in case of multiple plugins, I don't recall the exact one, sorry):

- QT Editor - Eclipse - IntelliJ - Visual Studio - VS Code - XCode

At the moment I mainly use VS Code, and I'm still editing much faster, despite the issues (occasional undo hiccups and error messages).

Re: History and Effective Use of Vim

#84
post #16
post #10

Earlier quoted context omitted.

Just a quick note, you can use Ctrl +[ rather than Escape. Saves your fingers from constantly having to reach for that corner.

On my keyboard I need ALT GR for [. On a side note, I'm rather disappointed that the ESC key didn't get updated with modern keyboards. The keyboard vi was designed on had ESC where Capslock now resides.

Are your sure it wasn't control? I know the ADM terminals were set up that way and they even had the arrows on HJKL.

Re: History and Effective Use of Vim

#85

After years of a love/hate relationship with Vim (I love what it does, but have configuring it), I had an epiphany: by sticking with the defaults, whether they are my preferred choices or not, I can instantly understand how to use Vim in any environment. Once you get used to biting the bullet and hitting escape instead of jj, or ctrl+c, it just works, everywhere. If you abandon the urge to pimp out your Vim with a bi…

I want syntax highlighting and correct tab behavior, though, and I use a language that not even Neovim has built-in syntax support for.

Re: History and Effective Use of Vim

#86

Earlier quoted context omitted.

After a several month effort to learn vim bindings and use them full-time, I eventually ended up weaning myself back off because the plugins for the editors I actually use all seemed to come with considerable downsides. vscode-vim caused odd performance issues, and I encountered significant bugs with the undo stack (namely hitting 'u' would sometimes take out the last 10-15 changes instead of just one). IDEAvim would…

Reading about that undo bug gave me a knot in my tummy. Damn.

If it’s any consolation, Ctrl-R will redo those same fifteen changes, so you won’t lose any work. And the vim extension’s undo history is separate from the editor’s so you can’t really lose any work accidentally.

Re: History and Effective Use of Vim

#87
post #5

After years of a love/hate relationship with Vim (I love what it does, but have configuring it), I had an epiphany: by sticking with the defaults, whether they are my preferred choices or not, I can instantly understand how to use Vim in any environment. Once you get used to biting the bullet and hitting escape instead of jj, or ctrl+c, it just works, everywhere. If you abandon the urge to pimp out your Vim with a bi…

this + nvi had more direct lineage to true vi, Keith Bostic was in the Bill Joy headspace, but it kind-of got stuck. Vim diverged in ways which used to annoy me but I've come to accept. I won't mention "the other editor family" here but it is interesting to see the things in that one, which I miss in this one (for me at least) which are principally the ability to cut-paste regions, and a set of things which became sc…

What about dip, di(, and di{? Those have always worked for me, as long as the code is well formed.

Re: History and Effective Use of Vim

#88
post #17
post #7

To anyone who hasn't tried it - http://www.vimgolf.com/ is probably the quickest and most fun way to take your skills to the next level.

I recommend the book "Practical Vim" too: https://pragprog.com/book/dnvim2/practical-vim-second-editio... I remember learning a fair amount from it when I read it a few years ago (and should probably read through it again at some point).

Agreed, it's a great book. Drew Neil, the author also runs vimcasts.org for nice short single lesson videos.

Re: History and Effective Use of Vim

#89
post #12

Earlier quoted context omitted.

Yup. I've been using vi[m] on an almost daily basis since about 1989...wow, that's 30 years. In those decades, I have resisted putting anything in my .vi[m]rc except: set tabstop=4 set expandtab set shiftwidth=4 set shiftround That's it. And I agree with you, it's a very happy place for me.

What made you pick those 4 if I may ask?

I have no idea where it started...I've been pasting those into my .vimrc for perhaps 20 years now, or more. I'm pretty sure I copied it from someone else.

Specifically, I can't tolerate the tab key actually putting a tab character in. And I like four spaces per tab.

Re: History and Effective Use of Vim

#90

Earlier quoted context omitted.

Yup. I've been using vi[m] on an almost daily basis since about 1989...wow, that's 30 years. In those decades, I have resisted putting anything in my .vi[m]rc except: set tabstop=4 set expandtab set shiftwidth=4 set shiftround That's it. And I agree with you, it's a very happy place for me.

set nu

Oh man...I know a lot of people love that, but I just can't handle it. (:
Post reply on HN