简体   繁体   中英

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.

how can I yank the full path of said node to the kill ring so that I can Cy this path afterwards?

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 ?

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'. Since you wish to Yank it you can follow some of the approaches listed here: File path to clipboard in Emacs

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