             (format "%s%s#%d"
                     (file-name-nondirectory git-root)
                     (s-chop-prefix git-root path)
-                    (line-number-at-pos)))
-      (kill-new path)
-      (message "Copied: `%s'" path))))
+                    (line-number-at-pos))))))
+
+(def-with-selected-window my/mode-line-copy-file-name-in-repo ()
+  (let ((path (my/mode-line-get-file-name-in-repo)))
+    (kill-new path)
+    (message "Copied: `%s'" path)))
 
 (def-with-selected-window my/mode-line-open-folder ()
   (let* ((name (buffer-file-name))

     ["Copy filename in repo w/ line num" my/mode-line-copy-file-name-in-repo t]
     "---"
     ["Open in Finder" my/mode-line-open-folder]
     ["Open in Sublime" my/mode-line-open-in-sublime])))


;; Buffer name: click to copy

      (kill-new path)
      (message "Copied: `%s'" path))))

(defun my/mode-line-get-file-name-in-repo ()
  (let* ((path buffer-file-name)
         (git-root (shell-command-to-string "git rev-parse --show-toplevel 2> /dev/null")))
    (setq git-root (s-trim git-root))
