Foto of Higor Hanschen on Unsplash

Let’s start this blog with some very fundamental programming skills - mastering the keyboard. In this post I will show you what you can do with your keyboard together with the shortcuts that I have used. Most of the shortcuts in this post will work for any text editor, some of the most advanced shortcuts are VSCode exclusives.

Agility

Gif of naruto hoppin on trees

Basic shortcuts for moving your cursor faster than the wind.

Move to next/previous word Alt/

Alt  left/right arrow to move between words

Move to line start/end Ctrl/

Alt  left/right arrow to move between words

Move to page top/bottom Ctrl/

Ctrl  up/down arrow to move between up and bottom of a page

Concentration

Naruto Meditating

Now that you have learned the basic skills of Agility, you are ready to familiarize to another ninja tool, the ⇧Shift key. By holding the ⇧Shift key while moving your cursor you will also select the text your cursor moves on.

Select next/previous word ⇧ShiftAlt/

Shift  Alt  left/right arrow to select words

Select next/previous line ⇧Shift/

Shift  up/down arrow to select lines

Select until line start/end ⇧ShiftCtrl/

Shift  Ctrl  /right arrow to select until start/end of line

Multiplication

Shortcuts in this section are VSCode exclusives

Naruto shadow clones

With two cursors you can type twice as fast.

Duplicate cursor up/down AltCtrl/

Code is often indented and it is nicely aligned. For this reason, it is very handy to duplicate your cursor sometimes up or down with this shortcut.

Cursor Duplication gif

Select next occurrence CtrlD

Sometimes what you want to select is not properly aligned, but it has a common word, or part of it.

Cursor Duplication gif

Box Selection hold ⇧ShiftAlt while dragging with your mouse

Extremely useful when dealing with Markdown tables.

Box Selection

Duplicate line above/below ⇧ShiftAlt/

Substitution

Shortcuts in this section are VSCode exclusives

kakashi substitiotion

Switch lines Alt/

You can switch the order of two lines with the command Alt/. You can also use this trick for moving blocks of selected code up or down.

The Path of the ninja

The best way to learn these ninjutsu is by practicing. Next time you find yourself changing something more than once, focus your chakra on your fingertips and start hitting a random combination of ⇧Shift, Alt, Ctrl and a bunch of arrow keys. You will fail the first times and make a mess, but eventually these shortcuts will become like second nature. Once you have mastered these ninjutsu, your coding speed will increase by 42%*.

*not guaranteed.


<
Blog Archive
Archive of all previous blog posts
>
Next Post
Kedro Review