# VIM

## Keyboard shortcuts

### Scrolling

| Shortcut  | Description                  |
|-----------|------------------------------|
| h         | Scroll left                  |
| j         | Scroll down                  |
| k         | Scroll up                    |
| l         | Scroll right                 |
| Ctrl + b  | Scroll up one full screen    |
| Ctrl + f  | Scroll down one full screen  |
| Ctrl + u  | Scroll up half a screen      |
| Ctrl + d  | Scroll down half a screen    |

## .vimrc

```vimrc
" set paste             " Enable paste mode
set tabstop=4
set shiftwidth=4
set expandtab
set number              " Display line numbers
set ruler               " Show cursor position

au BufNewFile,BufRead *.py
    \ set tabstop=4 |
    \ set softtabstop=4 |
    \ set shiftwidth=4 |
    \ set textwidth=119 |
    \ set expandtab |
    \ set autoindent |
    \ set fileformat=unix

au BufNewFile,BufRead *.sh
    \ set tabstop=4 |
    \ set softtabstop=4 |
    \ set shiftwidth=4 |
    \ set expandtab |
    \ set autoindent |
    \ set fileformat=unix

au BufNewFile,BufRead *.yml
    \ set tabstop=2 |
    \ set softtabstop=2 |
    \ set shiftwidth=2 |
    \ set expandtab |
    \ set autoindent |
    \ set fileformat=unix

au BufNewFile,BufRead *.yaml
    \ set tabstop=2 |
    \ set softtabstop=2 |
    \ set shiftwidth=2 |
    \ set expandtab |
    \ set autoindent |
    \ set fileformat=unix
```
