diff --git a/.vimrc b/.vimrc
index 12513f1..d03e46d 100644
--- a/.vimrc
+++ b/.vimrc
@@ -4,6 +4,7 @@ set spell spelllang=en_gb
set spell
hi SpellBad cterm=underline ctermfg=red ctermbg=NONE
set spellfile=~/.vim/spell/en.gb.add
+ hi SpellLocal cterm=NONE ctermfg=yellow ctermbg=NONE
syntax on
filetype plugin indent on
@@ -32,6 +33,60 @@ augroup MarkdownCodeHighlight
augroup END
hi markdownCodeBlock guifg=#00ff00 ctermfg=blue
+ hi markdownUrlText ctermfg=Blue guifg=Blue cterm=NONE gui=NONE
+ hi htmlLink ctermfg=Blue guifg=Blue cterm=NONE gui=NONE
let g:markdown_fenced_languages = ['html', 'python', 'bash=sh', 'javascript', 'json', 'xml', 'ruby']
+ inoremap <C-v> <C-r>+
+ vnoremap <C-c> "+y
+
+ nnoremap <leader>r i<C-r>=system(input('Command: '))<CR>
+
+
+ " Rename Markdown from YAML on save
+
+ function! RenameMarkdownFromTitle()
+ " Only act on .md files
+ if expand('%:e') !=# 'md'
+ return
+ endif
+
+ if line('$') < 2
+ return
+ endif
+
+ let l:line = getline(2)
+
+ if l:line !~? '^title: '
+ return
+ endif
+
+ " Extract and transform title
+ let l:newname = l:line[7:]
+ let l:newname = substitute(l:newname, ',', '', 'g') " remove commas
+ let l:newname = substitute(l:newname, ' ', '-', 'g') " spaces to hyphens
+ let l:newname = tolower(l:newname)
+
+ if l:newname !~ '\.md$'
+ let l:newname .= '.md'
+ endif
+
+ " Full new path
+ let l:newpath = expand('%:p:h') . '/' . l:newname
+
+ " Avoid renaming if same name
+ if expand('%:p') ==# l:newpath
+ return
+ endif
+
+ " Rename file and update buffer
+ execute 'saveas ' . fnameescape(l:newpath)
+ call delete(expand('#:p'))
+ endfunction
+
+ augroup RenameMarkdown
+ autocmd!
+ autocmd BufWritePost *.md call RenameMarkdownFromTitle()
+ augroup END
+