tamago324 / lir.nvim

Neovim file explorer

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Advice on implementing plugin integration

chipsenkbeil opened this issue · comments

Hi! Wanted to reach out as I'm looking into adding lir.nvim support to distant.nvim in the near future. Do you have any recommendations on the best practices for altering how lir accesses the filesystem? My integration would want to change how lir reads, opens, etc.

What is distant?

My plugin's goal is to enable listing, creating, deleting, and editing files remotely on another machine from the comfort of neovim. Rather than netrw's scp approach, this actually runs a small program I've written called distant that listens for encrypted commands. I've gotten most of the functions working now in the plugin, so I'm looking to spruce it up by integrating some of the plugins I use on my local machine.

What am I trying to do?

While I could have lir's settings specify equivalent actions that act on the remote machine, I want to be able to distinguish lir operating locally (like it does today) versus remotely with distant. E.g. if I start lir with some flag that it's using the remote machine, then all of the actions would be through distant whereas if I start lir without that flag then it works as normal

I've got the plugin working fine standalone, but still trying to figure out how best to integrate with lir.nvim. At the moment, lir and distant compete with one another because lir takes over any buffer than can be evaluated as a directory. This means opening a remote directory like /tmp that is also on the local machine results in lir consuming distant's directory buffer, renaming the filetype, and overwriting the mappings if they're the same.

Ideally, I'd like to have lir be able to use the file and directory information that distant can provide. In the short term, #44 would be nice to at least keep the two plugins separated.

Thoughts, @tamago324?

I tried writing a wrapper method that would call a different action depending on whether or not the buffer represented a remote or local directory. While the action works, the buffer still gets overwritten by lir loading in the local directory if it exists and replacing distant's list of remote contents.

image

Closing out due to lack of activity.