# Mastering text selection with keyboard in VSCode, Atom, or Sublime Text

Here’s a list of handy keyboard shortcuts for selecting, copying, cutting, and
pasting text in VSCode, Atom, or Sublime Text (they’re all the same in that
sense).

## Select word, next word, and next occurrence of a word

You know the thing where you press Cmd+D to select the next
occurrence of a word? **But what if you want to skip a word?** **Or go back one
step?** Here’s how to master the multiple selection tool in Visual Studio code.

Start by having a cursor on top of a word. If you’re on Windows or Linux please
replace Cmd with Ctrl.

| Shortcut         | What it does                                        |
| ---------------- | --------------------------------------------------- |
| Cmd+D | Selects a word, press again: select next occurrence |
| Cmd+K | Skip the current occurrence                         |
| Cmd+U | Go back one word                                    |

Also, the more universal text selection works:

| Shortcut                    | What it does                    |
| --------------------------- | ------------------------------- |
| Alt Shift+arrows | Selects the word next to cursor |

## Line commands

| Shortcut                   | What it does                |
| -------------------------- | --------------------------- |
| Cmd+L           | Selects current line        |
| Shift+Cmd+K     | Delete current line         |
| Cmd Shift+right | Select to end of line       |
| Cmd Shift+left  | Select to beginning of line |

## Moving lines

Shortcut
      What it does

Ctrl Cmd+up/down arrows

Moves line up and down

(fn)+F5

Alphabetizes lines (Only in Sublime Text)

## Moving cursor in the document

Shortcut
      What it does

Alt+left/right arrow

Move cursor to next or previous word

## Copying and duplicating lines

If you just do Cmd+C, without any text selected, it will copy the
whole line of text.

Shortcut
      What it does

Cmd+C

Copy whole line

Cmd+X

Cut whole line

Cmd Shift+D

Duplicates line (Sublime Text)

Shift+alt+up/down

Duplicates line (Visual Studio Code)

## Vintage mode

In Sublime Text there is a "Vintage Mode", which means that all the Vim commands
will work, enable it from the settings by adding this line:

```
"ignored_packages": ["Vintage"]
```
