A note to my future self…
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
- Place the cursor on the line you want to move. Select multiple lines if you want by holding down
SHIFTkey. - Press
ALT + ARROW Keysto move the selected lines up or down to the desired location - Tip: To make this work in Obsidian app, you have to configure your
HotKeysin Preferences menu. SelectMove line upandMove line downand assign a key shortcut, in my case I haveOption + ↑andOption + ↓.
Duplicate a line fast
- Just like the previous one, place the cursor on the line you want to duplicate.
- Press
SHIFT + Option + ↑orSHIFT + Option + ↓and voila, the line will be duplicated just below where your cursor is. - Tip: if you select various lines by holding down
SHIFTwhile 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:
- Place the cursor on the line you want to duplicate.
- And without selecting anything, press
CMD + CandCMD + V, and voila, the line will be duplicated just below where your cursor is.