TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Learning Vim incrementally (2010)

96 pointsby m3atover 5 years ago

22 comments

dustedover 5 years ago
Oh, can I resist.. Nope, sorry. Everyone who tried to convince me to use vim plugins was wrong. Keep it clean :) Vim is my daily driver for programming, which is my job, in my office we&#x27;re 2 using vim, we exchange tips and tricks sometimes, and ask questions that are exceedingly specific, and it just becomes nicer and nicer to work with text as I get better. I do need to experiment with multi-line cursor, that I mess from vscode studio.<p>The article is well written, and the authors has a good point. I don&#x27;t think there are that many situations where &quot;dive in head first&quot; is that good of an idea.. Slip in where you can find ground, and work your way out until you learn to swim. I&#x27;d never switch off my cursor keys, I don&#x27;t CARE if it&#x27;s supposed to be more efficient. That&#x27;s how I feel right now, maybe one day, I&#x27;ll feel different, but if I do, I won&#x27;t recommend any new users to do the same, that&#x27;s just silly.. I mean, that&#x27;d do nothing but scare them away and make their lives miserable.
评论 #21135028 未加载
评论 #21147818 未加载
melvinroestover 5 years ago
The following has been repeated quite a lot on HN, but for people who are new to vim or new to reading HN it bears repeating.<p>1. Go to your terminal.<p>2. Type in vimtutor.<p>3. Spend half an hour.<p>4. Congratulations! You are now able to survive in vim, while you&#x27;re by no means a master yet, you&#x27;re probably around 80 to 90% as productive in vim as with a general text-editor without plugins.<p>IMO it&#x27;s 30 minutes well spent.
评论 #21136283 未加载
评论 #21135773 未加载
评论 #21135742 未加载
alfonsodevover 5 years ago
The post is from 2010, today in 2019, I&#x27;d say that first step could be to install a vim extension in your already existing IDE&#x2F;editor, VSCode and Idea have good enough vim plugins to start learning insert mode and moving around, and even allow you to search and replace :%s&#x2F;termA&#x2F;termB&#x2F;g You can also play Vim Adventures[1] if you want to be even more playful.<p>[1] <a href="https:&#x2F;&#x2F;vim-adventures.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;vim-adventures.com&#x2F;</a>
评论 #21134732 未加载
评论 #21134701 未加载
评论 #21134783 未加载
elagostover 5 years ago
I&#x27;m convinced that people who use solely vim&#x2F;emacs started off before there were any good GUI editors and now have too much momentum. I&#x27;m not that old, but I frequently spend time on headless *nix boxes, so I use vim all the time and love it. I have a portable .vimrc that I take around with me because I have spent so much time that I want to configure things the way I like them.<p>Despite my love of vim, on the desktop, I fall back to gedit or Notepad++.<p>Vim and Emacs are great editors when you&#x27;re SSH&#x27;d to a headless server, but they will not replace an IDE (or even TextMate). That is completely ridiculous.
评论 #21135845 未加载
评论 #21135811 未加载
评论 #21136353 未加载
评论 #21138723 未加载
评论 #21136303 未加载
评论 #21136811 未加载
评论 #21140174 未加载
评论 #21136090 未加载
Phenix88beover 5 years ago
I started learning Vim keybindings (on Spacemacs) when my extensive 8h&#x2F;day use of the mouse had becoming painful. Some days I could barely move some of my right hand fingers.<p>One day I had enough, I started the Vimtutor process and never looked back. No more pain since.
majewskyover 5 years ago
I agree with the article, but I&#x27;d like to add another early step: Understand that Vim&#x27;s normal-mode commands are like a language with nouns and verbs. You can mix and match most nouns (motions) with most verbs (actions). So when you already know 5 motions, learning a new action actually means learning 5 action-motion combinations at once.<p>With this in mind, observe yourself as you work and notice which motions and actions you need most (like `ci&quot;` in the article). Focus on these at first for those sweet sweet quick wins.
DictumMortuumover 5 years ago
I keep reading about productivity on vi vs other browsers. That&#x27;s cool, however the thing that makes me want to use vi with proficiency is another though: availability. I spend a lot of time in ssh or docker sessions and not knowing vi can severely hinder my job.
评论 #21135004 未加载
UI_at_80x24over 5 years ago
There are two (non-exclusive) camps for vim use. Developer and Admin.<p>Most of the discussion here focuses on the dev-side of things naturally; but I want to touch on the Admin&#x2F;sysop side.<p>If you are just starting out editing config files there is very little benefit to using vim over some more simple (i.e. nano)<p>Example: Editing an sshd_config file. Scenerio: You want to change the default port number that sshd is listening to. Both nano and vim make this singular task very easy and quick. As far as speed goes, I&#x27;d say they are close or equal to each other to finish this task.<p>Where vim really shines is for larger and more &#x27;annoying&#x27; tasks.<p>Example: You need to iterate out a list of incrementing IPs for another service.<p><pre><code> e.g. 192.168.0.1 192.168.0.2 192.168.0.3 ...etc... 192.168.0.254 </code></pre> In nano, you need to manually edit&#x2F;add each line which is combersome; however with vim there are multiple ways of doing the same thing (recorded macros are amazing!).<p>But in my experience the hands-down &quot;it doesn&#x27;t get better then this&quot; &#x27;Admin use&#x27; of vim is this: editing YAML files (whitespace is evil, OMG why?!?) vim can be configured to convert your tabs to spaces and all pain is ended in the universe.<p>Little things add up. For the odd small job, you might not see an improvement over a &#x27;dumb&#x27; editor like nano; but the skills you learn on the small things translate into big improvements on the big jobs.<p>P.S. Being able to edit your editor is a HUGE benefit too. My company wants us to keep detailed track of our time-spent on each project. So I added a hotkey (F5) to input the date&#x2F;time-stamp whenever I start&#x2F;stop a task.<p>Consider this analogy, nobody needs to modify their .bashrc file or create custom aliases. But look at how much you suffer when your customizations are not there. You don&#x27;t need to use anything more then nano, but the improvements scale exponentially when you do.
评论 #21135373 未加载
golergkaover 5 years ago
When I switched to Vim, I was at 1&#x2F;3 of my usual productivity for the first week, and I think at about 1&#x2F;2 for the first month - author is completely true about that. However, since then, I&#x27;ve been so much more productive over next 7 years that it had definetly been a good decision.<p>And I don&#x27;t even use Vim now! Visual Studio, VS Code, all JetBrain editors have competent vim emulation plugins, so the core of my ehnanced productivity, the core and most important feature of Vim, is still paying off.<p>I just wish I had a spare year to learn and configure Emacs. (Yes, I have tried Spacemacs and other options, many times, and it was so confusing every time that I only believe in learning Emacs from absolute basics withut any plugins now).
评论 #21135010 未加载
raverbashingover 5 years ago
&gt; To those who would say &quot;that&#x27;s obvious; of course you learn vim incrementally&quot;, I would simply say that having spoken to a number of vim users in the past, I never got that advice. Instead, I got a lot of advice about turning off my arrow keys, disallowing the use of the mouse, and learning the (MORE EFFICIENT!!!) vim ways to do everything, all at once<p>Ugh, this.<p>Arrow keys have been invented for a reason, they&#x27;re good and intuitive and there&#x27;s <i>absolutely nothing wrong</i> with using them. Same with the mouse.<p>The &quot;pure&quot; VIM ways are more efficient than ed. They&#x27;re maybe more efficient some 10% of times you actually need some specific thing. But they&#x27;re not better than a visual editor.
评论 #21135251 未加载
评论 #21135988 未加载
Pimpusover 5 years ago
Learning a good editor is an investment. You sacrifice some productivity and time now for a massive return on your investment later. Stating the obvious, I know, but so is this article.
评论 #21135281 未加载
YeGoblynQueenneover 5 years ago
&gt;&gt; Turn off your arrow keys.<p>This has gotta be the worse piece of advice I&#x27;ve ever heard in my life, second only to &quot;why don&#x27;t you march towards my line?&quot; [1]. I&#x27;ve been using Vim for umm, eight years? Thereabouts. I never turn off my arrow keys. How much time are you supposed to save like that? Milliseconds? You go much faster with B, E, Crl+Y, Crl+D anyway.<p>Just misguided advice from otherwise well-meaning folks, that&#x27;s all.<p>Edit: btw, how do you go through your recent command history on vim without up and down arrow? Do you have to q: and navigate with hjkl every single time? Is that more productive than pressing up arrow three or four times?<p>_____________<p>[1] Sorry guys, Warhammer Fantasy Battles reference there. See, I got a shooty Dwarf army, he&#x27;s got a shooty Empire army, so we&#x27;re standing just outside each other&#x27;s range and scream insults at each other. His light cav mauls itself on my Slayers trying to flank my Thunderers (yeah, I don&#x27;t know what he was thinking, either). He&#x27;s got a Steam Tank, but I got a Lord on a shield (with a metric shitton of runes) protected by a regiment of Ironbreakers (with a metric shitton of runes) on the Tank&#x27;s side. So noone&#x27;s going anywhere in a hurry. So, by way of friendly advice, he says &quot;why don&#x27;t you march towards my line?&quot;. Yeah, right. So your Sniper can pick out my Lord and your Tank and Knights can sanswich my guys? You kiddin&#x27;?<p>Btw, he did win anyway. It turns out you gotta make _a lot_ of saves against a well-designed Steam Tank. Also, I suck at aiming artillery. But, come on. &quot;Walk towards my line&quot;? Do I look like an Elf or something?
评论 #21137209 未加载
评论 #21138765 未加载
pesarkhobeeeover 5 years ago
One of the possibilities for people who already used sublime or vscode is giving a try &quot;Oni Editor&quot;, it is based on neovim and Also have a really nice tutorial section which you can collect some achievements : <a href="https:&#x2F;&#x2F;github.com&#x2F;onivim&#x2F;oni" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;onivim&#x2F;oni</a>
roland35over 5 years ago
The best part of learning Vim is being able to load it into almost all IDEs such as Eclipse and VS Code. Even though those implementations are incomplete and slow versus stock vim, it makes navigating and modifying text much easier.<p>I just wish there were better guides managing plug ins for Vim in Windows! I have trouble with the new Vim 8 plug in system.
评论 #21135459 未加载
meukover 5 years ago
Vim is quite nice, but also quite... old-fashioned?<p>I use vanilla vim as my main editor. Today I had to search for some text verbatim, and I don&#x27;t think there&#x27;s a way to do this in vim: It treats everything as a regex. I&#x27;ll also happily use mouse support, and really <i>hate</i> the bad support for the clipboard in vim. I have spend multiple afternoons on getting this to work properly and it still doesn&#x27;t. So sometimes you just have to take your loss and use another editor for something.
评论 #21136551 未加载
评论 #21136441 未加载
评论 #21136418 未加载
ptahover 5 years ago
ok, i&#x27;ll bite: you need to learn vim if you are ever going to edit stuff remotely on a vanilla unix&#x2F;linux&#x2F;bsd server
denton-scratchover 5 years ago
I never knew you could use a mouse with vim. I&#x27;ve only ever used it in a terminal session. I can&#x27;t understand why anyone would use an editor designed for a terminal if they have a GUI.<p>[Actually I mainly use vi, but I believe it&#x27;s the same program]
评论 #21138739 未加载
评论 #21139082 未加载
评论 #21138462 未加载
kanokunover 5 years ago
I switched to vim I was unproductive for days and frustrated. Then I realised I don&#x27;t have to go thorough this pain there are so many great IDE&#x27;s out there. 10 years later I am still super productive and don&#x27;t use vim.
评论 #21135775 未加载
badsavageover 5 years ago
vim is still the best text editor, our whole family uses it for daily work
评论 #21134839 未加载
评论 #21135401 未加载
Zelphyrover 5 years ago
I&#x27;ve been using Vim for over 20 years yet every time I read an article like this I learn something new. How did I not know about `ci &quot;` until now?!
collywover 5 years ago
I can do the very basics of VIM (like exit it).<p>Can anyone tell me what I would gain over Pycharm (when most of my work is done there) as the learning curve seems steep?
评论 #21134878 未加载
评论 #21134869 未加载
评论 #21135563 未加载
评论 #21134807 未加载
ptahover 5 years ago
flame bait
评论 #21134617 未加载
评论 #21134621 未加载
评论 #21134635 未加载