TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ask HN: What are your favourite programming shortcuts

11 pointsby janpmzabout 1 year ago
My favourites are in VS Code:<p>Navigate back: Alt + left<p>Navigate forward: Alt + right<p>Switch tabs: CTRL + Page up&#x2F;down<p>Split tabs: CTRL + ALT + left&#x2F;right

13 comments

solardevabout 1 year ago
In Jetbrains, you can shift-F6 to rename something (like a variable or function) via a built-in refactorer. It&#x27;ll do it (somewhat) intelligently across not just the current file, but your whole project.<p>Like in a React project, you can rename the first part of `[isThisThingOn, setIsThisThingOn] = useState()` and it&#x27;ll automatically rename the setter and all the components that inherit that state. Or if you rename `&lt;MyComponent&#x2F;&gt;` to something else, it&#x27;ll rename that component, the imports, the filename itself, etc. across your whole project.<p>It works pretty well but does have its quirks, like how it handles properties inside objects or type definitions, so it&#x27;s worth double-checking the IDE&#x27;s work for readability.<p>VScode has something similar (F2), I think, but maybe only for some languages? <a href="https:&#x2F;&#x2F;code.visualstudio.com&#x2F;docs&#x2F;editor&#x2F;refactoring#_rename-symbol" rel="nofollow">https:&#x2F;&#x2F;code.visualstudio.com&#x2F;docs&#x2F;editor&#x2F;refactoring#_renam...</a>. It&#x27;s cute that they kept the F2 shortcut key from the Windows (3.1?) days.
joehx2about 1 year ago
I&#x27;ve recently discovered `git switch -` and `git merge -`. It switches to the previous branch you were on or merges the previous branch you were own.<p>No need to know the name.<p>So if I need to pull updates on the previous branch I was on and merge them into my current branch, I can just:<p><pre><code> git switch - git pull git switch - git merge -</code></pre>
评论 #39869659 未加载
评论 #39892070 未加载
fuzztesterabout 1 year ago
If you&#x27;re a vi(m) user on a *nix OS, running:<p>$ set -o vi<p>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&#x2F; and n to search for patterns. Been using this since early days of using Unix. Invaluable productivity aid.
az09mugenabout 1 year ago
In sublime text ctrl+m (go to matching parenthesis&#x2F;brace), ctrl+d (multiple selection), alt+F3 (multiselect all occurencies). In Jetbrains, alt+F7 to show usages of function&#x2F;method
khaledhabout 1 year ago
In JetBrains IDEs: pressing shift twice while some text is selected opens the Find in Files dialog with the selected text already populated.
pwgabout 1 year ago
Ctrl+[ - jump to matching paren.&#x2F;brace&#x2F;bracket<p>Ctrl+w - scroll up one line<p>Ctrl+z - scroll down one line<p>These are the mappings I have set in Joe on my system, the Ctrl+w&#x2F;z is originally from Wordstar, although I first encountered that mapping in Turbo Pascal 4.
yen223about 1 year ago
&quot;Expand selection&quot; in Intellij and similar, option + up by default.<p>This shortcut is, no joke, a very big part of why I&#x27;m still paying for Jetbrains tools.
评论 #39871486 未加载
kebsupabout 1 year ago
After more than 5yrs of coding in jetbrains, I&#x27;ve recently started using F2 to go to the next error.
interbasedabout 1 year ago
Not a shortcut persay but I love setting alias’s in my .zshrc file to make all my common commands a few key strokes.
useRustabout 1 year ago
Anyone has useful mac shortcuts?
jytechdevopsabout 1 year ago
pushd popd
fragmedeabout 1 year ago
command-shift-3 in bash comments out the current line and hits enter.
评论 #39871746 未加载
KomoDabout 1 year ago
ctrl+c, ctrl+v