简体   繁体   English

Emacs Tramp-将建议的路径添加到TRAMP

[英]Emacs Tramp - add proposed paths to TRAMP

I use the following method to connect to a remote host via emacs TRAMP : 我使用以下方法通过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. 它工作得很好, remotehost可以是我的ssh别名之一。 However I still have to navigate the whole path for the filename , which can be quite long. 但是,我仍然必须浏览filename的整个路径,这可能会很长。

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 ? 打开到特定主机的新TRAMP / ssh连接时,是否可以设置默认路径(如默认cd )在列表中预先填充/建议(例如,如果存在)?

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 注意:我在使用Emacs前奏以防万一

You might navigate to your complete path, open a dired buffer, then save that as a bookmark (Cx rm). 您可以导航到完整路径,打开干燥的缓冲区,然后将其另存为书签(Cx rm)。 The next time you want to go there, just use the bookmark (Cx rb). 下次您要去那里时,只需使用书签(Cx rb)。

The Tramp manual explains in its FAQ section several ways to shorten paths. Tramp手册在“常见问题”部分解释了几种缩短路径的方法。 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") 评估(info "(tramp) Frequently Asked Questions")

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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