简体   繁体   English

在emacs中,使用neotree,如何在指向终止环的节点上提取节点的完整路径?

[英]in emacs, using neotree, how can I yank the full path of the node at point to the kill ring?

Suppose I'm using neotree in emacs, and suppose point lies above a node representing a file or a directory. 假设我在emacs中使用neotree,并且假设点位于表示文件或目录的节点上方。

how can I yank the full path of said node to the kill ring so that I can Cy this path afterwards? 我如何才能将所述节点的完整路径拖到杀死环,以便以后可以将此路径Cy占用?

How about using neo-buffer--get-filename-current-line to get the filename or directory at point (which is a STRING), and then using kill-new to make STRING the latest kill in the kill ring ? 如何使用neo-buffer--get-filename-current-line获取neo-buffer--get-filename-current-line点(即STRING)的文件名或目录,然后使用kill-new 使STRING成为kill环中的最新kill

The solution, when combined, looks like this: 组合后的解决方案如下所示:

(kill-new (neo-buffer--get-filename-current-line))

You can open the file, and then find the location via M-: 'buffer-file-name'. 您可以打开文件,然后通过M-查找位置:“ buffer-file-name”。 Since you wish to Yank it you can follow some of the approaches listed here: File path to clipboard in Emacs 由于您希望通过Yank进行操作,因此可以按照此处列出的一些方法进行操作: Emacs中剪贴板的文件路径

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

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