Oliver Barreto
by Oliver Barreto

Categories

  • Blog

Tags

  • Productivity
  • Productivity Workflow
  • Coding
  • VSCode

A note to my future self…

image-right Get used to work with moving lines instead of copying and pasting lines again and again and again…

Instead of thinking in terms of copying a line of text, moving to the place you want to place it, and then (finally) paste it there… think in terms of just: move the line directly to the place you want it to be.

Move a line in VS Code & Obsidian

  1. Place the cursor on the line you want to move. Select multiple lines if you want by holding down SHIFT key.
  2. Press ALT + ARROW Keys to move the selected lines up or down to the desired location
  3. Tip: To make this work in Obsidian app, you have to configure your HotKeysin Preferences menu. Select Move line up and Move line down and assign a key shortcut, in my case I have Option + ↑ and Option + ↓.

Duplicate a line fast

  1. Just like the previous one, place the cursor on the line you want to duplicate.
  2. Press SHIFT + Option + ↑ or SHIFT + Option + ↓ and voila, the line will be duplicated just below where your cursor is.
  3. Tip: if you select various lines by holding down SHIFT while move your cursor to the lines you want you can duplicate those lines at once.

If you have a mac, you are in luck. If you just want to duplicate the line you are in, just:

  1. Place the cursor on the line you want to duplicate.
  2. And without selecting anything, press CMD + C and CMD + V, and voila, the line will be duplicated just below where your cursor is.