aboutsummaryrefslogtreecommitdiff
path: root/vim/after/ftplugin/html.vim
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2015-06-17 13:04:54 +1200
committerTom Ryder <tom@sanctum.geek.nz>2015-06-17 13:04:54 +1200
commit33aea3b41996356fd3a3974729545e8a895be197 (patch)
treedabb8dc51eea7bf24d1398c8d86db4a9d6b0938c /vim/after/ftplugin/html.vim
parentNitpick: fix indenting in vimrc (diff)
downloaddotfiles-33aea3b41996356fd3a3974729545e8a895be197.tar.gz
dotfiles-33aea3b41996356fd3a3974729545e8a895be197.zip
Add a function to make quick links
Diffstat (limited to 'vim/after/ftplugin/html.vim')
-rw-r--r--vim/after/ftplugin/html.vim9
1 files changed, 9 insertions, 0 deletions
diff --git a/vim/after/ftplugin/html.vim b/vim/after/ftplugin/html.vim
new file mode 100644
index 00000000..c7bdfc7d
--- /dev/null
+++ b/vim/after/ftplugin/html.vim
@@ -0,0 +1,9 @@
+" Make a bare URL into a link to itself
+function! UrlLink()
+ normal ByE
+ 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>
+