Filetype specific options

e.g. no line numbers for markdown

au FileType markdown set nonumber 

Copy all


Yank all text


:set spell spelllang=en_gb

]s move to the next mispelled word
[s move to the previous mispelled word
zg add a word to the dictionary
zug undo the addition of a word to the dictionary
z= view spelling suggestions for a mispelled word

Visual block mode to add to start or append to end of lines

Append to the end of all lines


Explanation: In normal mode, Visual select a paragraph vip, switch to Visual block mode Ctrl-V, append to all lines $A a comma ,.

Using I inserts at the start of the line.

Search and replace globally


Replaces x with y

Tabs and open files

:tabedit {file}

gt switch to next tab
gT switch to previous tab

Move between open files with


Changing colour scheme

:colorscheme elflord

changes the colourscheme to elflord

/ is search forward
? is search back
n is find next in the same direction
N is find next in the opposite direction

* find next instance of word under cursor
# find previous instance of word under cursor
Ctrl-o takes you back

Apend etc

ea is append end of word
ciw change inner word (i.e. delete word and go into insert mode)

Paste into a new line


:nmap <leader>p o<ESC>p

into your vimrc and use that

Underling headings in markdown



Typewritter scroll mode


Unite plugin

Removing ^M in text files

Add in further line-breaks to those that already exist in markdown

:%s/ \n/\0 \r/g

Swap two characters



Interactively replace


Removing Ctrl-M

There are quite a few ways of doing this, but a quick way to remove ^M scattered around your file is as follows:


Where C-v is Ctrl-v and C-m is Ctrl-m.