add open-browser.vim to fix broken netrw gx
This commit is contained in:
parent
5015d31b2e
commit
ad3c395dca
19
vim/vimrc
19
vim/vimrc
@ -40,6 +40,8 @@ call plug#begin(pluginDir)
|
|||||||
Plug 'tpope/vim-eunuch'
|
Plug 'tpope/vim-eunuch'
|
||||||
Plug 'tpope/vim-repeat'
|
Plug 'tpope/vim-repeat'
|
||||||
Plug 'editorconfig/editorconfig-vim'
|
Plug 'editorconfig/editorconfig-vim'
|
||||||
|
"browser/url opener
|
||||||
|
Plug 'tyru/open-browser.vim'
|
||||||
"git
|
"git
|
||||||
Plug 'tpope/vim-fugitive'
|
Plug 'tpope/vim-fugitive'
|
||||||
"visual
|
"visual
|
||||||
@ -68,8 +70,14 @@ let g:netrw_liststyle = 3
|
|||||||
let g:netrw_preview = 1
|
let g:netrw_preview = 1
|
||||||
let g:netrw_alto = 0
|
let g:netrw_alto = 0
|
||||||
let g:netrw_usetab = 1
|
let g:netrw_usetab = 1
|
||||||
|
let g:netrw_browsex_viewer = "xdg-open"
|
||||||
let g:NetrwIsOpen = 0 "for toggle function
|
let g:NetrwIsOpen = 0 "for toggle function
|
||||||
|
|
||||||
|
"netrw gx is borked and open-browser is way better
|
||||||
|
let g:netrw_nogx = 1
|
||||||
|
nmap gx <Plug>(openbrowser-smart-search)
|
||||||
|
vmap gx <Plug>(openbrowser-smart-search)
|
||||||
|
|
||||||
"ale
|
"ale
|
||||||
let g:ale_linters = {
|
let g:ale_linters = {
|
||||||
\ 'javascript': ['prettier', 'eslint'],
|
\ 'javascript': ['prettier', 'eslint'],
|
||||||
@ -239,9 +247,6 @@ command! Q q
|
|||||||
command! WQ wq
|
command! WQ wq
|
||||||
command! Q1 q!
|
command! Q1 q!
|
||||||
|
|
||||||
"function calls
|
|
||||||
command! -nargs=+ SearchGoogle call SearchGoogle(join([<f-args>]))
|
|
||||||
|
|
||||||
"general functions
|
"general functions
|
||||||
"-----------------
|
"-----------------
|
||||||
"toggle functions
|
"toggle functions
|
||||||
@ -289,14 +294,6 @@ function! ToggleNetrw() "make netrw toggleable <https://vi.stackexchange.com/que
|
|||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
"search functions
|
|
||||||
function! SearchGoogle(string)
|
|
||||||
let l:google = "https://www.google.com/search?q="
|
|
||||||
let l:browser = "xdg-open >/dev/null 2>/dev/null"
|
|
||||||
let l:query = substitute(join(split(a:string),"+"),'"',"","g")
|
|
||||||
execute "!" l:browser . "\ " . l:google . l:query
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
"syntax/filetype
|
"syntax/filetype
|
||||||
"---------------
|
"---------------
|
||||||
syntax on
|
syntax on
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user