Created
May 9, 2011 15:05
-
-
Save tyru/962695 to your computer and use it in GitHub Desktop.
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
function! HandleURI() | |
let s:uri = matchstr(getline("."), '[a-z]*:\/\/[^ >,;:]*') | |
echo s:uri | |
if s:uri != "" | |
exec "!open \"" . s:uri . "\"" | |
else | |
echo "No URI found in line." | |
endif | |
endfunction | |
map <Leader>w :call HandleURI()<CR> |
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
function! s:HandleURI() | |
let uri = matchstr(getline("."), '[a-z]*:\/\/[^ >,;:]*') | |
echo uri | |
if uri != "" | |
exec "!open \"" . uri . "\"" | |
else | |
echo "No URI found in line." | |
endif | |
endfunction | |
nnoremap <Leader>w :<C-u>call <SID>HandleURI()<CR> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
あれ、いつのまにか2個のファイルができてる。なんでだろ。