My 8 favorite VS Code Shortcut #1
Tags: vscode, webdev, codenewbie, javascript
Published: 2021-04-18 14:38:11

Hey ! Welcome here, I'm CodeOz and I'm sharing with you my favorite VS Code shortcut !

### Indent the whole line

By default when you are indenting a line on VSCode, the entire line is not indented, so there is a option for this :

`editor.action.indentLines`

```console
    {
        "key": "tab",
        "command": "editor.action.indentLines",
        "when": "editorTextFocus && !editorReadonly"
    },
```

#### Before

![Webp.net-gifmaker](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fh3ng6dx4eaztdf8m9ht.gif)
 

#### After

![Webp.net-gifmaker (1)](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cjj99su8gfc8xq578aeq.gif)
 

### Rename variable in all files

If you want to rename a variable from a file you will need to update the name in all other file where you need to use this variable, thanks to this shortcut, it will be more easier to rename your variable across your project !

`editor.action.rename`

```console
    {
        "key": "shift+f2",
        "command": "editor.action.rename",
        "when": "editorHasRenameProvider && editorTextFocus && !editorReadonly"
    },
```

![ezgif.com-gif-maker](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ylkildoyjncuqkase2qb.gif)
 
### Select all word in the file

You can also select all word from a word !

`editor.action.changeAll`

```console
    {
        "key": "ctrl+shift+f2",
        "command": "editor.action.changeAll",
        "when": "editorTextFocus && editorTextFocus && !editorReadonly"
    },
```

![select-all-word](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rvoj12aboqlixesr7x9w.gif)
 

### Navigation back, forward and last edit

One of my favorite ! You can navigate across your mouse's historical, from back to forward and from your last edit, it can be very very usefull

`workbench.action.navigateBack`

`workbench.action.navigateForward`

`workbench.action.navigateToLastEditLocation`

```console
	{
		"key": "f1",
		"command": "workbench.action.navigateBack"
	},
	{
		"key": "f2",
		"command": "workbench.action.navigateForward"
	},
	{
		"key": "f3",
		"command": "workbench.action.navigateToLastEditLocation"
	},
```

![naviguate](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p6wislhezj8gw0h27wwr.gif)


### Navigation at the start and the end of a line

You will earn a lot of time of using this, as mentioned in the title, you can navigate from the start or the end of a line !

`cursorLineStart` 

`cursorLineEnd` 

```console
    {
        "key": "alt+left",
        "command": "cursorLineStart"
    },
    {
        "key": "alt+right",
        "command": "cursorLineEnd"
    }
```

![ezgif.com-gif-maker](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dhdeje15sjlqhlki4339.gif)
 
---

I hope you like this reading!

🎁 You can get my new book `Underrated skills in javascript, make the difference` for FREE if you follow me on [Twitter](https://twitter.com/code__oz) and MP me 😁

Or get it [HERE](https://codeoz.gumroad.com/l/RXLYp)

🎁 [MY NEWSLETTER](https://www.getrevue.co/profile/code__oz)

☕️ You can [SUPPORT MY WORKS](https://www.buymeacoffee.com/CodeoZ) 🙏

🏃‍♂️ You can follow me on 👇

🕊 Twitter : [https://twitter.com/code__oz](https://twitter.com/code__oz)

👨‍💻 Github: https://github.com/Code-Oz

And you can mark 🔖 this article!