From 9512bbe82a90b770e64635dbe068e1a8aa7db8be Mon Sep 17 00:00:00 2001 From: Derek Taylor Date: Sun, 8 Jan 2023 14:02:13 -0600 Subject: [PATCH] Fixing custom start file for emacs and emacsclient --- .config/doom/config.el | 28 ++--------------------- .config/doom/config.org | 48 ++++++++------------------------------- .config/doom/packages.el | 2 +- .config/doom/start.org | 30 +++++++++++++----------- .config/xmonad/README.org | 3 ++- .config/xmonad/xmonad.hs | 3 ++- 6 files changed, 33 insertions(+), 81 deletions(-) diff --git a/.config/doom/config.el b/.config/doom/config.el index 1928a5f..bda6616 100644 --- a/.config/doom/config.el +++ b/.config/doom/config.el @@ -100,32 +100,6 @@ :desc "Clippy describes function under point" "f" #'clippy-describe-function :desc "Clippy describes variable under point" "v" #'clippy-describe-variable)) -(use-package dashboard - :init ;; tweak dashboard config before loading it - (setq dashboard-set-heading-icons t) - (setq dashboard-set-file-icons t) - (setq dashboard-banner-logo-title "\nKEYBINDINGS:\ -\nFind file (SPC .) \ -Open buffer list (SPC b i)\ -\nFind recent files (SPC f r) \ -Open the eshell (SPC e s)\ -\nOpen dired file manager (SPC d d) \ -List of keybindings (SPC h b b)") - ;;(setq dashboard-startup-banner 'logo) ;; use standard emacs logo as banner - (setq dashboard-startup-banner "~/.config/doom/doom-emacs-dash.png") ;; use custom image as banner - (setq dashboard-center-content nil) ;; set to 't' for centered content - (setq dashboard-items '((recents . 5) - ;; (agenda . 5 ) ;; Agenda crashes Dashboard if using custom org-agenda. - (bookmarks . 5) - (projects . 5) - (registers . 5))) - :config - (dashboard-setup-startup-hook) - (dashboard-modify-heading-icons '((recents . "file-text") - (bookmarks . "book")))) - -(setq doom-fallback-buffer-name "*dashboard*") - (map! :leader (:prefix ("d" . "dired") :desc "Open dired" "d" #'dired @@ -798,6 +772,8 @@ List of keybindings (SPC h b b)") (map! :leader :desc "Clone indirect buffer other window" "b c" #'clone-indirect-buffer-other-window) +(setq initial-buffer-choice "~/.config/doom/start.org") + (map! :leader (:prefix ("w" . "window") :desc "Winner redo" "" #'winner-redo diff --git a/.config/doom/config.org b/.config/doom/config.org index 4c0cc11..779cdc8 100644 --- a/.config/doom/config.org +++ b/.config/doom/config.org @@ -14,9 +14,6 @@ - [[#calendar][CALENDAR]] - [[#centaur-tabs][CENTAUR-TABS]] - [[#clippy][CLIPPY]] -- [[#dashboard][DASHBOARD]] - - [[#configuring-dashboard][Configuring Dashboard]] - - [[#dashboard-in-emacsclient][Dashboard in Emacsclient]] - [[#dired][DIRED]] - [[#keybindings-to-open-dired][Keybindings To Open Dired]] - [[#keybindings-within-dired][Keybindings Within Dired]] @@ -56,6 +53,7 @@ - [[#registers][REGISTERS]] - [[#shells][SHELLS]] - [[#splits][SPLITS]] +- [[#start-page][START PAGE]] - [[#winner-mode][WINNER MODE]] - [[#zap-to-char][ZAP TO CHAR]] @@ -246,42 +244,6 @@ Gives us a popup box with "Clippy, the paper clip". You can make him say various #+end_src -* DASHBOARD -Emacs Dashboard is an extensible startup screen showing you recent files, bookmarks, agenda items and an Emacs banner. - -** Configuring Dashboard -#+begin_src emacs-lisp -(use-package dashboard - :init ;; tweak dashboard config before loading it - (setq dashboard-set-heading-icons t) - (setq dashboard-set-file-icons t) - (setq dashboard-banner-logo-title "\nKEYBINDINGS:\ -\nFind file (SPC .) \ -Open buffer list (SPC b i)\ -\nFind recent files (SPC f r) \ -Open the eshell (SPC e s)\ -\nOpen dired file manager (SPC d d) \ -List of keybindings (SPC h b b)") - ;;(setq dashboard-startup-banner 'logo) ;; use standard emacs logo as banner - (setq dashboard-startup-banner "~/.config/doom/doom-emacs-dash.png") ;; use custom image as banner - (setq dashboard-center-content nil) ;; set to 't' for centered content - (setq dashboard-items '((recents . 5) - ;; (agenda . 5 ) ;; Agenda crashes Dashboard if using custom org-agenda. - (bookmarks . 5) - (projects . 5) - (registers . 5))) - :config - (dashboard-setup-startup-hook) - (dashboard-modify-heading-icons '((recents . "file-text") - (bookmarks . "book")))) -#+end_src - -** Dashboard in Emacsclient -This setting ensures that emacsclient always opens on *dashboard* rather than *scratch*. -#+begin_src emacs-lisp -(setq doom-fallback-buffer-name "*dashboard*") -#+end_src - * DIRED Dired is the file manager within Emacs. Below, I setup keybindings for image previews (peep-dired). Doom Emacs does not use 'SPC d' for any of its keybindings, so I've chosen the format of 'SPC d' plus 'key'. @@ -1296,6 +1258,14 @@ I set splits to default to opening on the right using 'prefer-horizontal-split'. :desc "Clone indirect buffer other window" "b c" #'clone-indirect-buffer-other-window) #+END_SRC +* START PAGE +Instead of using Doom's Dashboard or the Emacs Dashboard program, I have decided to just set an custom start file as my "dashboard" since it allows me more customization options. + +#+begin_src emacs-lisp +(setq initial-buffer-choice "~/.config/doom/start.org") + +#+end_src + * WINNER MODE Winner mode has been included with GNU Emacs since version 20. This is a global minor mode and, when activated, it allows you to “undo” (and “redo”) changes in the window configuration with the key commands 'SCP w ' and 'SPC w '. diff --git a/.config/doom/packages.el b/.config/doom/packages.el index 13b7e73..dacbb90 100644 --- a/.config/doom/packages.el +++ b/.config/doom/packages.el @@ -58,7 +58,7 @@ (package! flycheck-aspell) (package! calfw) (package! calfw-org) -(package! dashboard) +;;(package! dashboard) (package! dired-open) (package! dired-subtree) (package! dirvish) diff --git a/.config/doom/start.org b/.config/doom/start.org index a6b428e..4cfbcd3 100644 --- a/.config/doom/start.org +++ b/.config/doom/start.org @@ -1,19 +1,17 @@ #+TITLE: DT'S Emacs Start Page #+STARTUP: inlineimages -[[file:./doom-emacs-dash.png]] +[[file:./emacs-start-page.png]] * IMPORTANT KEYBINDINGS - -| /KEYBINDING/ | /FUNCTION/ | /DESCRIPTION/ | -|------------+-------------------+------------------------| -| SPC . | [[elisp:(ido-find-file)][find-file]] | Find a file | -| SPC f r | [[elisp:(counsel-recentf)][counsel-recentf]] | Find a recent file | -| SPC d d | [[elisp:(dired (getenv "HOME"))][dired]] | Dired file manager | -| SPC e s | [[elisp:(eshell)][eshell]] | Launch the eshell | -| SPC h r r | [[elisp:(doom/reload)][doom/reload]] | Reload Doom Emacs | -| SPC h d h | [[elisp:(doom/help)][doom/help]] | Doom Emacs user manual | -| SPC h b b | [[elisp:(counsel-descbinds)][counsel-descbinds]] | Describe keybindings | +|-----------+-------------------+---------------------------| +| M-x | [[elisp:(counsel-M-x)][counsel-M-x]] | Prompt for Emacs programs | +| SPC . | [[elisp:(counsel-find-file)][counsel-find-file]] | Find a file | +| SPC f r | [[elisp:(counsel-recentf)][counsel-recentf]] | Find a recent file | +| SPC d d | [[elisp:(dired (getenv "HOME"))][dired]] | Dired file manager | +| SPC e s | [[elisp:(eshell)][eshell]] | Launch the eshell | +| SPC h r r | [[elisp:(doom/reload)][doom/reload]] | Reload Doom Emacs | +|-----------+-------------------+---------------------------| * BUFFERS & SPLITS |------------------------------+------------------------------+-----------------------------| @@ -23,9 +21,13 @@ | (SPC w c) [[elisp:(evil-window-delete)][evil-window-delete]] | (SPC w l) [[elisp:(evil-window-left 1)][evil-window-left]] | (SPC w h) [[elisp:(evil-window-right 1)][evil-window-right]] | |------------------------------+------------------------------+-----------------------------| -* DOOM EMACS CONFIG FILES +* HELP INFORMATION +|-----------------------------+-----------------------------+-------------------------------| +| (SPC h d h) [[elisp:(doom/help)][doom/help]] | (SPC h d f) [[elisp:(doom/help-faq)][doom/help-faq]] | (SPC h i) [[elisp:(info)][info]] | +| (SPC h f) [[elisp:(counsel-describe-function)][describe-function]] | (SPC h v) [[elisp:(counsel-describe-variable)][describe-variable]] | (SPC h b b) [[elisp:(counsel-descbinds)][describe-bindings]] | +|-----------------------------+-----------------------------+-------------------------------| -| /NAME OF FILE/ | /DESCRIPTION/ | +* DOOM EMACS CONFIG FILES |----------------+------------------------------------------------------------| | [[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. | @@ -33,5 +35,7 @@ | [[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. | +|----------------+------------------------------------------------------------| =NOTE=: (SPC f p) [[elisp:(doom/find-file-in-private-config)][doom/find-file-in-private-config]] searches for files in HOME/.config/doom/. + diff --git a/.config/xmonad/README.org b/.config/xmonad/README.org index fd9b925..cd89194 100644 --- a/.config/xmonad/README.org +++ b/.config/xmonad/README.org @@ -808,7 +808,8 @@ myKeys c = -- Emacs (SUPER-e followed by a key) ^++^ subKeys "Emacs" - [ ("M-e e", addName "Emacsclient Dashboard" $ spawn (myEmacs ++ ("--eval '(dashboard-refresh-buffer)'"))) + [("M-e e", addName "Emacsclient" $ spawn (myEmacs)) + -- ("M-e e", addName "Emacsclient Dashboard" $ spawn (myEmacs ++ ("--eval '(dashboard-refresh-buffer)'"))) , ("M-e a", addName "Emacsclient EMMS (music)" $ spawn (myEmacs ++ ("--eval '(emms)' --eval '(emms-play-directory-tree \"~/Music/\")'"))) , ("M-e b", addName "Emacsclient Ibuffer" $ spawn (myEmacs ++ ("--eval '(ibuffer)'"))) , ("M-e d", addName "Emacsclient Dired" $ spawn (myEmacs ++ ("--eval '(dired nil)'"))) diff --git a/.config/xmonad/xmonad.hs b/.config/xmonad/xmonad.hs index 827dd0d..0949757 100644 --- a/.config/xmonad/xmonad.hs +++ b/.config/xmonad/xmonad.hs @@ -662,7 +662,8 @@ myKeys c = -- Emacs (SUPER-e followed by a key) ^++^ subKeys "Emacs" - [ ("M-e e", addName "Emacsclient Dashboard" $ spawn (myEmacs ++ ("--eval '(dashboard-refresh-buffer)'"))) + [("M-e e", addName "Emacsclient" $ spawn (myEmacs)) + -- ("M-e e", addName "Emacsclient Dashboard" $ spawn (myEmacs ++ ("--eval '(dashboard-refresh-buffer)'"))) , ("M-e a", addName "Emacsclient EMMS (music)" $ spawn (myEmacs ++ ("--eval '(emms)' --eval '(emms-play-directory-tree \"~/Music/\")'"))) , ("M-e b", addName "Emacsclient Ibuffer" $ spawn (myEmacs ++ ("--eval '(ibuffer)'"))) , ("M-e d", addName "Emacsclient Dired" $ spawn (myEmacs ++ ("--eval '(dired nil)'")))