6 ms·
Using Vim without knowing WAY more than this article is an anti-pattern. Vim is inefficient for editing so you have to learn a lot more than these tricks and ha
by stevebmark 8y ago
Using Vim without knowing WAY more than this article is an anti-pattern. Vim is inefficient for editing so you have to learn a lot more than these tricks and hacks to be proficient. If you aren't learning more about Vim's nasty design every day then it's an anti-pattern to use Vim, because you'll be much more efficient with less learning in any other editor. If, for example, you don't know how to edit searches and command-line mode commands in full Vim mode, then keep learning (press control-f in search mode). If you aren't proficient in Vim's garbage VimL then keep learning. Obviously an IDE with intellisense and multiple cursors is more efficient than most of Vim's efficiency hacks. Vim's efficiency gains more apply to editing text, not structured code.
- tartrate 8y agoNice gatekeeping
- michal-franc 8y agoBeen using vim for 'years' and I am not using it 'perfectly'. What I have noticed is that like with i3wm with vim you create your own way of working with it. You just find the way that works for you.
- lixtra 8y ago> Vim is inefficient for editing I learned vim a bit more than 20 years ago and can tell you it’s a very efficient tool. Fair enough if I was doing most of my coding in a single language it might be worthwhile to learn a different IDE. You’re welcome to use a different tool that better fits your needs. And hope that you find it at your next workplace or the legacy server that you are asked to fix.
- stevebmark 8y agoI've voluntarily used Vim every day for 10 years, know it better than you do, and can tell you learning a good IDE is more efficient.
- dang 8y agoCould you please stop being a jerk in HN comments? It's what we're trying to avoid here, and I'm afraid you've done it quite a lot. That's dismaying. If instead you would please review https://news.ycombinator.com/newsguidelines.html https://news.ycombinator.com/newsguidelines.html and take the spirit of this site to heart, we'd be grateful. Some other links that might help, too: https://news.ycombinator.com/newswelcome.html https://news.ycombinator.com/newswelcome.html https://news.ycombinator.com/hackernews.html https://news.ycombinator.com/hackernews.html http://www.paulgraham.com/trolls.html http://www.paulgraham.com/trolls.html http://www.paulgraham.com/hackernews.html http://www.paulgraham.com/hackernews.html
- Smaug123 8y agoThe article doesn't specify whether you're coding or not. It even says "whether writing code, poetry, or prose" at the top.
- croo 8y agoNah. You can get by just great if you know movements(h,j,k,l,w,b,W,B) and I, i ,A , a, o, O, dd, f, v, and how to use numbers with all that and how to combine them and how to quit and save. If you want to look like a wizard, learn to search/replace, ciw, star(*), macros and the dot(.). By now you probably have a custom config...
- ma2rten 8y agoI started using vim about 10 years ago. I am not an expert user, but I am using enough of it's features that I feel crippled when I am using another editor. I just have to think move this function to another file and my fingers will execute the vim commands. I don't know any Vim Script. You don't have to know it to use vim, unless you want to write your own plugins. I tried using an IDE recently (Clion), but it was not really worth it. Vim has plugins for most IDE features, including autocomplete and syntax checking. The only feature that I really miss in Vim automatic refactoring such as inlining functions.
- nwatson 8y agoYou don't mention interactive debugging in vim ... and I'm not sure there's a good story there that's better than your CLion (Jetbrain's C/C++ IDE) -- I'd like to hear about vim interactive debugging. Perhaps there are other good debugging solutions for C/C++ but I like to edit and debug in the same environment. Any Python code I write or review in Python I try to give a run-through in PyCharm (JetBrain's Python IDE) interactively -- having a chance to step through code lets me consider more options and corner cases and get a more expansive view on what I'm developing or reviewing. "vim" is my preferred editor when I'm not in an IDE, and often when writing bash scripts, but over the last ten years especially I've rarely written higher-level language code outside an IDE environment ... and I stick to JetBrain's suite mostly these days.
- jtms 8y ago20 year vim user here... There is a really decent VIM plugin that works with all of the jetbrains IDEs I have used that I would recommend. It will even read your vimrc file! I wouldn’t write Java or C# without an IDE (IntelliJ IDEA and Rider respectively) and the vim plugin makes adjusting to them much less painful.
- ma2rten 8y agoDo you mean the plugin that is built in or is there different one?
- coldtea 8y ago>Vim is inefficient for editing Probably the first time someone ever thought this inane idea. >Vim's nasty design OK, trolling, next.
- nukeop 8y agoAlthough you have to admit that Vim is excellent at beeping.
- gwn7 8y ago> Using Vim without knowing WAY more than this article is an anti-pattern. VIM is about composing small and straightforward operations, like in functional programming. So with several primitives you get a lot of combinations. So the idea actually is the opposite: Learn just a few primitives and get your shit done using the combinations, which can be very flexible and powerful. > you have to learn a lot more than these tricks and hacks to be proficient The techniques highlighted in this article are not tricks nor hacks. It's actually more like VIM 101. Surely VIM has a lot of hacks but these definitely aren't among those. You don't sound very informed about VIM here. > Obviously an IDE with intellisense and multiple cursors is more efficient than most of Vim's efficiency hacks. Obvious to you, maybe. Funny you believe that something that has caused a shitload of controversy can actually be obvious. Please don't serve your personal opinion as being "obvious". To me, and I'd say to many others, it's not only not obvious, but "obviously" wrong. Also VIM has multiple cursors for some time albeit as a plugin: https://github.com/terryma/vim-multiple-cursors https://github.com/terryma/vim-multiple-cursors > Vim is inefficient for editing > Vim's efficiency gains more apply to editing text, not structured code. First of all, structured code is text, so Vim's efficiency gains have to apply to it as well, there can't be any denying that. On top of plain text, VIM has other easily applicable features for structured code such as text objects, folding, highlighting, auto-completion and tag-browsing. These are not very hard to get right. > If you aren't proficient in Vim's garbage VimL then keep learning VimL really is garbage, I'll give you that. The trick is that you don't really need to learn it. I'm a ~10 years VIM user and still don't know anything about the VimL syntax (intentionally). The secret is that you can have a very effective VIM config around ~50 lines which itself mostly consists of settings, file type specific settings and aliases. But if you try to make VIM behave as something it wasn't meant to be, you'll be sorry. I think that the confusion comes from the tendency of comparing VIM to IDEs, as well as trying to make VIM behave like IDEs. In my opinion, most people in the VIM community are "guilty" of this as well. If you need an IDE, but you want VIM's mode and command composition driven approaches and keybindings as well; the wiser choice would probably be a modern IDE that supports a VIM mode. For me, stuff like popping fancy file browsers or git wrappers from VIM is not what I'm looking for in the VIM experience. But if what one wants is to get stuff done in the terminal; then one should learn a couple of UNIX tools instead of installing a gazillion of VIM plugins. In short, if you need a modern IDE, use a freaking modern IDE. No need to make ignorant comments about our beloved VIM.
- b3n 8y agoDo you have an example where multiple cursors are efficient, but Vim is not?
- krick 8y agoI easily can: modifying multiple expressions that have different length, but the same ending and are separated with some lines of code in between. In vim I either do it manually (because the movement is truly faster) or record a macro. In most "modern" text-editors I could do it with multiple cursors. Recording a macro always feels a bit more energy-consuming, than just making all the changes visually. TBH, now that I'm mostly using an IDE with vim-plugin for work, I still prefer writing macros in such situations than using multiple cursors, because such situations are rare enough, and the power of habit is strong.
- ChanderG 8y agoSounds like a job for the "global" ex command (with or without a macro).
- roel_v 8y agoTo an extent you're right. I've used vim for 20 years, and in the first say 5 years I would spend a lot of time tweaking configs, learning new commands etc. I don't think I will ever make back the time I spend on that in saved editing time. However, the main benefit of vim isn't so much 'increased speed' (to me) but rather 'feels like a solid tools in my hands', or even better, 'feels like an extension of my mind'. No other editor gives me that - there are always these small micro-interruptions of 'reaching for mouse, aim at menu, miss, try again' or 'take hands off home row, now my elbow isn't in a comfortable position any more when I go back'. It's like using say a Hilti, blue Bosch or Makita cordless drill vs a no-name or even cheaper brand name one. You can drill holes or screw screws just as well, but the reduced vibrations and excess power and tighter fit of everything just make everything feel more effortless and make you spend less time on being annoyed at the tools, even if they're all just 'micro-annoyances' that don't add up to any measurable time wasted. The more expensive ones (in Vim's case, expensive in learning time) are still worth it.
- deleted 8y ago[deleted]