Add functions+shortcuts to insert the filename into the buffer.
This commit is contained in:
@ -125,5 +125,15 @@ If PROJECT is not specified, assume current project root."
|
||||
"Check if font with FONT-NAME is available."
|
||||
(find-font (font-spec :name font-name)))
|
||||
|
||||
(defun insert-full-filename ()
|
||||
"Insert the full path file name into the current buffer."
|
||||
(interactive)
|
||||
(insert (buffer-file-name)))
|
||||
|
||||
(defun insert-filename-only ()
|
||||
"Insert the filename (without path) into the current buffer."
|
||||
(interactive)
|
||||
(insert (file-name-nondirectory (buffer-file-name))))
|
||||
|
||||
(provide 'init-functions)
|
||||
;;; init-functions.el ends here.
|
||||
|
@ -37,6 +37,10 @@
|
||||
(define-key global-map "\M-[" 'backward-paragraph)
|
||||
(define-key global-map "\M-]" 'forward-paragraph)
|
||||
|
||||
;; Insertar nombre del archivo
|
||||
(global-set-key (kbd "C-c ff") 'insert-full-filename)
|
||||
(global-set-key (kbd "C-c fo") 'insert-filename-only)
|
||||
|
||||
;; Deactivar el abrir *messages* al cliquear en el minibuffer
|
||||
(define-key minibuffer-inactive-mode-map [mouse-1] #'ignore)
|
||||
|
||||
|
Reference in New Issue
Block a user