
History and Effective Use of Vim - begriffs
https://begriffs.com/posts/2019-07-19-history-use-vim.html
======
2bitencryption
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 billion plugins, and just
use it raw, it's a kind of editor Nirvana. Let go of your desires and live
without want :)

Of course, that's just me. I understand why someone would want to turn Vim
into their personalized powerhouse editor with IDE powers, with their .vimrc a
'git pull' away.

But I've learned to live with the humble defaults, and it's made life easy.

~~~
Diederich
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.

~~~
urda
What made you pick those 4 if I may ask?

~~~
pvg
Every thousand years this metal sphere ten times the size of Jupiter floats
just a few yards past the Earth. You climb on your roof and take a swipe at it
with a single feather. Hit it once every thousand years til you've worn it
down to the size of a pea.

Same thing but start with the biggest vim config you can find.

------
stirfrykitty
Been using vim since 1998 and rarely stray unless I'm typing notes for
something unimportant and them I use Nano.

Back in the day when I was a Unix admin, we often worked in full screen
terminals and when editing a config file didn't like having to close the vim
instance to go look at something, so learned about this little gem:

:sh (go back to shell and do your thing and leave vim running)

Ctrl-d to return to intact and running vim instance.

As an aside, if you decide to use nano to edit config files, make sure you use
nano -w (no wrap), otherwise you may find yourself with a non-bootable OS
instance.

~~~
Syssiphus
Or just CTRL+z and then 'fg' to go back.

~~~
stirfrykitty
Does that work in all shells?

~~~
pfranz
[https://en.wikipedia.org/wiki/Job_control_(Unix)](https://en.wikipedia.org/wiki/Job_control_\(Unix\))

I haven't used many esoteric environments, but wikipedia says it "exists in
most modern Unix shells" and the timeline for first adding it was the late 70s
early 80s.

~~~
mprovost
Job control was first implemented in csh, another Bill Joy invention, although
I believe that particular feature was added by someone else.

------
anaphor
This video of a talk that Bram Moolenaar (the author of vim) gave at Google in
2007 has some pretty good advice.

[https://www.youtube.com/watch?v=eX9m3g5J-XA](https://www.youtube.com/watch?v=eX9m3g5J-XA)

Mainly the idea is to not try and learn everything about vim, but instead pay
attention to how you use it, and find things that are inefficient or could be
easier, and _then_ go figure out how to make vim do that thing more
efficiently.

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

~~~
smitty1e
[https://vimvalley.com/](https://vimvalley.com/) isn't cheap, but you get what
you pay for.

~~~
newman8r
wow good for them if they're getting people to pay $99. It does look well-
designed, but the course outline seems a bit elementary. If anyone is thinking
about buying this, you could probably just google the items in the course
outline and try watching a youtube video on it.

~~~
smitty1e
Absolutely.

The courseware runs entirely in the browser; gives great feedback; and helped
me level up in a jiffy.

Such that I have no qualms mentioning it here.

~~~
newman8r
yeah, increasing your skill is easily worth $100. Back when I was employed as
a developer, I bought all kinds of educational stuff. Now that I'm working on
startups, everything's gotta be free.

------
goemacs
Everyone is missing the most important contribution of vi[m].

Vim defines an ergonomic set of rules for text navigation and manipulation,
often implemented by very simple key bindings. This is wonderful.

The Vim editor implements all these rules, but the Vim's plugin ecosystem is a
disaster. Hacks pile upon hacks. Noone understand Vim scripts. Vim scripts are
easily broken and do not interoperate well with other scripts.

These set of rules can be easily implemented by other editors, as evidenced by
many IDEs supporting Vim key bindings. Although these editors may not support
all the above rules, they are pretty close (see the evil plugin in Emacs) and
can replace Vim in daily usage.

The editor war is over. Vim's keybinding is superior. But the longevity of a
text editor lies in its extensibility. For this, Emacs wins in the long run.

------
andrewstuart
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 when logged into Linux systems. That's all I use it for.

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.

As a sidenote: can I just say that PyCharm is an incredible IDE and I can
recommend it heartily to anyone. If your job is programming then it is many
times over worth paying the money for the professional edition.

~~~
chimpburger
You can install IdeaVim in PyCharm. I've been using IdeaVim with IntelliJ for
6 years and could never go back to non-vim style editing. This plugin provides
the best of both worlds.

~~~
michaelmrose
Not to be unkind but have you tried actual Vim or adding any functionality to
an ide?

~~~
huseyinkeles
Not OP but I’ve been using ideaVim for many years now and I can say that it’s
quite good. It even uses my main .vimrc file and handles most of the things
very well.

~~~
michaelmrose
[https://github.com/JetBrains/ideavim](https://github.com/JetBrains/ideavim)
for any readers interested.

It IS much better than when I tried it. It parses your vimrc with and matches
simple patterns to support the subset of features it does support but it
doesn't really have an interpreter although one was discussed

[https://youtrack.jetbrains.com/issue/VIM-669](https://youtrack.jetbrains.com/issue/VIM-669)

Which means no plugins for example or complex viml. Presumably this would
simply be ignored not broken.

Another approach for a different environment that seems more interesting
[https://github.com/lunixbochs/ActualVim](https://github.com/lunixbochs/ActualVim)
I don't use sublime so I can't report on how optimal it is the idea of using
an embedded vim instance is certainly interesting.

------
emsy
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 superior). I do hope Neovim will solve this,
though I didn't test it because the last time I checked windows support was
experimental.

~~~
deergomoo
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 randomly go completely
unresponsive for me, sometimes requiring just re-opening the file and
sometimes requiring a restart of the entire IDE. And last I checked the Xcode
plugin requires re-signing the entire binary with a self-signed certificate
because the new plugin system won't support modal editing.

I was quite happy with neovintageous in Sublime, as well as Sublime's
excellent performance in general, but no matter how many plugins I installed
it could never seem to come close to the smarts of the other tools I was
using.

Ultimately I just arrived the the conclusion that I'm never going to be happy
with any editor and decided to make the best of what I could with a consistent
set of keybindings across the tools I use.

That said, every time I edit my hosts file or something on a remote server and
reach for vim, I wonder if I made the wrong choice. I'm really hoping Language
Server Protocol becomes the standard and we reach the point where it no longer
matters what editor we use.

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

~~~
xconverge
If it is any consolation, as a VSCodeVim maintainer, me too. We had some
issues at times, a lot of them have been resolved, but that first impression
is impossible to get back. Contributions have dwindled from people and I feel
like it needs another kick to make it perfect.

~~~
Legogris
Thanks for your work!

FWIW, since recently (can't tell you which version, but maybe a week or two
back), my editor has become real unresponsive (2-5 seconds delay when I switch
from Insert mode) and if I type before it switches, keystrokes get inserted as
text.

------
b3b0p
I don't limit my plugin usage on purpose. I will add a plugin if it adds a
value I can make use of.

Disregarding color schemes here is my list:

* FZF

* COC (it provides a lot of QoL, functionality of modern editors with it's plugins using an easy seamless yarn add)

* Sandwich

Very few customizations. Mostly vanilla.

Regarding colors, I love to try new ones all the time and my current is scery
followed by Gruvbox, and Dracula because they work in Terminal.app and iTerm.
They also look nice / easy-on-the-eyes. My friend at work has a thing for Nord
and another loves Monokai Pro, but apparently the author wants money for
it...? Which seems... different.

------
uberduper
I very recently set out to start bringing my vimrc with me when logging into
remote hosts and came up with this.

    
    
      Host * !github.com
        RemoteCommand echo -e "syntax enable\nset ts=2\nset sw=2\n" > ~/.tmp_vimrc && bash -c 'set -a; vi() { vim -u ~/.tmp_vimrc "$@"; }; set +a;bash -l'
        RequestTTY yes
    

It gets ugly when you get a lot of options in there.

It's possible to just curl or scp something in place via RemoteCommand above,
or `source: [https://foo.io/vimrc`](https://foo.io/vimrc`) but my security
paranoia lead me to this instead.

~~~
jacobparker
Curl it, check the sha256 of the download vs a hardcoded one and then source
it if they match?

The URL you curl could be a GitHub blob URL (theoretically immutable) but if
you check the hash you’re not trusting GH for anything other than
availability.

------
MisterOctober
Excellent article by the creator of the equally-excellent postgREST.
Especially the neato historical material - I didn't know that Vi was directly
derived from the ex [and by extension, ed] editor.

------
bayesian_horse
I've been using Vim for a couple of years now and I almost can't stand any
text editor without VIM-like extension.

However, recently I took a liking to Visual Studio Code (with VIM bindings of
course). Yes I know, it's terribly bloated and consumes RAM like nobody's
business, but the Browser DOM arguably is the successor of terminal emulation
in terms of ubiquitous interfaces, and VSC does use the additional power quite
smartly. There are graphical hints and tweaks which are next to impossible to
achieve in a terminal emulation.

I'll still use VIM all the time, especially remotely. But VSC does provide
similar extensibility. I somehow wish there was something like VSC, based on
web/electron, but more like a Texteditor, less like an IDE. And preferably not
controlled by a huge corporation.

~~~
brynjolf
There are just so many bugs with Vim implementation in VSC. For example the
two undo systems can lose sync and randomly delete half the document.

~~~
bayesian_horse
That hasn't happened to me, so far. But yes, it can be a bit buggy.

------
feiss
I used vim for years, but then Sublime appeared.. although I miss the
snappiness of vim, and wouldn't mind to come back. Specifically, I'd miss
these nice features of Sublime:

1\. Multiple cursors!! (and _how easy_ is to use them)

2\. Real-time preview of regex search

3\. Package Manager (easy installation _and_ discoverability of plugins)

4\. Jump to file, jump to function, jump to css selector.. (ctrl+p, ctrl+r,
using fuzzy search)

5\. Project tree in small font (many files at sight)

Edit: Here there is a bunch of good stuff:
[https://medium.com/@huntie/10-essential-vim-plugins-
for-2018...](https://medium.com/@huntie/10-essential-vim-plugins-
for-2018-39957190b7a9)

~~~
haolez
I've grown quite dependent on multiple cursors myself. Supposedly, Kakoune is
a vim-like editor with good multiple cursors support.

[http://kakoune.org/](http://kakoune.org/)

~~~
feiss
Mmm.. I see there are also vim plugins for multiple cursors, like
[https://github.com/terryma/vim-multiple-
cursors](https://github.com/terryma/vim-multiple-cursors) ..

~~~
Perceptes
I've been using that for years after I switched to Vim from sublime. It has
worked just fine for me.

------
jLyrrad
I remember the first time I ran `vimtutor` in my terminal. A lot changed since
then! Although I just stick with defaults since I have my IDE for my day-to-
day job.

~~~
dllthomas
Also of note, the first part of [https://vim-adventures.com](https://vim-
adventures.com) is fun. I expect the rest is too, but I got sticker shock when
I went to buy. Probably worth it for someone who doesn't already know vim
well, though.

------
kazinator
> _Some of the clones:_

>

> _nvi - 1980 for 4BSD_

> _[ ... ]_

> _elvis - 1990 for Minix and 386BSD_

This is incorrect; nvi is in fact a mid 1990's fork of Elvis, worked over for
better POSIX compliance by Keith Bostic.

> _vim - 1991 for Amiga_

Though that was the first public release, Moolenaar had worked on it since
1988. It was based on Tim Thompson's Stevie, which had been released, in 1987
(noted in the table).

~~~
begriffs
Thanks for the correction, can you give me a more precise date for nvi? I can
update the article.

~~~
kazinator
OK, I dug something up.

There is this page:

[https://sites.google.com/a/bostic.com/keithbostic/vi/](https://sites.google.com/a/bostic.com/keithbostic/vi/)

Where if you download the Nvi archive, you get 1.79 from 1996.

In the tarball's docs/ directory, there is a changelog which goes back to 0.92
-> 0.93 (Mon Dec 20, 1993). 0.94 went to 1.00 on January 10, 1994.

------
_hardwaregeek
I realized why Vim has always felt a little off to me. The primary
navigational commands are mostly on the right hand, which as a left handed
person feels very weird to me. While Emacs commands favor neither hand (if
anything they favor the left with C-f, C-b, C-a, C-e, C-x C-s, M-x, etc). Just
a small observation.

~~~
nightkoder
You may enjoy a dvorak keyboard. Up and down (j and k) are the c and v keys.
Left and right (h and l) are j and p.

~~~
_hardwaregeek
Yeah...but I like other people being able to use my keyboard. Besides I
already get confused between Windows shortcuts and Mac ones. Can't imagine
QWERTY vs DVORAK

~~~
michaelmrose
It's possible to switch keyboard layouts on the fly when another user takes
over.

------
Foober223
> Oct 2010 - Feb 2014 : Vundle (Discontinued after NeoBundle ripped off code)

Looks like Vundle has an MIT license. rip off usually implies something
negative or dishonest. Copying MIT licensed code is a normal and encouraged
activity.

~~~
begriffs
Sorry, the way I phrased that was sloppy. I should have said, "main author
abandoned, saying NeoBundle ripped off code."

[http://www.gmarik.info/blog/2014/why-i-stopped-
contributing-...](http://www.gmarik.info/blog/2014/why-i-stopped-contributing-
to-vundle/)

------
djhworld
I don't think I'll ever be able to internalise all the features of Vim.

I've been using it for > 10 years now but I still find myself learning (and
sadly forgetting) new features when reading articles like these.

------
adembudak
Shameless plug: A few days ago a write a quick reference for Vim too, checkout
[https://github.com/p1v0t/Doctor](https://github.com/p1v0t/Doctor)

------
xvilka
In addition to the [Neo]Vim, I can also recommend vifm[1] - vi-like file
manager. It supports vi-like key bindings, similar configuration, and color
schemes[2]. Moreover, it can be integrated[3] with Vim itself.

[1] [https://github.com/vifm/vifm](https://github.com/vifm/vifm)

[2]
[https://vifm.info/colorschemes.shtml](https://vifm.info/colorschemes.shtml)

[3] [https://github.com/vifm/vifm.vim](https://github.com/vifm/vifm.vim)

------
runn1ng
Just finished reading this book, “Ed Mastery”. I can’t tell if it’s “worth the
money” - not sure if learning ed(1) is worth anything- but it’s fun to see the
design decisions made way back in the 70s still being present in vim

[https://www.amazon.com/Ed-Mastery-Standard-Unix-Editor-
ebook...](https://www.amazon.com/Ed-Mastery-Standard-Unix-Editor-
ebook/dp/B07BVBSDNZ)

------
Accacin
I'm a React Developer that uses Vim, and whilst I have reduced my .vimrc down
a lot since I started playing with vim, I still use about 15 plugins such as
Deoplete, tern, ale, fzf, a language pack (I'm always messing around learning
new languages), and then a selection of Tim Pope addons.

At 120 lines, I consider my .vimrc quite light.. Although I'm not sure what
others will think.

~~~
jeremyjh
I used to shell into servers a lot and open vim to edit files, so I'm quite
comfortable with a sparse configuration. But when I'm developing software, I
want features, and these days I spend most of my time doing development. My
current setup is I use Spacemacs for development work, but I use a very
minimalist vim configuration for quick edits. This gives me the best of both
worlds - very quick, responsive editor that I can use reliably and
efficiently. And a good development experience that is easy on my fingers.

------
passthejoe
Don't lead off with the history. #protip

------
jcutrell
I'm deep into vim and have recently seen some things that colleagues are doing
with VS Code. I have to admit, I'm tempted.

But I'm so used to vim + tmux now, it's hard to imagine working with something
different.

~~~
rhizome
The more I use VS Code, the more I want a way not to have to use the mouse
anymore.

------
cryptonector
There's only one thing I need to improve my VIM experience: a way to set style
options (and search paths) for each git workspace. I've yet to find a non-
hairy way to do this. Help!

~~~
Seb-C
.editorconfig files works well for me for the essential styles. And it can be
useful to the other team members as well.

