Browse Source

Add find-file emacs.d

master
Riyyi 4 years ago
parent
commit
bab1fcf243
  1. 32
      .emacs.d/config.org

32
.emacs.d/config.org

@ -927,19 +927,26 @@ Set UTF-8 encoding as default.
Functions that only use built-in Emacs functionality. Functions that only use built-in Emacs functionality.
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(defun config-visit () (defun display-startup-echo-area-message ()
"Config edit." "Hide default startup message."
(message nil))
(defun dot/config-visit ()
"Edit config file."
(interactive) (interactive)
(find-file (concat dot-emacs-dir "/config.org"))) (find-file (concat dot-emacs-dir "/config.org")))
(defun config-reload () (defun dot/config-reload ()
"Config reload." "Reload config file."
(interactive) (interactive)
(org-babel-load-file (concat dot-emacs-dir "/config.org"))) (org-babel-load-file (concat dot-emacs-dir "/config.org")))
(defun display-startup-echo-area-message () (defun dot/find-file-emacsd ()
"Hide default startup message." "Find a file under `dot-emacs-dir', recursively."
(message nil)) (interactive)
(let ((files (mapcar 'abbreviate-file-name
(directory-files-recursively dot-emacs-dir ""))))
(find-file (completing-read "Find file (emacs.d): " files nil t))))
(defun dot/indent-buffer () (defun dot/indent-buffer ()
"Indent each nonblank line in the buffer." "Indent each nonblank line in the buffer."
@ -964,7 +971,7 @@ Functions that only use built-in Emacs functionality.
"Use `completing-read' to open a recent file." "Use `completing-read' to open a recent file."
(interactive) (interactive)
(let ((files (mapcar 'abbreviate-file-name recentf-list))) (let ((files (mapcar 'abbreviate-file-name recentf-list)))
(find-file (completing-read "Find recent file: " files nil t)))) (find-file (completing-read "Find file (recent): " files nil t))))
(defun dot/reload-theme () (defun dot/reload-theme ()
"Reload custom theme." "Reload custom theme."
@ -1456,12 +1463,10 @@ General.el ~leader key binds.
"b <left>" '(previous-buffer :which-key "Previous buffer") "b <left>" '(previous-buffer :which-key "Previous buffer")
"b <right>" '(next-buffer :which-key "Next buffer") "b <right>" '(next-buffer :which-key "Next buffer")
;; Comments / config ;; Comments
"c" '(:ignore t :which-key "comment/config") "c" '(:ignore t :which-key "comment/config")
"c c" '(evilnc-comment-or-uncomment-lines :which-key "Toggle comment") "c c" '(evilnc-comment-or-uncomment-lines :which-key "Toggle comment")
"c p" '(evilnc-comment-or-uncomment-paragraphs :which-key "Toggle comment paragraph") "c p" '(evilnc-comment-or-uncomment-paragraphs :which-key "Toggle comment paragraph")
"c r" '(config-reload :which-key "Config reload")
"c v" '(config-visit :which-key "Config visit")
"c y" '(evilnc-comment-and-kill-ring-save :which-key "Comment and copy") "c y" '(evilnc-comment-and-kill-ring-save :which-key "Comment and copy")
;; Elisp ;; Elisp
@ -1473,6 +1478,11 @@ General.el ~leader key binds.
;; File ;; File
"f" '(:ignore t :which-key "file") "f" '(:ignore t :which-key "file")
"f e" '(:ignore t :which-key "emacs")
"f e c" '(dot/config-visit :which-key "Config visit")
"f e f" '(dot/find-file-emacsd :which-key "Find file emacs.d")
"f e r" '(dot/config-reload :which-key "Config reload")
"f d" '(dired :which-key "Find directory")
"f f" '(find-file-in-project-root :which-key "Find file") "f f" '(find-file-in-project-root :which-key "Find file")
"f r" '(dot/recentf-open-files :which-key "Recent files") "f r" '(dot/recentf-open-files :which-key "Recent files")
"f R" '(rename-file-and-buffer :which-key "Rename file") "f R" '(rename-file-and-buffer :which-key "Rename file")

Loading…
Cancel
Save