yip # Yank inside paragraph (copy the para you're in)
ct< # Change to open bracket
# Change the text from where you are to the next open bracket
d$ # Delete till end of line
```
## Some shortcuts and tricks
<!--TODO: Add more!-->
```
> # Indent selection by one block
< # Dedent selection by one block
:earlier 15m # Reverts the document back to how it was 15 minutes ago
:later 15m # Reverse above command
ddp # Swap position of consecutive lines, dd then p
. # Repeat previous action
```
## Macros
Macros are basically recordable actions.
When you start recording a macro, it records **every** action and command
you use, until you stop recording. On invoking a macro, it applies the exact
same sequence of actions and commands again on the text selection.
```
qa # Start recording a macro named 'a'
q # Stop recording
@a # Play back the macro
```
### Configuring ~/.vimrc
The .vimrc file can be used to configure Vim on startup.
Here's a sample ~/.vimrc file:
```
" Example ~/.vimrc
" 2015.10
" Required for vim to be iMproved
set nocompatible
" Determines filetype from name to allow intelligent auto-indenting, etc.
filetype indent plugin on
" Enable syntax highlighting
syntax on
" Better command-line completion
set wildmenu
" Use case insensitive search except when using capital letters
set ignorecase
set smartcase
" When opening a new line and no file-specific indenting is enabled,
" keep same indent as the line you're currently on
set autoindent
" Display line numbers on the left
set number
" Indentation options, change according to personal preference
" Number of visual spaces per TAB
set tabstop=4
" Number of spaces in TAB when editing
set softtabstop=4
" Number of spaces indented when reindent operations (>> and <<) are used
set shiftwidth=4
" Convert TABs to spaces
set expandtab
" Enable intelligent tabbing and spacing for indentation and alignment
set smarttab
```
### References
[Vim | Home](http://www.vim.org/index.php)
`$ vimtutor`
[A vim Tutorial and Primer](https://danielmiessler.com/study/vim/)
[What are the dark corners of Vim your mom never told you about? (Stack Overflow thread)](http://stackoverflow.com/questions/726894/what-are-the-dark-corners-of-vim-your-mom-never-told-you-about)
[Arch Linux Wiki](https://wiki.archlinux.org/index.php/Vim)