20 Years of Vim
contextualize.ai
contextualize.ai
Vim was the first text editor I've ever used (back in 2008), and it shaped the way I interact with computers forever. I'm grateful to all maintainers, and to Bram for creating it and shepherding it through all these decades.
The annotations are interactive, so if you hover them you'll see more context about the events.
I built the tool to make this visualization: https://www.contextualize.ai
It would be helpful to put this somewhere on the page. On mobile especially one isn’t likely to accidentally discover this with random mouse movements.
How could anyone skip any other more "normal" editors and jump right into Vim?
Downloading something over limewire or torrent and seeing a readme file for the first time is a pretty strong memory.
My first IDE was visual studio writing Visual Basic, I quickly binned that for netbeans and Java and then I think ended up using Eclipse.
Today I’m a casual evil mode emacs user mostly for magit and org-mode. also working in VScode for web languages.
But, I also think there’s enough leeway in the idea of “using a tool” to not be surprised that somebody doesn’t count a one-off use of notepad. And I think there must exist at least some people who really never used notepad.
Nowadays I only assume someone between, like, 30 and 50 will inherently have to have used Windows at some point. Outside that range, you might get graybeards who were around before Windows, or younger folks who only ever used smartphones.
Anyway, all that rambling is to say, I’d put it in the “most but not shocking to hear otherwise” category.
What I’ve tried to express is that there’s a small band where not having used it is unusual and surprising, and that isn’t the case anymore. I still think the majority of people have used Windows at least a handful of times but hearing that somebody hasn’t no longer produces a “how could anyone” sort of response.
After trying out finger-twister with Emacs, vim was a breath of fresh air, and had better features than plain "vi", like it was improved or something.
Now, how do I save and exit?
gvim (for GTK/Gnome) is an official part of vim!
Sort by creation date, notepad, kedit, kwrite, notepad++, Scite, and plenty more.
For me it was my first editor on Linux. Didn't stick until I rediscovered it some 20 years ago when I got fed up with the netbeans nonsense and gedit and Kate kept breaking on me.
I've been using it for 29 years now.
The last 20 years don't mean anything; the Vim codebase is too much of a dumpster fire for anything significant to happen in that time span.
They had to fork an entire parallel command set to implement "location lists" (new in Vim 7, I think) which are exactly like the "quickfix list". Most of the difference are that location list commands start with l, wheras quickfix list commands start with c. Your keybinding to go to the next quickfix item doesn't work in a location list because it uses :cn^M, but the location list wants :ln^M or whatever. The only explanation for this ridiculous state of affairs must be that it was too difficult to extend quickfix lists to do the things that location lists do. Once you get into the Vim codebase, that will not be surprising.
Vim's visual editing semantics assumes that you have a block cursor, and that that the character covered by the cursor is included in a visual selection. This is not so nice when you switch your terminal to an I-beam (or vertical line) cursor, which references between characters. If the cursor is to the left of the selection start, it includes the character to the left of the cursor too. I-beam semantics allows for a zero-length selection, whereas in block semantics, there is always at least one character in the selection, which is the one under the cursor. I-beam semantics is virtually what pretty much all GUI editors do, including the text widget in Firefox I'm using now to type this.
A bunch of years ago I looked into what it would take to have a flag in Vim to flip to I-beam semantics for selection. Gack! I estimated a month of full time work. Numerous places in the code would have to change in ways where you're not sure what side effect they will have elsewhere.
Navigating quickfix and location lists is global, so a single common command wouldn't make sense (you can use `:cn` from any window -- even if the quickfix is not visible). However, you could use a `<buffer>` map to use the same key to navigate within loclist/quickfire windows.
> The only explanation for this ridiculous state of affairs must be that it was too difficult to extend quickfix lists to do the things that location lists do.
Their entire concept is to be what quickfix isn't: instead of a global list, it's a list that's tied to a window. I can't think of features that a loclists have but quickfix doesn't unrelated to their nonglobal nature.
I can't claim vim's code is easy to understand, but this is not a fair complaint.
let &t_SI = "\e[6 q" and
let &t_EI = "\e[2 q"
in some auto commands to sort of address this
a|b
Type r, and b gets covered by a block cursor. Then type c, and b is replaced by c, and cursor goes back to bar.> This chart shows the last 20 years of development as seen in the Vim git repository.
nvi and vile were two names that spring to mind, but I know there were others.
Looks like vile itself started in 1992:
Personally, I've been using Vim for years, but I must confess that I use almost the same commands as I did in the beginning. Is there any good website that teaches useful tricks, maybe on a daily basis?
My own "trick" for improving my vim usage was to start mapping things to <Nop> that have better replacements, it is a great way to shock yourself out of bad habits like hjkl movements or reliance on /. Then again, I think text-objects and the items below it in motion.txt are the main to use vim so YMMV.
² https://pragprog.com/titles/dnvim2/practical-vim-second-edit...
I got stuck in that suboptimal mode and had to break myself of it.
However, my reasoning is the same as noted in echelon's reply. There are often far better ways to move around as described in ":h text-objects" and ":h motion.txt" more generally.
try inflicting something like that on people now, though it might be good for them.
Credit Bill Joy for the modal editing paradigm, but vim is so much more than that. Most editors have a vi mode, but they don't compare to vim because they are awkward to script and don't have powerful regular expressions so readily available (both introduced in vim).
We could thank Ken Thompson and Dennis Ritchie for enabling vi, but I thank Bram for keeping vi viable, portable, and well-supported across languages.
In what ways has vim become a completely new editor?
If I tried running a version from 20+ years ago, today, would it still work on a modern O/S ? Are there modern vim features that I would miss?