16 ms·
I write C++ professionally and primarily edit code using Emacs inside Tmux over ssh, and I've found once you get accustomed to it you can be just as productive
by logicchains 4y ago
I write C++ professionally and primarily edit code using Emacs inside Tmux over ssh, and I've found once you get accustomed to it you can be just as productive without any fancy plugins. E.g. instead of autocomplete, it only takes a couple seconds to split the window, open the other source file in the second pane, jump (by text-based search, if you weren't already there) to where the definition is, highlight the word and copy-paste it back to the first pane. And that way you never have to worry about your tooling randomly breaking in template-heavy code, something no C++ IDE is safe from. No more moments of frustration when the IDE randomly freezes while you're trying to do something important.
- sidlls 4y agoMost of the things IDEs provide are unnecessary, and ultimately harm the developer by permitting skill atrophy of one sort or another. My opinion (obviously, and perhaps controversially). There are some exceptions (e.g., because the other tooling is garbage, one might consider Visual Studio "necessary" for building certain applications on Windows), but not many.
- G3rn0ti 4y agoIf you think lsp-mode is too slow you can simulate „jump to definition“ using old-school „xref“ and „etags“ that comes with your Emacs. It creates a reverse index for you. Then you can put that in your git repo and add it to your .gitignore. Finally, you can press „M-.“ for jump to definition and return to your buffer pressing „M-,“ — if the name of the function is unique. In practice, that works good enough most of the time. „etags“ runs so quickly you can call it from a git hook and re-generate the reverse index every time you pull or check out a branch. It works with all languages. No lsp server required.
- marcosdumay 4y agoDoesn't the language server lisps provide that? (I'm postponing installing and learning to use any for years...)
- G3rn0ti 4y agoYes, language servers provide that feature, too, and all language server clients replace „xref“ with their own implementation. „lsp-mode“ even provide some gui extensions to Emacs so it can display a hover window when there are several possible matches for your definition (e.g. all overridden methods in your inheritance tree). That’s quite cool. But the disadvantage is you now need to run a static analyzer in the background parsing half of your code base to find definitions. On very large code based this can create slow downs. Furthermore, finding definitions by means of static analysis cannot always work, especially so in dynamically typed languages or in languages employing generic variables.
- IshKebab 4y ago> E.g. instead of autocomplete ... split the window, open the other source file in the second pane, jump (by text-based search, if you weren't already there) to where the definition is, highlight the word and copy-paste it back to the first pane. Just to be clear, are you being serious? I mean this is what I do too when autocomplete doesn't work, but it's very obviously far inferior to actual autocomplete.
- ParetoOptimal 4y ago> instead of autocomplete, it only takes a couple seconds to split the window, open the other source file in the second pane, jump It takes less than 0.3 seconds with autocomplete and doesn't force a context switch. Maybe your method isn't a context switch for you, but it very much is for me. Also, if you know the source file to open don't you likely know the word making the faster option to just type it?
- yCombLinks 4y agoI can't tell if this is a joke or not, it sound awful. Further it requires already knowing the API, something autocomplete aids in learning.