3 ms·
Then here is a better example: $ find-file /ssh:foo@example.com:/opt/myfile.txt Emacs will open the remote file in a buffer local to your Emacs and you can ed
by mickeyp 9y ago
Then here is a better example:
$ find-file /ssh:foo@example.com:/opt/myfile.txt
Emacs will open the remote file in a buffer local to your Emacs and you can edit it as though it were a local file. When you save it's saved remotely, etc.
- rekado 9y agoHey mickey, thanks for "Mastering Emacs"! I'm glad I bought it. I recommend it to everyone having trouble making themselves comfortable in Emacs.
- mickeyp 9y agoThank you very much :)
- bjpbakker 9y agoCompletely agree! It came out just after I decided to ditch vim and use emacs. This book has helped me a whole lot with understanding emacs. Thank you vey much for this book Mickey!
- throwanem 9y agoSeconded - I've been using Emacs exclusively since 2009, and still find something worthwhile every time I dip into Mastering Emacs.
- gkya 9y agoAlso when you C-x C-f /ssh:x@y.com:/a/directory, it opens in dired and all the dired operations happen on the remote computer, including visiting files w/ RET. Also, from within that dired buffer, typing M-x shell RET starts a remote shell session. Dired w/ dired-hacks package is my main tool for interacting w/ projects. Also, IIRC, VC mode works nicely w/ tramp too, when editing remote files.
- oblio 9y agoI guess the SSH functionality is provided by ssh itself, or is there some SSH client built in to Emacs?
- mickeyp 9y agoEmacs uses external programs; it supports a multitude of protocols give you this transparent file access.
- auganov 9y agoEven better example, if you do say: $ *npm install whatever in a remote directory, it will actually execute the real thing on the server. So as long as you don't need to use ncurses based program etc. it's a good-enough ssh too. Though quite honestly I much prefer to just start emacs on the server, make 4 eshell windows and have it be my fancy tmux/screen. It feels inelegant when you first do it, but it's very liberating actually.