Browse Source

vim-sanegx: tiny plugin which deals with more use cases to the netrw_gx bug (#479)

rmagillxyz 4 năm trước cách đây
mục cha
commit
6211202ce6
3 tập tin đã thay đổi với 3 bổ sung4 xóa
  1. 0 3
      lua/keymappings.lua
  2. 3 0
      lua/plugins.lua
  3. 0 1
      lua/settings.lua

+ 0 - 3
lua/keymappings.lua

@@ -48,9 +48,6 @@ vim.api.nvim_set_keymap('x', 'J', ':move \'>+1<CR>gv-gv', {noremap = true, silen
 vim.cmd('inoremap <expr> <c-j> (\"\\<C-n>\")')
 vim.cmd('inoremap <expr> <c-k> (\"\\<C-p>\")')
 
--- fix to get netrw's gx command to work correctly
-vim.api.nvim_set_keymap('n', 'gx', ":call netrw#BrowseX(expand((exists('g:netrw_gx')? g:netrw_gx : '<cfile>')),netrw#CheckIfRemote())<cr>", {noremap = true, silent = true})
-
 vim.cmd('vnoremap p "0p')
 vim.cmd('vnoremap P "0P')
 -- vim.api.nvim_set_keymap('v', 'p', '"0p', {silent = true})

+ 3 - 0
lua/plugins.lua

@@ -89,6 +89,9 @@ return require("packer").startup(function(use)
     -- Zen Mode
     use {"Pocco81/TrueZen.nvim", opt = true}
 
+		-- Sane gx for netrw_gx bug
+    use {"felipec/vim-sanegx"}
+
     require_plugin("nvim-lspconfig")
     require_plugin("lspsaga.nvim")
     require_plugin("nvim-lspinstall")

+ 0 - 1
lua/settings.lua

@@ -35,7 +35,6 @@ vim.o.updatetime = 300 -- Faster completion
 vim.o.timeoutlen = O.timeoutlen -- By default timeoutlen is 1000 ms
 vim.o.clipboard = "unnamedplus" -- Copy paste between vim and everything else
 vim.g.nvim_tree_disable_netrw = O.nvim_tree_disable_netrw -- enable netrw for remote gx gf support (must be set before plugin's packadd)
-vim.g.loaded_netrwPlugin = 1 -- needed for netrw gx command to open remote links in browser
 vim.cmd('filetype plugin on') -- filetype detection
 -- vim.o.guifont = "JetBrainsMono\\ Nerd\\ Font\\ Mono:h18"
 -- vim.o.guifont = "Hack\\ Nerd\\ Font\\ Mono"