DEV Community

Gohomewho
Gohomewho

Posted on

Basic but powerful shortcuts that help editing texts

I want to share some basic but very powerful shortcuts that I use every day. These shortcuts come in handy from time to time, and sometimes it is more efficient to use them rather than moving our hand off keyboard and use a mouse.

Note I am using windows, but I think these shortcuts work across Mac and Linux.

Keys that we'll use in this article:
← β†’ ↑ ↓ Home End Ctrl Shift Z X C V


Select texts

There are various way to select texts. We can select from a single character to a word, a line, or multiple lines! We have the power to select what we want while holding(πŸ‘‡) Shift and moving our cursor. The idea is to select from where cursor starts to where cursor ends.

Select characters

πŸ‘‡Shift + ←/β†’
select as cursor moving forward or backward.

Select words

πŸ‘‡Ctrl + ←/β†’
This allows us to move cursor forward or backward over words.

πŸ‘‡Shift + πŸ‘‡Ctrl + ←/β†’
composed with Shift, we can easily select words.

Select single line

Home
move cursor to the start of the line.

πŸ‘‡Shift + Home
select from cursor position to the start of the line.

End
move cursor to the end of the line.

πŸ‘‡Shift + End
select from cursor position to the end of the line.

Select multiple lines

πŸ‘‡Shift + ↑/↓
select from cursor position to next position of cursor.

Select all

πŸ‘‡Ctrl + A
select all texts within an area.

Select towards all

πŸ‘‡Ctrl + πŸ‘‡Shift + End
select from cursor position to the end of an area.

Select backwards all

πŸ‘‡Ctrl + πŸ‘‡Shift + Home
select from cursor position to the start of an area.


Actions

Now we have texts selected, we can start manipulate the texts.

Copy

πŸ‘‡Ctrl + C
copy the selected text.

Cut

πŸ‘‡Ctrl + X
cut the selected text.

Paste

πŸ‘‡Ctrl + V
paste the texts we copied or cut.

Undo

πŸ‘‡Ctrl + Z
Undo your last change.

Redo

πŸ‘‡Ctrl + πŸ‘‡Shift + Z
Undo your last undo.

Be aware that the behavior of undo and redo could vary on different environments, and might not work as we want sometimes.


Wrap up

With the help of shortcuts, we can select and edit text easier and faster. They are simple but really powerful. Next time I'll share some basic shortcuts on VSCode and show how we can leverage these tools.

Top comments (0)