简体   繁体   中英

Emacs Tramp - add proposed paths to TRAMP

I use the following method to connect to a remote host via emacs TRAMP :

C-x C-f /remotehost:filename  RET (or /method:user@remotehost:filename)

It works great, and remotehost can be one of my ssh aliases. However I still have to navigate the whole path for the filename , which can be quite long.

Is there a way to set up a default path (like a default cd ) that would be pre-filled/proposed in the list (if existing for instance) when opening a new TRAMP/ssh connection to a particular host ?

Example :

C-x C-f /work-host:/
;; auto complete suggests some files, how do I suggest another file/path ?

Note : I am using Emacs prelude in case it matters

You might navigate to your complete path, open a dired buffer, then save that as a bookmark (Cx rm). The next time you want to go there, just use the bookmark (Cx rb).

The Tramp manual explains in its FAQ section several ways to shorten paths. It's not exactly what you have asked for, but maybe it gives you some imagination what could be done.

Eval (info "(tramp) Frequently Asked Questions")

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM