DEV Community

Keyboard shortcuts which will make sure you don't have to touch your mouse while writing code

Shubhra Agarwal on November 09, 2021

There are times when you might feel like reaching for the mouse to execute a certain task. But we all know that shifting our hand to and fro from t...
Collapse
 
pengeszikra profile image
Peter Vivo

Shortcuts always helpful,
alt + arrow :: line or selected up or down
alt + shift + arrow :: copy line or selected up or down

By the way I never use mouse in my MacBook Pro 13 because touch bar is very smooth even the fast and precise momentum driven scroll up and down : best for take look the code.

Collapse
 
shubhracodes profile image
Shubhra Agarwal

Thank you for adding these Peter

Collapse
 
itr13 profile image
Mikael Klages

One almost universal shortcut I use a lot is "Move from end of line to next/prev end of line". It's right up left to go up a line, and right down left to go down a line

Collapse
 
dima000 profile image
Dumitru Motpan

It's a nice trick, quite handy.
The same can also be achieved with the Home and End buttons.

Collapse
 
shubhracodes profile image
Shubhra Agarwal

Yes, it's awesome

Collapse
 
najsurf profile image
Łukasz Jóźwiak

Also one of the less known shortcuts is shift + alt + o to organize imports, very cool to use

Collapse
 
shubhracodes profile image
Shubhra Agarwal

I haven't heard of it, I'll try it out for sure

Collapse
 
ceoshikhar profile image
Shikhar

Vim or NeoVim FTW

Collapse
 
ful1e5 profile image
Kaiz Khatri

Absolutely legend

Collapse
 
shubhracodes profile image
Shubhra Agarwal

haha yes

Collapse
 
aneeskodappana profile image
Anees Kodappana

Ctrl+Enter is something new, thanks for sharing

Collapse
 
shubhracodes profile image
Shubhra Agarwal

You're most welcome Anees

Collapse
 
drsimplegraffiti profile image
Abayomi Ogunnusi

I use home and end keys to navigate to the beginning and end of lines respectively

Collapse
 
shubhracodes profile image
Shubhra Agarwal

Yes, that's a great way!

Collapse
 
zaki_dz profile image
Zaki_Dz

In number 8 just correct world to word.
and thank you .

Collapse
 
shubhracodes profile image
Shubhra Agarwal

Thanks a lot for pointing it out🙏

I'll correct it.

And I'm glad you liked it

Collapse
 
barungh profile image
Barun Ghosh

Readers of this blog post will move to Vim/Neovim in next few years 😎

Collapse
 
shubhracodes profile image
Shubhra Agarwal

Hahaha😂

Collapse
 
dima000 profile image
Dumitru Motpan

PageUp and PageDown are also really usefull when you want to get to the end or the start of a file.
It also becomes really handy when navigating webpages. When reading manwha for example :)

Collapse
 
shubhracodes profile image
Shubhra Agarwal

Yes, Page up/down buttons are underrated

Collapse
 
jonrandy profile image
Jon Randy 🎖️

Might want to list the Mac shortcuts too

Collapse
 
shubhracodes profile image
Shubhra Agarwal

These work for Mac too, just replace Ctrl with Command