DEV Community

Discussion on: 5 Visual Studio Code Tricks to Boost Your Productivity

Collapse
 
nicoespeon profile image
Nicolas Carlo

Nice advices, thanks for sharing. I discovered these progressively, and they make me save so much time today!

As for points #1 and #2, I'm working on a VS Code Extension to go even further! The idea is to provide automated refactorings to save me some time on the thing I frequently do (just like "Rename Symbol").

Maybe you'd be interested in checking it out.
It's called Abracadabra: bit.ly/vscode-abracadabra

Related to #2: with alt + up and alt + down you can move lines up / down indeed. But sometimes, you'd like to move a statement above / below another one. Like, to switch from:

const oldNode = { 
  type: "identifier",
  loc: {
    start: 0,
    end: 10
  }
};

const newNode = { 
  type: "expression",
  loc: {
    start: 14,
    end: 20
  }
};

to the following:

const newNode = { 
  type: "expression",
  loc: {
    start: 14,
    end: 20
  }
};

const oldNode = { 
  type: "identifier",
  loc: {
    start: 0,
    end: 10
  }
};

in a single keystroke. Moving lines up/down will mess things up until you're done, because the two objects would "merge". Thus, we tend to cut & paste indeed.

With Abracadabra, I'm working on a "Move Statement Up/Down" so you can swap them with Ctrl + Shift + Up for instance 😁

Well, that's one example. If you feel like trying it, I'd love to get your feedbacks so I can make it better!

Anyway, thanks for this article. Have a great week 👋

Collapse
 
hexrcs profile image
Xiaoru Li

This looks super cool. Thanks for making this!