Live data from Hacker News

How Did Vim Become So Popular?

pragmaticpineapple.com

501–507 of 507 posts

Re: How Did Vim Become So Popular?

#502

Controversial comment here, but I would say Vim isn't popular at all. I would say instead, Vim advocates are incredibly vocal (a bit like Vegans and Crossfitters) and won't hesitate to talk about it at all times. I've been engineering now since 2002 so approaching 20 years and sure, every office has one guy who's the "hardcore" Vim guy. Everyone else in the office uses Visual Studio or VSCode, Atom, Sublime, IntelliJ…

Did you not read TFA? ~25% of web devs in the SO 2019 survey said they used VIM as their editor. Amongst dev-ops that number is higher, around 40%. https://insights.stackoverflow.com/survey/2019#technology-_-... So your anecdotal example of "99% of people using VS or VSCode" doesn't ring true for the industry as a whole.

Besides the other facts mentioned by the other commenters, Vim has a sort of geek-chic aspect to it. It's "cool" to be a Vim user in certain circles. That inflates the numbers plus it also causes a "New Year's resolution" effect where someone would say they use it just because they know :wq and this year they're really, really going to go to the gym, oh, sorry, going to use Vim proficiently for a real project.

Re: How Did Vim Become So Popular?

#503

Earlier quoted context omitted.

Code browsing and inspection is somewhat hampered by the fact its CLI. I use ctags and macros to move around code but its not always perfect. But then again there are many things I dislike in modern IDEs, I don't think there is a ideal solution, just like there is no one language to solve all problems.

I've been a Windows admin before but now on an app support team running almost all Windows systems as an analyst but came from a poly sci degree. My Linux experience is homelab and a few work connected systems over time like a Ubuntu Server box that managed IP cameras on site. My experience with coding is mostly Windows automation via PowerShell and its built into Windows IDE as I need a dev role here to get like Vis…

> As a fairly novice level coder I'll stick to an IDE with scroll ability and a mouse/etc for coding

Check out gvim - it's a graphical version of vim that gives you scrolling and mouse support.

It's not quite as graphical as a regular IDE but basic stuff like mouse and scrolling is fully supported. You can even use the mouse to e.g. resize tiled windows within the editor.

Re: How Did Vim Become So Popular?

#504
post #217

Earlier quoted context omitted.

(Funnily enough ctrl-[ is one of my most used shortcuts in vim. It’s a convenient alternative to escape if you map caps-lock to ctrl)

Even better: map held Caps to Ctrl and a tap of Caps to Esc

I map held Caps to Super (so I can switch windows and use other higher-than-application-level shortcuts without leaving the home row in dwm), but yes, definitely don't limit yourself to one use for your keyboard's most convenient key without a use. In X11 it's as easy as

    setxkbmap -option caps:super
    xcape -e 'Super_L=Escape'
(where setxkbmap is built into X, and xcape is a one-command install away). And IIUC you can do this with ~6 clicks in a third-party GUI like https://karabiner-elements.pqrs.org/docs/manual/configuratio... in macOS.

Re: How Did Vim Become So Popular?

#505

For me it is being able to efficiently navigate a file without leaving the home row (Gotta learn touch typing first). Once you understand the commands follow a composable grammar it is really like a superpower for dancing around text. „Go down 5 lines, move right two word, replace the contents of the brackets“. I don‘t use the actual editor all that often but have vim mode enabled in all my „real“ editors like VSCode…

> Go down 5 lines Look at the beginning of a target line, remember the number (takes up a slot in our limited short-term memory), switch to command mode, type the command. vs Hold/mash "down" button until cursor is there. After watching a few vim coding screen-casts I have the impression that the second way is more popular in vim too.

TBH I think I almost never look at the line numbers in vi, but the alternative isn't always holding/mashing j.

I occasionally use a count (5j to move 5 lines down, especially good for moving ~4 lines at a time), sometimes use C-u/d, C-f/b, or H/L to scroll half a page up/down, a full page up/down, or move the cursor to the Highest/Lowest line on the screen (these are good for large movement. And you can use zz to recenter the cursor on the screen after H/L). But likely the most common vertical movement I use is curly brackets/braces to move a paragraph up/down.

In CUA editors to me the nicest shortcuts are Control[+Shift]+Backspace and Control[+Shift]+Arrow because they involve the editor understanding a basic construct of human language (words). Vi takes that to the next level.

Re: How Did Vim Become So Popular?

#506
post #302

Earlier quoted context omitted.

Here's my best take at this so far, I wrote it in 2007: Why, oh WHY, do those #?@! nutheads use vi? http://www.viemu.com/a-why-vi-vim.html

This post has been my enlightenment about modal editing. Thank you for this excellent piece. And I've referred dozens of people to it after me.

My pleasure :)

Re: How Did Vim Become So Popular?

#507
post #93
post #76

Comes with every *nix distribution. Fast to start. I use Emacs for programming but if I have one single file, like a config file, that needs a quick edit, use vi(m) because otherwise I have to either: 1. Go to my open Emacs and navigate to the location of the file needing the quick edit 2. Open a second Emacs instance, and hope I don't lose the desktop settings for the "real" instance. Especially if the file needs to…

I'm confused by your workflow. Why are you opening a second Emacs instance? In Emacs you just C-x C-f /path/to/config, for sudo C-x C-f /sudo::/path/to/config. Starting location will be home, or the parent of the active file (if the active buffer is an editor).

TIL about /sudo:: I will look at it further.

For the other it's usually something like

/usr/x/y/z/a/b/c/config.ini

Yeah, I want to type that path into Emacs when I can

    vi config.ini
or

    sudo vi config.ini
and be done in seconds.
Post reply on HN