From 71c7636bc27d1fe1acbde3fff1a4e28079830074 Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Mon, 19 Oct 2015 00:51:57 -0400 Subject: Add touch buffer file command --- lisp/init-files.el | 8 ++++++++ 1 file changed, 8 insertions(+) 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) -- cgit v1.2.3