5 ms·
> Most actions are blazingly fast compared to a gui text editor. e.g. To delete a whole line just press dd instead of home + shift + end + delete Ctrl + X work
by rootlocus 9y ago
> Most actions are blazingly fast compared to a gui text editor. e.g. To delete a whole line just press dd instead of home + shift + end + delete
Ctrl + X works on most 'gui text editors'
> There hasn't been one feature that and IDE has that I used, which can't be achieved in vim (or via a plugin)
How does "find references" work in vim? If i want to find all usages of a method called "getName", does it know how to differentiate between calls on an object of the class I'm searching from, or usages from all classes that have a "getName" method (aka dumb text search)?
- Asooka 9y agoDepends on the language. For C/C++ there is rtags, which compiles your code with clang and extracts type info, after which it can find all usages of said method on the exact class you're searching for. I personally use ctags and rtags together for code browsing, to alleviate problems one or the other has. Rtags can be a bit unstable and slow-ish, while ctags is just for definitions and somewhat of a dumb text search. So far every C/C++ IDE I've seen on Linux has been incredibly dodgy, unstable, resource-hungry, etc. The text editor compoment is invariably light years behind vim and the actual "integrated" parts are of similar quality, so I continue using vim with enough plugins to get the job done. That doesn't really give you an IDE, it gives you a coding component of a Non-integrated Development Environment, where you build and test on the commandline by running commands and scripts, commit by running git, etc. I'm honestly perfectly fine with an NDE, as long as each component does its job reasonably well. I've tried various gdb integrations and they're so horrible, I just learned how to use vanilla gdb on the console. So yes, setting a breakpoint means copying the method name from vim and pasting it in gdb's commandline, but the important part is that it works and keeps working and doesn't set the breakpoint wrong, or crash, or put my editor in some weird state, or lose connection with the debugger (literally how??), etc. So I just use ol' reliable tools to get the job done without fuss. About the only one that I've seen that actually works is QtCreator, but its license costs more than VisualStudio's, and it's definitely not worth the price (to me or my employer). CLion I've also heard good things about, but couldn't put through its paces enough before the trial period ran out.
- user5994461 9y agoI think we can all agree that all C++ editors are a complete disaster. The language is too hard to parse and process, noone ever managed to make good tools. Visual studio and Qt Creator are the least worst IDE. The first one only works on Windows obviously. They are both free so I am not sure why you'd mention pricing issues??? Visual Studio has the best debugger by far, I'd go as far as saying it's the only debugger in existence for C++. If you have money, there is a paid refactoring plugin called Visual Assist X that makes the C++ experience a lot better.
- executesorder66 9y ago> Ctrl + X works on most 'gui text editors' Really? Even if you haven't selected the line? Because if you haven't selected the line then you'll have to use your mouse first or do the home + shift + end + Ctrl + X to delete the line. I remember Ctrl + D does this (without needing to select the line) in Eclipse. But it's still faster to type dd than Ctrl + D > How does "find references" work in vim? https://stackoverflow.com/a/9616315 https://stackoverflow.com/a/9616315
- cytzol 9y ago> Really? Even if you haven't selected the line? Yeah
- rootlocus 9y ago> Really? Even if you haven't selected the line? Absolutely, works for the entire line, no matter where you are. > But it's still faster to type dd than Ctrl + D Don't be overly pedantic. I could say Ctrl + D is faster because dd means: 'press d' + 'release d' + 'press d' while Ctrl + d means 'press Ctrl' + 'press d', or I could say that you don't have to change modes to use Ctrl + D, but you could say your finger is already on d, you're more comfortable, etc. The difference in speed is quite negligible. > https://stackoverflow.com/a/9616315 https://stackoverflow.com/a/9616315 Using cscopes sure is better than dumb text search, but apparently doesn't know the difference I asked about. From the comments: > Now that I've spent a bit of time with cscope, it seems to me that cscope does not differentiate variables of the same name that belong to different classes. class_b::var may be returned even though I'm only looking for class_a::var. I'm using C++. Am I doing anything wrong? Maybe it works better for other languages. However, my point is: if you think "There hasn't been one feature that and IDE has that I used, which can't be achieved in vim (or via a plugin)", then I don't think you've used JetBrains IDEs.
- user5994461 9y agoCtrl + D is delete the line on some editors, duplicate the line on some editors. Prepare to be surprised when trying to to use it across environments. Ctrl + X is the shortcut for cut (as in cut then paste). It cuts the current selection. It doesn't auto select the line if there is no selection.