Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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>
Add Comment
Please, Sign In to add comment