11 ms·
VIM Pays Excellent Dividends: Learn it early, if you can
- gshulegaard 10y agoCame here to make a comment about other utilities in the same vein...but the author already did! > [4] Or, emacs. Or, really, any other tool that you 1) use constantly; 2) is almost universally applicable; and, 3) makes you more productive. Nice to see consideration for other tools in a piece like this.
- pathdependent 10y agoThanks! I put VIM in the title because 1) it's got a recognizable identity to pull in readers and, 2) I use VIM. But, in a weird and almost recursive way, editor wars are kinda like language wars. If it gets you that 5% (or more) boost, great! But, the differences between them often washes out.
- karmajunkie 10y agoYeah, the most important thing is to know your tools of choice really, really well. vim never made me more productive—being able to do what I needed to in it quickly did. I could just as easily have used emacs (had I learned that first), or atom (had that been around back then) or <insert favorite editor/ide here>.
- pathdependent 10y agoYes. The had-I-learned-it-first concept is something I didn't mention, but do think is important. And, often it works in an inhibiting way. With an IDEA-like rich IDEs -- which I think is a great tool, esp with VIM bindings! -- you get such a boost from things like good contextual auto-complete, that you never feel the need to learn it more deeply.
- emsy 10y agoThis way you can also attract furious members from the church of emacs ;) But learning Vi is extremely useful, because many editors/IDEs feature a Vi Plugin: Visual Studio, Qt, Eclipse, Xcode, Atom, IntelliJ and of course Emacs. Learning the basic Emacs shortcuts is likewise useful for terminal (though some shells also have a Vi mode!)
- nxc18 10y agoThis is a huge thing I've been thinking about lately. Very recently I was a pretty staunch advocate for IDEs and thought the whole VIM situation was crazy. It is unintuitive. It doesn't come bundled with lots of useful tools. It takes some configuration if you want nice things (e.g. file tree on the side). Over winter break I decided to really commit to becoming productive in VIM. I stopped using VSCode and I stayed away from other IDEs, even as I was learning Java Spark and digging into some Python projects. I didn't notice it at the time, but VIM has made me much more productive, even with my very minimal knowledge (I learn new commands even for basic things all the time). Ultimately, the fact of the matter seems to be that the keyboard->mouse->keyboard transition is really slow. Going to Visual Studio (I'm learning Win32 and I don't want to do that without IntelliSense) after ~2 months in VIM is almost excruciating. I'll be loading up the VIM plugin pretty soon The long and short of it is, and my advice for everyone who asks is, learn VIM (and other command line tools) as soon as you possibly can. I have no loyalty to the UNIX philosophy or ecosystem, but take it from me, you'll be glad you did.
- omellet 10y agoI use VsVim in Visual Studio, highly recommended.
- KanyeBest 10y ago> let’s say it makes you 5% more productive > It’s an extra twenty minutes a day Author presumes 100% of programming time is spent typing/editing. Is this really the case? I'd wager it's close to 10% for most people.
- ThrustVectoring 10y agoIt's closer to 10%, but that just makes having a fluid and easy editing experience more important IMO. Editing tasks are interruptions at that level, and you want to make it as easy and quick as possible to get your mental models re-loaded into short-term memory.
- pathdependent 10y agoI admit, 5% is a subjective prior / fudge-factor. But, statistical white-lies communicate a promise which extends the invitation: try it, see if you're more productive. I'd love to see some objective stats though!
- muh_gradle 10y agoI've used vim and emacs. I can't claim to be an expert on either, but I am somewhat comfortable with vim and it can be convenient for any unix straight out of the box. But I found it to be fairly overrated even with all these claims of boost in productivity. Just use Sublime Text in this day and age and use the spare time you would've had to learn vim and do something more useful.
- ndh2 10y agoI've always been wondering if there is some secret that I've been missing and that these VIM or Emacs gurus keep to themselves which makes them "more productive". All these abstract claims in blog posts and on forum pages about productivity are completely worthless. Go watch a stream where you can actually see someone program. Maybe you'll pick something up that they do better/faster/more elegant than you. Other than that, the best advice is to ignore these kinds of topics.
- bakul 10y agoI don't know about being more productive but I use commands like 3cwfoo<esc> to replace the next three words with foo. Or 2cf,foo<esc> to replace everything including the second comma on the current line. Or some : command. I no longer even consciously think about such things as how vi works is something I know in my fingers. Originally I learned such things only after repeating some command multiple times, thinking there has to be a better way, and then learning the more powerful commands. The core set of vi commands is quite regular and once you learn something it can be applied in other situations. If I am working with another expert vi user it is very easy to give him precise instructions - I can just say things like replace the second foo with bar on every line starting with a space and he'd know to type the correct : incantation. The key is to pay attention to your inner voice saying "there has to be a better way" and doing something about it! Bottom line: learn to know how to use your everyday tools well.
- btschaegg 10y agoI also was rather sceptical wrt Vim at first; the only reason I ever started using it was that I needed a text editor that compiled for ARM architectures (I wanted to use it in a chroot on my chromebook). After a couple of hours the distrust got to "hm, this might not be too bad". After a couple of days I switched my ZSH to Vim bindings. Now I even use pentadactyl/qutebrowser for browsing the web. The whole "Vim gives me amazing productivity" thing seems to be a personality trait: People telling you this are much more positive wrt tooling than I am. My basic gist is more like "why the hell can't I do X with this tool". I only started recognizing Vim's worth after getting more and more frustrated at other tools because they seemed to slow me down. Funny enough, I had the exact same experience a couple of years earlier after I got reasonably accustomed with Linux and Bash/ZSH. Learning them was more or less "meh", but coming back to Windows is a nightmare for me now. You have to do everything via the mouse, and the terminal seems almost unusable for me - it's not that I am amazed at how great my tools are (which, to be fair, they actually are), but I get very angry at any tool that doesn't at least do a decent job. Luckily for me, this effect only seems to affect my experience with tools. I still can get very excited about APIs and programming paradigms :-)
- lostmsu 10y ago> it makes you 5% more productive Is there a study, or you just feel like it?
- pathdependent 10y agoFull quote, for context: Being conservative, let’s say it makes you 5% more productive. It's subjective. I'd like to see a before and after study, but empirically measuring code productivity is -- a hard problem.
- IshKebab 10y agoIt might no be too hard in this case, since you're really testing editing speed not code productivity. You could take a random selection of (small) git commits and time how long it takes people to recreate them. That maybe gives Vim an unfair advantage actually since the IDE features help more while actually composing code, rather than just editing text. Still I think it could be measured.
- Veen 10y agoI think the focus on speed is counterproductive. Increased productivity isn't the only — or even the most important — measure of value. I enjoy using Vim (Emacs Evil mode these days) because I can edit more fluidly without having to shift focus and context switch. My hands stay on the keyboard, my eyes stay on the screen, and I don't have to think about "how" to achieve my goals — I just think about what I want to achieve and muscle memory takes care of the rest. I might edit more quickly, but that's a side effect of using a tool that allows me to focus deeply and maintain that focus for longer: both of which are vital to flow and satisfaction with my work.
- kentt 10y agoI've been interested in using vim and am not completely useless at using it, but I haven't quite been able to commit to it. The main reason is that I'm not sure it's any faster than using IntelliJs products well. Last time I mentioned to a coworker who is a vim user, that I was thinking if switching to it, he said he was thinking of switching to Idea after seeing me use it.
- pathdependent 10y agoBuried in my footnote is the real gist is: learn your editor, deeply. IntelliJ is a great tool, too.
- brootstrap 10y agoVIM'er here. I use IntelliJ-Pycharm when i'm really strappin in for a good DEV session. Plus you get the ideaVim plugin and i've got the same VIM magic I know and love. Plus all the fancy IDE stuff. Some will say you can upgrade VIM to IDE level (project tree, auto complete, other fancies) which is totally true. I dont got time for dat. Other bonus for vi is that you are now capable of editing files on any unix server in the world.
- weaksauce 10y agospacemacs is a pretty well integrated, community sourced configuration of emacs that has a lot of sane defaults out of the box. add a few layers for your favorite languages and you are off and running. magit and org mode are both excellent reasons to use emacs. the vim bindings are some of the best i have seen in an emulator as well.
- weaksauce 10y agoyou can always learn vim stuff by using a plugin for your favorite editor. I'm frustrated quite a bit if I have to use an editor without basic vi shortcuts at the very least.
- kentt 10y ago
- lowry 10y agoI moved to VIM (ideavim, vimperator) completely once I started feeling uncomfortable in the right palm. Reducing the number of keystrokes per days is paramount to productivity increase for me, nowadays.
- bmc7505 10y agoIf you like IdeaVim and Vimperator, try using a plugin called AceJump [1]. Like Vimperator, you can map the F key in normal mode to activate AceJump, then start typing any visible character or string on the screen. We are working on multi-monitor support and history, and would love to get your feedback. Full disclosure: I am a contributor. [1]: https://github.com/johnlindquist/AceJump https://github.com/johnlindquist/AceJump
- icc97 10y agoI find using Vim more natural when I'm spending time in the command line. I'm an entrenched Windows user but I love the power of the linux command tools. Now thanks to the GNU Tools packaged with Git, you get Vim and OpenSSH as lovely extras. It's really nice to be able to switch back and forth between editing on Linux via SSH in Vim and then back in Windows. If you're searching around and moving files via the DOS prompt, getting your daily Docker/Vagrant fix it becomes much more natural just to open Vim edit the file and close it. Plus you can add the solarized colours to the DOS prompt and you get lovely syntax highlighting too.
- orev 10y agoYou know Cygwin has been around for ages and has done this forever. You didn't need to wait for some big bundle of git to arrive on Windows for this.
- Cpoll 10y agoI don't think you need to wait for anything; I think he's describing MinGW that comes with a Windows install of Git. It's been around for a long time. Cygwin vs MinGW is a whole other argument, of course.
- icc97 10y agoYeah the MinGW - it's just that Git packaged them all up nicely, previously I always found there was a few missing tools. I find it much nicer to be able to use those inside DOS.
- icc97 10y agoYes, I was using Cygwin a decade ago - it was the most painful experience. It's got nothing to do with Git - just that Git bundles the most up to date versions of GNU tools compiled for Windows. There were pre-cursors to Git, but Git packages them all nicely. Just for sentimental reasons I love using DOS, same as any Linux user loves their shell. So having the tools natively in DOS is a much nicer experience.
- jogjayr 10y agoI can't claim to have ever "tried" to get into vim - in the sense of ditching my daily driver (Sublime/VS Code) and going 100% vim. I've done the vimtutor, I even know how to do basic text editing (cut, copy, paste, find-and-replace, visual mode highlight) in vim, plus some of those "magic" things where you can repeat an action multiple times (:2wi or whatever). And I'll happily fire up vim if it's something really quick, like making a list in a plain text file or something. So what's kept me from going 100% vim? 1. Plugin/add-on support - I have no clue what's going on here. There's no clear guidance on what to use (vundle? pathogen?). I haven't really grokked how plugins really work - where do they come from? how do I search for them? where are they really installed? how are they organized in the install directory? do I need to care? etc (I'm aware this is all documented somewhere, and maybe I just need to make more of an effort). Whereas in something like Sublime Text there's an easily installable package manager that takes care of all these things for you. And if you really care to learn, you can drop into one of the packages and find easy-to-understand Python and JSON. Versus vimscript, weird config files and whatever else vim uses to configure things. 2. Multi-file support - Sublime has a Cmd + T fuzzy filename finder right out of the box. With vim (for a beginner) your choices are either: a) open multiple terminal windows with a single file in each, Cmd + Tab endlessly or b) open multiple files in the same editor and drop out of insert mode every time you want to switch files (way more keystrokes than Cmd + T or Ctrl + Tab; maybe there's a toggle file shortcut in Vim also). I'm aware that there exist plugins for fuzzy-file searching in vim also, but because of 1 I don't know how to find or install them. 3. Buffers and marks - I'm vaguely aware they exist. I'm not sure what they do and why they're important. Again, this one is probably on me rather than the tool itself.
- 7we4cniromfce 10y ago#1 I have been using pathogen since I started using vim, I can recommend it. (copy paste directions to install: https://github.com/tpope/vim-pathogen https://github.com/tpope/vim-pathogen) And this is where you can find vim plug-ins: http://vimawesome.com/ http://vimawesome.com/ After installing pathogen, to install a plug-in: cd ~/.vim/bundle git clone <url> and you are done in most cases, some require adding a few lines on ~/.vimrc. #2 There are multiple ways to work with multiple files. There are tabs in vim, split screens, files in buffer etc, these are all without plug-ins.
- aanm1988 10y ago> Most of the time, you shouldn’t use the Best Paradigm (TM) that exists. You should use the one that is good enough and works well in the language you are using.[3] Clever only gets you geek cred; conventions let you communicate well, both to others and to yourself six months later. That really cool pattern you learned that one time? You may never use it, and even if you do, the marginal gain probably won’t be that impressive. Aren't these all reasons to not bother learning vim?
- mnm1 10y agoIf I could go back in time and change one thing about my computing, it'd be to learn proper ergonomics and posture from the beginning and avoid the pain that came later. I often have to type slower than I can to avoid pain. I realize now that all the frenzy to get the ideas out as quickly as possible probably gained me very little time in exchange for a lot of pain. These days, a tool that might increase my data entry speed by 5% doesn't even make it onto the radar because my primary concern is my health and getting rid of RSI. Speed is antithetical to that. Interestingly enough, whether going full speed as before or in a more controlled manner like now, my actual productivity is the same.
- 0x6a62 10y agoIgnoring generalities. For me, there are clearly times vim is the more efficient tool. I find that to be more often the case than not. At a minimum, learning it allows me to think about things differently than the standard wysiwyg editors. These both make me a better dev. But ultimately, using vim makes me happy. That's what matters to me, and should matter to others as they pick their tools.
- tetraodonpuffer 10y agoWhen I read articles about vi/vim being great for coders I always wonder how you deal with having to use the same part of your brain for writing the code you are writing and to "code vim commands" I mean, I understand it's attractive to a programmer's mind to be able to do fancy 'replace the next 3 words with x' and so on, and compose them in vim's language, but if I am deep in an algorithm the last thing I want is to have to context switch to "programming my editor" When doing editing tasks in a more visual as opposed to programmatical way, it feels more that my "coding brain" is free to continue working on the algorithm at hand while some other part of my brain deals with the moving of text around. Keeping the right cursor key pressed for 1 second is a lot slower than doing some fancy move to the X word in the line, but if engaging my brain to create the composite "move to the X word" command takes me out of the "flow state" I am in, it is way way way more expensive in the long run. In the end what you want is to be the most productive, and the most productive could mean that you are using the editor less efficiently because the more efficient parts of your brain are busy doing something else. Not sure, maybe somebody that started with vim as their first editor does not have this context switching issue, I personally started with emacs and remained with it and I have my emacs config full of hyper / super / meta / alt / control / shift shortcuts and tons of cool packages, but while I am deep in coding flow state I still use the cursor keys with minimal package help (outside of multiple-cursors and macros sometimes) to avoid getting distracted.
- btschaegg 10y agoI am actively using a vim-like control scheme for almost any text I write for about 15 months now. I certainly am not the most proficient in it (in fact, I suspect I could do much better if I weren't "confined" to VS and VSVIM at work - I use Spacemacs privately), but I have enough "training" to make the basic moves I need unconciously. If you come from more limited IDEs or text editors this alone is already well worth it. And at the moment when you understand the basic gist of macros on top of that, it basically becomes a superweapon. I'm sure there's something to get out of being an "expert Vim user", but even if you're starting out, there's already much to be gained from the simple routines. I find the notion of a "Vim Kata" very compelling as a metaphor, since it's really the repetition that teaches those "reflexes" at first. I don't know how much an avid Emacs user could get out of it though. I guess that comes down to personal preferences. I couldn't get myself to memorize all the weird key combinations for example, but I quite like Spacemacs' mnemonics system.
- nunez 10y agoagreed, 100%. I used to be a GUI diehard. Then, I was told about emacs and became an emacs fanatic. But the difference between emacs and vi/vim is that you can count on vim not only being on any system anywhere, but behaving in almost the exact same way anywhere. vim is timeless.
- iLemming 10y agoI'm a diehard Vim fan. I use Vi-motion keybindings everywhere. System-wide. In every single tool I use. I don't ever touch arrow keys. I don't need to. I rarely have to use touchpad. It feels empowering to be able to do things the way I do. I don't think anymore about how and what I need to do to get quickly where I want to be - I just intuitively do it. This is probably how controlling things with your mind would feel. The downside? I can't work using one hand anymore. It just feels weird. Vim is awesome. It's not an editor - it's a lifestyle. It's telling the machine who's the boss. It's staying "in the zone". It's cutting through the code like slicing butter with hot knife. So, one day I woke up. I realized that Emacs can be better Vim than Vim. Hold on. Before throwing stones at me do one thing: give an honest and heartfelt try to Spacemacs. I guarantee it - you will be amazed.
- deleted 10y ago[deleted]