Ask HN: What are your IDE superpowers? Tips that make you a better developer?

51 points by andrewstuart ↗ HN
Knowing your IDE well can give you superpowers.

What are some of the ways you use your IDE that boost your effectiveness as a developer?

Do you have any tricks and tips to share?

53 comments

[ 2.0 ms ] story [ 53.5 ms ] thread
I find that using very elaborate multi-word camel-case variable names is a huge help in avoiding errors in reasoning and in debugging. The compiler doesn't care. It doesn't effect the compiled code. It's painless and useful.
Learn refactoring tools for IDEs for your language. I can't believe how many things developers on my team still do by hand that are totally automated with 1 button press... Renaming things, extracting code into functions, organising stuff ...

Another great one: Fuzzy finders for files and even code symbols.

  ls | entr make
Or any variation thereof. I.e. auto compile and run on file changes

A variation (swapping make for ninja/samu)

  find . -maxdepth 1 | entr sh -c "samu || lldb -c /tmp/core -b -o bt -o q"
I have a similar command that is basically `entr -r "$@" <<</run/some-well-known-file`. Then I have configured my editor to just touch that file every time I save. This is like `ls | entr` but without needing to bother actually listing the right files 99% of the time I just want to trigger when I save anyways. Plus I can use another command to trigger manually if I want (or just touch the file). I almost always have something like `w nix-build`, `w cargo test`, `w -s 'foo && bar'`. Probably my most used command.
I used Visual Studio for 20 years or so and came to rely on the wizards / automatic things that it provides for .NET development i.e. the right-click deploy container to AWS function that comes with the Visual Studio AWS toolkit is pretty good, but frustrating because you are limited in how the deployment occurs.

Turns out I was much more productive when I switched to mixing in a lot of CLI after I trialled VSCode.

Now, I think I would rather have a mix of a less capable IDE (i.e. a glorified editor) and rely more on CLI where it's appropriate. It's a more flexible approach and you get to understand what is going on under the hood, which means you have a better shot at scripting the more complicated bits of your build process.

Many things in Vim can be a super power if you build the muscle memory.

I find di/yi (delete/yank inside) to be one of the most powerful.

Once I realized that vim can be used to process data from stdin and output it to stdout for another program...it changed the way I use unix environments forever.

Every time I am too lazy to cut or awk for a one-time bash script, I just use vim's visual mode.

Need a quick list of things to do or write a bash script to get shit done? "ls -l | vim -" is your friend.

Need to be more efficient in processing git bisects, patches or merges? Use a git alias for vimdiff.

How can vim write to stdout? I use the stdin frequently as a better `less` but haven't use stdout.
“:w !command” (e.g. “:w !wc -l”)

Another fun one is “:%! command”, which pipes the current content to command, and replaces it with the output. (E.g. “:%!jq ‘.’” - to pretty print json). Pretty useful to quickly iterate when building a complicated command with multiple pipes.

I tend to use: "vi | !!ls" -- same result.

Also find paste, and cut commands very useful with tabular outputs.

I should try vim for that, I currently use lnav which is amazing for tracing logs and large outputs. I did try vimdiff but was unable to grasp it first try.

https://lnav.org/

I found this kind of usage of vim extremely helpful when doing Advent of Code in 2020. I saved myself a lot of boring string processing code by using vim for quick fixups on the input files. A little judicious usage of visual mode and the g command can definitely save a lot of time.
I use Pycharm/Jetbrains IDE's.

The most valuable tip for any IDE is to thoroughly learn source code navigation. For example putting the cursor on a function and hitting control B (I think, it's programming into my finger memory so I don't know that actual keys) jumps to function declaration - much easier than searching for function definitions. https://www.jetbrains.com/help/pycharm/navigating-through-th...

There's alot of value in learning how to move functions and methods via the refactoring tools. Someone else in this thread mentioned the value of learning the refactoring tools.

In Pycharm, go to the trouble to make sure the IDE has the correct Python interpreter and environment configured. Pycharm has good tools for managing venv's too - worth learning.

In Pycharm/Jetbrains IDE's the database tools are extremely good - worth learning.

In general it's worth spending several hours watching YouTube videos on whatever your favorite IDE is.

Another super valuable tip is this - if you send alot of time programming, it's easily worth it to spend hard cash on a top class IDE. Of course there's lots of great free IDE's - depends on your preferences - but for me spending a few hundred $ on Jetbrains is nothing compared to the productivity value I get out of it.

I agree with your point on investing in a good IDE. In the Jetbrains family, a game changer for me was "tapping the shift key twice in quick succession". This brings up an input box that can fuzzy-find classes/structs, files, "symbols" (methods, constants), git branches, and kick off IDE actions like refactoring. If enabled, you can even find database tables, functions, and commands that were pulled from the project's datasources. Sort of a combination between macOS' spotlight and Emacs dwim-style operations (short for "do what I mean"). You can use tab once the input appears to switch what type of thing it searches for.

This feature has saved me a lot of time for some IDE features I don't use often enough to have memorized a keyboard shortcut. It's the same overlay that appears if you hit CTRL-N (CMD-N on macOS) to search for classes/structs project wide.

For Jetbrains IDEs, I've installed the IdeaVIM plugin and that's been a huge boost to productivity. I get the best of both worlds, the IDEs amazing tooling but also VIM's navigation which I find very intuitive.
Anybody has experience using webstorm? How does it compare to vscode?
If you're doing TypeScript development, a good IDE lets you hover over code to see what their type is, or what the expected type is in case of an error - this is a huge superpower.
1. Paying for jet brains everything pack. It's really nice to keep the ide mostly consistent across languages

2. Double shift for Search all (actions, classes, functions, etc)

3. Learn a bit of regex for more complex file searches

4. Actually learn the debugger features beyond just breakpoint

Also +1 for refactoring tools, that's one of my next ide learning adventures

Quickly write program, apply to current file / set of files. Optionally save the program for later if it might be useful again.

If your IDE can't do that or gets in the way of the quickly part, replace said IDE. Ideally the program is written in elisp but substitutes are available.

Super basic, but I most often use Ctrl+Alt+G on highlighted text for global text search and Ctrl+Shft+R for filename search in Eclipse.
Switching the Keymap from JetBrains default to Eclipse is way more productive and intuitive to me.

And shortcuts like:

- shift shift - search everywhere

- alt + left / right - go back / forward

- alt + shift + r - refactor / rename

- alt + y / alt + shift y - (un)mark next occurrence (multicursor editing)

- alt + up / down - move current line

- alt + shift + x - run / run test

- alt + shift + d - debug / debug test

- ctrl/cmd + shift + up / down - extend current marked text

VS Code: alt+arrow to move a line up/down

alt+shift+arrow to duplicate a line or block of text above or below

alt+ctrl+arrow for multi-cursor

ctrl+d for select next instance of a word

I have these baked into my muscle memory such that I had to physically type them it to remember what key combos they were! I feel completely naked without these combos in other editors.

thank you for ctrl+d. i felt like id forgotten how to cycle through searches

middle mouse button also for multi-cursor. good for getting to the ends of lines with different lengths, then ctrl+arrow back through them

get really fast at using tmux

use a ton of tmux splits

zoom or break-pane to manage info overload

ripgrep/fd to find info fast

vim splits

vim macros can be useful but sometimes I get them wrong on my first try so it’s a tossup as to whether they’re always the choice over . (repeat)

vim bindings in everything that supports it

the key thing for writing software fast is getting guidance and feedback from your tooling without it distracting you or you having to choose to make it apparent; so a good type checker, good linter, good randomized unit tests, and a good Jupyter + Vim window split are killer

I don't leave the shell, and set an alarm* for my next meeting and try to ignore everything else

I use `vert term` in vim to have side by side shell and editor within vim

I stay out of GUI windows when coding because I find them distracting, and its just too easy to switch to Slack which is just about the most focus destroying app in existence

* alarm code

    #!/bin/bash
    #./alarm.sh <minutes> <zoom link>

    to_seconds=$(( $1\*60 ))
    message=$2
    sleep $to_seconds

    while : 
    do
      afplay /System/Library/Sounds/Funk.aiff; say "MEETING"; echo $2
    done
VS Code

auto hide terminal,cmd + J to open it

auto hide side bar (which is on the right), cmd + B to open it

turn off tabs, cmd + P to find files

Turn off tabs? You don't switch between files regularly?
I found that I always had way too many tabs open. My brain can only hold a handful of tabs in my memory. I switch tabs using the Open Editors section which can be accessed by pressing Control + Tab (on a mac)
shameless plug for the church of emacs, but my productivity as a programmer has increased vastly from two things: org mode, which to those unaware, is kind of like a super powered literate programming system, and magit, an unrivaled git client. there are other things, eg consult, marginalia, vertico, orderless, etc. the ecosystem is rich, and dev is very active. also, if you are a common lisp programmer, there is no ide-like setup that comes close to slime/sly, in my opinion, for any language/ide pair
magit alone is almost worth the price of admission.
For people that want to begin with Emacs, I recommend Doom Emacs. The config files are quick to get started with, and it performs much better than Spacemacs.
In day-to-day, ctrl-k, ctrl-shift-v, F1 and sessions in QtCreator. Also multi-line editing, apparently not everyone knows that ?
vim’s text manipulation capabilities are overpowered. I can dump unstructured or poorly structured logs into a text file and format the key fields into a CSV in under a minute using no code. It’s like excel, grep, and sed rolled into one tool
The IntelliJ / RubyMine / PyCharm Local History feature is amazing!

You can time-travel any folder or file in a project to the way it looked each time it was saved/changed and pick changes or whole files out from the historical entries.

Right-click on a file or folder in the project explorer and choose Local History->Show History. I have been shocked when other devs didn't know about it, so maybe this will help someone.

This has saved my ass once or twice when I lost a change due to crashes or clumsy usage of git. It's definitely a great and underutilized feature.
Oh wow, I had no idea this existed, thank you! I can think of a number of times when I would have loved to have this feature.
Jetbrains IDES with sublime text keybindings.

Second small keyboard to single press buttons for macros instead of killing my hands with weird key combos.

Multiple cursors, fuzzy search, local (not git) history, find next occurrence keybind, go to start/end of method, go to next/prev compilation error keybind, scratch files, not having the IDE lock up for no reason, JS + type hints is extremely productive and flexible in webstorm, built in web server for test HTML files...

Jetbrains IDES with sublime text keybindings.

Second small keyboard to single press buttons for macros instead of killing my hands with weird key combos.

Multiple cursors, fuzzy search, local (not git) history, find next occurrence keybind, go to start/end of method, go to next/prev compilation error keybind, scratch files, not having the IDE lock up for no reason, JS + type hints is extremely productive and flexible in webstorm, built in web server for test HTML files...

I also like to bind the prev/next error navigation to the up/down buttons on my mouse. This makes code navigation and refactoring a breeze.

Interesting about the 2nd keyboard. Is it a custom one? What specific macros do you have there? Thanks!
Oh, it's technically a keypad. Just a square little thing. Search for "USB keypad".

Macros for starting/stopping services or running a debugger etc.

Inside a pair of argument parentheses and want to quickly select a specific argument or the whole lot between the parentheses? Try Jetbrains IDEs' Extend/Shrink Selection (Ctrl + W / Ctrl + Shift + W) feature.

You can also use it in other places and the IDE can evolve the selections smartly based on ASTs.

I use the IdeaVIM plugin. I do "vib" (visual inside braces) to select everything within the parentheses. Added benefit of it works in lots of other places as well (terminal etc).
Yes, vim does has something similar. One advantage the IDE's implementation has is that the user doesn't have to explicitly specify the constructs --- it doesn't have to be parentheses or a word, but any construct that "wraps around" the cursor; so it's less effort for the mind.