feat(nvim): add netman for remote resource access
This commit is contained in:
parent
aa6af5408c
commit
b9df79bce9
@ -5,20 +5,54 @@ return {
|
|||||||
"nvim-tree/nvim-web-devicons",
|
"nvim-tree/nvim-web-devicons",
|
||||||
"nvim-lua/plenary.nvim",
|
"nvim-lua/plenary.nvim",
|
||||||
"MunifTanjim/nui.nvim",
|
"MunifTanjim/nui.nvim",
|
||||||
|
"miversen33/netman.nvim"
|
||||||
},
|
},
|
||||||
cmd = "Neotree",
|
cmd = "Neotree",
|
||||||
keys = {
|
keys = {
|
||||||
{ "<leader>nt", "<cmd>Neotree show toggle focus<cr>", desc = "Neotree: Toggle" },
|
{ "<leader>nt", "<cmd>Neotree show toggle focus<cr>", desc = "Neotree: Toggle" },
|
||||||
},
|
},
|
||||||
|
init = function()
|
||||||
|
-- Correctly hijack netrw, thanks to
|
||||||
|
-- https://github.com/nvim-neo-tree/neo-tree.nvim/issues/1247#issuecomment-1836294271
|
||||||
|
vim.api.nvim_create_autocmd("BufEnter", {
|
||||||
|
group = vim.api.nvim_create_augroup("NeoTreeInit", { clear = true }),
|
||||||
|
callback = function()
|
||||||
|
local f = vim.fn.expand("%:p")
|
||||||
|
if vim.fn.isdirectory(f) ~= 0 then
|
||||||
|
vim.cmd("Neotree current dir=" .. f)
|
||||||
|
-- neo-tree is loaded now, delete the init autocmd
|
||||||
|
vim.api.nvim_clear_autocmds { group = "NeoTreeInit" }
|
||||||
|
end
|
||||||
|
end
|
||||||
|
})
|
||||||
|
end,
|
||||||
opts = function()
|
opts = function()
|
||||||
vim.g.neo_tree_remove_legacy_commands = 1
|
vim.g.neo_tree_remove_legacy_commands = 1
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
sources = {
|
||||||
|
"filesystem",
|
||||||
|
"git_status",
|
||||||
|
"buffers",
|
||||||
|
"netman.ui.neo-tree",
|
||||||
|
},
|
||||||
source_selector = {
|
source_selector = {
|
||||||
winbar = true,
|
winbar = true,
|
||||||
|
sources = {
|
||||||
|
{
|
||||||
|
source = "filesystem",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
source = "buffers",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
source = "remote",
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
filesystem = {
|
filesystem = {
|
||||||
use_libuv_file_watcher = true,
|
use_libuv_file_watcher = true,
|
||||||
|
hijack_netrw_behavior = "open_current",
|
||||||
},
|
},
|
||||||
window = {
|
window = {
|
||||||
mappings = {
|
mappings = {
|
||||||
|
8
dots/.config/nvim/lua/plugins/configs/netman.lua
Normal file
8
dots/.config/nvim/lua/plugins/configs/netman.lua
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
return {
|
||||||
|
{
|
||||||
|
"miversen33/netman.nvim",
|
||||||
|
config = function()
|
||||||
|
require("netman")
|
||||||
|
end
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user