aboutsummaryrefslogtreecommitdiff
path: root/vim/autoload/html/url.vim
blob: 99b4409e192e5f01cb22c1c632e88704a2137f24 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
" Make a bare URL into a link to itself
function! html#url#Anchor() abort

  " Yank this whole whitespace-separated word
  normal! yiW
  " Open a link tag
  normal! i<a href="">
  " Paste the URL into the quotes
  normal! hP
  " Move to the end of the link text URL
  normal! E
  " Close the link tag
  normal! a</a>

endfunction