aboutsummaryrefslogtreecommitdiffstats
path: root/plugin/spec.vim
blob: 5583a29f715fecc36c36c427a7b97569e4128027 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
noremap gG :,!abbrevURL<CR>

" Doesn't work because of gh#vim/vim#4738
let g:netrw_browsex_viewer='setsid osurl'

" This is just temporary workaround until the above issue is truly
" resolved.
function! OpenURLUnderCursor()
  let s:uri = expand('<cword>')
  echom "s:uri = " . s:uri
  " let s:uri = matchstr(getline('.'), '[a-z]*(:\/\/\|#)[^ >,;()]*')
  " let s:uri = shellescape(s:uri, 1)
  " echom "s:uri = " . s:uri
  if s:uri != ''
    silent exec "!osurl '".s:uri."'"
    :redraw!
  endif
endfunction
nnoremap gx :call OpenURLUnderCursor()<CR>