Is there a way, in the buffer launched from helm-find-files, to copy a file path to the kill ring?
2 Answers
Try C-c TAB when you have the file highlighted. This will yank the path into the current buffer, which might be an undesired side effect, but as long as you do helm-find-files from the buffer you want to use it in, you should be fine.
- The key binding of
helm-copy-to-bufferisC-c C-i, however,C-c TABworks as well (though I don't know why).xuchunyang– xuchunyang2016-01-26 03:58:52 +00:00Commented Jan 26, 2016 at 3:58 - @xuchunyang hmm, now that you mention it I see in
helm.elthathelm-copy-to-bufferis indeed bound toC-c C-i, buthelm-helplists the binding asC-c TABwith no mention ofC-c C-i...elethan– elethan2016-01-26 04:20:59 +00:00Commented Jan 26, 2016 at 4:20 - 2I see: Emacs doesn't distinguish between
C-iandTABaccording to emacs.stackexchange.com/questions/17509/…xuchunyang– xuchunyang2016-01-26 04:34:41 +00:00Commented Jan 26, 2016 at 4:34 - @xuchunyang Ha! That is interesting! Thanks for pointing this out.elethan– elethan2016-01-26 04:36:14 +00:00Commented Jan 26, 2016 at 4:36
- 1This copies the absolute path - is there some way to copy the relative path?Chris Stryczynski– Chris Stryczynski2018-11-15 15:09:10 +00:00Commented Nov 15, 2018 at 15:09
If yanking the path into the current buffer is not acceptable, use C-u C-c C-k, which invokes helm-kill-selection-and-quit.
From the documentation of helm-kill-selection-and-quit:
Store display value of current selection to kill ring. With a prefix arg set to real value of current selection. Display value is what you see in `helm-buffer' and real value is what is used to perform actions.
Tested using helm 1.9.1.
- Nice, I thought about adding
helm-kill-selection-and-quit, but I thought it just gave you the file name. I didn't realize that with a prefix argument you get the path!elethan– elethan2016-01-26 02:33:52 +00:00Commented Jan 26, 2016 at 2:33 - 2This works, but how would anyone ever find this!GaryO– GaryO2020-01-21 20:52:06 +00:00Commented Jan 21, 2020 at 20:52