Description
Description
I'm using nosduco/remote-sshfs.nvim
to work remotely over sshfs.
nvim-tree
doesn't show anything from the mounted folder on the server, however, you can perform edit operations from nvim-tree
directly, such as creating a new file (see image, I basically pressed a
on top of the folder in nvim-tree panel).
I checked on server and the file was indeed created.
Thanks
Neovim version
NVIM v0.10.0
Build type: Release
LuaJIT 2.1.1716656478
"nvim-tree.lua": { "branch": "master", "commit": "517e4fbb9ef3c0986da7047f44b4b91a2400f93c" }
Operating system and version
macOS Sonoma 14.5 (23F79)
Windows variant
No response
nvim-tree version
{ "branch": "master", "commit": "517e4fbb9ef3c0986da7047f44b4b91a2400f93c" }
Clean room replication
vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1
vim.cmd [[set runtimepath=$VIMRUNTIME]]
vim.cmd [[set packpath=/tmp/nvt-min/site]]
local package_root = "/tmp/nvt-min/site/pack"
local install_path = package_root .. "/packer/start/packer.nvim"
local function load_plugins()
require("packer").startup {
{
"wbthomason/packer.nvim",
"nvim-tree/nvim-tree.lua",
"nvim-tree/nvim-web-devicons",
-- ADD PLUGINS THAT ARE _NECESSARY_ FOR REPRODUCING THE ISSUE
'nosduco/remote-sshfs.nvim',
"nvim-telescope/telescope.nvim", branch = "0.1.x",
"nvim-lua/plenary.nvim",
},
config = {
package_root = package_root,
compile_path = install_path .. "/plugin/packer_compiled.lua",
display = { non_interactive = true },
},
}
end
if vim.fn.isdirectory(install_path) == 0 then
print "Installing nvim-tree and dependencies."
vim.fn.system { "git", "clone", "--depth=1", "https://github.com/wbthomason/packer.nvim", install_path }
end
load_plugins()
require("packer").sync()
vim.cmd [[autocmd User PackerComplete ++once echo "Ready!" | lua setup()]]
vim.opt.termguicolors = true
vim.opt.cursorline = true
-- MODIFY NVIM-TREE SETTINGS THAT ARE _NECESSARY_ FOR REPRODUCING THE ISSUE
_G.setup = function()
require("nvim-tree").setup {}
require('remote-sshfs').setup {
connections = {
ssh_configs = { -- which ssh configs to parse for hosts list
vim.fn.expand "$HOME" .. "/.ssh/config",
"/etc/ssh/ssh_config",
},
sshfs_args = { -- arguments to pass to the sshfs command
"-o reconnect",
"-o auto_cache",
"-o Ciphers=aes128-ctr",
"-o ConnectTimeout=5",
"-C",
"-o cache_timeout=60",
"-o cache=yes",
},
},
mounts = {
base_dir = vim.fn.expand "$HOME" .. "/.sshfs/", -- base directory for mount points
unmount_on_exit = true, -- run sshfs as foreground, will unmount on vim exit
},
handlers = {
on_connect = {
change_dir = true, -- when connected change vim working directory to mount point
},
on_disconnect = {
clean_mount_folders = false, -- remove mount point folder on disconnect/unmount
},
on_edit = {}, -- not yet implemented
},
ui = {
select_prompts = false, -- not yet implemented
confirm = {
connect = true, -- prompt y/n when host is selected to connect to
change_dir = false, -- prompt y/n to change working directory on connection (only applicable if handlers.on_connect.change_dir is enabled)
},
},
log = {
enable = false, -- enable logging
truncate = false, -- truncate logs
types = { -- enabled log types
all = false,
util = false,
handler = false,
sshfs = false,
},
},
}
require('telescope').setup {}
end
-- UNCOMMENT this block for diagnostics issues, substituting pattern and cmd as appropriate.
-- Requires diagnostics.enable = true in setup.
--[[
vim.api.nvim_create_autocmd("FileType", {
pattern = "lua",
callback = function()
vim.lsp.start { cmd = { "lua-language-server" } }
end,
})
]]
Steps to reproduce
1. nvim -nu /tmp/nvt-min.lua
2. :RemoteSSHFSConnect (pick server; have it listed in your ~/.ssh/config)
3. :NvimTreeOpen
4. expand the mounted folder (should be ~ on your server)
Expected behavior
List all files, directories, normal navigation as one would have locally.