Adding new 'start-mode' to Doom for custom start page.

This commit is contained in:
Derek Taylor 2023-01-09 21:18:19 -06:00
parent c1df596f6f
commit 8339e69fe4
5 changed files with 90 additions and 17 deletions

View File

@ -352,6 +352,7 @@
(map! :leader
(:prefix ("=" . "open file")
:desc "Edit agenda file" "=" #'(lambda () (interactive) (find-file "~/.config/doom/start.org"))
:desc "Edit agenda file" "a" #'(lambda () (interactive) (find-file "~/nc/Org/agenda.org"))
:desc "Edit doom config.org" "c" #'(lambda () (interactive) (find-file "~/.config/doom/config.org"))
:desc "Edit doom init.el" "i" #'(lambda () (interactive) (find-file "~/.config/doom/init.el"))
@ -774,6 +775,40 @@
(setq initial-buffer-choice "~/.config/doom/start.org")
(defun open-config-org()
(interactive)
(find-file "~/.config/doom/config.org"))
(defun open-init-el()
(interactive)
(find-file "~/.config/doom/init.el"))
(defun open-packages-el()
(interactive)
(find-file "~/.config/doom/packages.el"))
(defun open-eshell-aliases()
(interactive)
(find-file "~/.config/doom/eshell/aliases.el"))
(defun open-eshell-profile()
(interactive)
(find-file "~/.config/doom/eshell/profile.el"))
(define-minor-mode start-mode
"Provide functions for custom start page."
:lighter " start")
(evil-define-key 'normal start-mode-map
(kbd "1") 'open-config-org
(kbd "2") 'open-init-el
(kbd "3") 'open-packages-el
(kbd "4") 'open-eshell-aliases
(kbd "5") 'open-eshell-profile)
(provide 'start-mode)
;;(require start-mode)
(map! :leader
(:prefix ("w" . "window")
:desc "Winner redo" "<right>" #'winner-redo

View File

@ -730,18 +730,20 @@ Neotree is a file tree viewer. When you open neotree, it jumps to the current f
* OPEN SPECIFIC FILES
Keybindings to open files that I work with all the time using the find-file command, which is the interactive file search that opens with 'C-x C-f' in GNU Emacs or 'SPC f f' in Doom Emacs. These keybindings use find-file non-interactively since we specify exactly what file to open. The format I use for these bindings is 'SPC =' plus 'key' since Doom Emacs does not use 'SPC ='.
| PATH TO FILE | DESCRIPTION | KEYBINDING |
|-------------------------------+-----------------------+------------|
| ~/nc/Org/agenda.org | /Edit agenda file/ | SPC = a |
| ~/.config/doom/config.org | /Edit doom config.org/ | SPC = c |
| ~/.config/doom/init.el | /Edit doom init.el/ | SPC = i |
| ~/.config/doom/packages.el | /Edit doom packages.el/ | SPC = p |
| ~/.config/doom/eshell/aliases | /Edit eshell aliases/ | SPC = e a |
| ~/.config/doom/eshell/profile | /Edit eshell profile/ | SPC = e p |
| PATH TO FILE | DESCRIPTION | KEYBINDING |
|-------------------------------+-----------------------------+------------|
| ~/.config/doom/start.org | /Edit start.org (start page)/ | SPC = = |
| ~/nc/Org/agenda.org | /Edit agenda file/ | SPC = a |
| ~/.config/doom/config.org | /Edit doom config.org/ | SPC = c |
| ~/.config/doom/init.el | /Edit doom init.el/ | SPC = i |
| ~/.config/doom/packages.el | /Edit doom packages.el/ | SPC = p |
| ~/.config/doom/eshell/aliases | /Edit eshell aliases/ | SPC = e a |
| ~/.config/doom/eshell/profile | /Edit eshell profile/ | SPC = e p |
#+BEGIN_SRC emacs-lisp
(map! :leader
(:prefix ("=" . "open file")
:desc "Edit agenda file" "=" #'(lambda () (interactive) (find-file "~/.config/doom/start.org"))
:desc "Edit agenda file" "a" #'(lambda () (interactive) (find-file "~/nc/Org/agenda.org"))
:desc "Edit doom config.org" "c" #'(lambda () (interactive) (find-file "~/.config/doom/config.org"))
:desc "Edit doom init.el" "i" #'(lambda () (interactive) (find-file "~/.config/doom/init.el"))
@ -1264,6 +1266,39 @@ Instead of using Doom's Dashboard or the Emacs Dashboard program, I have decided
#+begin_src emacs-lisp
(setq initial-buffer-choice "~/.config/doom/start.org")
(defun open-config-org()
(interactive)
(find-file "~/.config/doom/config.org"))
(defun open-init-el()
(interactive)
(find-file "~/.config/doom/init.el"))
(defun open-packages-el()
(interactive)
(find-file "~/.config/doom/packages.el"))
(defun open-eshell-aliases()
(interactive)
(find-file "~/.config/doom/eshell/aliases.el"))
(defun open-eshell-profile()
(interactive)
(find-file "~/.config/doom/eshell/profile.el"))
(define-minor-mode start-mode
"Provide functions for custom start page."
:lighter " start")
(evil-define-key 'normal start-mode-map
(kbd "1") 'open-config-org
(kbd "2") 'open-init-el
(kbd "3") 'open-packages-el
(kbd "4") 'open-eshell-aliases
(kbd "5") 'open-eshell-profile)
(provide 'start-mode)
;;(require start-mode)
#+end_src
* WINNER MODE

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

View File

@ -1,6 +1,6 @@
#+STARTUP: inlineimages
[[file:./emacs-start-page.png]]
[[file:./images/emacs-start-page.png]]
⦿ *IMPORTANT KEYBINDINGS*
|------------+---------------------+------------------------------------|
@ -30,11 +30,14 @@
|-----------------------------+-----------------------------+-------------------------------|
⦿ *DOOM EMACS CONFIGS* (=NOTE=: 'SPC f p' [[elisp:(doom/find-file-in-private-config)][doom/find-file-in-private-config]])
|----------------+------------------------------------------------------------|
| [[elisp:(find-file (concat (getenv "HOME") "/.config/doom/config.org"))][config.org]] | This is the main user configuration file for Doom Emacs. |
| [[elisp:(find-file (concat (getenv "HOME") "/.config/doom/init.el"))][init.el]] | Allows you to turn on/off the standard Doom modules. |
| [[elisp:(find-file (concat (getenv "HOME") "/.config/doom/packages.el"))][packages.el]] | Easily install extra packages by adding them to this file. |
| [[elisp:(find-file (concat (getenv "HOME") "/.config/doom/start.org"))][start.org]] | View/edit your custom start page. |
| [[elisp:(find-file (concat (getenv "HOME") "/.config/doom/eshell/aliases"))][eshell/aliases]] | Aliases file for the eshell. |
| [[elisp:(find-file (concat (getenv "HOME") "/.config/doom/eshell/profile"))][eshell/profile]] | Profile for the eshell. |
|----------------+------------------------------------------------------------|
|---+----------------+------------------------------------------------------------|
| 1 | [[elisp:(find-file (concat (getenv "HOME") "/.config/doom/config.org"))][config.org]] | This is the main user configuration file for Doom Emacs. |
| 2 | [[elisp:(find-file (concat (getenv "HOME") "/.config/doom/init.el"))][init.el]] | Allows you to turn on/off the standard Doom modules. |
| 3 | [[elisp:(find-file (concat (getenv "HOME") "/.config/doom/packages.el"))][packages.el]] | Easily install extra packages by adding them to this file. |
| 4 | [[elisp:(find-file (concat (getenv "HOME") "/.config/doom/eshell/aliases"))][eshell/aliases]] | Aliases file for the eshell. |
| 5 | [[elisp:(find-file (concat (getenv "HOME") "/.config/doom/eshell/profile"))][eshell/profile]] | Profile for the eshell. |
|---+----------------+------------------------------------------------------------|
;; Local Variables:
;; eval: (start-mode)
;; End: