summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
Diffstat (limited to 'config')
-rw-r--r--config/extra/emacs/config.org689
-rw-r--r--config/extra/emacs/init.el11
2 files changed, 479 insertions, 221 deletions
diff --git a/config/extra/emacs/config.org b/config/extra/emacs/config.org
index 60c0812..50d6af6 100644
--- a/config/extra/emacs/config.org
+++ b/config/extra/emacs/config.org
@@ -4,38 +4,48 @@
#+OPTIONS: toc:3
* TABLE OF CONTENTS :toc:
-- [[#startup-configuration][Startup Configuration]]
+- [[#startup][Startup]]
- [[#elpaca-package-manager][Elpaca (Package Manager)]]
- [[#evil-mode][Evil Mode]]
- [[#keybindings][Keybindings]]
- [[#helper-functions][Helper functions]]
- [[#buffer-move][buffer-move]]
- [[#reload-emacs][Reload Emacs]]
-- [[#graphical-configuration][Graphical configuration]]
- - [[#disable-menubar-toolbars-and-scrollbars][Disable Menubar, Toolbars and Scrollbars]]
+- [[#graphical-tweaks][Graphical tweaks]]
+ - [[#disable-ui-elements][Disable UI elements]]
- [[#display-line-numbers-and-truncated-lines][Display Line Numbers and Truncated Lines]]
+ - [[#blinking-cursor][blinking cursor]]
- [[#fonts][Fonts]]
- [[#setting-the-font-face][Setting the Font Face]]
- [[#theme][Theme]]
+ - [[#transparency][Transparency]]
+ - [[#highlight-todo][Highlight TODO]]
+- [[#misc-options][Misc. options]]
- [[#org-mode][ORG Mode]]
- [[#enabling-table-of-contents][Enabling Table of Contents]]
- [[#enabling-org-bullets][Enabling Org Bullets]]
- - [[#source-code-block-tag-expansion][Source Code Block Tag Expansion]]
+- [[#big-ass-header][Big ass header]]
- [[#shell][Shell]]
- [[#default-shell][Default shell]]
- [[#eshell][Eshell]]
+- [[#language-support][Language Support]]
- [[#packages][Packages]]
+ - [[#dashboard][Dashboard]]
+ - [[#diminish][Diminish]]
+ - [[#dired][Dired]]
+ - [[#git][Git]]
+ - [[#ivy-counsel][Ivy (Counsel)]]
+ - [[#language-support-1][Language Support]]
+ - [[#modeline][Modeline]]
+ - [[#perspective][Perspective]]
+ - [[#projectile][Projectile]]
+ - [[#rainbow-mode][Rainbow Mode]]
+ - [[#rainbow-delimiters][Rainbow Delimiters]]
- [[#sudo-edit][Sudo edit]]
+ - [[#tldr][TLDR]]
- [[#which-key][Which-Key]]
- - [[#all-the-icons][All The Icons]]
- - [[#rainbow-mode][Rainbow Mode]]
- - [[#ivy-counsel][IVY (Counsel)]]
- - [[#projectile][Projectile]]
- - [[#dashboard][Dashboard]]
- - [[#flycheck][Flycheck]]
- - [[#company][COMPANY]]
-* Startup Configuration
+* Startup
** Elpaca (Package Manager)
#+begin_src emacs-lisp
(defvar elpaca-installer-version 0.6)
@@ -104,8 +114,8 @@
** Evil Mode
#+begin_src emacs-lisp
-;; Expands to: (elpaca evil (use-package evil :demand t))
-(use-package evil
+ ;; Expands to: (elpaca evil (use-package evil :demand t))
+ (use-package evil
:init ;; tweak evil's configuration before loading it
(setq evil-want-integration t) ;; This is optional since it's already set to t by default.
(setq evil-want-keybinding nil)
@@ -118,101 +128,221 @@
(setq evil-collection-mode-list '(dashboard dired ibuffer))
(evil-collection-init))
(use-package evil-tutor)
+ ;; Using RETURN to follow links in Org/Evil
+ ;; Unmap keys in 'evil-maps if not done, (setq org-return-follows-link t) will not work
+ (with-eval-after-load 'evil-maps
+ (define-key evil-motion-state-map (kbd "SPC") nil)
+ (define-key evil-motion-state-map (kbd "RET") nil)
+ (define-key evil-motion-state-map (kbd "TAB") nil))
+ ;; Setting RETURN key in org-mode to follow links
+ (setq org-return-follows-link t)
+
#+end_src
** Keybindings
#+begin_src emacs-lisp
-(use-package general
- :config
- (general-evil-setup)
-
- ;; set up 'SPC' as the global leader key
- (general-create-definer user/leader-keys
- :states '(normal insert visual emacs)
- :keymaps 'override
- :prefix "SPC" ;; set leader
- :global-prefix "M-SPC") ;; access leader in insert mode
-
- (user/leader-keys
- "SPC" '(counsel-M-x :wk "Counsel M-x")
- "." '(find-file :wk "Find file")
- "f c" '((lambda () (interactive) (find-file "~/.config/emacs/config.org")) :wk "Edit emacs config")
- "f r" '(counsel-recentf :wk "Find recent files")
- "f w" '(evil-write :wk "Write current buffer")
- "f q" '(evil-quit :wk "Write current buffer")
- "TAB TAB" '(comment-line :wk "Comment lines"))
-
- (user/leader-keys
- "b" '(:ignore t :wk "buffer")
- "b b" '(switch-to-buffer :wk "Switch buffer")
- "b i" '(ibuffer :wk "Ibuffer")
- "b k" '(kill-this-buffer :wk "Kill this buffer")
- "b n" '(next-buffer :wk "Next buffer")
- "b p" '(previous-buffer :wk "Previous buffer")
- "b r" '(revert-buffer :wk "Reload buffer"))
-
- (user/leader-keys
- "e" '(:ignore t :wk "Eshell/Evaluate")
- "e b" '(eval-buffer :wk "Evaluate elisp in buffer")
- "e d" '(eval-defun :wk "Evaluate defun containing or after point")
- "e e" '(eval-expression :wk "Evaluate and elisp expression")
- "e h" '(counsel-esh-history :which-key "Eshell history")
- "e l" '(eval-last-sexp :wk "Evaluate elisp expression before point")
- "e r" '(eval-region :wk "Evaluate elisp in region")
- "e s" '(eshell :which-key "Eshell"))
-
- (user/leader-keys
- "h" '(:ignore t :wk "Help")
- "h f" '(describe-function :wk "Describe function")
- "h v" '(describe-variable :wk "Describe variable")
- ;;"h r r" '((lambda () (interactive) (load-file "~/.config/emacs/init.el")) :wk "Reload emacs config"))
- "h r r" '(reload-init-file :wk "Reload emacs config"))
-
- (user/leader-keys
- "t" '(:ignore t :wk "Toggle")
- "t l" '(display-line-numbers-mode :wk "Toggle line numbers")
- "t t" '(visual-line-mode :wk "Toggle truncated lines")
- "t v" '(shell :wk "open shell"))
-
- (user/leader-keys
- "w" '(:ignore t :wk "Windows")
- ;; Window splits
- "w c" '(evil-window-delete :wk "Close window")
- "w n" '(evil-window-new :wk "New window")
- "w s" '(evil-window-split :wk "Horizontal split window")
- "w v" '(evil-window-vsplit :wk "Vertical split window")
- ;; Window motions
- "w h" '(evil-window-left :wk "Window left")
- "w j" '(evil-window-down :wk "Window down")
- "w k" '(evil-window-up :wk "Window up")
- "w l" '(evil-window-right :wk "Window right")
- "w w" '(evil-window-next :wk "Goto next window")
- ;; Move Windows
- "w H" '(buf-move-left :wk "Buffer move left")
- "w J" '(buf-move-down :wk "Buffer move down")
- "w K" '(buf-move-up :wk "Buffer move up")
- "w L" '(buf-move-right :wk "Buffer move right"))
-
-;; org mode
- (user/leader-keys
- "m" '(:ignore t :wk "Org")
- "m a" '(org-agenda :wk "Org agenda")
- "m e" '(org-export-dispatch :wk "Org export dispatch")
- "m i" '(org-toggle-item :wk "Org toggle item")
- "m t" '(org-todo :wk "Org todo")
- "m B" '(org-babel-tangle :wk "Org babel tangle")
- "m T" '(org-todo-list :wk "Org todo list"))
- (user/leader-keys
- "m b" '(:ignore t :wk "Tables")
- "m b -" '(org-table-insert-hline :wk "Insert hline in table"))
- (user/leader-keys
- "m d" '(:ignore t :wk "Date/deadline")
- "m d t" '(org-time-stamp :wk "Org time stamp"))
- (user/leader-keys
- "p" '(projectile-command-map :wk "Projectile"))
+ (use-package general
+ :config
+ (general-evil-setup)
+ ;; set up 'SPC' as the global leader key
+ (general-create-definer user/leader-keys
+ :states '(normal insert visual emacs)
+ :keymaps 'override
+ :prefix "SPC" ;; set leader
+ :global-prefix "M-SPC") ;; access leader in insert mode
-)
+ (user/leader-keys
+ "SPC" '(counsel-M-x :wk "Counsel M-x")
+ "." '(find-file :wk "Find file")
+ "=" '(perspective-map :wk "Perspective") ;; Lists all the perspective keybindings
+ "TAB TAB" '(comment-line :wk "Comment lines")
+ "u" '(universal-argument :wk "Univeral argument")
+ "s" '(universal-argument :wk "say I want to type somet")
+ "q" '(evil-quit :wk "quit emacs"))
+
+ (user/leader-keys
+ "b" '(:ignore t :wk "Bookmarks/Buffers")
+ "b c" '(clone-indirect-buffer :wk "Create indirect buffer copy in a split")
+ "b C" '(clone-indirect-buffer-other-window :wk "Clone indirect buffer in new window")
+ "b d" '(bookmark-delete :wk "Delete bookmark")
+ "b i" '(ibuffer :wk "Ibuffer")
+ "b k" '(kill-this-buffer :wk "Kill this buffer")
+ "b K" '(kill-some-buffers :wk "Kill multiple buffers")
+ "b l" '(list-bookmarks :wk "List bookmarks")
+ "b m" '(bookmark-set :wk "Set bookmark")
+ "b n" '(next-buffer :wk "Next buffer")
+ "b p" '(previous-buffer :wk "Previous buffer")
+ "b r" '(revert-buffer :wk "Reload buffer")
+ "b R" '(rename-buffer :wk "Rename buffer")
+ "b s" '(basic-save-buffer :wk "Save buffer")
+ "b S" '(save-some-buffers :wk "Save multiple buffers")
+ "b w" '(bookmark-save :wk "Save current bookmarks to bookmark file"))
+
+ (user/leader-keys
+ "d" '(:ignore t :wk "Dired")
+ "d d" '(dired :wk "Open dired")
+ "d j" '(dired-jump :wk "Dired jump to current")
+ "d p" '(peep-dired :wk "Peep-dired"))
+
+ (user/leader-keys
+ "e" '(:ignore t :wk "Eshell/Evaluate/EWW")
+ "e b" '(eval-buffer :wk "Evaluate elisp in buffer")
+ "e d" '(eval-defun :wk "Evaluate defun containing or after point")
+ "e e" '(eval-expression :wk "Evaluate and elisp expression")
+ "e h" '(counsel-esh-history :which-key "Eshell history")
+ "e l" '(eval-last-sexp :wk "Evaluate elisp expression before point")
+ "e r" '(eval-region :wk "Evaluate elisp in region")
+ "e R" '(eww-reload :which-key "Reload current page in EWW")
+ "e s" '(eshell :which-key "Eshell")
+ "e w" '(eww :which-key "EWW emacs web wowser"))
+
+ (user/leader-keys
+ "f" '(:ignore t :wk "Files")
+ "f c" '((lambda () (interactive)
+ (find-file (expand-file-name "config.org" user-emacs-directory)))
+ :wk "Open emacs config")
+ "f d" '(find-grep-dired :wk "Search for string in files in DIR")
+ "f e" '((lambda () (interactive)
+ (dired user-emacs-directory))
+ :wk "Open user-emacs-directory in dired")
+ "f i" '((lambda () (interactive)
+ (find-file (expand-file-name "init.el" user-emacs-directory)))
+ :wk "Open emacs init.el")
+ "f g" '(counsel-grep-or-swiper :wk "Search for string current file")
+ "f j" '(counsel-file-jump :wk "Jump to a file below current directory")
+ "f l" '(counsel-locate :wk "Locate a file")
+ "f r" '(counsel-recentf :wk "Find recent files")
+ "f w" '(evil-write :wk "Write current buffer"))
+
+ (user/leader-keys
+ "g" '(:ignore t :wk "Git")
+ "g /" '(magit-displatch :wk "Magit dispatch")
+ "g ." '(magit-file-displatch :wk "Magit file dispatch")
+ "g b" '(magit-branch-checkout :wk "Switch branch")
+ "g c" '(:ignore t :wk "Create")
+ "g c b" '(magit-branch-and-checkout :wk "Create branch and checkout")
+ "g c c" '(magit-commit-create :wk "Create commit")
+ "g c f" '(magit-commit-fixup :wk "Create fixup commit")
+ "g C" '(magit-clone :wk "Clone repo")
+ "g f" '(:ignore t :wk "Find")
+ "g f c" '(magit-show-commit :wk "Show commit")
+ "g f f" '(magit-find-file :wk "Magit find file")
+ "g f g" '(magit-find-git-config-file :wk "Find gitconfig file")
+ "g F" '(magit-fetch :wk "Git fetch")
+ "g g" '(magit-status :wk "Magit status")
+ "g i" '(magit-init :wk "Initialize git repo")
+ "g l" '(magit-log-buffer-file :wk "Magit buffer log")
+ "g r" '(vc-revert :wk "Git revert file")
+ "g s" '(magit-stage-file :wk "Git stage file")
+ "g t" '(git-timemachine :wk "Git time machine")
+ "g u" '(magit-stage-file :wk "Git unstage file"))
+
+ (user/leader-keys
+ "h" '(:ignore t :wk "Help")
+ "h a" '(counsel-apropos :wk "Apropos")
+ "h b" '(describe-bindings :wk "Describe bindings")
+ "h c" '(describe-char :wk "Describe character under cursor")
+ "h d" '(:ignore t :wk "Emacs documentation")
+ "h d a" '(about-emacs :wk "About Emacs")
+ "h d d" '(view-emacs-debugging :wk "View Emacs debugging")
+ "h d f" '(view-emacs-FAQ :wk "View Emacs FAQ")
+ "h d m" '(info-emacs-manual :wk "The Emacs manual")
+ "h d n" '(view-emacs-news :wk "View Emacs news")
+ "h d o" '(describe-distribution :wk "How to obtain Emacs")
+ "h d p" '(view-emacs-problems :wk "View Emacs problems")
+ "h d t" '(view-emacs-todo :wk "View Emacs todo")
+ "h d w" '(describe-no-warranty :wk "Describe no warranty")
+ "h e" '(view-echo-area-messages :wk "View echo area messages")
+ "h f" '(describe-function :wk "Describe function")
+ "h F" '(describe-face :wk "Describe face")
+ "h g" '(describe-gnu-project :wk "Describe GNU Project")
+ "h i" '(info :wk "Info")
+ "h I" '(describe-input-method :wk "Describe input method")
+ "h k" '(describe-key :wk "Describe key")
+ "h l" '(view-lossage :wk "Display recent keystrokes and the commands run")
+ "h L" '(describe-language-environment :wk "Describe language environment")
+ "h m" '(describe-mode :wk "Describe mode")
+ "h r" '(:ignore t :wk "Reload")
+ "h r r" '((lambda () (interactive)
+ (load-file (expand-file-name "init.el" user-emacs-directory))
+ (ignore (elpaca-process-queues)))
+ :wk "Reload emacs config")
+ "h t" '(load-theme :wk "Load theme")
+ "h v" '(describe-variable :wk "Describe variable")
+ "h w" '(where-is :wk "Prints keybinding for command if set")
+ "h x" '(describe-command :wk "Display full documentation for command"))
+
+ (user/leader-keys
+ "l" '(:ignore t :wk "load")
+ "l t" '(load-theme :wk "load theme"))
+
+ ;; org mode
+ (user/leader-keys
+ "m" '(:ignore t :wk "Org")
+ "m a" '(org-agenda :wk "Org agenda")
+ "m e" '(org-export-dispatch :wk "Org export dispatch")
+ "m i" '(org-toggle-item :wk "Org toggle item")
+ "m t" '(org-todo :wk "Org todo")
+ "m B" '(org-babel-tangle :wk "Org babel tangle")
+ "m T" '(org-todo-list :wk "Org todo list"))
+ (user/leader-keys
+ "m b" '(:ignore t :wk "Tables")
+ "m b -" '(org-table-insert-hline :wk "Insert hline in table"))
+ (user/leader-keys
+ "m d" '(:ignore t :wk "Date/deadline")
+ "m d t" '(org-time-stamp :wk "Org time stamp"))
+
+ (user/leader-keys
+ "o" '(:ignore t :wk "Open")
+ "o d" '(dashboard-open :wk "Dashboard")
+ ;; "o e" '(elfeed :wk "Elfeed RSS")
+ "o f" '(make-frame :wk "Open buffer in new frame")
+ "o F" '(select-frame-by-name :wk "Select frame by name")
+ "o s" '(shell :wk "open shell"))
+
+ (user/leader-keys
+ "p" '(projectile-command-map :wk "Projectile"))
+
+ ;; FIXME: fix the error here
+ ;; (user/leader-keys
+ ;; "s" '(:ignore t :wk "Search")
+ ;; "s d" '(dictionary-search :wk "Search dictionary")
+ ;; "s m" '(man :wk "Man pages")
+ ;; "s t" '(tldr :wk "Lookup TLDR docs for a command")
+ ;; "s w" '(woman :wk "Similar to man but doesn't require man")
+ ;; )
+
+ (user/leader-keys
+ "t" '(:ignore t :wk "Toggle")
+ "t l" '(display-line-numbers-mode :wk "Toggle line numbers")
+ "t t" '(visual-line-mode :wk "Toggle truncated lines")
+ "t" '(:ignore t :wk "Toggle")
+ "t e" '(eshell-toggle :wk "Toggle eshell")
+ ;; "t f" '(flycheck-mode :wk "Toggle flycheck")
+ "t o" '(org-mode :wk "Toggle org mode")
+ "t r" '(rainbow-mode :wk "Toggle rainbow mode")
+ "t t" '(visual-line-mode :wk "Toggle truncated lines"))
+
+ (user/leader-keys
+ "w" '(:ignore t :wk "Windows")
+ ;; Window splits
+ "w c" '(evil-window-delete :wk "Close window")
+ "w n" '(evil-window-new :wk "New window")
+ "w s" '(evil-window-split :wk "Horizontal split window")
+ "w v" '(evil-window-vsplit :wk "Vertical split window")
+ ;; Window motions
+ "w h" '(evil-window-left :wk "Window left")
+ "w j" '(evil-window-down :wk "Window down")
+ "w k" '(evil-window-up :wk "Window up")
+ "w l" '(evil-window-right :wk "Window right")
+ "w w" '(evil-window-next :wk "Goto next window")
+ ;; Move Windows
+ "w H" '(buf-move-left :wk "Buffer move left")
+ "w J" '(buf-move-down :wk "Buffer move down")
+ "w K" '(buf-move-up :wk "Buffer move up")
+ "w L" '(buf-move-right :wk "Buffer move right"))
+ )
#+end_src
@@ -312,8 +442,8 @@ This is just an example of how to create a simple function in Emacs. Use this f
#+end_src
-* Graphical configuration
-** Disable Menubar, Toolbars and Scrollbars
+* Graphical tweaks
+** Disable UI elements
#+begin_src emacs-lisp
(menu-bar-mode -1)
(tool-bar-mode -1)
@@ -325,6 +455,10 @@ This is just an example of how to create a simple function in Emacs. Use this f
(global-display-line-numbers-mode 1)
(global-visual-line-mode t)
#+end_src
+** blinking cursor
+#+begin_src emacs-lisp
+ (setq blink-cursor-mode nil)
+#+end_src
** Fonts
Defining the various fonts that Emacs will use.
@@ -364,36 +498,72 @@ Defining the various fonts that Emacs will use.
** Theme
How to make thet theme work even in daemon mode: (https://stackoverflow.com/questions/18904529/after-emacs-deamon-i-can-not-see-new-theme-in-emacsclient-frame-it-works-fr)
+#+begin_src emacs-lisp :noeval
+ (add-to-list 'custom-theme-load-path (expand-file-name "themes/" user-emacs-directory))
+ (use-package doom-themes
+ :config
+ (setq doom-themes-enable-bold t
+ doom-themes-enable-italic t)
+ (load-theme 'doom-nord t)
+ (doom-themes-org-config))
+#+end_src
+
+** Transparency
+
#+begin_src emacs-lisp
- (add-to-list 'custom-theme-load-path "~/.config/emacs/themes/")
- (defvar my:theme 'nord)
-(defvar my:theme-window-loaded nil)
-(defvar my:theme-terminal-loaded nil)
+ (add-to-list 'default-frame-alist '(alpha-background . 96))
+#+end_src
-(if (daemonp)
- (add-hook 'after-make-frame-functions(lambda (frame)
- (select-frame frame)
- (if (window-system frame)
- (unless my:theme-window-loaded
- (if my:theme-terminal-loaded
- (enable-theme my:theme)
- (load-theme my:theme t))
- (setq my:theme-window-loaded t))
- (unless my:theme-terminal-loaded
- (if my:theme-window-loaded
- (enable-theme my:theme)
- (load-theme my:theme t))
- (setq my:theme-terminal-loaded t)))))
+** Highlight TODO
+Adding highlights to TODO and related words.
- (progn
- (load-theme my:theme t)
- (if (display-graphic-p)
- (setq my:theme-window-loaded t)
- (setq my:theme-terminal-loaded t))))
+#+begin_src emacs-lisp
+(use-package hl-todo
+ :hook ((org-mode . hl-todo-mode)
+ (prog-mode . hl-todo-mode))
+ :config
+ (setq hl-todo-highlight-punctuation ":"
+ hl-todo-keyword-faces
+ `(("TODO" warning bold)
+ ("FIXME" error bold)
+ ("HACK" font-lock-constant-face bold)
+ ("REVIEW" font-lock-keyword-face bold)
+ ("NOTE" success bold)
+ ("DEPRECATED" font-lock-doc-face bold))))
#+end_src
+* Misc. options
+
+#+begin_src emacs-lisp
+
+ ;; move backup files to trash instead of same directory
+ (setq backup-directory-alist '((".*" . "~/.local/share/Trash/files")))
+
+ ;; escape minibuffer with one [escape]
+ (global-set-key [escape] 'keyboard-escape-quit)
+
+
+ ;; Automatically show changes if the file has changed
+ (global-auto-revert-mode t)
+
+ ;; You can select text and delete it by typing.
+ (delete-selection-mode 1)
+
+ ;; Turns on automatic parens pairing
+ (electric-pair-mode 1)
+ ;; The following prevents <> from auto-pairing when electric-pair-mode is on.
+ ;; Otherwise, org-tempo is broken when you try to <s TAB...
+ (add-hook 'org-mode-hook (lambda ()
+ (setq-local electric-pair-inhibit-predicate
+ `(lambda (c)
+ (if (char-equal c ?<) t (,electric-pair-inhibit-predicate c))))))
+
+ ;; display new page when scrolline 1 line from the bottom
+ (setq scroll-margin 1)
+#+end_src
+
* ORG Mode
** Enabling Table of Contents
#+begin_src emacs-lisp
@@ -411,8 +581,17 @@ Org-bullets gives us attractive bullets rather than asterisks.
(add-hook 'org-mode-hook (lambda () (org-bullets-mode 1)))
#+end_src
-** Source Code Block Tag Expansion
-Org-tempo is not a separate package but a module within org that can be enabled. Org-tempo allows for '<s' followed by TAB to expand to a begin_src tag. Other expansions available include:
+** Org Level Headers
+#+begin_src emacs-lisp
+ (custom-set-faces
+ '(org-level-1 ((t (:inherit outline-1 :height 1.25))))
+ '(org-level-2 ((t (:inherit outline-2 :height 1.15))))
+ '(org-level-3 ((t (:inherit outline-3 :height 1.10))))
+ '(org-level-4 ((t (:inherit outline-4 :height 1.05))))
+ '(org-level-5 ((t (:inherit outline-5 :height 1.00))))
+ '(org-level-6 ((t (:inherit outline-5 :height 1.00))))
+ '(org-level-7 ((t (:inherit outline-5 :height 1.00)))))
+#+end_src
| Typing the below + TAB | Expands to ... |
|------------------------+-----------------------------------------|
@@ -465,69 +644,105 @@ Eshell is an Emacs 'shell' that is written in Elisp.
#+end_src
-* Packages
-** Sudo edit
-[[https://github.com/nflath/sudo-edit][sudo-edit]] gives us the ability to open files with sudo privileges or switch over to editing with sudo privileges if we initially opened the file without such privileges.
-
+* Language Support
#+begin_src emacs-lisp
-(use-package sudo-edit
- :config
- (user/leader-keys
- "fu" '(sudo-edit-find-file :wk "Sudo find file")
- "fU" '(sudo-edit :wk "Sudo edit file")))
+ (use-package php-mode)
+
#+end_src
-** Which-Key
+
+* Packages
+
+** Dashboard
+Emacs Dashboard is an extensible startup screen showing you recent files, bookmarks, agenda items and an Emacs banner.
+
#+begin_src emacs-lisp
- (use-package which-key
+ (use-package dashboard
+ :ensure t
:init
- (which-key-mode 1)
+ (setq initial-buffer-choice 'dashboard-open)
+ (setq dashboard-set-heading-icons nil)
+ (setq dashboard-set-file-icons nil)
+ (setq dashboard-banner-logo-title "Emacs Is More Than A Text Editor!")
+ (setq dashboard-startup-banner 'logo) ;; use standard emacs logo as banner
+ ;; (setq dashboard-startup-banner "/home/aluc/.config/emacs/images/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 )
+ (bookmarks . 3)
+ (projects . 3)
+ (registers . 3)))
:config
- (setq which-key-side-window-location 'bottom
- which-key-sort-order #'which-key-key-order-alpha
- which-key-sort-uppercase-first nil
- which-key-add-column-padding 1
- which-key-max-display-columns nil
- which-key-min-display-lines 6
- which-key-side-window-slot -10
- which-key-side-window-max-height 0.25
- which-key-idle-delay 0.8
- which-key-max-description-length 25
- which-key-allow-imprecise-window-fit nil
- which-key-separator " → " ))
+ (dashboard-setup-startup-hook))
#+end_src
-** All The Icons
-This is an icon set that can be used with dashboard, dired, ibuffer and other Emacs programs.
-
+** Diminish
+This package implements hiding or abbreviation of the modeline displays (lighters) of minor-modes. With this package installed, you can add ':diminish' to any use-package block to hide that particular mode in the modeline.
+
#+begin_src emacs-lisp
-(use-package all-the-icons
- :ensure t
- :if (display-graphic-p))
+(use-package diminish)
-(use-package all-the-icons-dired
- :hook (dired-mode . (lambda () (all-the-icons-dired-mode t))))
#+end_src
-** Rainbow Mode
-Display the actual color as a background for any hex color value (ex. #ffffff). The code block below enables rainbow-mode in all programming modes (prog-mode) as well as org-mode, which is why rainbow works in this document.
+** Dired
+*** dired-open
+#+begin_src emacs-lisp
+ (use-package dired-open
+ :config
+ (setq dired-open-extensions '(("gif" . "imv")
+ ("jpg" . "imv")
+ ("png" . "imv")
+ ("mkv" . "mpv")
+ ("mp4" . "mpv"))))
+#+end_src
+*** peep-dired
#+begin_src emacs-lisp
- (use-package rainbow-mode
- :hook
- ((org-mode prog-mode) . rainbow-mode))
+ (use-package peep-dired
+ :after dired
+ :hook (evil-normalize-keymaps . peep-dired-hook)
+ :config
+ (evil-define-key 'normal dired-mode-map (kbd "h") 'dired-up-directory)
+ (evil-define-key 'normal dired-mode-map (kbd "l") 'dired-open-file) ; use dired-find-file instead if not using dired-open package
+ (evil-define-key 'normal peep-dired-mode-map (kbd "j") 'peep-dired-next-file)
+ (evil-define-key 'normal peep-dired-mode-map (kbd "k") 'peep-dired-prev-file))
#+end_src
-** IVY (Counsel)
+** Git
+*** Git Time Machine
+[[https://github.com/emacsmirror/git-timemachine][git-timemachine]] is a program that allows you to move backwards and forwards through a file's commits. 'SPC g t' will open the time machine on a file if it is in a git repo. Then, while in normal mode, you can use 'CTRL-j' and 'CTRL-k' to move backwards and forwards through the commits.
+
+
+#+begin_src emacs-lisp
+(use-package git-timemachine
+ :after git-timemachine
+ :hook (evil-normalize-keymaps . git-timemachine-hook)
+ :config
+ (evil-define-key 'normal git-timemachine-mode-map (kbd "C-j") 'git-timemachine-show-previous-revision)
+ (evil-define-key 'normal git-timemachine-mode-map (kbd "C-k") 'git-timemachine-show-next-revision)
+)
+#+end_src
+
+*** Magit
+[[https://magit.vc/manual/][Magit]] is a full-featured git client for Emacs.
+
+#+begin_src emacs-lisp
+(use-package magit)
+
+#+end_src
+
+** Ivy (Counsel)
+ Ivy, a generic completion mechanism for Emacs.
+ Counsel, a collection of Ivy-enhanced versions of common Emacs commands.
+ Ivy-rich allows us to add descriptions alongside the commands in M-x.
#+begin_src emacs-lisp
(use-package counsel
+ :diminish
:after ivy
:config (counsel-mode))
(use-package ivy
+ :diminish
:custom
(setq ivy-use-virtual-buffers t)
(setq ivy-count-format "(%d/%d) ")
@@ -535,11 +750,6 @@ Display the actual color as a background for any hex color value (ex. #ffffff).
:config
(ivy-mode))
- (use-package all-the-icons-ivy-rich
- :after ivy
- :ensure t
- :init (all-the-icons-ivy-rich-mode 1))
-
(use-package ivy-rich
:after ivy
:ensure t
@@ -554,69 +764,110 @@ Display the actual color as a background for any hex color value (ex. #ffffff).
#+end_src
-** Projectile
+** Language Support
+** Modeline
+The modeline is the bottom status bar that appears in Emacs windows. While you can create your own custom modeline, why go to the trouble when Doom Emacs already has a nice modeline package available. For more information on what is available to configure in the Doom modeline, check out: [[https://github.com/seagle0128/doom-modeline][Doom Modeline]]
+
#+begin_src emacs-lisp
-(use-package projectile
+(use-package doom-modeline
+ :ensure t
+ :init (doom-modeline-mode 1)
:config
- (projectile-mode 1))
+ (setq doom-modeline-height 24 ;; sets modeline height
+ doom-modeline-bar-width 3 ;; sets right bar width
+ doom-modeline-persp-name t ;; adds perspective name to modeline
+ doom-modeline-persp-icon nil)) ;; remove folder icon next to persp name
+
#+end_src
-** Dashboard
-Emacs Dashboard is an extensible startup screen showing you recent files, bookmarks, agenda items and an Emacs banner.
+** Perspective
+[[https://github.com/nex3/perspective-el][Perspective]] provides multiple named workspaces (or "perspectives") in Emacs, similar to multiple desktops in window managers. Each perspective has its own buffer list and its own window layout, along with some other isolated niceties, like the [[https://www.gnu.org/software/emacs/manual/html_node/emacs/Xref.html][xref]] ring.
#+begin_src emacs-lisp
- (use-package dashboard
- :ensure t
- :init
- (setq initial-buffer-choice 'dashboard-open)
- (setq dashboard-set-heading-icons t)
- (setq dashboard-set-file-icons t)
- (setq dashboard-banner-logo-title "Emacs Is More Than A Text Editor!")
- (setq dashboard-startup-banner 'logo) ;; use standard emacs logo as banner
- ;; (setq dashboard-startup-banner "/home/aluc/.config/emacs/images/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 )
- (bookmarks . 3)
- (projects . 3)
- (registers . 3)))
+ (use-package perspective
:custom
- (dashboard-modify-heading-icons '((recents . "file-text")
- (bookmarks . "book")))
+ ;; helps suppress an annoying warning message.
+ (persp-mode-prefix-key (kbd "C-c M-p"))
+ :init
+ (persp-mode)
:config
- (dashboard-setup-startup-hook))
+ ;; Sets a file to write to when we save states
+ (setq persp-state-default-file (expand-file-name "sessions" user-emacs-directory)))
+
+ ;; This will group buffers by persp-name in ibuffer.
+ (add-hook 'ibuffer-hook
+ (lambda ()
+ (persp-ibuffer-set-filter-groups)
+ (unless (eq ibuffer-sorting-mode 'alphabetic)
+ (ibuffer-do-sort-by-alphabetic))))
+
+ ;; Automatically save perspective states to file when Emacs exits.
+ (add-hook 'kill-emacs-hook #'persp-state-save)
+
#+end_src
-** Flycheck
-Install =luacheck= from your Linux distro's repositories for flycheck to work correctly with lua files. Install =python-pylint= for flycheck to work with python files. Haskell works with flycheck as long as =haskell-ghc= or =haskell-stack-ghc= is installed. For more information on language support for flycheck, [[https://www.flycheck.org/en/latest/languages.html][read this]].
+** Projectile
+#+begin_src emacs-lisp
+(use-package projectile
+ :config
+ (projectile-mode 1))
+#+end_src
+
+** Rainbow Mode
+Display the actual color as a background for any hex color value (ex. #ffffff). The code block below enables rainbow-mode in all programming modes (prog-mode) as well as org-mode, which is why rainbow works in this document.
#+begin_src emacs-lisp
-(use-package flycheck
- :ensure t
- :defer t
+ (use-package rainbow-mode
:diminish
- :init (global-flycheck-mode))
+ :hook
+ ((org-mode prog-mode) . rainbow-mode))
+#+end_src
+
+** Rainbow Delimiters
+Adding rainbow coloring to parentheses.
+
+#+begin_src emacs-lisp
+(use-package rainbow-delimiters
+ :hook ((emacs-lisp-mode . rainbow-delimiters-mode)
+ (clojure-mode . rainbow-delimiters-mode)))
#+end_src
-** COMPANY
-[[https://company-mode.github.io/][Company]] is a text completion framework for Emacs. The name stands for "complete anything". Completion will start automatically after you type a few letters. Use M-n and M-p to select, <return> to complete or <tab> to complete the common part.
+** Sudo edit
+[[https://github.com/nflath/sudo-edit][sudo-edit]] gives us the ability to open files with sudo privileges or switch over to editing with sudo privileges if we initially opened the file without such privileges.
#+begin_src emacs-lisp
- (use-package company
- :defer 2
- :diminish
- :custom
- (company-begin-commands '(self-insert-command))
- (company-idle-delay .1)
- (company-minimum-prefix-length 2)
- (company-show-numbers t)
- (company-tooltip-align-annotations 't)
- (global-company-mode t))
-
- (use-package company-box
- :after company
- :diminish
- :hook (company-mode . company-box-mode))
+(use-package sudo-edit
+ :config
+ (user/leader-keys
+ "fu" '(sudo-edit-find-file :wk "Sudo find file")
+ "fU" '(sudo-edit :wk "Sudo edit file")))
+#+end_src
+
+** TLDR
+
+#+begin_src emacs-lisp
+(use-package tldr)
+
+#+end_src
+
+** Which-Key
+#+begin_src emacs-lisp
+ (use-package which-key
+ :init
+ (which-key-mode 1)
+ :config
+ (setq which-key-side-window-location 'bottom
+ which-key-sort-order #'which-key-key-order-alpha
+ which-key-sort-uppercase-first nil
+ which-key-add-column-padding 1
+ which-key-max-display-columns nil
+ which-key-min-display-lines 6
+ which-key-side-window-slot -10
+ which-key-side-window-max-height 0.25
+ which-key-idle-delay 0.8
+ which-key-max-description-length 25
+ which-key-allow-imprecise-window-fit nil
+ which-key-separator " → " ))
#+end_src
diff --git a/config/extra/emacs/init.el b/config/extra/emacs/init.el
index 19a2beb..537edcf 100644
--- a/config/extra/emacs/init.el
+++ b/config/extra/emacs/init.el
@@ -8,10 +8,17 @@
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(custom-safe-themes
- '("4c7228157ba3a48c288ad8ef83c490b94cb29ef01236205e360c2c4db200bb18" default)))
+ '("88f7ee5594021c60a4a6a1c275614103de8c1435d6d08cc58882f920e0cec65e" "4c7228157ba3a48c288ad8ef83c490b94cb29ef01236205e360c2c4db200bb18" default))
+ '(package-selected-packages '(doom-modeline)))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
- )
+ '(org-level-1 ((t (:inherit outline-1 :height 1.25))))
+ '(org-level-2 ((t (:inherit outline-2 :height 1.15))))
+ '(org-level-3 ((t (:inherit outline-3 :height 1.1))))
+ '(org-level-4 ((t (:inherit outline-4 :height 1.0))))
+ '(org-level-5 ((t (:inherit outline-5 :height 1.0))))
+ '(org-level-6 ((t (:inherit outline-5 :height 1.0))))
+ '(org-level-7 ((t (:inherit outline-5 :height 1.0)))))