Ask HN: What are your favourite programming shortcuts
My favourites are in VS Code:
Navigate back: Alt + left
Navigate forward: Alt + right
Switch tabs: CTRL + Page up/down
Split tabs: CTRL + ALT + left/right
Navigate back: Alt + left
Navigate forward: Alt + right
Switch tabs: CTRL + Page up/down
Split tabs: CTRL + ALT + left/right
19 comments
[ 3.5 ms ] story [ 51.7 ms ] threadCtrl+w - scroll up one line
Ctrl+z - scroll down one line
These are the mappings I have set in Joe on my system, the Ctrl+w/z is originally from Wordstar, although I first encountered that mapping in Turbo Pascal 4.
This shortcut is, no joke, a very big part of why I'm still paying for Jetbrains tools.
No need to know the name.
So if I need to pull updates on the previous branch I was on and merge them into my current branch, I can just:
I keep getting screenshots when I hit command-shift-3. https://support.apple.com/en-us/102646
https://tiswww.cwru.edu/php/chet/readline/readline.html#inde...
insert-comment (M-#) Without a numeric argument, the value of the comment-begin variable is inserted at the beginning of the current line.
Like in a React project, you can rename the first part of `[isThisThingOn, setIsThisThingOn] = useState()` and it'll automatically rename the setter and all the components that inherit that state. Or if you rename `<MyComponent/>` to something else, it'll rename that component, the imports, the filename itself, etc. across your whole project.
It works pretty well but does have its quirks, like how it handles properties inside objects or type definitions, so it's worth double-checking the IDE's work for readability.
VScode has something similar (F2), I think, but maybe only for some languages? https://code.visualstudio.com/docs/editor/refactoring#_renam.... It's cute that they kept the F2 shortcut key from the Windows (3.1?) days.
$ set -o vi
at the (ba)sh prompt ($ by default), enables vi-mode command-line editing. (The default is emacs.). You are initially in append mode on the current command line. Now you can do ESC to go to command mode, then use k and j to move up and down respectively in the command history, b and w to move backward or forward, and can use many other vi(m) movement and editing commands on the history lines, including/ and n to search for patterns. Been using this since early days of using Unix. Invaluable productivity aid.