6 ms·
For some (myself included) the high speed and efficiency of proficient modal editing serves as a thinking aid, like sketching with a pencil and eraser. I tend "
by helaoban 4y ago
For some (myself included) the high speed and efficiency of proficient modal editing serves as a thinking aid, like sketching with a pencil and eraser. I tend "play" with the code: chopping it up; splitting lines and inserting a bunch of white space; duplicating lines dozens of times to act as placeholder values (e.g filling an array literal); renaming variables across a file many many times before settling on the right name; moving helpers functions to the top, then to the middle, then next to their first invocation etc.... All doable with other editing styles, but at a higher cost, and the cost of manipulation has to be very low in order to reap those meditative qualities.
Manipulation far outweighs input. And manipulation is fundamentally thinking, at least for me.
- Aperocky 4y agoGreat point, /SEARCH_TERM and n is extremely useful for finding stuff and understanding. also when you screw up either because muscle memory went haywire or the logic looks bad then just uuuuu until the status bar (plugin) show no change since last save.
- p-e-w 4y agoAs opposed to other editors, which don't have shortcuts for search and undo?
- rhaway84773 4y agoCtrl/CMD + Z vs u Ctrl/CMD + Y vs r There’s a significant difference in speed. But more importantly, the former requires RSI inducing finger gymnastics, whereas the latter is a tap of a fingertip. The much faster speed but more importantly less complicated chords/key taps in VIM, leads to a qualitatively different editing/reading experience.
- worksonmine 4y agoIf your goal is to return to the state where you opened the file ":earlier 10m" might be more useful than spamming u.
- probablynish 4y agoThis is a great point that I never thought of. Seems like a general example of the idea that lowering the cost of some action sufficiently low can lead to not just efficiency gains in areas where that action is currently used, but also new and surprising uses of that action. For example, I once read an economics book that characterized computers as lowering the cost of integer arithmetic by an extreme amount. That led to things like digital music/pictures - no-one would have previously thought of using a ton of numbers to represent a song - not just efficiency gains in accounting.
- tjrDL6MjB2Zwwa 4y agoClaude Shannon showed that everything is just data, that's why it wasn't done previously. It seems obvious today, but wasn't always.
- thwarted 4y ago> no-one would have previously thought of using a ton of numbers to represent a song Music has long been represented using math and math concepts. Musical notation is a cartesian plane with time on the x-axis and pitch on the y. But that's the representation, and it's not about the representation, it's the ability to manipulate at extremely high speed.
- probablynish 4y agoI see what you're saying, but musical notation isn't a precise representation of the audio. Given the same score, two musicians can produce very different interpretations. Perhaps I should have said 'audio' instead of 'song'. (I took classical piano exams as a kid, and at some point a group of us would perform our prepared pieces for each other as practice, and I remember always being surprised at how different everyone's pieces sounded. I'd thought mine was the One True Way!)
- 5e92cb50239222b 4y agoAll of that can be done in JetBrains' IDEs with a single hotkey. Especially stuff like code extraction or variable/class/function renaming — it actually works reliably across the whole project (not just a couple of files) even if you have multiple functions with the same name. Extracting code to variables/constants/functions also works reliably (like automatically adding referenced data as function arguments).
- kqr 4y agoYes, but does it work the same way in Shell scripts, Ada, Haskell, Perl, Python, C#, screenwriting, and documentation? The power of text-based manipulation is that you don't have to learn a different set of hotkeys for different types of material.
- probablynish 4y agoIntelliJ (the canonical JetBrains IDE) has plugins for the first 6 of those - so at least for those, it does work the same way. The hotkeys to perform the actions mentioned in the parent comment don't change.
- kqr 4y agoTIL! There weren't so many language plugins last time I tried it, so I felt like I had to drop back into Emacs/Evil fairly often. Good to know that's not as much the case anymore!
- 5e92cb50239222b 4y agoYes, and also in CSS, SQL, ocaml, Rust, and a million other languages. Navigation works reliably (including cross-language navigation: for example, you can easily jump from a CSS class mentioned in HTML or JSX to its definition even if it's has a very generic name and is defined in a random file far away). Even if it has a complicated definition using something like SCSS and is simply not greppable. Or do the reverse — find all usages of a CSS class from its definition (again: do so reliably, it's not a simple grep). Find all references to a particular database column (in SQL queries across the project, foreign keys in other database tables, and ORM models)? Same hotkey. Stuff like code selection works reliably since IDE work with code on an AST level and you're asking it to select the current AST node (and not the "current text block"), going up the tree as needed. And so on.
- mannykannot 4y agoPersonally, when I find myself doing the things you mention, I realize it's time to back off and refocus on the things mentioned in p-e-w's second paragraph. In that state, I feel I am fidgeting with the code, and it is probably because some unresolved issue is blocking me.
- fierro 4y agototally agree. Also, when developing in complex codebases, being able to shorten the time distance between thinking an action needs to be done and actually doing it means you can keep more ideas in your head rather than spend your CPU cycles on visually moving around your screen, clicking, waiting, etc.