120 comments

[ 2.8 ms ] story [ 154 ms ] thread
I've been working inside vim for decades.

I wanted a tattoo of the vim logo but my wife said no.

i started using dtach so i could abandon tmux & use vim as my outtermost multiplexer, as my container.

one of the only things i havent dug into is how to leave a :term open without keeping a window open. this is more porblematic because im not a vim tabs user. so i end up with a bunch of super mini-sized splits eith a couple random terminals.

but in general- never going back. the way on is through. these other tools just murky it up, vim is better.

switching threads, recently reflected on my lifelong idlings of perhaps getting a debian tattoo. still has great appeal. but even now feels like debianistas are pretty closed ranks. that the boundary between insider & outsider is very high. & that don't jive well.

Are you not using 'set hidden'? Or am I misunderstanding? You can keep a terminal active and not visible.
I want my headstone to read :wq!
And rest for an eternity as nerds stroll by and snort, "Hmpf, [Shift]ZZ uses fewer keystrokes."?

Ha, no thanks!

:x - less strain on the pinky.
Wait, saving is an option? I want to reload!
:edit %
:e %

You can usually abbreviate Vim commands down to one or two characters.

Changed my life when I accidentally typed :qa instead of :qall and it still quit all my buffers. As stupid (and short) as it sounds, it feels much more fluent and of course I learned that abbreviations worked! I love vim!
:e

By default it reloads the current file

One of my three girls may or may not have two Vi’s in her name :)
Don’t worry, vim has your back.

In Vim, on a line with only her name, type:

:s/vi//ign

We can get to the bottom of this mystery.

I dated a girl called "Vi" last year (pronounced "Vee"). I explained why I thought her name was a bit amusing and ended up showing her Vim. She thought I was bonkers: "why don't you use your computer like a normal person?!" She was funny; too bad things didn't work out.
Ha. My pc at home boots up to the linux console terminal login. I had a similar response with a similar outcome. :)
My ex asked me if my mouse was broken. We are still good friends, though!
I've long wanted the Tarsius from the O'Reilly book cover
Been working with vim for 2 or 3 years. Now, when I don’t have it on any kind of text entry fields I get a bit disappointed. Happy birthday you revolutionary odyssey.
I've always loved vim but I always assumed I was the younger one in our relationship... Turns out I am 3 years older. That's depressing...
Just tell yourself that vim is really actually vi wearing a snazzy new hat, and that you’re the spring chicken in a romance with a distinguished yet energetic 45 year old partner.
You........ You just took my weird feelings about this to an extreme new level....... Guess it's gonna be another night of contemplating my life choices, huh.
Yeah I remember using vi in the 80s. Still use it now over vim or eMacs for the simple reason that vi is always installed.
I’ve never understood that argument. That’s like saying you prefer to walk everywhere because your car (which you already own) might not always have a full tank of gas.
Much of the reason Vi(m) is still in use today is because it’s guaranteed to be on pretty much any *nix box. When it’s 3AM and you’re trying to rewrite /etc/lstab from scratch and the network won’t come up… there’s no way you’re installing emacs or nano.
I never said that using vi when no alternatives were installed was unacceptable.
It’s just habit at this point. eMacs, vim, nano, etc was not allowed to be installed on so many systems I’ve used, and not having permissions to install them, I just stick with vi and the muscle memory I have for its keybindings.
On most GNU/Linux systems, vi is usually Vim running in vi-compatible mode (it also has an Ex mode if you’d like even less bells and whistles).
Honestly, ex mode would be such a good idea … if it didn’t clear the entire goddamn screen when it started up! The whole point of using a line editor is that it shouldn’t take up the entire screen.
vi resolves to vim on all major OS releases these days, as the Lord intended
Pffffttthhh....

I'm way older than the original vi.

I'm actually older than Unix itself.

If programmers paid for computer time by the keystroke, everyone would use vim.
> If programmers paid for computer time by the keystroke, everyone would use vim.

No, they’d use editors with mousing-heavy interfaces.

I've only used vim for three years and it's been a fantastic experience. Every time I'm in a normal editor I long for vim. I think the most important video I watched about vim was about text completion in a thoughtbot meetup [0]. There I learned about ctags, the jumplist and ways to complete words, sentences, lines and blocks of code.

[0]: https://www.youtube.com/watch?v=3TX3kV3TICU

I know it’s silly, but Vim is single-handedly responsible for people thinking I “code fast” in interviews. I always chuckle when someone notes how fast I can manipulate code and I think about the learning-wall I hit when first picking up Vim.
I get the same kinds of reactions when coworkers watch me over my shoulder. They're always like "what is going on??"

Some people like to say that coding/typing speed is an insignificant portion of overall productivity, but I wonder how true that really is.

Vim is at its best reading text files,perhaps moreso than for editing them.

I have to use an IDE or notebook environment a lot now, but when I'm trying to make sense of a folder full of source files I always break out vim.

This is where the mouse-free operation (though modern vim has OK mouse integration) and the close relationship with bash/sh/zsh shine.

If you take the time to invest in building a rock solid foundation, it looks like nothing's happening for a long time. Critics complain. "Why aren't they doing anything?" "This is taking too long." "We're paying you to build a skyscraper, not dig a hole!"

Then suddenly, a skyscraper shoots up in what seems like no time at all.

Too many people want the penthouse without committing the required time to dig deep into the Earth and pour a solid foundation.

It almost never works.

Or I can code to within 95% of the speed of a Vim expert in any other editor and my skills are transferrable to almost any platform. And, as is always mentioned and then always brushed off by the Vim avout, code manipulation/editing is almost never the bottleneck for anything but the most trivial of problems.
This is definitely not true. I regularly type fast enough that some major editors lag behind by seconds.

There may be a subset of editors where this can be true, but definitely not “any other editor”.

Since we’re not typists, of course the speed of text input is not the bottleneck, but thinking, getting motivated, etc.

But that’s not what Vim is (only) about. Editing text with Vim a pleasurable experience unlike any other. See the parent’s comment on that as well.

It is, however, the steepest wall I’ve had to climb usability wise. Probably akin to Blender, where everything is different from what you would expect at first, but, hopefully, for a good reason.

People use vim for purposes other than code editing. Being able to think about a document in terms of it's logical structure is often beneficial, may that be the structure of a sentence in prose or fields of a record in a CSV file.

If you are only developing software, vim isn't the best program for the job. By default, it is missing important features of an IDE. Customizing it to fill those gaps is difficult. Yet if you're working of different types of text files, the skills that you learn in one domain are transferrable to another domain. If you are proficient at editing documentation and data files in vim, you're probably going to prefer it for editing code since you are building upon pre-existing skills.

For example during vimconf[0] there is this guy writing his novel with nvim. I found it inspiring, and he's not even tech-savvy.

0: https://www.vimconf.live/

> It's just simple arithmetic. If you spend more time hammering out code, then in order to keep up, you need to spend less time doing something else.

> But when it comes to programming, there are only so many things you can sacrifice! You can cut down on your documentation. You can cut down on commenting your code. You can cut down on email conversations and participation in online discussions, preferring group discussions and hallway conversations.

A great snippet of a Yegge article from 2008. I don't even use Vim, but your mindset seems pretty toxic and it's unlikely that your 95% is actually 95% when all of the sacrifices you have to make are taken into account.

It's not all about speed. Vim keybindings match more closely to how I reason about code(such as replacing text within brackets. Using a mouse is a distraction from cognitive flow.
I spend most of my time in JetBrains' IDEs and never have to use the mouse, it's fully keyboard-driven. While there's no direct alternative to ci(, you can select everything inside the brackets with a single key press and then start typing. Unlike text editors (like vim), it actually understands your code and lets you operate on the underlying AST (for example, you can move code blocks, expressions, or whole functions around with a single key combo). So for me vim seems like a downgrade.
> While there's no direct alternative to ci(

The shortcut CTRL-W (CMD-W on Mac) could be used in IntelliJ for this. But not sure, I switched back to Vim some time ago...

Sure, but that's more of an alternative to vi(. No that it matters too much in practice, which is what I was trying to say.
The two are the same in anything other than vim.
This is a good time to introduce you to Treesitter, but it's Neovim-only for now iirc.
Also a good time to introduce IDEAVim.
I have to be honest, seeing some content on YouTube and noticing some folks presumably putting things on the screen in the same speed as they were thinking is what got me into it.

I've had a TREMENDOUSLY DIFFICULT time getting fully up and running with it in terms of workflow, but the text navigation alone has absolutely made me code not necessarily faster, but in a MUCH more enjoyable way. After a while it became difficult to imagine navigating a piece of code without some of VIM's core ideas, even if in my case it is down to mostly the feature-set related to easily navigating a file.

Alas, for me then the VScode-Vim extension is doing the trick, but since you mentioned the learning wall, curious if you know any resources or can suggest a path to move past it nowadays.

Definitely agree about the enjoyable part. I don’t necessarily think vim has made me more efficient than normal keyboard+mouse, but I definitely find text editing a lot more enjoyable. It makes a really big difference in my state of mind during the day.
For me it was a combination of:

- Reading through vimtutor

- Disabling my arrow key bindings and unplugging my mouse for a week (as part of a combined vim/i3/vimiuim learning experience/experiment)

- Playing Vim Adventures, a puzzle game based on Vim's controls

The three days of godawful productivity has paid off a thousandfold- especially when I later became temporarily disabled (broken bones in both arms) and couldn't use a mouse for a while.

Is the vim-vscode extension good? I love vim on the terminal but I tried thr extension once and felt like I was trying to shovel one system into another system. Maybe I was just doing it wrong...?
Note that I haven’t used it in two years, but this is the same problem I had with the extension and experimenting with things like evil mode in emacs. There was also a problem where VSCode would update and the vim extension would break or get laggy until the extension devs caught up. It may be better now, but both experiences drove home the fact the I really just felt more comfortable in vim.
I can't speak to the more advanced stuff and feature set, but if all you are looking for is some of the keyboard-based navigation, registers, marks, etc., it seems to do these quite well (in my case, at least)
>>VScode-Vim extension is doing the trick

I tried using vim on vscode, but it doesn't play well with Python utils like Black and Flake.

If you are using these modern tools you are buying into the whole experience.

Playing editor golf has really gotten out of fashion these days.

Could you share some of the videos? I’m getting better at Vim but maybe some videos showing “whats possible” would be great to focus some of my learning.
And 90% of your typing was probably trying to figure out how to exit?
I've never used Vim, but I use Evil mode and vim bindings everywhere. I'd have a much poorer relationship with my computer without vim modes.
What a great piece of software. It's amazing how many features it has in such a small size.
Doing less work on Xcode and working more on servers made me appreciate vim alot!

I don't use any plugins (tried it back then with neovim and found the editor itself slow to load) and make me memorize folder structure a whole lot more since I'm using tmux alongside it.

I love the fact that I can hop on any system that has vim and I'm ready to go.

Happy birthday, vim!!!

that's the biggest draw for me.
It's pretty amazing that vim has remained relevant for that long, outliving so many other editors. On top of that, it continues to evolve. Even in the ~5 years that I've used it, huge progress has been made. The fact that coc.nvim works so well, even in vanilla vim, is crazy.
I’m grateful to Vim because it taught me that I can write plain text. Previously, I was under the assumption that I need to create a Word or Google Doc. I wonder how many others are in the same situation I was in…
I never thought about this until you mentioned it but my love for markdown only came after I learned vim.

Vim is easily my most used application; I use it for my task list, to write notes when learning new topics and even to journal my personal thoughts.

Prior to this I used applications like evernote, google keep, google docs etc. I think the only advantage of those tools had was easy sync notes between devices but I solved that with syncthing[0].

[0]:https://syncthing.net/

I was opposite with Markdown—I started using it with Obsidian, then fell in love with vim. Now I love Markdown even more and use vimwiki instead of Obsidian.

> I solved that with syncthing

syncthing is great!

> vimwiki

I've been looking for a Personal Knowledge Base (?) for a while and have started using Obsidian. I love the idea of the tags, backlinks, and Graph view but the editor itself leaves much to be desired (besides the fact that it's not vi(m)); whoever came up with the default color scheme (medium/light grey on dark grey) needs to be shot.

So how do they compare? If I can do everything I want with vim(wiki) I won't bother with Obsidian.

I hear that VSCode is going to incorporate backlinks and will be a better Obsidian than Obsidian is.

Well it occurred to me after reading this thread that I could edit my Obsidian vault via vim. Of course, that's only for basic text editing capabilities everything else has to happen inside Obsidian.
Initially, I used vim emulation within Obsidian, but later realized that I didn’t need to know about backlinks very often—I just wanted a simple wiki, so I started using vimwiki. The main downside for me is that you can’t (to my knowledge) use folders without changing links ([[folder/note]] instead of [[note]] in Obsidian), so all my notes are in one directory with no subdirectories. I also don’t think renaming files in vimwiki updates links in other files like in Obsidian. Because I prioritize using my own vim config over many of the features in Obsidian, I use vimwiki. Whenever I need something that Obsidian can do that vimwiki can’t, I just open Obsidian. I love owning my notes in plaintext :)
(comment deleted)
I once tried out my modern vimrc with Vim 7.0 and only had to add feature checks to three lines or so. Powerful software!
I’ve always wanted to learn vim but the keying for Dvorak users is chaos. Interested to hear from Dvorak users who use vim effectively!
I use neo2. The keys for hjkl are totally scattered and left and right switched. Still, working in qwerty or without vimbindings seems like hell. Keep at it, it will become muscle memory.
I also use neo2 and am using the neo arrow keys and Esc on layer 4. Works like a charm.

Fun thing with neo: You have additional keys free for keybindings: hjkläöüß

I'm using ä, ö and ü to save, close buffer and quit vim. I'm very happy with that.

Vim ships with a "dvorak" plugin; you can load it with ":packadd dvorak".

Curiously, this is not documented unless I'm missing something; after loading you can enable "dvorak mode" with ",d" (w/o quotes), and disable it with ",q". It just maps some keys, see: https://github.com/vim/vim/blob/master/runtime/pack/dist/opt...

Hasn't been updated in 6 years, and there may be better plugins/ways. I'm sure you're not the only person.

I was a dvorak user for years, and the standard vim key-bindings were not a problem. I mean, j and k are still right next to each other, and h is still to the left of l. Most of the other commands are mnemonic like (i)nsert (d)elete, so the location of the key relative to others isn't all that important. I always use both left and right control keys, so no chord is a stretch.

(like many people, I went back to QWERTY because I was losing QWERTY speed and was tired of looking like an idiot when using other people's computers. But sometimes I turn dvorak back on for fun and I'm surprised how I still have muscle memory for common words, even after years.)

I started using vim about 5 years ago, and switched to Dvorak 2 years ago. It was painful at first, but so was everything with Dvorak. The muscle memory takes over eventually and now it’s very comfortable. The only thing I still occasionally use QWERTY for is games.
if you avoid the hjkl thing all the other keys are mnemonic for the most part... if you are on mac os you can remap caps-hjkl(well the dvorak equivalent if it doesn't mess up) to arrow keys system wide and get that
Can't say that I'm using Vim effectively, but at least the basic keys are fine.

Basic movement keys are split into two hands. J / K (up & down) are still next to each other and are operated with the left hand. H / L (left & right) are still close together and are operated with the right hand. It actually feels better to use and easier to remember than the one-row arrow cluster on QWERTY.

W / B (to next word & to previous word) are close together and are operated by the right hand. I actually use W B much more than H L and it feels great.

Y / P (copy & paste) are next to each other which is great.

Ctrl B / F (page up & down) are a bit counter intuitive because of the position (page up is below page down). Ctrl U / D (half page up & down) are fine.

A I O (various ways to enter insert mode) are clustered into left hand home row. S C R (various ways to replace text) are clustered into right hand.

I never bothered to learn HJKL navigation since I nearly simultaneously started using Dvorak, Vim and DreymaR's incredible Extend layer. The Extend layer is a software XKB mapping where holding Caps Lock lets me use arrow keys, Home/End, Backspace/Delete, PgUp/PgDown etc. Directly from my home row position. It is responsible for tripling my editing efficiency as it lets me make instant corrections and jumps anywhere.
Checkout ThePrimagen on YouTube. He makes videos about Vim while recording his hand movements on a Dvorak keyboard
Been using both vim and dvorak for nigh on 20 years now (started learning both in university), and have zero problems with the default keymappings, including hjkl navigation--once it becomes muscle memory you can get used to anything.
Still rocking vim since 1997 and love it. But old age's getting to me and I'm now finding myself reaching for either Visual Studio or JetBrains CLion for my coding more and more these days.
Both of those have vim plugins. Highly recommend it. It gives you the power of an IDE, with the speed and much of the flexibility of Vim.
What blows my mind is that vim is now twice as old as vi was when vim was released.
Happy birthday, Vim! Thanks to everyone who has worked on that project.

I've used vim for a while now, although not a power user I'm certainly capable. One of my favorite experiences with vim was remote pairing about a decade ago with another developer. He lived a couple of states over, and we paired by sshing into the other person's machine and using vim on a byobu session. It was also fun because both of us had different habits using vim and got to learn some stuff from each other.

(comment deleted)
And vi is 45. Thanks, Bill!
OK, today is the day I donate to the children in Uganda. If I'd donated a penny every time I'd seen the vim splash screen, I'd have probably donated tens of thousands of dollars by now.

Thank you Bram.

You commented prompted me to donate too. Vim is my most used piece of software. Hope others join!
One of the best things about PyCharm and friends is the vim bindings. They are much closer to actual vim than other IDE plugins. This is the main reason reason I made the switch to using an IDE for Python development.
Possibly the best foundational tool I learned all those years ago. Every time I see someone have to use Nano or the like, I just feel sorry.