5 ms·
I mainly use vim and occasionally use Jetbrains. My setup in vim is super complex. I can tell you exactly how I feel about it: Vim is a better text editor than
by edanm 7y ago
I mainly use vim and occasionally use Jetbrains. My setup in vim is super complex. I can tell you exactly how I feel about it:
Vim is a better text editor than anything else. By far. Unfortunately, vim is terrible at basically everything else.
The problem is, once you learn to use vim's text editing capabilities, then editing code using anything else feels like a pain. I'm not talking about variable lookups / etc. I'm talking the pure "move the cursor to a certain place and enter some text" aspect of it. If you don't know vim, then it's hard to understand how slow editing text feels without it - it's kind of like going from not knowing how to type properly to being a solid touch typer. (not that extreme, but that's what it feels like).
Unfortunately, because vim sucks at everything else, my setup has to be complex to actually get it to do the other things a good IDE does out of the box. If I could do it the other way around, I would - I'd love to be able to use vim-like editing inside of an IDE, but every vim-mode I've tried so far just doesn't work properly (except one - evil mode in Emacs - which is why I recently switched to Spacemacs, but that's another story).
- janderland 7y agoThe vim emulation for the IntelliJ tools worked very well for me. Used to use only vim with a complex setup. Have been using Goland, and IntelliJ for about a year now.
- edanm 7y agoI actually haven't tried it (just started using PyCharm again very recently). But I gave it a go right after posting my comment. And like almost every other emulation I've ever tried, within 1 minute, I found 5 things that didn't work correctly. And I'm not exaggerating here - I literally spent 1, maybe 2 minutes and found 5 things. I'll have to use it for a while to find out whether it's just a few minor annoyances, or much worse than vim.
- libria 7y agoCan you briefly enumerate some of them here? I'm a casual vimmer and have plateau'd on the basic vim features that are good enough, so I'm curious what advanced commands are useful day-to-day.
- edanm 7y agoNothing really advanced, I think, although maybe one or two obscure things. Here's the problems I found and remember (I wasn't looking for anything, I was just trying some basic stuff). They all might seem trivial, but we're talking muscle memory heI'M. 1. First thing I did was to fold all the functions in the file - this is something vim does pretty badly, actually, because it doesn't know how to deal with Python syntax without lots of customization. But anyway, the command for "fold everything that can be folded, recursively" is zM. Then the command to open everything back up is zR... Except that for some reason, this vim emulation doesn't open everything, it kept the imports at the top of the file closed. Verdict: Probably not a big deal, just inconsistent (but maybe PyCharm's way is better?) 2. I then did a standard thing I like to do - if you want to delete a paragraph, you hit 'dip'. Works well. If you have a few lines of whitespace between paragrpahs, and you want to delete everything except one line, the command in vim is 'dvip'. This is actually somewhat obscure but I use this constantly to clean up code. Didn't work. Verdict: obscure command that's rarely copied correctly, but I use it all the time. Annoying. 3. I then tried to change some text. Let's simplify and say that I did 'ci(' to change the contents of parenthesis. Worked well. However, I tried to undo the change. In vim, this is a single 'u' since the change command is atomic. However here, this required hitting 'u' three times. Verdict: Ok this is really annoying. It's unpredictable and screws up my muscle memory, plus it's a very very used feature. 4. This might just be my fault - I tried to navigate my Python file using ']]' and '[['. The second one took me to the end of the file, the first did nothing - neither did what I want, which is to jump through various methods/functions. I also tried ']m' and ']d'. This one is not stock vim though (or not exactly), so it might be possible and I just don't know it. -- I don't remember the other thing. And btw, I totally don't mean to diss PyCharm, which is awesome in many ways. And I could be only nitpicking here - though again, finding 4/5 problems in 1 minute is not a good sign. But that's my point - emulating vim is, for whatever reason, either really hard, or not something that people spend a lot of effort on. That's why I have to rely on vim itself (or actually Spacemacs nowadays, which amazingly does have an almost completely working vim emulation.)
- janderland 7y agoAgreed that it’s not perfect emulation. I took some time to find alternatives to everything it lacked for me and now I’m satisfied. The biggest plus is when working with larger projects. The single-threaded autocomplete and jump-to-definition functionality was very slow in Vim, stalling the UI updates. Goland feels so much smoother in these cases.
- zabzonk 7y ago> within 1 minute, I found 5 things that didn't work correctly It would be useful to say what these 5 things are.
- thawaway1837 7y agoI don’t know about 5, but some issues I face are: Response Speed. Most emulations tend to fall behind my actual Vim command speeds, which really destroys the vim editing flow. Occasionally emulators will not honor mode switches correctly or on the first try. So I would expect to be in insert mode after a complex set of commands but the emulator isn’t there. This is also likely due to speed issues, but maybe not. Emulators do not do a good job of handling macros, and vim’s repeatability. The auto stuff they try to do (such as formatting, etc) precisely the reasons one would prefer an emulator, can mess up repeatability. Many of them don’t handle certain basic commands. A lot of emulators, for example, do not handle commands like HML which shift the viewport, possibly because the IDEs do not really give them access to it, or maybe because they aren’t known well enough that they fall way down the priority list.
- formercoder 7y agoI always found Jetbrains + vim plugin to be unparalleled. A good friend swears by spacemacs but that’s a different ballgame.
- w0utert 7y agoI wanted to say exactly that. I've never been a big fan of vim plugins in IDE's, even though I still prefer them over no vim bindings. The VS code or Eclipse vim bindings are 'not great' at best, for example. But CLion + vim plugin is actually very good: it uses my .vimrc, doesn't mess up undo/redo, supports things like block select in visual mode, etc. The only downside is that it interferes with some standard CLion keybindings (which is inevitable I guess), so you have to remap some things.
- runevault 7y agoOut of curiosity is the plugin just called vim or what? I've been craving getting back to using vim style controls to edit text (and use CLion when working with Rust) so would be interested in at experimenting with this.
- keithnz 7y agoIdeaVim It also has two popular vim packages, surround and easymotion you can use too, which I really like. I then customize all the IDE stuff to vim combos.... super nice. only PITA is in some drop downs on a number of jetbrains products is that it doesn't play nice with auto hotkey, I have ALT-J and ALT-K bound to up and down arrow keys which makes for a much nicer vim experience when dealing with autocomplete drop downs ( or any drop down )
- rubyn00bie 7y agoWas going to chime in to say the same, the VIM plugin in Intellij is hands-down the best vim emulation I've seen. It takes your vimrc as `.ideavimrc` and fucking works. Been paying for Intellij for nearly a year now and I don't regret a day of it. Well okay, I do regret the one day EAP was totally broken by the VIM plugin, by besides that it has been brilliant.
- wayneftw 7y ago> "move the cursor to a certain place and enter some text" In vscode, I'm usually already looking at the call site of a function I want to edit. So I move the cursor into the function call and hit F12 which takes me to the function definition to edit it. Once I'm done, I hit Alt+LEFT to navigate back to where I was to continue on... If I didn't start from a call site but I know the file I want to edit - I hit Ctrl+P, type the name of a file, hit ENTER - now I'm in the file, ready to edit it. To jump to a function, I collapse all functions (Ctrl+K,Ctrl+0/1/2/3/4) and then scroll (or PAGE UP/DN) to find it...then use arrow keys or Ctrl+G to enter the line number. Now I'm ready to edit the function. I might have to hit Ctrl+Shift+] to expand the body of the function. Alternatively, I Ctrl+F and type the name of the function I want to edit, pressing ENTER to find it...and I'm ready to edit the function. What do you do in vim that is far easier?
- deleted 7y ago[deleted]
- nik_0_0 7y agoReading the parent comment (and being somewhat a vim user) - "move the cursor to a certain place and enter some text" - sounds mostly about the first thing you mentioned - "move the cursor". Stock vim is mouseless, and without arrow-keys, which means relying on /? (searching) or other keys to achieve the function of arriving at text. CTRL-F never quite matches that (after you hit enter, the CTRL-F dialog is still open, and needs to be closed with ESC or by clicking away), and moving to the arrow keys/pgup/pgdown/mouse is slow. Having said that - there are some plugins that match this behaviour - I particularly like the ones where a key (f in vimium) highlights each word with a character, allowing for one or two keypresses to jump anywhere on the screen.
- savanaly 7y ago>So I move the cursor...What do you do in vim that is far easier? The part about moving the cursor. Vim users typically don't move the cursor with the mouse but rather with the keyboard. Having to move your hands off the keyboard to reach for the mouse then back is the part that starts to feel sluggish if you get used to not doing it.
- dehrmann 7y ago> editing code using anything else feels like a pain What if I told you I read way more code than I edit?
- edanm 7y agoEveryone does, that's totally legit. However, even without editing anything, just "moving around the file" is much snappier with vim. Even when I'm reading code I'll move to certain parts of a line to better understand what's going on. Plus, you do eventually have to edit code. If you really never did anything except read code, then I think vim wouldn't give much of an advantage. Then again, neither would any of the shortcuts that every IDE provides.
- foolfoolz 7y agomy friend had a good sticker on his laptop. “typing is not the bottleneck” you may be more productive editing code in vim but when it comes to engineering text editing is not the most important thing to be solving for
- edanm 7y agoOf course. I don't even know if I'm actually more productive in editing text. I just know that subjectively, going from speaking a language with powerful concepts, to using the super crude tools available in most editors, just feels sluggish. I highly doubt it was actually a good investment time wise to master vim, but I salary really enjoy messing with editors so it was partially for fun.
- slightwinder 7y agoI always wonder how good and productive people who claim this are in reality. Personally I consider typing as a strong bottleneck for my productivity. I type all the day, and the less time I waste on transfering my thoughts into commands, the more time I have for focusing on the important parts. Not all typing is for textediting, but editors like vim&emacs are not limited to textediting.