I’ve been working in a Docker lab environment with several CentOS minimal installations. I am editing Docker Stack YAML files, and I’ve gotten too used to my
vi setup (actually,
spacevim)– so when I invoke
vi I’m shocked at the barbarous lack of color coding! Heathen!
Well, I knew I could invoke
vi remotely, but nevery really did it (or if I did, I know I forgot). But it’s so simple! You can do this a couple of ways– you can mount the remote host with FUSE and SSHFS, but that’s seems to be a hammer problem when you have a screw (of the “Everything looks like a nail when you have a hammer” fame). I wanted something with a little more finesse.
Answer? Simple! vi scp://<user>@<host>//<directory>/<filename>
Once you authenticate, you’re in like Flynn! The only thing you may run into is the ‘buftype’ might be set (e.g.,
E382: Cannot write, 'buftype' option is set). If so, just enter
vi‘s set buftype command
:set buftype=" ".
See the terminal capture below (even if the typing is a little slow).