~duncan-bayne/setups

122a70e2b9808d3b6f02bcde4b8434a7f269ecb6 — Duncan Bayne 3 months ago 00c5a89
Add a utility to grab the current buffer relative pathname
1 files changed, 5 insertions(+), 0 deletions(-)

M emacs/emacs.d/001-utils.el
M emacs/emacs.d/001-utils.el => emacs/emacs.d/001-utils.el +5 -0
@@ 267,3 267,8 @@
  (interactive "nFont size: ")
  (set-face-attribute 'default nil :height font-size)
  (set-face-attribute 'linum nil :height font-size))

(defun utils/yank-buffer-project-filename ()
     "Put the current buffer's filename, relative to the current Git project directory, on the kill ring."
  (interactive)
  (kill-new (concat "/" (file-relative-name (buffer-file-name (current-buffer)) (magit-toplevel)))))