]> git.bundesbrandschatzamt.de Git - emacsconfig.git/commitdiff
added bba-copy-buffer-name
authorAndreas Gerler <baronNOSPAMbundesbrandschatzamt.de>
Tue, 5 Jan 2016 18:56:59 +0000 (19:56 +0100)
committerAndreas Gerler <baronNOSPAMbundesbrandschatzamt.de>
Tue, 5 Jan 2016 18:56:59 +0000 (19:56 +0100)
- copy buffer file name to kill ring.

bba.org

diff --git a/bba.org b/bba.org
index df03fcbee4676e3cbe341e10e8d3b197397d0bde..538876f52dd5da91ab93cce4de82898a56ef81c1 100644 (file)
--- a/bba.org
+++ b/bba.org
@@ -1857,6 +1857,18 @@ safe files with #! in first line as user executable.
 
 #+END_SRC
 
+* copy buffer file name to kill ring
+
+Sometimes you need the filename of your current buffer on the command
+line or somewhere else.
+
+#+BEGIN_SRC emacs-lisp
+  (defun bba-copy-buffer-name ()
+    (interactive)
+    (kill-new (buffer-file-name)))
+#+END_SRC
+
+
 * ggtags
 
 Configure [[https://github.com/leoliu/ggtags][ggtags]] and [[https://github.com/syohex/emacs-helm-gtags][helm-gtags]] to use [[https://www.gnu.org/software/global/][GNU Global]].