Giter VIP home page Giter VIP logo

Comments (3)

fdschmidt93 avatar fdschmidt93 commented on May 27, 2024 1

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.

fdschmidt93 avatar fdschmidt93 commented on May 27, 2024

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.

miversen33 avatar miversen33 commented on May 27, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.