justinmk / vim-dirvish

Directory viewer for Vim :zap:
Other
1.18k stars 64 forks source link

Using dirvish with scp / remote #62

Open krruzic opened 7 years ago

krruzic commented 7 years ago

Maybe I'm just stupid (I'm pretty new to vim in general) but when running dirvish with a file open via scp, it doesn't work. Support for this would be nice

(in case you want the error): dirvish: invalid directory: 'scp://redacted@server.tld/current/path'

hauleth commented 7 years ago

In general support for scp comes from netrw. If I could suggest something then try sshfs instead of scp or some kind of filewatcher with rsync instead, should work better in general.

justinmk commented 7 years ago

As mentioned by @hauleth, FUSE/sshfs provides an abstraction at the filesystem layer (as opposed to some other "middleware"), so that any dumb local navigator (like drivish) works without adding special-case support for scp, FTP, webdav, ..., as netrw does.

It might be interesting to use a strategy pattern as dispatch.vim does, so that remote operations are exposed to dirvish in a normalized way. Authentication is the most annoying part of this.

krruzic commented 7 years ago

Thanks, I'll check out those other methods. The reason I asked is netrw does it very smoothly.

bounceme commented 7 years ago

w3m -dump file://$PWD works, using the generic protocol approach, so it would in theory work for any url supported by w3m. that introduces a dependency though, and many probable issues, and is just useless info for the most part

bounceme commented 7 years ago

lynx -dump -nonumbers file://$PWD lynx actually works well, not adding formatting and html nonsense

bounceme commented 7 years ago

i got dirvish to work using the file:// protocol with lynx, as opposed to glob(). the bad part is that there is a lot of code which makes isdirectory() isreadable() calls, which obviously fail with :Dirvish ftp://user:pass@host

bounceme commented 7 years ago

86 shows the barebones implementation. i've only tested on a local ftp server

justinmk commented 6 years ago

see also https://github.com/bounceme/remote-viewer

bounceme commented 6 years ago

good progress with ^^. still depends on an awful hack though: https://github.com/bounceme/remote-viewer/blob/master/plugin/remotedir.vim#L78