________________________________________________________________________________
Both this website and vimtutor teach basic commands (finger mechanics) but some learn more effectively if they have some of the philosophy and logic of _why_ vi/vim works the way it does. For example, this popular Stackoverflow answer explains vim's concepts of "verb + noun" commands:
https://stackoverflow.com/questions/1218390/what-is-your-mos...
Also, a lot of beginners are perplexed why vi uses "hjkl" keys for cursor movement. It's because the 1976 ADM-3A terminal didn't have any dedicated arrow keys like the 1986 IBM PC 101-key layout:
https://catonmat.net/why-vim-uses-hjkl-as-arrow-keys
Without background info like that, learning vi can seem like memorizing random incoherent trivia.
> Also, a lot of beginners are perplexed why vi uses "hjkl" keys for cursor movement.
I really don't understand why people get hung up on this. Vim supports arrow keys. hjkl are convenient alternatives but if you're at the point of not being comfortable switching between normal and insert mode just use the arrow keys. Insisting othereise is insisting you learn everything at once, which is demotivating and unnecessary.
Arrow keys are more versatile too. They do the behavior you expect in pretty much any mode.
I knew a vim-evangelist developer once who added bindings to his .vimrc file so that, if you pressed an arrow key in insert mode, it would insert the appropriate arrow symbol. I think this was meant to train the user _not_ to use the arrow keys to navigate around, but rather to switch to normal mode and use hjkl or other movement commands.
While I don't approve of this on a practical level, I have to admit that I find the logic of the joke hilarious. You were in insert mode, and you pressed the arrow key, so it ... inserted an arrow.
On the hjkl thing, I think it's also good to explain why it was a good idea that the ADM-3A used hjkl, and that's because it allows directional navigation (an extremely common operation) without moving your fingers away from their "home row" position.
So vi/vim use those keys not /only/ because some old terminal, but because some old terminal used those keys /and/ there was a benefit to it.
I paid for vim.so. It was helpful to learn the most basic commands but I wish it had more exercises.
I don't think there is any point in using vim over an IDE but it is often quicker to edit config files in vim or navigate text so I use it for that.
Author of another [1]vim learning tool here.
I launched it 10 months ago on [2]HN and that launch ended up leading me down the path to start a company and get accepted into YC.
It's cool to see other people's take on a problem but this feels eerily similar to my tool, down to some of the copy, layout, and pricing.
[1]
[2]
https://news.ycombinator.com/item?id=25846347
Can anyone of the "old" group explain what the benefit of vim is, if we have nano now? Having missed the days when only vim was there, I find it perplexing that vim is sometimes suggested. Personally, I have to look up each single keystroke in vim when nano just seems to follow common UX conventions.
This is just a clone of vim.so. Whoever did this is simply ripping off the original site. They didn't even fix the copy.
Lots of people think learning vim is learning random letter-command mappings. This is true to some extent, but the idea that you're ONLY memorizing these mappings is not the right conceptualization, IMO. Instead, you are ingraining physical motion. The same way you don't think about how you're inserting your car key, or brushing your teeth, or walking, I don't think about pressing `o` to create a newline or pressing `CTRL-[` to cancel an operation. Maybe at the start I did that, but now I (barely) think "create a newline" and my fingers just DO it. Only when I'm substituting or recording a macro do I actually have to be careful. Otherwise? Pure physical motion.
This is true to the point that when someone asks me to explain how to do something that I do all the time I feel confused and it requires me significant effort to reverse engineer my muscle memory so I can verbalize the correct keystrokes.
Recording a macro is probably easier than to decode that physical memory haha.
Reminder: VSCode, Visual Studio, IntelliJ, and Notepad++ all individually have a higher usage share among professional programmers[0]. Vim is similar to Android Studio. But you'd never know that such un-sexy tools are actually super popular reading technical sites.
And before the "but it is already on your server!" You know what else is installed on almost every *NIX server? Nano. A text editor that needs no deep introduction to be productive or that you have to reconfigure basic keybinds like the arrow keys "because it could break a system not used since the 1970s!"
I know Vim well, I've used Vim a lot, still don't understand the strange obsession people have with getting others into it. You want some professional advice? Don't learn Vim, learn Nano, and use the time you saved to learn VSCode better.
[0]
https://insights.stackoverflow.com/survey/2021#most-popular-...
With the implication that you "save a lot of time" by learning another editor (nano) you are confusing skill ceiling with skill floor. If you want to compare those editors, compare them at the learning level you are presenting them.
The other editors do not involve any learning if you don't learn anything about them, Vim involves a lot of learning if you learn _most_ of its features. However to use Vim in the way you present the other editors, you don't have to learn much at all, arrow keys work, the gui version has window menus for most options.
Want to use Vim without the learning? i to insert, ESC to go back from insertion mode, arrow keys to navigate, there you are, you are basically using Vim at the level that you want people to use other editors.
If I want much more than that I'll have to learn the features and keybindings of the other editors too. Last time I checked the knowledge of how to search, split panes, switch buffers, search and replace etc. wasn't magically inserted into my brain as soon as I open my copy of VSCode or Nano.
> you have to reconfigure basic keybinds like the arrow keys
Since when do arrow keys not work in Vim by default?
Learning all of Vims features vs. learning only the minimum in other editors is not a fair comparison.
Other editors don't require nearly the same effort to learn because features are (typically) easily discoverable via the menu bar, or use standard shortcuts. I've never used VSCode in my life, but I bet you a dollar that control-C copies, control-V pastes, and control-F brings up a search dialogue. I also would bet that if I want to split a pane, I can figure out how to do that my mousing around the menu in under ~30 seconds.
Whereas, trying to do pane-like things in vim requires Googling (more efficient in my experience than trying to use the built-in manual) and then reading some stackexchange answer that devolves into a philosophical discussion about the merits of buffers versus tabs.
I think that the journey that you went through (philosophical discussion about...) is more important than just going on with your life which is made easy in VSCode. This eventually gives rise to a community. Like I can assume that hacker news readers can (or figure out how to) exit vim without using any search engine.
The problem with Vim only development we don't have the OS support to use only the keyboard.
Soon or later you have to reach for the mouse to scroll through the browser, or change/rearrange windows, even with all the fancy Vim plug-ins.
I'm not sure why that's a problem for using vim, as if the only reason people use vim is to avoid using the mouse.
> Reminder: VSCode, Visual Studio, IntelliJ, and Notepad++ all individually have a higher usage share among professional programmers[0].
20 years ago, this list would have had a bunch of different names on it.
20 years from now, it will be different names still.
Meanwhile, vim will still be there, and my knowledge in it built 20 years ago will be serving me still 20 years from now.
Knowledge between modern editors and IDEs is generally highly transferrable. You don’t magically forget how to copy / paste when going from Pycharm -> VScode.
> I know Vim well, I've used Vim a lot, still don't understand the strange obsession people have with getting others into it.
The reason someone might advocate for its adoption can lead to greater availability (this is why there's a vim mode in pretty much every other text editor). Or they think it's a better way to edit text and want others to experience it. I would love if I could edit text in everything as I do in vim because editing text in the more "intuitive" way is slow and clunky and frustrating.
I think what's more peculiar is the strange obsession people have with dumping on vim or on the people who are advocating for its use. It reads as petty and insecure.
Excuse me, my obsession with dumping on vim is not strange! It is well justified by the fact that, due to several positive comments on HN, I spent many, many hours trying to learn and use vim only to realize that it was fundamentally slower, and imposed a higher cognitive burden, than the editing tools I was previously using. I only want to save other people the same trouble.
I realize my experience is n=1, my editing needs might not by typical or generalizable, etc. But I do think it is important to push back a bit on vim boosterism.
I'll bump you up to n=2!
I learned vim to, say, like, a low-moderate-ish proficiency? Basically forced myself to use it everywhere at work and home. After a few weeks of this... I went back to just vanilla IDEs/Editors.
For me, it was just a mix of not liking some stuff being handled in vim bindings and some stuff being handled by the IDE's bindings. I'm sure there's a bunch've plugins or customizations that'd smooth it over, but... vim also made me realize, I'm a pretty meat and potatoes text editing kinda guy. I like to shift lines, expand selections in a context aware way, and copy/paste. When I split panes, I do it with the mouse like a cave man. So the bulk of vims power was either lost on me, or felt like it got in the way of my minimal needs.
Also, I pretty much never ssh onto an individual machine to edit anything substantial these days, so... the selling point of having some bedrock transferable "everywhere" skill is kinda moot.
> I spent many, many hours trying to learn and use vim only to realize that it was fundamentally slower
Your lack of proficiency in vim does not mean it is _fundamentally_ slower.
> I realize my experience is n=1, my editing needs might not by typical or generalizable, etc.
> I only want to save other people the same trouble.
Pick one!
I don't think there's anything wrong with saying some people may have needs similar to mine, and some may not. I've tried to spell out in other comments what those needs and experiences were so that people can make an informed decision.
After just a week in Vim, being required to move my hands of the home row feels like a significant, possibly even disturbing undertaking.
> Reminder: VSCode, Visual Studio, IntelliJ, and Notepad++ all individually have a higher usage share among professional programmers
This is an artifact of the structure of the question. They're not asking what you use the most, they're asking what you use _at all_. Check all that apply.
So then you check Notepad++ even if you're a Linux developer who primarily uses vim or emacs but have Notepad++ on your rarely used Windows VM. You check Visual Studio or VS code if you had to contribute to an existing project which is tied to its build system, even if you avoid it whenever possible.
A quarter of all developers use vim. That's not a small number and it's not for no reason.
I have used all of those editors and a dozen more over the years, but Vim is just the best by a large margin (IMO). The neovim plugin ecosystem includes everything I could possibly want from those IDEs, for every language, and most importantly, _only_ the things I want. Even if we dismiss vim's editing capabilities and its native integration with the wider linux ecosystem (tmux, zsh, ssh, etc), the best part about vim is that it's a blank slate that you can build into an IDE that's highly tuned to the work you do and the way you think, rather than trying to shoehorn every new IntelliJ feature into your workflow just because it exists in an IDE dropdown menu.
I don't begrudge anyone that says "wow, I don't want to take the time to research every damn feature of my IDE, just let me work", that's totally reasonable, and any of those IDEs will let you get the job done - for me - the time invested is worth it because of how much of my life is spent editing files on my computer.
So, don't learn vim because it's marketahare is "small"? Larger than xcode, atom, sublime and even notepad++ when you add neovim? That logic makes no sense and even if it did, the chart you linked still shows vim to be one of the largest is the world
> you have to reconfigure basic keybinds like the arrow keys "because it could break a system not used since the 1970s!"
Never had to do that on Nixos, Ubuntu, Amazon Linux, RHEL, MacOS or WSL
For my workflow with lots of context switching between code and commands, using only a terminal is more efficient use of my time. VSCode cannot do that in a way that works for me
_But ignoring all of that, many use [neo]vim because they simply enjoy it. Enjoyment does not need justification_
VSCode, Visual Studio, and IntelliJ all support vim bindings.
For me, the most useful part of vim is that once you learn how to use it, you can switch text editors without needing to relearn most of their shortcuts.
Every time I try an IDE (admittedly not very often) I end up frustrated that its Vim binding implementation is incomplete. It feels even worse than using its default bindings because I start to feel confident and then suddenly it doesn't work as expected and I feel cheated :-) I guess after a while you learn what to expect from the Vim implementation of your IDE of choice but I haven't yet had the patience to reach that stage.
I think XCode's new vim mode is the only time I've found it truly jarring how incomplete the mode was, but it's certainly better that it's there than not.
_all support vim bindings_
Last time I tried za and it didn’t work. These extensions stop right at the impedance raising point, it’s something you should know beforehand.
I tried hard for a few months to be efficient with vim. At the end, I was still faster with a laptop keyboard and trackpad for selecting and editing text at arbitrary places in a document ("random access editing").
One case where I find a mouse/trackpad essential: editing LaTeX documents. Being able to control-click to jump between a spot in the compiled .pdf and the corresponding source code, or the reverse, is invaluable (a feature supported in TeXShop, for instance). I realize that one can probably set up a similar system in vim. But, the appeal of vim for me was that, at the cost of learning a bunch of arcane keyboard shortcuts, I could go mouseless and as a consequence be faster. If I'm going to keep the mouse, the value proposition seems a lot worse.
Then use your mouse to highlight and do random access editing in vim? this has worked just fine for ~20 years.
Source: my experience of using vim for the last ~20 years
Nano and almost everything here you listed (without vim bindings) are not modal editors.
Here's some other professional advice: people liked vim because it is modal, that means the coding process itself can be automated, scripted on, insanely fast and can completely forego mouse/touchpad input.
Vim bindings by themselves are great, but they are not fully vim, for instance, most vim bindings including this website does not support `:norm`
For me, and I assume many others, vim is fun. It sort of gamifies text editing. There's always new things to learn, and executing advance keystrokes is satisfying. Once you know them, moving to other IDE's is a pleasure because they all offer a vim mode (with varying levels of compatibility). Personally I use vim / emacs + evil / jetbrains depending on the task.
But if you don't care about that aspect, I agree with you, just stick with the boring thing that works. I don't think vim really saves me much time in the long run, but it sure makes my daily tasks more fun.
I agree, don't use vim the text editor. But please, give a try to vim the editing paradigm, supported by all those programs or a reason via plugins.
Popularity is not a good a metric for comparing value. If we were to use it for choosing where to shop, the top choice would be Walmart [0]. This isn't to say that VSCode is bad, just that Vi/Vim being less popular doesn't mean it's not worth it for anyone to learn. It's also good to have a healthy field of tools to pick from. Plus, learning Vi to a degree that is productive takes a week of use, and then the keybindings can be applied elsewhere, such as VSCode.
[0]
https://nrf.com/resources/top-retailers/top-100-retailers/to...
Something like this website doesn't teach you vim, it teaches you vi keybindings and the basic concepts. Vim bindings are available in all the editors you mentioned (although my understanding is that the Notepad++ bindings in particular are bad). For the people who say they're using vim productively, they're usually running some combination of plugins (that hopefully don't step on each others toes) that emulate the featureset of an IDE that they want to use.
And you're bang on wrt nano existing everywhere vim does!
I use VSCode. And vim. Every day. Am I a VSCode user or a vim user? Probably the former (my usage is slightly higher, but not significantly).
I suspect some variation is the same for many; it's a likely driver of demand for vim bindings (which are ubiquitous).
Even if people's daily usage of vim is much lower than their GUI-IDE of choice, the aggregate is likely far higher than reported.
The survey cited allowed you to select _multiple_. So your assumptions about what the data shows isn't based. Here is the question text:
> Which development environments did you use regularly over the past year, and which do you want to work with over the next year? Please check all that apply.
Pretty fair question if I've ever seen one.
I use VSCode, IntelliJ and Notepad++ all with VIM mode. VIM isn't just the editor, it's a style of editing.
Honestly if an editor doesn't have VIM mode, I don't use it.
That survey is potentially very biased -- 92% of professional developers are male?
That's the real number.
You should lookup Argumentum ad populum. There are still many reasons to use a free and open source keyboard centric editor that can run as a TUI, has stayed around for 30 years while other Microsoft owned editors died on the vine barely 5 years into their lifespan.
If my professional opinion, learning vim or emacs will give you a tool that will last you several lifetimes and can grow with you as you customize it to your specific needs.
So true! When I started as a professional programmer they were using Eclipse, then Textmate was the big thing, then it was all about SublimeText and now it seems everybody has moved to VSCode. And here I am still using Vim happily after 20 years...
is the place to learn vim ... and the vimtutor
Always felt the best way to learn vim is to just use it.
I'm a beginner to intermediate level vim user (well, vim bindings user), and while this is true, you don't know what you don't know.
The question is: do you need to know?
I handily accept that I don't know a big part of vim. At the same time I use it daily and went as far as developing vim script to automate stuff that are repetitive to me.
Vim bindings are quite easy to pick up and fairly straightforward though, but that should just take a cheat sheet and some usage.
Spending a week on an island in the middle of the Pacific with very little internet really got me to appreciate :help.
But I think it's important to gradually use vim. If you're new to vim leave your IDE installed.
true, but mixing things up can sometimes be fun too
This looks verrryy similar to
The pricing is even the same :)
Vim is unnatural. It basically boils down to writing programming language commands to edit text. For example 4dd to delete 4 lines. Now, why exactly would I want to go into edit mode to type 4dd to delete 4 lines instead of select and delete.
It's just our minds don't work that way when thinking about editing text. The way I view text is visual. I don't think in terms of delete 4 lines, go line 435 and dw to delete a word. Copying and pasting text is a nightmare. Navigating from insert mode to visual mode to select and paste text. It's impossible to design a less intuitive text-editor.
> It's impossible to design a less intuitive text-editor.
Intuitiveness (or lack thereof) isn't a strong reason for dissuading use of a tool that you'll be using over a lifetime. Any tool you're using that you hope to be competent in requires learning and practice to become proficient in.
> It's just our minds don't work that way when thinking about editing text. The way I view text is visual. I don't think in terms of delete 4 lines, go line 435 and dw to delete a word.
Visually, if you want to delete a paragraph, how would you go about that? In most text editors you might grab your mouse and click on one end and drag through to the other end of the text and press backspace. In vim you can just tell your editor to delete the paragraph. Or maybe you want to change what's inside the parentheses, so you tell your editor you want to change what's inside the parentheses and you do that. If anything, the 'normal' way of text editing has almost nothing to do with how my mind models editing text while vim allows me to tell the editor exactly what I want it to do and it performs it.
>In most text editors you might grab your mouse and click on one end and drag through to the other end of the text and press backspace. In vim you can just tell your editor to delete the paragraph. Or maybe you want to change what's inside the parentheses, so you tell your editor you want to change what's inside the parentheses and you do that. If anything, the 'normal' way of text editing has almost nothing to do with how my mind models editing text while vim allows me to tell the editor exactly what I want it to do and it performs it.
That's the problem with telling the editor to do exactly what you tell it to do. Telling a machine to do exactly what you want is programming. For text editing doing what I want with 95% percent precision is more than enough. If that fails I can press CTRL + Backspace to delete few more words. How would you delete a paragraph in vim? I reckon something like:
1) Visually see the line where the paragraph is
2) Jump to that line with 100 gg
3) Run another command to delete the paragraph. Now again some thinking needs here is it a code block between curly braces {} or is it a textual paragraph but why is that thinking required when I can actually see it in front of me and select it.
4) Get back to insert mode
In a normal text-editor:
1) Visually see the line and select it with cursor and delete it.
This is just making it all the more apparent that you didn't really grok vim while you were using it. to get to a paragraph you can use navigation keys, you can click on it with your mouse, you can jump to a line directly by its number, relative or absolute, you can search for a snippet of text inside of it. There's a myriad of ways you can move your cursor so that you can perform actions on a specific block of text, which includes the way you would do so in a normal text editor.
> Now again some thinking needs here is it a code block between curly braces {} or is it a textual paragraph but why is that thinking required when I can actually see it in front of me and select it.
There is almost no overhead to performing this action when you are even modestly proficient in vim, no more than the cognitive load it takes you to decide you must use a mouse to select that portion of text, which also requires more precision since you must accurately place the cursor both at the start and end points.
> How would you delete a paragraph in vim? I reckon something like: <snip>
I think more experienced vim users would use "dip" for text (<d>elete <i>n <p>aragraph) or "di}"/"di{" (<d>elete <i>n <brace>) for stuff in braces.
If you want to change something instead? "cip" (<c>hange <i>n <p>aragraph) or "ci{"/"ci}" (<c>hange <i>n <braces>).
Vim feels very natural when you grok it.
> Now, why exactly would I want to go into edit mode to type 4dd to delete 4 lines instead of select and delete.
Because it's faster and more flexible.
> The way I view text is visual.
Vim allows you to select text easily. For example V4j will select this and the 4 lines below, vi{ will select all lines between curly brackets and vt( will select characters from this up to the character before (.
> Copying and pasting text is a nightmare.
Copying and pasting text is a bliss.
> It's impossible to design a less intuitive text-editor.
The learning curve is steep for sure, but with a little bit of effort you will edit text in a more convenient, flexible and faster way than before.
_It's just our minds don't work that way when thinking about editing text_
Please speak for yourself, sir. I do 2-5 line rearrangements and jumps very often and hate to do “home home shift+ down down down shift- ctrl_x scroll scroll scroll scroll …” instead of “4dd'a”. When it’s hard to count lines, you can “V/something<CR>” or “V30j” and adjust with jk to select more or less. When it’s a block, “%v%”. Vim always has less-movement ways even when you can’t calculate precisely and my mind can’t work in a “wait for 50 key-repeats” mode.
But I’ve felt what you’re describing at the time when my knowledge was shallow and I didn’t really know the essential part of vim.
_It's impossible to design a less intuitive text-editor._
This one I agree with.
> For example 4dd to delete 4 lines. Now, why exactly would I want to go into edit mode to type 4dd to delete 4 lines instead of select and delete.
The thing is that you can do both in Vim. 4dd is faster but harder to learn and commit to, it's not in any way required though and you can stick to vim basics and go the regular select and delete route too (via mouse, _v_, etc.)
But those are features of vim. The default settings of vim are nonexistent. I needed to spend hours just to get it to sort of work. It was not even showing line numbers let alone syntax highlighting.
Vim has a visual mode that you may find more intuitive. I use it all the time for multi-line editing, particularly through the `V` command.
Here are is a comment for learning vim.
Open up terminal
vimtutor
Enjoy the tutorial
I knew vim well before I read this advice, so didn't need it myself, but think it's worthy: Go through vimtutor, then use the native vim for you platform that also has a GUI, so when you get frustrated you can 'fall back' to using menus. Over time replace your menu-fallback stuff with "hand on the keyboard" techniques. It was soooo frustrating in the early going with vim. Very distracting from what I was trying to do. (Presumably true for most of us.)
I learned Vim by watching some videos of a guy talking VERY enthusiastically about Vim. I can't find them anymore though. Was just some programmer explaining Vim in a series of videos. Probably almost 10 years ago. Anyone know what I'm talking about?
EDIT Found it! This guy is brilliant.
http://derekwyatt.org/vim/tutorials/index.html
Thanks--these look great!
Is this not just a clone of vim.so??
What's wrong with the built-in `vimtutor`?
nothing is wrong.
Some people prefer guided tutorials that give you direct feedback (e.g. correct / incorrect).
Vimtutor is perfect for self-guided and self-motivated
website you cannot leave without asking another website
which you can't do because you can't leave the first one
vim.so, openvim.com, vim-adventures.com, and now vim.is which looks weirdly similar?
Thanks, but I'd rather spend the $25 to help poor children in Uganda.
Is it either-or?
www.colonwqbang.com is still available.
Doesn't look like it is, I just tried to go there without success.
OP may have been referring to the domain name.
vim seems like very compusive tool at first but as you keep using this is seems like very productive. thats how it was for me
I first created this vi quickstart tutorial at the request of two Windows sysadmin friends who were given charge of a few Unix servers. They later told me that it helped them come up to speed with text editing on Unix.
https://mobile.twitter.com/vasudevram/status/124858356689776...
I'm finally gonna rant about Vim here. Gets way more credit than it is worth! ("but it's soooo coool! I'm superfast doing find / replace! You just gotta learn the crazy syntax, haha!") My response: "are you sure? I wouldn't rely on those fancy commands... best to use a statically typed language and rely on an abstract syntax tree for renaming tasks than an editor to do that."
Like everything in the software world, because some Google engineers used it, it became world wide famous. There's a saying in german that I love, basically amounting to, "they also cook with water". In short, there is no real tool that has "secret sauce" or is "super magical". It's an editor, that's all.
Say what you will but nano is is fine for me via SSH, VS Code for everything else.
Looks like many of the comments take a similar stance, which I'm actually surprised at.
I'll see your "are you sure?" and raise you one. :) Are you sure that vi/vim have many people who use them and that those tools are "world wide famous" because of such superficial reasons? Isn't it possible (and far more likely) that there is some substance to their reasons?
Use whatever tool works best for you. I use vim because it is far and away the most efficient way to edit text - especially code. Anytime I have to use something else it's amazing how sluggish and tedious it feels to do the most basic operations - it feels a lot like trying to run in knee-deep water. I've extensively used many (most?) of the major editors on the planet (including many obscure ones) over several decades. I had to be forced to use vim at first because it seemed so terrible. Believe me, it's not my editor of choice because of some randos at Google, haha.
> Like everything in the software world, because some Google engineers used it, it became world wide famous.
I'm skeptical to this claim because vi/vim's widespread usage predate google itself, by decades. It used to be the only way to really edit something in the 1980s on unix systems, unless you preferred ed.
Vim's modal system extends way beyond some special cases. The most time save I have using it are probably not fancy stuff but quick movement across lines and within lines.
Vi(m) predates Google by about.. 30? Years.
The rest of your post is fine though. You do you :)