FINMB - ViM (A New Series!)
[finmb
vim
config
]
Welcome internet friend, to the first in a series of posts I call “Fuck! its not my box…” or FINMB for short.
We’ve all had it happen. You spend hours tinkering and configuring. setting up dotfiles, changing settings, getting it juuuuust right. And then, whether youre a l33t Hax0r 7 proxies deep, or a sysadmin on a customers server, or just screwing around in a VM, you open your tool of choice and… shit. it’s default. right… because ssh and all my dotfiles… I can’t work like this!
So this series is looking at simple configs, hopefully one liners, that can get you on your feet in a usable environment in as few keystrokes as possible. The “minimum viable configuration” I guess you could say. No plugins, no fanciness. Just enough to get in, do what we need, and get out without blowing our brains out. This time, were looking at *drumroll* VIM! As always, I write this blog mostly for myself, so my preferences may not be your preferences. This is what I use. Tweak as needed. So close nano, you’re better than that, wipe off the tears, and lets get started!
First things first. If you’re on a coworkers machine, or logged in via another
users account, it’s not unreasonable to assume that a vimrc is already there.
So lets ignore it: vim -u NONE
cool. Now here’s the magic!
Great. See ya next time everybody!
Kidding. Lets see some other options.
That’s short but its hard to read and badly structured. The options are ordered not on a theme, but on how well they roll off the fingers and onto the keys. wmnu nu ru. you get it. And they’re all the shortened versions. Here’s the longer, more verbose version if you’d like:
Some of those are ViM specific, so if its 1999 and your vi remains woefully uniMproved, there’s this:
Yikes. Not much. But you get ‘showmode’ (smd) which is that little “—INSERT—” thing that’s off by default. Rejoice! (Thats right! That thing that makes vi just so much more inferior? That thing that drives you insane about vi? “What mode am I in?! Why doesnt it just tell me!?!?!” It actually has that feature. It’s just off by default for some reason. Annoyed yet?) And line numbers. so not too bad.
And I guess let’s do one more. Some of those settings are already on by default. I only include them because being explicit is usually a good idea. But just for fun, heres only turning on what isn’t already on (default in ViM 8.1; YMMV):
Theres a lot of other things you could add.
:syntax enable
is the first to come to mind. But this is meant to be a short
one liner. and these options are usually enough to get by until I get back
to my machine.
As always, I’d love to hear what options you’d add to your one-liner.
Until Next time. [ESC]:wq!