xahlee / xah-fly-keys

the most efficient keybinding for emacs
http://xahlee.info/emacs/misc/xah-fly-keys.html
472 stars 80 forks source link

xah-copy-file-path should display the copied path #46

Closed divansantana closed 6 years ago

divansantana commented 6 years ago

Would be nice if xah-copy-file-path displayed the path to the file when you copy it to the "clipboard".

This is useful for when you want to see the full path to a file quick.

Spacemacs have this function which does that.

;; http://camdez.com/blog/2013/11/14/emacs-show-buffer-file-name/
(defun spacemacs/show-and-copy-buffer-filename ()
  "Show and copy the full path to the current file in the minibuffer."
  (interactive)
  ;; list-buffers-directory is the variable set in dired buffers
  (let ((file-name (or (buffer-file-name) list-buffers-directory)))
    (if file-name
        (message (kill-new file-name))
      (error "Buffer not visiting a file"))))

WDYT @xahlee

xahlee commented 6 years ago

thanks. nice suggestion. done. it was doing that but last month i removed thinking of reducing message clutter. now it's back.