aboutsummaryrefslogtreecommitdiff
path: root/vim/indent/html.vim
diff options
context:
space:
mode:
Diffstat (limited to 'vim/indent/html.vim')
-rw-r--r--vim/indent/html.vim18
1 files changed, 18 insertions, 0 deletions
diff --git a/vim/indent/html.vim b/vim/indent/html.vim
new file mode 100644
index 00000000..654aa407
--- /dev/null
+++ b/vim/indent/html.vim
@@ -0,0 +1,18 @@
+" Explicitly set indent level; this matches the global default, but it's tidy
+" to enforce it in case we changed from a filetype with different value (e.g.
+" VimL)
+setlocal shiftwidth=4
+setlocal softtabstop=4
+setlocal tabstop=4
+
+" Run tidy -eq -utf8 on file for the current buffer
+nnoremap <leader>v :exe "!tidy -eq -utf8 " . shellescape(expand("%"))<CR>
+
+" Make a bare URL into a link to itself
+function! UrlLink()
+ normal yiW
+ execute "normal i<a href=\"\<C-R>0\">\<Esc>"
+ normal E
+ execute "normal a</a>\<Esc>"
+endfunction
+nnoremap <silent> <leader>r :<C-U>call UrlLink()<CR>