1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-01-24 02:40:05 +08:00
SpaceVim/config/plugins/open-browser.vim
2021-01-02 18:00:51 +08:00

22 lines
1.1 KiB
VimL

let g:netrw_nogx = get(g:, 'netrw_nogx', 1) " disable netrw's gx mapping.
" Open URI under cursor.
nmap go <Plug>(openbrowser-open)
" Open selected URI.
vmap go <Plug>(openbrowser-open)
" Search word under cursor.
nmap gs <Plug>(openbrowser-search)
" Search selected word.
vmap gs <Plug>(openbrowser-search)
" If it looks like URI, Open URI under cursor.
" Otherwise, Search word under cursor.
nmap gx <Plug>(openbrowser-smart-search)
" If it looks like URI, Open selected URI.
" Otherwise, Search selected word.
vmap gx <Plug>(openbrowser-smart-search)
" vnoremap gob :OpenBrowser https://www.baidu.com/s?wd=<C-R>=expand("<cword>")<cr><cr>
" nnoremap gob :OpenBrowser https://www.baidu.com/s?wd=<C-R>=expand("<cword>")<cr><cr>
" vnoremap gog :OpenBrowser https://www.google.com/?#newwindow=1&q=<C-R>=expand("<cword>")<cr><cr>
" nnoremap gog :OpenBrowser https://www.google.com/?#newwindow=1&q=<C-R>=expand("<cword>")<cr><cr>
" vnoremap goi :OpenBrowserSmartSearch http://www.iciba.com/<C-R>=expand("<cword>")<cr><cr>
" nnoremap goi :OpenBrowserSmartSearch http://www.iciba.com/<C-R>=expand("<cword>")<cr><cr>