Created
November 3, 2013 09:06
-
-
Save syui/7288263 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" GistPaste | |
" Gistへの投稿後、「:GistPaste」で投稿のHTMLタグを貼り付け | |
" http://nukino.github.com/blog/2012/01/16/gist_vim/ | |
func! s:paste_gist_tag() | |
let mx = 'http[s]\?://gist.github.com/\([0-9]\+\)' | |
" +または"レジスタの中身を検索する | |
let regs = [@+,@"] | |
for r in regs | |
let mlist = matchlist(r, mx) | |
if ( len(mlist) > 2 ) | |
"カーソル行に挿入 | |
exe "normal! O<script src='https://gist.github.com/" . mlist[1] . ".js'></script>" | |
return | |
endif | |
endif | |
endfunc | |
command! -nargs=0 GistPaste call <sid>paste_gist_tag() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment