Comments (3)
Sorry for the late reply.
In brief: As you've mentioned, plenary.nvim
in all likelihood just fails when working via remote and with it, pretty much anything useful from telescope-file-browser
. I'm also not necessarily convinced that running commands etc remotely is the way to go as that's always going to be overhead on the user (install required binaries) and doesn't necessarily integrate well with other plugins.
One things that comes to mind, that (at least for Unix users), could be very easily and seamlessly wrapped is rsync
.
In other words, https://github.com/KenN7/vim-arsync with the full lua treatment once lua autocommands land could be very ergonomous. Then you could rsync remote to local /tmp
or project folder, respectively, have a session manager with json files (thanks to vim.json
, etc.), and so forth. Very fast and since everything is local, almost everything just works.
On top of that you could probably integrate nvim-dap
and neovim terminal to integrate remote execution.
Maybe I'd work on that once lua autocommands land. It just feels like the most universal solution, as opposed to rather idiosyncratic solutions that impose other constraints (distant
seems super cool, but extra binaries and stuff).
In any case, I'm afraid closing. From a telescope-file-browser
perspective it's just out of scope.
from telescope-file-browser.nvim.
As cool as that feature would be, it sounds largely out of scope of the project, or otherwise put, sad to say I'm not the right person for the job.
I've never used netrw (isn't it mostly unusably slow?) for that matter and on the few ssh connections I maintain every once in a while synchronize my dotfiles.
What would be a way to support this feature it the lightest way possible?
In a perfect world, we would be able to open a remote filesystem via neovim directly (which would use netrw) and then browse/manage said filesystem via the telescope-file-browser plugin
That would be nice indeed.
from telescope-file-browser.nvim.
I'm not terribly familiar with lua (or neovim development) but I was able to get a (very) jank finder in place as a sort of POC to show it is possible. Below is the (awful) lua code I used. I am going to poke around a bit with this this weekend and see if I can
a) Make it actually usable (it appears I am going to have to poke around with NetRW global variables and path reading)
b) Clean it up so it doesn't look awful.
There are also some design questions that should be asked. Namely
- How do you/we/the user want to designate they are searching a remote filesystem? The reason the
nvim-telescope
plugin doesn't currently work for remote filesystems is because it uses the Plenary Path tool which is designed explicitly for local file systems. On that note, if a user opens the nvim-telescope extension, should the decision to examine a remote filesystem be based on the "cwd" (which vim doesn't track if you are remote) or the current file they are in? Or should it be its own finder altogether (my recommendation).
Some jank lua code as a POC
local pickers = require("telescope.pickers")
local finders = require("telescope.finders")
local conf = require("telescope.config").values
local sys = require("plenary.job")
--- TESTED AND WORKS
local user = ""
local host = ""
local remote_command = "ssh"
local remote_args = { "" .. user .. "@" .. host, "ls","/tmp" }
local get_remote_files = function()
local job = sys:new({
command = remote_command,
args = remote_args,
})
job:start()
job:join()
return job:result()
end
local create_remote_finder = function(opts)
opts = opts or {}
pickers.new(opts, {
prompt_tile = "Remote Files",
finder = finders.new_table({
results = get_remote_files()
}),
sorter = conf.generic_sorter(opts)
}):find()
end
create_remote_finder()
My current recommendation is (if this is implemented) that you check the current open file to see if it starts with sftp://
or scp://
and if it does, you select a new finder with the remote search ability.
from telescope-file-browser.nvim.
Related Issues (20)
- `goto_parent_dir` is not reliable HOT 2
- Indicator for modified files within git submodule directory? HOT 4
- Incorrect Parent Folder Name When Moving Folders HOT 13
- File browsing too slow in large git repository HOT 2
- Navigate to specified path HOT 4
- [question] Custom command for `remove` action? HOT 2
- Getting Error when using a dot in file path cwd `cwd = "~/.config/"` ERROR:'replacement string' item co ntains newline' HOT 4
- [question] Creating `file_browser._picker` with custom setup HOT 3
- Searching for a file suddenly works quite different HOT 2
- files = true opt for picker = freeze / 100% CPU load HOT 4
- add windows to ci HOT 1
- (question): how to disable search bar HOT 2
- Option to flatten/collapse empty directories HOT 1
- fzf as THE search engine for faster results pasing HOT 5
- Wrong path is used in Windows when %HOMEDRIVE% points to other drive
- Do not create files on empty result HOT 2
- Toggle between directory-selection mode and live_grep/file_find mode in `path` HOT 1
- [question] How to keep `cwd` at project root? HOT 3
- [feature request] copy file on y, go to the desired dir, paste on p HOT 1
- File Browser won't work if there is a dir named github.com like "~/go/src/github.com/KRook/app/" HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from telescope-file-browser.nvim.