4 ms·
Can 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 advance
by libria 7y ago
Can 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.