I Still Use Vim
buttondown.email
buttondown.email
I use VIM on and off, but I wanted to post the above because I think it exemplifies who might like using VIM.
VIM is ideal for people who find it worthwhile to spend the time building their configuration out. VIM is the productivity tool that gets better as you put the time and effort into building it out. If you aren't the kind of person who wants to put that time and effort in, it is still decent as a basic editor, but it doesn't really shine.
Despite me not hacking it like crazy, I still think it really shines as an editor; Vim macros were sort of life-changing to me once they clicked for me. I also just think that modal editing is superior once you get past the initial learning curve.
I use VIM for almost all basic editing. Its muscle memory.
But for code editing, I generally end up on VSCode because it seems to have better language support. I've spent a fair amount of time with configuring VIM trying to get where I feel it needs to be. But whenever I shift to a new stack, it always seems to take an investment of time and effort to get VIM set where it's better than VSCode.
One notable exception is Go with its [vim-go](https://github.com/fatih/vim-go) plugin, which feels very mature to me as someone new to the language.
I would love to have this functionality with just
brew install ts-vim
And just be done with it.[1]: https://marketplace.visualstudio.com/items?itemName=asvetlia...
BTW, your main point about using vim is emacs greatest strength.
(People keep telling me I'd love emacs, and I have nothing against it, I just happened to learn vim first.)
Have you got any suggestions? The number of people that recommend it makes me sure that there's value to be had there, but it's never really become a habit for me.
I've been using vim and before that other vi clones or actual vi as one of my main editors for 40 years, and my .vimrc is 60 lines.
20 of those are to automatically decrypt on read and encrypt on write .gpg or .asc files, which I copied from somewhere 20-25 years ago and haven't actually used in 15+ years, leaving only 40 lines I actually care about.
Which means your Vim experience now has some risk of rot. Once and awhile my configurations/extensions rot and I have to go and update myself as to what happened in the ecosystem, or what is interacting with what. One day I decided I'm too tired and switched to VSC.
Also the author failed to talk about the #1 killer feature of VSC, the reason for its meteoric rise in popularity — intellisense.
LSP is truly one of those "rising tide lifting all boats" projects.
Vim suffers a bit from the design equivalent of tech debt. Much of the defaults and common behaviors were created based on the limits of software/ hardware 30+ years ago. Those limits still affect current design.
> Also the author failed to talk about the #1 killer feature of VSC, the reason for its meteoric rise in popularity — intellisense.
Given a fairly small amount of configuration, you can get autocomplete which is nearly as good as Intellisense in VSCode. For Typescript anyhow, the autocompletion comes from the same source background process.
Vimscript is weird. Sometimes the answer to "how to do this" comes in the form of "just install this package manager...". Stop. No.
Sure, I'm ok with adding a couple of lines to vimrc, copying some files, but don't push it.
I get much more out of the box from Vscode, PyCharm, etc. Why can't it be the same with vim?
If you take a step back and look at software development as a whole then IDEs like VSCode and PyCharm take the top down approach.
Whereas Vim is one of the solutions which do it bottom up.
With both approaches you can theoretically arrive at the same functionality but in reality, there will always be something missing.
Some people prefer the bottom up approach as that gives them the illusion of knowing their tool completely whereas people with the top down preference think everything is curated for them.
Over time, both kinds of people notice this isn't quite true.
So no, vim shines and it's pretty bright
600 lines seems pretty long to me. I don't even know what I would put in a .vimrc file. Obviously I don't use it enough to even have annoyances.
The nice thing about have no config is that I can hop into vim on any computer or server anywhere and be able to use the editor. I don't have to worry about having muscle memory of using keybindings/aliases that don't exist.
That's the way to go. Unfortunately, most humans are fallible and I had to add a single line:
inoremap <tab> <esc>I knew a guy that not only had no config, he didn't even use syntax highlighting, which I can't live without.
All of that power and configurability is there for a reason. My config is about 250 lines; a lot of that is just to have Vim operate like it's 2020 and not the 90's.
I'm not a C programmer, so I don't want /usr/include in my search path, which it is by default.
I want to ignore things I have no intention to edit, so I have
set wildignore=*~,.DS_Store,.git,.hg,.svn,*.bmp,*.gif,*.gz,*.ico,*.jpeg,*.jpg,*.mp4,*.pdf,*.png,*.tar,*.webp,*.xz
Gotta have relative numbering while showing the absolute number for the current line: set number
set relativenumber
I write a lot of HTML; having Emmet (see https://medium.com/vim-drops/be-a-html-ninja-with-emmet-for-...) enables me to write div#page>div.logo+ul#navigation>li*5>a <C-y>,
and get <div id="page">
<div class="logo"></div>
<ul id="navigation">
<li><a href=""></a></li>
<li><a href=""></a></li>
<li><a href=""></a></li>
<li><a href=""></a></li>
<li><a href=""></a></li>
</ul>
</div>
Saves lots of time and keystrokes.From .vimrc to .vim: https://vimways.org/2018/from-vimrc-to-vim/
Fabulous article that explains runtime files and why many modifications to most people's .vimrc should be in ~/.vim/.vimrc and other other runtime directories.
Lots of Vim users talk about using a minimal config because they need to access random machines that won't have their custom setup.
Or that it's some kind of badge of honor to not have any plugins, even if they could save you a ton of time and keystrokes.
Let's not forget: 1. Vim is great at remote editing, so you can use your config when updating files on servers, etc.
2. You could put your ~/.vim/.vimrc in a repo and install it anywhere you need it in like 5 minutes.
3. You could also rsync your local config to a machine if you needed to.
Of course I can use barebones Vim on some random server, but sometimes you need all the goodies with you.
The video Your Vim is only for you: (https://www.youtube.com/watch?v=6LPBpmkQdw8) reminds us that our Vim is just for us and if that means tricking it out so that it becomes our own custom editor, then so be it.
I've been using VIM for over a decade and currently my customized config consists of a half a dozen tweaks, such as YAML-specific settings stashed in ./.vim/after.
Speaking of modal editing, I'm really interested in Kakoune's model. With Vim, you type the action, then type the motion, and it performs the action immediately. This often means I have to repeat actions a few times if I'm unsure quite what motion I want, or I have to pause and count things (e.g. if I want to delete from the beginning of a token until a close paren, doing that with a single "d" command requires me to mentally balance parens to find what count I want to give to the motion). Kakoune flips this around, you do the motion first, then do the action. Of course Vim has its visual mode which is similar, but that puts you into a different mode entirely that you then have to exit if you change your mind, and not all commands work in visual mode. Kakoune also has far better support for multiple selection than Vim. The problem with Kakoune is just that I can't use it anywhere except in the terminal, which is a barrier to adopting it (whereas I use MacVim often). I'm also not sure offhand what the plugin situation is like (I know it supports plugins, but I don't know how powerful they are; I recall when kakoune first came out all extensibility was done by shelling out to external commands but I don't know if that's still the case).
Vim was my first editor in Linux. Before that I used Borland, VS(Visual studio) and MASM(Microsoft assembler) editors.
After learning regular expressions, I felt superman with Vim. I started doing incredible automated work that was impossible or very hard to do in anything else like VS, netbeans or whatever.
Then I learned Lisp, so I forced myself to master eMacs. It happened again, I felt super-superman once you understand Lisp and can use it to automate everything on the editor.
IDEs are great for starting to program. But if you plan on being a serious programmer I recommend that you download anki and start memorizing Vim or emacs or regular expressions commands.
That will make you also a super human, able to do things in way less time that everybody else.
I like Vim/Emacs, but they succeed in making programmers feel like magical wizards more than they succeed in making them super human.
I've also paired with vim/Emacs users who are fast at manipulating text, but terrible at all the things you can do in a couple of seconds with an IDE (rename a file/function/class/parameter and have all references update, jump to a failing test, jump to a definition of library code that isn't stored under the working directory path, structural search and replace[1], extract JSX code from the render method to create a new component etc. etc.).
For many, it's easier to add vim emulation to an IDE than it is to add the IDE features they care about to vim/Emacs. You can still be a passionate, professional, productive developer and use an IDE.
[1]: https://www.jetbrains.com/help/webstorm/structural-search-an...
Serious programmers don't say such nonsense. Serious programmers use whatever they are comfortable with. Whether it is vi or IDEA
There are reasons why some people can do more than other people. Some people have natural advantages, in certain directions. Nobody has them in all directions, but automation can often compensate in the other directions.
If you don't have ambition to excel, you can stay with the minimum. If you have enough natural talent, you can play to your strengths and excel only there. It's a choice of where to invest your time and effort. It should be a conscious choice.
IDEs are a trap because they automate only certain things the IDE author thought was important, and do not reward impulses to improve in other directions.
Yes. 80% (or more) of that is them perfecting their technique (whatever this means in each case). 15% is them spending time on what is really matters. And 5% is for the rest, including crafting or customising their tools. And in many cases you don't really need these 5%.
>IDEs are a trap because they automate only certain things the IDE author thought was important
No, human mind is a trap. IDE is just another piece of software that can be extended just as much as vim or emacs and tailored to your needs. Maybe not that easily or extensively but still.
>things the IDE author thought was important
Modern IDE's are crafted by great number of people with constant communication with their customers and industry. Obviously mass product can't be tailored for each person but you can safely say that a generalised IDE will have all things that are actually important. Everything else can be added via plugins
PS: I'm writing this as a neovim user by the way. Still think that IDEA and VSCode are the best pieces of dev software aimed for mass market out there.
I use regular expression search/replace (even across all files in the project) frequently in WebStorm. I'm really curious what functionality I'm missing out on.
Yes I probably shouldn't open massive log files and hold page down, but it's nice to know that I can.
Likewise, find the file of size that vim can't handle on your machine, then open it with nvi.
For those virtues, speed and opening large files, nvi eats vim's lunch.
Oh, and I use proportional fonts so VIM is out.
I find moving around tmux panes kind of annoying and scrolling them even more annoying, but that's probably more of a lack of comfortability with it than anything else.
set -g mouse on
in your ~/.tmux.conf file.That feature is built into Vim with quickfix commands.
> multiple files open in multiple panes
That's also built-in.
> a file list
There's at least two built-in features that provides this, netrw and quickfix.
> list of currently changed files
That's also built-in? It's like the most basic of features.
> I use proportional fonts so VIM is out
You can use a terminal that supports it, or perhaps some NeoVim UI.
Regardless, I have no plans to switch because I can't see it improving my productivity enough to justify the learning curve.
I'm just pointing out that all the features you've listed as lacking in Vim are built-in, widely used, and documented. And of course, these features can be used at the same time, there's nothing preventing you from doing so.
In my experience, vim tends to start choking on files in the 100MB/1GB range.
My experience with vim always seems atypical when I read blog posts like this. For me it's a hard-to-kill, reliable text editor. I barely know any of the commands (despite using it for a decade) because I've honestly never felt like I was missing anything. Just having something reliably fast lets me get away with inefficiencies that are problems elsewhere. I can't stand hjkl navigation, or remember anything more complex than how to find/replace strings. But I'm perfectly happy with it just like that.
I'm working on building VR applications with Unity and C#. For that task I have to say that VSCode works pretty well, it has a ton of really nice features I regularly use: like debugging unity code, autocomplete/snippets from the unity API, and my favorite Zen Mode. My biggest complain with VSCode is how slow it runs sometimes, I can type faster than VSCode refreshes which adds noise to my flow, note that I don't consider myself to be a fast typist. If they would only fix that I would be very happy with it.
I wish I started learning Vim ten years ago. There's not many other things I can say that about.
Sure, someday I might switch to another primary editor or split time between a few, but learning Vim changed the way I think about editing text forever (and it's really fun).
https://pragprog.com/titles/dnvim2/practical-vim-second-edit...
Reframing vi(m) usage in my head as a conversation, a linguistic back-and-forth, really helped me understand how to use vi(m) effectively.
1. https://stackoverflow.com/questions/1218390/what-is-your-mos...
To me that seems like saying "Anyone wanting to learn C++ should probably start off by learning how to use C".
EDIT: I use Eclipse and Visual Studio code on any sort of larger project. Learning to use code completion, embedded debuggers, and embedded test tools is what makes some programmers way more productive than others. But, vim is my tools of choice for any other text editing (oh and TextMate I guess if I have to).
The former just makes you sound like an Arch Linux user.
Joking aside, I could never be efficient in vi or vim because I need to edit simultaneously as I type. In vim, I'm slowed down by the fear "not to mess up", since I have to switch to normal mode to edit before switching back to editing mode and continue to type. Or, for instance, in languages without a function composition operator (or pipes), typing out nested functions in order of application (which is not left-to-right) requires A LOT of switching between editing and normal modes just to complete the thought.
I've never been able to figure out how others find this desirable.
edit: s/corresponding/equivalent/g
ys2w) will put brackets around the next 2 words. That is a beautiful thing.
[4 [5 [6 [7 [8 [9 +0U7 0,0X4 10U4 [4 ETU4 [4 EDU4 [4 EUU4 [4 ^D ET&(128#64#32#1^_)#512#16#8#2ET ED"G 0ED ' @^U5/U9 ET#1ET 27^T Q9^T ET&(1^_)ET/ @^U6/.U8 ZU4 -3U6 ^^HM5 13^T ^^KM5 10^T ^^KM5 13^T :G4 < ^TU7 !F! Q7^T ZJ Q7@I%% Q7-10"E 13^T ^^KM5 -1%6 ' Q7-21"E Q6^W 0U7 0; ' Q7-127"E -D Z-Q4"N -1AU9 -D Q9-27"E 32U9 ' Q9-31"G ^^DM5 ^^KM5 1+ ' 0"E 13^T -Q6-2< ^^KM5 ^^AM5 > 10^T 13^T :G4 Q4,ZT ' ' ' Q7-27"E ^TU7 Q7-27"E !F0! 27@I%% Q4,ZX4 ^^HM5 13^T -1U7 0; ' Q7-^^?"E ^T^[ @O!F0! ' @O!F! ' > Q4,ZK Q8J Q7/ 0,0X7 G_ ^YX8 ^YK 0,0X9 ^^HM5 13^T ^^=M5 < !A! 0U4 0U6 !B! 1U5 ET#32ET ^TU7 ET&(32^_)ET Q7"L -1^W ^TU7 ' !V! Q7-127"E .-Q5"L .U5 ' -Q5D @O!A! ' Q7-31"G Q7@I%% @O!A! ' Q7-26"E 0; ' Q7-21"E 0K @O!A! ' Q7-11"E Q5K @O!A! ' Q7-8"E Q5L .-1"G 2R ' @O!A! ' Q7-4"E Q5K @13I%% 10@I%% 2R @O!A! ' Q7-3"E 0; ' Q7-27"N Q7@I%% @O!A! ' ^TU7 Q7-^^C"E Z-.-Q5"L Z-.U5 ' Q5C @O!A! ' Q7-^^D"E .-Q5"L .U5 ' Q5R @O!A! ' Q7-^^?"E ^T&31#32U7 Q7-^^0"E Q5L @O!A! ' Q7-^^1"E Q5-1"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6 ]5 ]4
https://scienceblogs.com/goodmath/2006/09/22/worlds-greatest...
I feel like it's the opposite, vim is my swiss army knife for working with rust or cpp or python whenever I want whereas the IDE is something I open to work on specific, more complex projects where I just care about getting something done (like my homework).
If I had to compare tech to real life tools, then IDEs would be food processors: heavy, extremely good at what they do, make some things possible and other things trivial, best at scale. And vim would be, I dunno, a really nice chef's knife? But you can't serrate a chef's knife. Whatever, analogies are dumb.
(Emacs of course would be a smart fridge running emacs as an OS.)
I like simplicity and granular control which vim provides. At some-point I had a mouseless linux box with vi-like keybinding for everything (vimperator, muttator eg).
That said, the instant compilation and error feedback developing in rust in vscode is amazing, especially while learning.
You can get pretty much the same experience in vim, using the exact same language servers as vscode. It's not even hard to setup.
Have you tried `nvim-coc`? `coc-rls` might be a good option.
Times have changed. It's so awful to get used to, and the alternative is just reaching for Home/End/Pg Up/Pg Down. Gimmie a break, fam. (What's ironic is that most people I know who love vim do use those keys, so they're paying the speed penalty of not having to reach for them for nothing -- plus the million penalties of using a terminal editor, and a byzantine one at that.)
Also, ever wonder why the movement keys are HJKL and not the home row's JKL;, which would be far better and more intuitive? Glance back at that picture; for no good reason, the manufacturer of those terminals decided to put arrows on HJKL. And so, in inertial carryover of dumb design, vi's creator decided those should be the movement keys.
Sorry, time to eject from this fossilized ride from the '70s and into the 21st century.
0: http://vintagecomputer.ca/wp-content/uploads/2015/01/LSI-ADM...
[1]: https://twitter.com/hillelogram/status/1326600125569961991
Many many things that are important in life have little to do with computers. But the important things which involve computers are usually text based. You edit them with a text editor.
IDEs, at their best, edit one family of languages. At their worst: Java. They do that very well, but general purpose text editors they are not.
the learning cliff is significant, I've spent a whole month doing everything in vim to burn everything into muscle memory, and once that period is over, it becomes self reinforcing.
The payoff is significant, I don't leave the terminal to go to some graphic IDE anymore, unless it's Java. And my vim setup started to look more like an IDE - but an IDE that comes with the full power of vim and it's different modes. Once you get over the initial excitement over keystrokes, you'd realize that modal editing is actually the biggest draw.
People have different preferences, but for me, vim has been absolutely worth it.
Then came h, l, j, k and life started getting easier. Later came w, b, G, gg, c$, d^ and it clicked, that’s when it became vim for everything ascii.
The vim plugin for vscode keeps the feel going.
As for "tweaking" Vim, I'd suggest checking out open source vimrcs, like ThoughtBot's or Steve Losh's. You should also browse vim.org/scripts and check out plugins by people like Tim Pope and Junegunn. I can't think of any at the moment, but I know I've seen analogues to ruby-toolbox.com and clojure-toolbox.com which index plugins and let you search by topics and are a little more curated and user friendly than vim.org. You may also want to consider an opinionated Vim distribution (Janus, Space Vim, etc.), which comes with non-standard .vimrc settings and plugins.
Over time, you will accrue the things you need to know to use vim effectively.
A big tip I have is watch youtube videos and search new tweaks. While learning commands add a few on a post-it note and use that for a week. After the week is over you either learned those commands or aren't using them and don't need them.
https://stevenwalton.github.io/tutorial/vim/2019/08/31/vim-b...
[0] https://stackoverflow.com/questions/1218390/what-is-your-mos...
https://vimways.org/ is also a great resource. 'Death by a Thousand Files' in the 2018 edition is one of my favorite vim articles.
Open vim
Hit i
Type the things you need to type
Hit esc
:wq
Continue like this for a few days (maybe even map the arrow keys to hjkl, like a heretic), then I'm sure you'll think something along the lines of "hmm, I wonder how you do X in vim" learn that and continue along.
That's what I did all those years ago.
`vimtutor` is the official starter guide
:help is an inbuilt manual, with a section for every topic you could think of
Still use it more than any other program.
[^1]: These structural regular expressions took me a bit to get used to, but by now I really like the concept.