Live data from Hacker News

History and Effective Use of Vim

begriffs.com

121–130 of 226 posts

Re: History and Effective Use of Vim

#121
post #96

Earlier quoted context omitted.

If you want portable then yeah empty out your .vimrc and get fluent with vims superpowers as they are. If you want "personalized powerhouse editor with IDE powers" you are FAR better off going with Emacs/Evil. The Emacs plugin ecosystem is way ahead of Vim. Plugins are clean, stable and compose well together. That was never my experience with Vim. Also unlike Vimscript, Elisp is pretty clean useable language that man…

Use tramp with Emacs and you can interact with remote machines as if they were local. Who cares if the server only has vim, you have Emacs.

+1 for Tramp. You can connect to SMB, ssh, and even docker containers from within Emacs. It's strictly better than using a remote ssh session with vim because you don't need to configure anything server-side. It would be a huge hassle to setup plugins like autocompletion on a remote machine for vim, but Emacs lets you use all your regular plugins while ssh'ing, which is a huge bonus.

Re: History and Effective Use of Vim

#122
post #25

Earlier quoted context omitted.

I despise and hate with passion the Capslock key. On linux I always run setxkbmpap -option caps:escape. I wish the same could be done on Windows. I got used to it so much that I find myself from time to time writing catpital letters when I'm on Windows or foreign setup. My hate for the key came years before I thought about the possibility of remapping it. Similarly, I hate the F1, a key that when accidentally pressed…

> I wish the same could be done on Windows You can:) https://vim.fandom.com/wiki/Map_caps_lock_to_escape_in_Windo...

I use autohotkey...

This is a bit older than my current bindings, but this does 3 useful bindings

https://github.com/keithn/vsvimguide/blob/master/vsvim.ah

CapsLock = Esc

Alt-J = Down Arrow

Alt-K = Up Arrow

this is super useful in non vim editors that support vim bindings, and the browser with vimium. The arrow keys are for where you get a dropdown list and don't want to touch your arrow keys. In Visual Studio where I use vim keybindings ( using VsVim ) a lot of refactorings / auto complete gives dropdown options and this gives an easy way to select them without leaving your homerow.

Re: History and Effective Use of Vim

#123
post #96

Earlier quoted context omitted.

Use tramp with Emacs and you can interact with remote machines as if they were local. Who cares if the server only has vim, you have Emacs.

+1 for Tramp. You can connect to SMB, ssh, and even docker containers from within Emacs. It's strictly better than using a remote ssh session with vim because you don't need to configure anything server-side. It would be a huge hassle to setup plugins like autocompletion on a remote machine for vim, but Emacs lets you use all your regular plugins while ssh'ing, which is a huge bonus.

Vim can also edit remote files, with its built-in netrw module. It can do ssh, ftp, dav, fetch, http, rcp, rsync.

vim scp://remoteuser@server.tld//absolute/path/to/document

:help netrw-start

Re: History and Effective Use of Vim

#124
post #21

Earlier quoted context omitted.

I've taken this approach halfway and only install plugins/config that I can easily do without. Things like git-gutter [0] and a line at the 80th column [1] are great, but I don't depend on them when I log into a remote machine. If I really want some features, I have them somewhat organized in my .vimrc [2]. It's a great compromise; I find that I haven't thought about major editor configuration in a couple of years. […

I would recommend ditching gitgutter for vim-signify: https://github.com/mhinz/vim-signify It is less buggy and doesn't refresh until you save, which I find to be less distracting.

I've never really understood why you'd want a constant visual indication of changed lines all the time, especially with something bright/colourful on the side. The only time I find that useful is during reviews before committing. Otherwise it seems like a distraction. Vim is great for minimalism.

Likewise I keep Nerdtree closed until I need it and it opens on the right. While VSCode, old Textmate, etc has it always visible and on the left side.

Re: History and Effective Use of Vim

#125

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…

If you want portable then yeah empty out your .vimrc and get fluent with vims superpowers as they are. If you want "personalized powerhouse editor with IDE powers" you are FAR better off going with Emacs/Evil. The Emacs plugin ecosystem is way ahead of Vim. Plugins are clean, stable and compose well together. That was never my experience with Vim. Also unlike Vimscript, Elisp is pretty clean useable language that man…

I agree, and I use both Vim and Emacs regularly. Both great tools with different payoffs.

Re: History and Effective Use of Vim

#126
post #111
post #66

Earlier quoted context omitted.

I use a bunch of plugins and I've never had trouble remembering the defaults in the odd case I'm unable to use my own config. I don't get why the top comment on all vim threads is always recommending using poor defaults your whole life so you can avoid learning to configure it or avoid a second of confusion when you're ssh'd somewhere. Maybe everyone else besides me spends all their time ssh'd into random servers.

It's not a serious issue for me. I can't download my configs to random devices either. Working on embedded stuff I've usually only got vi, and honestly, the most annoying thing is no `F` binding (which is a default in vim).

Poor undo is my main bugaboo in vi, but I'm usually OK with just :e! and starting over.

Re: History and Effective Use of Vim

#127
post #124

Earlier quoted context omitted.

I would recommend ditching gitgutter for vim-signify: https://github.com/mhinz/vim-signify It is less buggy and doesn't refresh until you save, which I find to be less distracting.

I've never really understood why you'd want a constant visual indication of changed lines all the time, especially with something bright/colourful on the side. The only time I find that useful is during reviews before committing. Otherwise it seems like a distraction. Vim is great for minimalism. Likewise I keep Nerdtree closed until I need it and it opens on the right. While VSCode, old Textmate, etc has it always v…

Ones that take up space are kind of annoying, I agree. I like IntelliJ's solution: mark with green, or yellow for additions and changes. It's a 1px line next to the line number, and also it's in the "minimap" type of view so you can jump right to where your changes are in a large file.

Re: History and Effective Use of Vim

#128
post #10

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…

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

ESC is a much much larger target requiring much much less peripheral attention. Maybe I'm not as good a touch-typist as I like to think I am.

Re: History and Effective Use of Vim

#129

I started my programming career determined to be a vim guru and do all my programming with vim. This was misguided and after a year of wasted productivity and wasted time fiddling with plugs and dealing with broken stuff (surely by my own hand) I switched to a professional IDE and I rapidly became a much better developer. I use vim constantly now but in it's most plain vanilla form, for the purpose of editing files w…

> I really wish however that every Linux system had a clone of the old DOS edit command which was beautifully simply and straightforward and met most needs highly intuitively. The nano editor experience is pretty close to the old DOS edit feeling.

nano, pico, joe, depending on which carrier package you hvae installed. they all have the ^s ^x status bar type interface.

Re: History and Effective Use of Vim

#130

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'd take a tremendous hit in productivity if I followed that advice.

The amount of time I spend in Vim not customized is negligible, and I can always hit Esc in those cases with a not even in the ballpark time saving over losing snips and all the custom plugins.

Post reply on HN