3 ms·
Example 1: bool ProcessFunkyParam(int nitems, bool properly); bool RecallClunkyItem(bool displace): bool DisposeOfAllParams(int ntrials); This example i
by eitland 5y ago
Example 1:
bool ProcessFunkyParam(int nitems, bool properly);
bool RecallClunkyItem(bool displace):
bool DisposeOfAllParams(int ntrials);
This example is nice for I have used vim often if I have to look after servers, and I agree this is really nice.
In an VSCode or an IDE however, this is just as easy or easier:
- <End> to get to the end of the line
- shift + alt + <arrow down> twice to get to enable block editing and get a cursor on the end of all three lines simultaneously
- backspace once to delete all semicolons
- type <space> and one { and <enter> to get at new line, you'll also get the closing curly brace on a line below and your insertion points will be on the starting point for all the three new functions we created.
Example 2:
if (!entry.used && equivalent(entry.key(). qk.key) && (curcontext & entry.contexts))
Here I just
- get my cursor anywhere inside the expression in question,
- press ctrl + alt + v for extract variable
- and IntelliJ pops a dialog that gives me options for how big chunk of the expression I want to extract. As I move between the options using my keyboard it highlights the expression.
- when I select it IntelliJ already creates it as a value on the line above, complete with a temporary name based on its content. The name is selected already to rename and if I type something else or accept it, it renames it both in the declaration and where it was substituted immediately.
- lostmsu 5y agoFor example 1 I bet Visual Studio or CLion or both have a context menu item, that creates implementations in the correct file and navigates you to it with ~ 4 key presses in total. So vim loses before his example even starts, because it takes much more to select functions, copy them, switch to implementation, find a place and paste.
- eitland 5y agoExactly. If people want to use vim and to use git only by cli, by all means, but if we could stop the cult like part of it that would be nice. Same goes for telling students who are learning Java for the first time that it is smart to start with plain Notepad and javac. Starting to program should be encouraging, not a hazing ritual.