summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2015-10-19 00:51:57 -0400
committerKyle Meyer <kyle@kyleam.com>2015-10-19 00:51:57 -0400
commit71c7636bc27d1fe1acbde3fff1a4e28079830074 (patch)
tree09e90b9b2f1761c9d18941710b0240940a970afd
parente5abe3d7cd34fe63045148de7ed9048fce03dce9 (diff)
downloademacs.d-71c7636bc27d1fe1acbde3fff1a4e28079830074.tar.gz
Add touch buffer file command
-rw-r--r--lisp/init-files.el8
1 files changed, 8 insertions, 0 deletions
diff --git a/lisp/init-files.el b/lisp/init-files.el
index ddfa001..afff9d1 100644
--- a/lisp/init-files.el
+++ b/lisp/init-files.el
@@ -63,6 +63,13 @@
(dired-jump 'other-window (expand-file-name file))
(user-error "No file at point"))))
+(defun km/touch-buffer-file ()
+ "Run touch on `buffer-file-name'."
+ (interactive)
+ (call-process "touch" nil nil nil
+ (or (buffer-file-name (buffer-base-buffer))
+ (user-error "Not visiting file"))))
+
(defun km/write-file ()
"Run `write-file'.
Use the current file name as initial input of prompt."
@@ -84,6 +91,7 @@ Use the current file name as initial input of prompt."
(define-key km/file-map "R" 'km/find-file-as-root)
(define-key km/file-map "n" 'km/rename-current-buffer-file)
(define-key km/file-map "l" 'nlines-run-command)
+(define-key km/file-map "t" 'km/touch-buffer-file)
(define-key km/file-map "v" 'view-file)