How to open remote files in sublime text 3

后端 未结 4 1045
既然无缘
既然无缘 2020-11-29 15:29

I am connecting to remote server using \"mRemoteNG\" and want to open remote server files in my local sublime text editor. During my research, I found this relevant blog htt

4条回答
  •  死守一世寂寞
    2020-11-29 16:04

    Base on this.

    Step by step:

    • On your local workstation: On Sublime Text 3, open Package Manager (Ctrl-Shift-P on Linux/Win, Cmd-Shift-P on Mac, Install Package), and search for rsub
    • On your local workstation: Add RemoteForward 52698 127.0.0.1:52698 to your .ssh/config file, or -R 52698:localhost:52698 if you prefer command line
    • On your remote server:

      sudo wget -O /usr/local/bin/rsub https://raw.github.com/aurora/rmate/master/rmate
      sudo chmod a+x /usr/local/bin/rsub
      

    Just keep your ST3 editor open, and you can easily edit remote files with

    rsub myfile.txt
    

    EDIT: if you get "no such file or directory", it's because your /usr/local/bin is not in your PATH. Just add the directory to your path:

    echo "export PATH=\"$PATH:/usr/local/bin\"" >> $HOME/.bashrc
    

    Now just log off, log back in, and you'll be all set.

提交回复
热议问题