aboutsummaryrefslogtreecommitdiffstats
path: root/plugin/spec.vim
diff options
context:
space:
mode:
authorMatěj Cepl <mcepl@cepl.eu>2021-03-16 21:10:12 +0100
committerMatěj Cepl <mcepl@cepl.eu>2024-03-28 17:02:37 +0100
commitfd4b6f4870ff10351a85dbc1269ec9f542bac94f (patch)
tree16bdb3d02108303f47107c25e1767332b9a1731d /plugin/spec.vim
parent71109d5ed6aa057129fe11e3fd4e8420aeac377b (diff)
downloadvim-suse-changes-fd4b6f4870ff10351a85dbc1269ec9f542bac94f.tar.gz
fix(plugin): no netrw for gx.
Diffstat (limited to 'plugin/spec.vim')
-rw-r--r--plugin/spec.vim16
1 files changed, 15 insertions, 1 deletions
diff --git a/plugin/spec.vim b/plugin/spec.vim
index 6dc02dc..5583a29 100644
--- a/plugin/spec.vim
+++ b/plugin/spec.vim
@@ -1,5 +1,19 @@
noremap gG :,!abbrevURL<CR>
-" for netrw
+" 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>