Created
January 13, 2012 15:21
-
-
Save nukino/1606941 to your computer and use it in GitHub Desktop.
[20120114-0021]_vimrc/OctopressにGist-tag貼り付け
This file contains 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
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{% gist " . mlist[1] . " %}" | |
return | |
endif | |
endif | |
endfunc | |
"コマンド | |
command! -nargs=0 PasteGist call <SID>paste_gist_tag() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment