6 ms·
Vim speed is not really the point
- octo_t 14y agoThis is definitely a good way to explain the appeal of vim, but this is exactly what IDEs let you do. In intelliJ: oh I need to introduce a new parameter here, cmd-f6 -> add a new parameter, set a default and it does it across the entire codebase. Another key press and it runs all the tests again.
- solutionyogi 14y agoAgreed. It's all about 'declarative' editing. I want to be able to declare my action and let editor take care of the 'details'. But, IntelliJ (or Resharper which I use) is only good for the language they are written for. There are quite a few times where Resharper doesn't have what I am looking to do OR I am working on language/text where there is no Resharper or equivalent [especially for dynamic languages]. In such cases, Vim is a god send. And the best part is that once you know the Vim language, it can be used to edit any text (programming or non programming).
- swah 14y agoReally hoping for the day that editor-independent intellij-like functionality for all popular languages is available.. like Yegge told us he wanted to do.
- martinced 14y ago"...add a new parameter, set a default and it does it across the entire codebase." OK but why exactly does a new parameter with a default need to be repeated at different places across the codebase? Because you're using Java and Java is incredibly verbose and requires you to do crazy stuff and you end up with a super-complected codebase where instead of passing messages around you're actually telling objects "do this", "do that" and then when you have one parameter to a method you're in a world of hurt (because that method is used from different parts of your spaghetti codebase). In Clojure, for example, you'd simply pass the parameters in an associative array (a map) and, even better, when you're constantly passing through the same set of parameter you'd simply wrap the method + its common parameters in a higher-order function and then you pass that higher-order function order. This makes for incredibly shorter codebases and incredibly easier refactoring. Don't get me wrong: at 75% off during doomsday I did buy my IntelliJ IDEA licence but you're foolish if you think that the "text editor" part of IntelliJ is anywhere near close what vim or Emacs do offer you. Also what's really great about Emacs is that you can add functionalities yourself to the "editor". Wanna run unit tests automatically and see the result in another frame/window/buffer? That's trivial to write. No later than yesterday I missed IntelliJ's "goto declaration..." feature. I wrote a quick defun in elisp that had... Seven lines of code and did 90% of the job. Sure people are going to hard that it's for those 10% cases where my script doesn't work that IntelliJ really shines but that's not the point. The point is that you can program Emacs to suit your way of working. You adapt vim / Emacs to yourself. With Eclipse / IntelliJ you have to adapt yourself to the IDE.
- Roboprog 14y agoDoesn't the menu of possible code transformations become somewhat large after a while? See also the comment somebody made here about the problem of huge code bases. (I understand that these are usually inherited, rather than created, but they are still a problem, not a virtue) Does the IDE have a menu item / command to move 3 lines up into the end of this if/else block? There are 2 ways to look at this problem, specialized IDE vs generalized editor. Both are right, at times. (I personally like to use the vim plugin within NetBeans) Oh, example of moving the lines just after an if/else into the block: (assuming sitting on the first line of to-be-moved text, which is just after a close-curly or end line) Delete the 3 lines: 3 d d Move back up 2 lines: k k Paste the 3 lines: p Indent the 3 lines: 3 > > 9 keypresses, no reaching for the right side of the keyboard, let alone a mouse. About is fast as you can think it, the block of lines disappear, the cursor moves back to the new block, the lines reappear, and then slide right. (ignoring the clumsy autoformat that most IEDs, er, IDEs want to inflict upon your code, I'll do the indent myself, just 3 keypresses)
- dljsjr 14y agoI'm a huge vim fan myself, but I haven't thrown IDE's out of the window entirely. There are still 2 things that I can't give up that IDE's do better than vim (in my opinion): 1. Refactoring operations. I have yet to find a vim plugin that has the extreme refactoring awareness I've become accustomed to in IntelliJ IDEA and Eclipse. And writing a macro to do it for you is not the answer, because these tasks are non trivial to do a.) correctly, b.) in the general case, and c.) across an entire codebase. There's a reason people have sunk a gazillion years and R&D dollars in to creating IDE's, and some bullshit vim macro that I put together mid-day on a Thursday because I need to extract a method isn't going to compete. 2. Super-powerful auto completions. I get that vim has code completion plugins, and most of them are good (I'm currently using YouCompleteMe). But they aren't great. IntelliJ has it's legendary "index the world" mentality, and is really great at fuzzy match finding. Eclipse is a little clunkier, but its ability to drop in the entire method signature and provide tab-stops for quickly filling in the parameters is a boon. The majority of my bias towards these features probably comes from the fact that I write Java code for a living at my day job, where the "documentation" is actually the code completion popup 90% of the time and most file operations or refactors are accompanied by some degree of boilerplate that is handily automated. Say what you will about verbose code and "enterprise" languages, but learning an API as you go by mindlessly mashing Ctrl+Space and skipping the inheritance/implementation rain dance is a huge productivity gain. I do all of my C/C++, Haskell, HTML/CSS/JS, and Ruby in vim, where I have a pain-stakingly customized pathogen setup that I sync across all of my computers (personal and work). Code completion is good enough, between YouCompleteMe and ctags, but I still miss refactoring something fierce. But if FP Complete releases their Haskell IDE tomorrow and it isn't completely offensive to look at (Leksah!), has good refactoring, and has good code completion, I'd jump ship in a heartbeat. I don't think that the whole IDE vs. vim/emacs war is real. I think that they're two completely different tools that are good at very different things; I will not argue that I am way, way, way faster at just editing text in vim; EasyMotion, ctags, never having to use a mouse... I love these things. But anybody that writes off an IDE without fully understanding just how powerful the two features I mentioned above can be when dealing with multi-million loc codebases is being narrow minded.
- swah 14y agoI love Python but I reject the view that for dynamic languages IDEs wouldn't be as useful. I'd love to type "os." or the name of an instance and get great Java-like completion. Many times I have thought that len was a method on any string...
- TheEzEzz 14y agoI rolled my own 'text editing version 2.0' with an eye toward both speed and logical commands for ease of use (and to ease the mental demand). At first I found that the speed and ease allowed me to code faster and longer. Later I realized I was making mistakes more often, because of how little thought I needed to put into editing. I think there is a fundamental limit to how fast I can get ideas from my brain into code, and the limiting factor has never been my input method. I still prefer working with an advanced input system, but I now treat it the way the OP does: like a Samurai with his sword. Sit back, relax, think, then strike. Afterward take a moment to read over what just happened and make sure it is correct.
- pekk 14y agoIs this a reason to do things awkwardly, that it is slower to do it awkwardly forcing you to think more? If so, where does this reasoning stop? Should editors intentionally make things awkward?
- deleted 14y ago[deleted]
- saosebastiao 14y agoSo in other words: it is not the speed, it is the latency. I can agree with that. As an aside...I always sucked at the speed part. I have always been a 2, maybe 3 finger typer, throwing in a pinky for CTRL and a thumb for the space bar. While my vimming is pretty fast, typing long segments is embarrassingly slow. Have any of you overcome this after > 10 years of bad habits? How did you do it?
- gamegoblin 14y agoI was an 80WPM 3 finger typed after typing a ton playing runescape as a kid. After being forced to take two years of formal typing class, I became a 120WPM standard typist. I only had 2 or 3 years of bad habits to break, though.
- goldfeld 14y agoYou do realize there are actually courses in a technique called touch typing? Fortunately, it won't clash with your bad habits. I can hunt and peck on mobile keyboards yet my brain uses a whole different part of my memory to keep my touch typing sharp and untainted from the lazy use of iOS' autocomplete, never confusing the two.
- saosebastiao 14y agoI don't have the problem with needing to watch my hands press the keys. It is more that my hands hover needlessly high above the keyboard because the fingers need to move more.
- zargon 14y agoTyping with 3 fingers is not touch typing, even if you don't look at the keys. Lean to touch type.
- bluedino 14y agoGet a rhythm going, so you type at a steady pace (slow at first, of course). Say each letter out loud. H-A-C-K-E-R space N-E-W-S period Don't look at the keyboard, either. Just practice this for a little bit every day (re-type a blog post or two, including the source code) and you'll get the hang of it.
- btipling 14y agoThe real power of vim is its proven staying power. It is worth the investment to learn it. It's been around for a long time and is likely to be around for much longer. Newer, hip editors that depend on one person or small company to make a living maintaining their product cannot provide such assurances. Some have suggested open sourcing the application, but I am not sure that has worked for Text-Mate 2. Vim has been around, will be around, and is available pretty much every where and has a giant community. That's the point.
- zalew 14y agoyou can replace vim with eclipse and all you said still stands valid.
- ajanuary 14y agoTo add some figures: * vi is 36 years old, vim is 21 years old * Eclipse is 12 years old vim is on pretty much every linux box. Eclipse isn't.
- mercurial 14y agoBut it should be! Imagine how productive you would be with an edipsesudo instead of visudo :)
- Evbn 14y agoHow many Linux boxes do you spend >10hrs coding on in a year?
- zalew 14y agoit is on mine and it's all that counts. unless what you mean is that it doesn't work without an X session on remote hosts, but in general I don't work on live code. 'The real power of vim is its proven staying power' is a non-argument, today I work on stuff that didn't even exist 10 years ago, there is no guarantee vim will be even usable for the sort of work you will be doing in a decade, and for sure there is no guarantee it will be the best choice. both vim and eclipse are here to stay for the next years and both have a lot of support. there are lots of reasons to learn/use vim, but a 10 years longer historical consistency isn't one.
- laurent123456 14y ago> I was also forcing myself into improving my usage. I can understand that people "force" themselves to go to the gym because there are obvious benefits to it, but I keep wondering why developers "force" themselves to use Vim. It's like playing and mastering a very hard videogame, except it's not a game and it's not that much fun to learn.
- jamesrcole 14y agoI'd see it as akin to "forcing" yourself to learn a foreign language. You might think it is worthwhile but at the same time not find it a pleasant process. (I'm of course not implying that everybody will find either of those tasks unpleasant).
- goldfeld 14y agoExcept millions of people do master very hard videogames, which has little benefit once you stop playing that game. Vim is a game I keep on playing eight plus hours a day throughout the years (at my day job then on my side projects.) Oh, and I find it a lot of fun to force limitations to improve my usage. Maybe you should only really get into vim if you find the whole thing fun in the first place.
- danielbarla 14y agoI like to think there are obvious benefits to Vim, too. Why do developers force themselves to touch-type? Because hopefully it will increase your productivity, in the long run.
- pekk 14y agoIt's a power tool, not a game. Realistically it isn't much harder than completely learning Eclipse. If you are only learning editors for fun, you are weird.
- gbog 14y agoDon't know for the OP, but for me discovering vim corners is fun, just as some videogames, except it is actually useful. Reading a vim tutorial is like reading a game walkthrough.
- 14y ago
- Roboprog 14y agoSometimes, the IDE way of doing things seems to assume that your project is one of the "lifetime employment" variety -- that this is the only project and/or language you will ever work in the rest of your career, so you can take an "infinite" amount of time and setup customizing operations to just that one language and project, vs get in, hit hard, get out and move on.