The function to show current file's full path in mini buffer

前端 未结 12 501
醉梦人生
醉梦人生 2020-12-12 11:58

I need to get the full path of the file that I\'m editing with emacs.

  • Is there a function for that?
  • If not, what would be the elisp function for getti
12条回答
  •  误落风尘
    2020-12-12 12:20

    The simplest way and would be

    (buffer-name)<(C-x)(C-e)> for the file name to appear in the echo area
    
    (buffer-name)<(C-u)(C-x)(C-e)> would print the location 
    

    Borrowing from Trey Jackson I came up with this:

    (defun buffer-kill-path ()
      "copy buffer's full path to kill ring"
      (interactive)
      (kill-new (buffer-file-name)))
    

    You can find more information on site

提交回复
热议问题