feat(nvim): add netman for remote resource access

This commit is contained in:
Price Hiller 2024-01-10 14:36:44 -06:00
parent aa6af5408c
commit b9df79bce9
Signed by: Price
SSH Key Fingerprint: SHA256:Y4S9ZzYphRn1W1kbJerJFO6GGsfu9O70VaBSxJO7dF8
2 changed files with 42 additions and 0 deletions

View File

@ -5,20 +5,54 @@ return {
"nvim-tree/nvim-web-devicons",
"nvim-lua/plenary.nvim",
"MunifTanjim/nui.nvim",
"miversen33/netman.nvim"
},
cmd = "Neotree",
keys = {
{ "<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()
vim.g.neo_tree_remove_legacy_commands = 1
return {
sources = {
"filesystem",
"git_status",
"buffers",
"netman.ui.neo-tree",
},
source_selector = {
winbar = true,
sources = {
{
source = "filesystem",
},
{
source = "buffers",
},
{
source = "remote",
},
},
},
filesystem = {
use_libuv_file_watcher = true,
hijack_netrw_behavior = "open_current",
},
window = {
mappings = {

View File

@ -0,0 +1,8 @@
return {
{
"miversen33/netman.nvim",
config = function()
require("netman")
end
}
}