From 6e60475f3f956ee4b7a2a2deea47f44d9676ed9a Mon Sep 17 00:00:00 2001 From: jdhao Date: Fri, 16 Aug 2024 00:02:24 +0200 Subject: [PATCH] Use gx.nvim for browsing in Browser --- lua/plugin_specs.lua | 11 +++++++++-- viml_conf/plugins.vim | 11 ----------- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/lua/plugin_specs.lua b/lua/plugin_specs.lua index 9620024..8230e06 100644 --- a/lua/plugin_specs.lua +++ b/lua/plugin_specs.lua @@ -223,7 +223,12 @@ local plugin_specs = { -- For Windows and Mac, we can open an URL in the browser. For Linux, it may -- not be possible since we maybe in a server which disables GUI. { - "tyru/open-browser.vim", + "chrishrb/gx.nvim", + keys = { { "gx", "Browse", mode = { "n", "x" } } }, + cmd = { "Browse" }, + init = function() + vim.g.netrw_nogx = 1 -- disable netrw gx + end, enabled = function() if vim.g.is_win or vim.g.is_mac then return true @@ -231,7 +236,9 @@ local plugin_specs = { return false end end, - event = "VeryLazy", + dependencies = { "nvim-lua/plenary.nvim" }, + config = true, -- default settings + submodules = false, -- not needed, submodules are required only for tests }, -- Only install these plugins if ctags are installed on the system diff --git a/viml_conf/plugins.vim b/viml_conf/plugins.vim index f7c202b..9b223a6 100644 --- a/viml_conf/plugins.vim +++ b/viml_conf/plugins.vim @@ -113,17 +113,6 @@ let g:Lf_PreviewResult = { \ 'Gtags': 0 \} -""""""""""""""""""""""""""""open-browser.vim settings""""""""""""""""""" -if g:is_win || g:is_mac - " Disable netrw's gx mapping. - let g:netrw_nogx = 1 - - " Use another mapping for the open URL method - nmap ob (openbrowser-smart-search) - xmap ob (openbrowser-smart-search) - nmap ob echoerr "Use ob instead!" -endif - """"""""""""""""""""""""""" vista settings """""""""""""""""""""""""""""""""" let g:vista#renderer#icons = { \ 'member': '',