Follow/Open url in floating window #3123
-
I'd love to be able to open a url embedded in the docs of a given object: |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
My key-mappings to open url: nnoremap <silent> <leader>o :call <SID>Open()<CR>
function! s:Open()
let res = CocAction('openLink')
if res | return | endif
let line = getline('.')
" match url
let url = matchstr(line, '\vhttps?:\/\/[^)\]''" ]+')
if !empty(url)
let output = system('open '. url)
else
let mail = matchstr(line, '\v([A-Za-z0-9_\.-]+)\@([A-Za-z0-9_\.-]+)\.([a-z\.]+)')
if !empty(mail)
let output = system('open mailto:' . mail)
else
let output = system('open ' . expand('%:p:h'))
endif
endif
if v:shell_error && output !=# ""
echoerr output
endif
endfunction you can jump to float window of neovim, but not popup of vim. |
Beta Was this translation helpful? Give feedback.
-
I use https://github.com/tyru/open-browser.vim but @chemzqm 's solution is better: it directly opens the link if the symbol under the cursor has a doc! |
Beta Was this translation helpful? Give feedback.
-
do you mean like hovering over the URL and pressing |
Beta Was this translation helpful? Give feedback.
My key-mappings to open url:
you can jump to float window of neovim, but not popup of vim.