diff --git a/README.org b/README.org index 563e447..adccd3a 100644 --- a/README.org +++ b/README.org @@ -106,7 +106,7 @@ Here's a complete list of all of the options configurable for each host, and the (org-babel-load-file host-file))) #+end_src -* Modules +** Modules Breaking down the project into logical units or chapters to keep the code more maintainable and organized. This is also a fundamental requirement to achieve the goal of modularity. Here are all of the available modules, also listed in the variable ~dotfiles/modules-p~. @@ -127,146 +127,3 @@ Here's a complete list of all of the options configurable for each host, and the (when (file-exists-p mod-file) (org-babel-load-file mod-file)))) #+end_src -# ** Lines - -# Relative line numbers are important when using =VI= emulation keys. You can prefix most commands with a *number*, allowing you to jump up / down by a line count. - -# #+begin_example -# 5: -# 4: -# 3: -# 2: -# 1: -# 156: << CURRENT LINE >> -# 1: -# 2: -# 3: -# 4: -# 5: -# #+end_example - -# https://github.com/emacsmirror/linum-relative -# + Integrate with ~display-line-numbers-mode~ for performance - -# #+begin_src emacs-lisp -# (use-package linum-relative -# :commands (linum-relative-global-mode) -# :custom (linum-relative-backend 'display-line-numbers-mode)) -# #+end_src - -# Add line numbers to the toggles behind =SPC t l=. - -# #+begin_src emacs-lisp -# (dotfiles/leader -# "tl" '(linum-relative-global-mode :which-key "Lines")) -# #+end_src - -# https://github.com/Fanael/rainbow-delimiters -# + Colourize nested parenthesis - -# #+begin_src emacs-lisp -# (use-package rainbow-delimiters -# :hook (prog-mode . rainbow-delimiters-mode)) -# #+end_src - -# ** Themes - -# #+ATTR_ORG: :width 420px -# #+ATTR_HTML: :width 420px -# #+ATTR_LATEX: :width 420px -# [[./docs/images/what-is-emacs-customizable.gif]] - -# Cherry pick a few modules from =doom-emacs=. High quality and modern colour themes are provided in the [[https://github.com/hlissner/emacs-doom-themes][doom-themes]] package. - -# #+begin_src emacs-lisp -# (use-package doom-themes -# :init (load-theme 'doom-moonlight t)) -# #+end_src - -# [[https://github.com/seagle0128/doom-modeline][doom-modeline]] provides an elegant status bar / modeline. - -# #+begin_src emacs-lisp -# (use-package doom-modeline -# :custom (doom-modeline-height 16) -# :config (doom-modeline-mode 1)) -# #+end_src - -# Load a theme with =SPC t t=. - -# #+begin_src emacs-lisp -# (dotfiles/leader -# "tt" '(counsel-load-theme t t :which-key "Theme")) -# #+end_src - -# ** Pretty - -# Make programming buffers prettier with [[https://github.com/pretty-mode/pretty-mode][pretty-mode]], complimentary to the built in ~prettify-symbols-mode~. - -# #+begin_src emacs-lisp -# (use-package pretty-mode -# :hook (python-mode . turn-on-pretty-mode)) -# #+end_src - -# ** Ligatures - -# Enable font ligatures via [[https://github.com/jming422/fira-code-mode][fira-code-mode]], perform this action *only* when ~Fira Code~ is the current font. - -# #+begin_src emacs-lisp -# (when (display-graphic-p) -# (use-package fira-code-mode -# :hook (prog-mode org-mode))) -# #+end_src - -# Toggle global ligature mode with =SPC t g=. - -# #+begin_src emacs-lisp -# (dotfiles/leader -# "tg" '(global-fira-code-mode :which-key "Ligatures")) -# #+end_src - -# ** Dashboard - -# #+ATTR_ORG: :width 420px -# #+ATTR_HTML: :width 420px -# #+ATTR_LATEX: :width 420px -# [[./docs/images/desktop.png]] - -# Present a dashboard when first launching Emacs. Customize the buttons of the navigator: - -# + Brain @ http://localhost:8080 -# + Homepage @ https://chrishayward.xyz -# + Athabasca @ https://login.athabascau.ca/cas/login -# + Bookshelf @ https://online.vitalsource.com - -# #+begin_src emacs-lisp -# (use-package dashboard -# :custom (dashboard-center-content t) -# (dashboard-set-init-info t) -# (dashboard-set-file-icons t) -# (dashboard-set-heading-icons t) -# (dashboard-set-navigator t) -# (dashboard-startup-banner 'logo) -# (dashboard-projects-backend 'projectile) -# (dashboard-items '((projects . 5) (recents . 5) (agenda . 10))) -# (dashboard-navigator-buttons `(((,(all-the-icons-fileicon "brain" :height 1.1 :v-adjust 0.0) -# "Brain" "Knowledge base" -# (lambda (&rest _) (browse-url "http://localhost:8080")))) -# ((,(all-the-icons-material "public" :height 1.1 :v-adjust 0.0) -# "Homepage" "Personal website" -# (lambda (&rest _) (browse-url "https://chrishayward.xyz")))) -# ((,(all-the-icons-faicon "university" :height 1.1 :v-adjust 0.0) -# "Athabasca" "Univeristy login" -# (lambda (&rest _) (browse-url "https://login.athabascau.ca/cas/login")))) -# ((,(all-the-icons-faicon "book" :height 1.1 :v-adjust 0.0) -# "Bookshelf" "Vitalsource bookshelf" -# (lambda (&rest _) (browse-url "https://online.vitalsource.com")))))) -# :config (dashboard-setup-startup-hook)) -# #+end_src - -# When running in *daemon* mode, ensure that the dashboard is the initial buffer. - -# #+begin_src emacs-lisp -# (setq initial-buffer-choice -# (lambda () -# (get-buffer "*dashboard*"))) -# #+end_src diff --git a/modules/interface.org b/modules/interface.org index 726d948..50e57f7 100644 --- a/modules/interface.org +++ b/modules/interface.org @@ -41,6 +41,15 @@ There's a lot of occasions Emacs asks to input text to match a file name in a di :config (counsel-mode 1)) #+end_src +*** Switch buffers with , + +Cherry picked from =doom=. + +#+begin_src emacs-lisp +(dotfiles/leader + "," '(counsel-switch-buffer :which-key "Buffers")) +#+end_src + ** Additional details Provide more information about each item in the completion menu with *Ivy rich*[fn:2]. @@ -85,20 +94,174 @@ Define a transient keybinding for Scaling the text. * Icons -- [ ] All the icons -- [ ] All the icons dired +Dired feels more modern with prioritized icon fonts using *All the Icons*[fn:3]. This makes navigation and visually parsing directories much faster, given that file types are quickly identified by their corresponding icons. + +#+begin_src emacs-lisp +(use-package all-the-icons) +#+end_src + +Integration with the *All the Icons Dired*[fn:4]package. + +#+begin_src emacs-lisp +(use-package all-the-icons-dired + :hook (dired-mode . all-the-icons-dired-mode)) +#+end_src * Themes +#+ATTR_ORG: :width 420px +#+ATTR_HTML: :width 420px +#+ATTR_LATEX: :width 420px +[[../docs/images/what-is-emacs-customizable.gif]] + +High quality and modern colour themes are provided in the *Doom Themes*[fn:5] package. + +#+begin_src emacs-lisp +(use-package doom-themes + :init (load-theme 'doom-moonlight t)) +#+end_src + +Load a theme with =SPC t t=. + +#+begin_src emacs-lisp +(dotfiles/leader + "tt" '(counsel-load-theme t t :which-key "Theme")) +#+end_src + +* Modeline + +*Doom modeline*[fn:6] provides an elegant and modern status bar / modeline. + +#+begin_src emacs-lisp +(use-package doom-modeline + :custom (doom-modeline-height 16) + :config (doom-modeline-mode 1)) +#+end_src + * Line numbering +Relative line numbers are important when using VI emulation keys. You can prefix commands with a number, allowing you to perform that action that number of times. Useful when navigating around pages that are hundreds, or even thousands of lines long. + +#+begin_example + 5: + 4: + 3: + 2: + 1: +156: << CURRENT LINE >> + 1: + 2: + 3: + 4: + 5: +#+end_example + +#+begin_src emacs-lisp +(use-package linum-relative + :commands (linum-relative-global-mode) + :custom (linum-relative-backend 'display-line-numbers-mode)) +#+end_src + +Toggle line numbers with =SPC t l=. + +#+begin_src emacs-lisp +(dotfiles/leader + "tl" '(linum-relative-global-mode :which-key "Lines")) +#+end_src + +* Parenthesis + +Colourize nested parenthesis with *Rainbow delimeters*[fn:8]. + +#+begin_src emacs-lisp +(use-package rainbow-delimiters + :hook (prog-mode . rainbow-delimiters-mode)) +#+end_src + * Pretty symbols +Programming buffers made prettier with *Pretty mode*[fn:9], complimentary to the built-in *Prettify symbols mode*[fn:10]. + +#+begin_src emacs-lisp +(use-package pretty-mode + :hook (python-mode . turn-on-pretty-mode)) +#+end_src + * Ligatures +Enable font ligatures via *Fira Code mode*[fn:11], perform this action *only* when *Fira Code* is the current font. + +#+begin_src emacs-lisp +(when (display-graphic-p) + (use-package fira-code-mode + :hook (prog-mode org-mode))) +#+end_src + +Toggle global ligature mode with =SPC t g=. + +#+begin_src emacs-lisp +(dotfiles/leader + "tg" '(global-fira-code-mode :which-key "Ligatures")) +#+end_src + * Dashboard +#+ATTR_ORG: :width 420px +#+ATTR_HTML: :width 420px +#+ATTR_LATEX: :width 420px +[[../docs/images/desktop.png]] + +Present a *Dashboard* when first launching Emacs. Customize the buttons of the navigator. + ++ Brain @ http://localhost:8080 ++ Homepage @ https://chrishayward.xyz ++ Athabasca @ https://login.athabascau.ca/cas/login ++ Bookshelf @ https://online.vitalsource.com + +#+begin_src emacs-lisp +(use-package dashboard + :custom (dashboard-center-content t) + (dashboard-set-init-info t) + (dashboard-set-file-icons t) + (dashboard-set-heading-icons t) + (dashboard-set-navigator t) + (dashboard-startup-banner 'logo) + (dashboard-projects-backend 'projectile) + (dashboard-items '((projects . 5) (recents . 5) (agenda . 10))) + (dashboard-navigator-buttons `(((,(all-the-icons-fileicon "brain" :height 1.1 :v-adjust 0.0) + "Brain" "Knowledge base" + (lambda (&rest _) (browse-url "http://localhost:8080")))) + ((,(all-the-icons-material "public" :height 1.1 :v-adjust 0.0) + "Homepage" "Personal website" + (lambda (&rest _) (browse-url "https://chrishayward.xyz")))) + ((,(all-the-icons-faicon "university" :height 1.1 :v-adjust 0.0) + "Athabasca" "Univeristy login" + (lambda (&rest _) (browse-url "https://login.athabascau.ca/cas/login")))) + ((,(all-the-icons-faicon "book" :height 1.1 :v-adjust 0.0) + "Bookshelf" "Vitalsource bookshelf" + (lambda (&rest _) (browse-url "https://online.vitalsource.com")))))) + :config (dashboard-setup-startup-hook)) +#+end_src + +When running in *daemon* mode, ensure that the dashboard is the initial buffer. + +#+begin_src emacs-lisp +(setq initial-buffer-choice + (lambda () + (get-buffer "*dashboard*"))) +#+end_src + * Resources [fn:1] https://github.com/abo-abo/swiper [fn:2] https://github.com/Yevgnen/ivy-rich +[fn:3] [[https://github.com/domtronn/all-the-icons.el]] +[fn:4] https://github.com/jtbm37/all-the-icons-dired +[fn:5] https://github.com/hlissner/emacs-doom-themes +[fn:6] https://github.com/seagle0128/doom-modeline +[fn:7] https://github.com/emacsmirror/linum-relative +[fn:8] https://github.com/Fanael/rainbow-delimiters +[fn:9] https://emacswiki.org/emacs/pretty-mode.el +[fn:10] https://emacswiki.org/emacs/PrettySymbol +[fn:11] https://github.com/jming422/fira-code-mode +[fn:12] https://github.com/emacs-dashboard/emacs-dashboard