DEV Community

Cover image for Keyboard Shortcuts for Moving the Cursor in a Text Editor
Jake Witcher
Jake Witcher

Posted on

Keyboard Shortcuts for Moving the Cursor in a Text Editor

One of the skills you can develop to increase productivity is your ability to navigate around a text editor using keyboard shortcuts instead of a mouse. However not all shortcuts are equally useful nor are they all universal across text editors.

If you are new to using keyboard shortcuts, one of the best places to start is with the shortcuts that move the cursor around a page. These shortcuts are universal across most text editors as well as many other desktop applications like Slack, Microsoft Teams, Goodle Docs, and Microsoft Word.

It can take some time to develop the muscle memory but a few days or weeks of awkward and slow key presses will pay off in dividends once the shortcuts become second nature and you can quickly move the cursor as you code, write, or send your coworkers a message.

Below are the keyboard shortcuts for both Windows and Mac that I use the most frequently for moving the cursor around.

Moving the Cursor on a Windows PC

Move Cursor To Keyboard Shortcut
the start of the line HOME
the end of the line END
the top of the page CTRL + HOME
the bottom of the page CTRL + END
one word to the right CTRL + RIGHT ARROW
one word to the left CTRL + LEFT ARROW

Moving the Cursor to Select Text on a Windows PC

Select Text From The Cursor To Keyboard Shortcut
the start of the line SHIFT + HOME
the end of the line SHIFT + END
the top of the page SHIFT + CTRL + HOME
the end of the page SHIFT + CTRL + END
one word to the right SHIFT + CTRL + RIGHT ARROW**
one word to the left SHIFT + CTRL + LEFT ARROW**

**the right or left arrow can be repeatedly pressed to select multiple words


Moving the Cursor on a Mac

Move Cursor To Keyboard Shortcut
the start of the line CMD + LEFT ARROW
the end of the line CMD + RIGHT ARROW
the top of the page CMD + UP ARROW
the bottom of the page CMD + DOWN ARROW
one word to the right OPTION + LEFT ARROW
one word to the left OPTION + RIGHT ARROW

Moving the Cursor to Select Text on a Mac

Select Text From The Cursor To Keyboard Shortcut
the start of the line SHIFT + CMD + LEFT ARROW
the end of the line SHIFT + CMD + RIGHT ARROW
the top of the page SHIFT + CMD + UP ARROW
the end of the page SHIFT + CMD + DOWN ARROW
one word to the right SHIFT + OPTION + RIGHT ARROW**
one word to the left SHIFT + OPTION + LEFT ARROW**

**the right or left arrow can be repeatedly pressed to select multiple words


Once you are able to move the cursor around the page with ease, you can combine the above keyboard shortcuts with several other universal and editor-specific shortcuts in your workflow like copying text, renaming methods or variables, moving blocks of code up or down the page, and extracting methods.

Discussion (0)