Adding ligatures and dired tweaks

This commit is contained in:
Chris Cochrun 2021-02-18 06:41:30 -06:00
parent ae8fde41e1
commit b4c9e64328
3 changed files with 80 additions and 3 deletions

View file

@ -7,12 +7,14 @@
- [[#keep-folders-clean][Keep Folders Clean]] - [[#keep-folders-clean][Keep Folders Clean]]
- [[#set-basic-ui-config][Set basic UI config]] - [[#set-basic-ui-config][Set basic UI config]]
- [[#lets-bootstrap-straightel][Let's bootstrap straight.el]] - [[#lets-bootstrap-straightel][Let's bootstrap straight.el]]
- [[#ligatures][Ligatures]]
- [[#keybindings][Keybindings]] - [[#keybindings][Keybindings]]
- [[#undo-tree][Undo-Tree]] - [[#undo-tree][Undo-Tree]]
- [[#better-ui][Better UI]] - [[#better-ui][Better UI]]
- [[#completion][Completion]] - [[#completion][Completion]]
- [[#help][Help]] - [[#help][Help]]
- [[#format][Format]] - [[#format][Format]]
- [[#file-management][File Management]]
- [[#org-mode][Org Mode]] - [[#org-mode][Org Mode]]
- [[#magit][Magit]] - [[#magit][Magit]]
- [[#pdf-tools][PDF-Tools]] - [[#pdf-tools][PDF-Tools]]
@ -40,7 +42,7 @@ Let's create a message that will tell us how long it takes emacs to load in orde
#+end_src #+end_src
Let's also set the =gc-cons-threshold= variable to a high setting for the remainder of our setup process to speed things up. Let's also set the =gc-cons-threshold= variable to a high setting for the remainder of our setup process to speed things up.
#+begin_src emacs-lisp #+begin_src emacs-lisp :tangle no
(setq gc-cons-threshold 50000000) (setq gc-cons-threshold 50000000)
#+end_src #+end_src
** Keep Folders Clean ** Keep Folders Clean
@ -164,6 +166,37 @@ Also, real quick let's make sure that ~<escape>~ works as the same as ~<C-g>~
:defer 1) :defer 1)
#+end_src #+end_src
** Ligatures
Here let's try to add ligatures to our font system since the VictorMono Nerd Font supports all ligatures being a "Nerd Font".
#+begin_src emacs-lisp
(let ((alist '((?! . "\\(?:!\\(?:==\\|[!=]\\)\\)")
(?# . "\\(?:#\\(?:###?\\|_(\\|[!#(:=?[_{]\\)\\)")
(?$ . "\\(?:\\$>\\)")
(?& . "\\(?:&&&?\\)")
(?* . "\\(?:\\*\\(?:\\*\\*\\|[/>]\\)\\)")
(?+ . "\\(?:\\+\\(?:\\+\\+\\|[+>]\\)\\)")
(?- . "\\(?:-\\(?:-[>-]\\|<<\\|>>\\|[<>|~-]\\)\\)")
(?. . "\\(?:\\.\\(?:\\.[.<]\\|[.=?-]\\)\\)")
(?/ . "\\(?:/\\(?:\\*\\*\\|//\\|==\\|[*/=>]\\)\\)")
(?: . "\\(?::\\(?:::\\|\\?>\\|[:<-?]\\)\\)")
(?\; . "\\(?:;;\\)")
(?< . "\\(?:<\\(?:!--\\|\\$>\\|\\*>\\|\\+>\\|-[<>|]\\|/>\\|<[<=-]\\|=\\(?:=>\\|[<=>|]\\)\\||\\(?:||::=\\|[>|]\\)\\|~[>~]\\|[$*+/:<=>|~-]\\)\\)")
(?= . "\\(?:=\\(?:!=\\|/=\\|:=\\|=[=>]\\|>>\\|[=>]\\)\\)")
(?> . "\\(?:>\\(?:=>\\|>[=>-]\\|[]:=-]\\)\\)")
(?? . "\\(?:\\?[.:=?]\\)")
(?\[ . "\\(?:\\[\\(?:||]\\|[<|]\\)\\)")
(?\ . "\\(?:\\\\/?\\)")
(?\] . "\\(?:]#\\)")
(?^ . "\\(?:\\^=\\)")
(?_ . "\\(?:_\\(?:|?_\\)\\)")
(?{ . "\\(?:{|\\)")
(?| . "\\(?:|\\(?:->\\|=>\\||\\(?:|>\\|[=>-]\\)\\|[]=>|}-]\\)\\)")
(?~ . "\\(?:~\\(?:~>\\|[=>@~-]\\)\\)"))))
(dolist (char-regexp alist)
(set-char-table-range composition-function-table (car char-regexp)
`([,(cdr char-regexp) 0 font-shape-gstring]))))
#+end_src
** Keybindings ** Keybindings
There are two major packages we need to get the functionality I desire. Evil and general. There are two major packages we need to get the functionality I desire. Evil and general.
#+begin_src emacs-lisp #+begin_src emacs-lisp
@ -407,6 +440,16 @@ Marginalia makes for some great decoration to our minibuffer completion items. W
(setq format-all-formatters '("Emacs Lisp" emacs-lisp)) (setq format-all-formatters '("Emacs Lisp" emacs-lisp))
:defer 1) :defer 1)
#+end_src #+end_src
** File Management
*** Dired
#+begin_src emacs-lisp
(chris/leader-keys
"od" '(dired-jump :which-key "open dired here"))
(general-def 'normal dired-mode-map
"h" 'dired-up-directory
"l" 'dired-find-file
"q" 'kill-this-buffer)
#+end_src
** Org Mode ** Org Mode
Let's start by creating a self contained function of what I'd like started on every org buffer. Let's start by creating a self contained function of what I'd like started on every org buffer.
@ -628,6 +671,7 @@ As of right now I haven't fully setup my early-init file, this does not export i
;; threshold to temporarily prevent it from running, then reset it later by ;; threshold to temporarily prevent it from running, then reset it later by
;; enabling `gcmh-mode'. Not resetting it will cause stuttering/freezes. ;; enabling `gcmh-mode'. Not resetting it will cause stuttering/freezes.
(setq gc-cons-threshold 50000000) (setq gc-cons-threshold 50000000)
(message "set gc-cons-threshold to 50000000")
;; ;; In noninteractive sessions, prioritize non-byte-compiled source files to ;; ;; In noninteractive sessions, prioritize non-byte-compiled source files to
;; ;; prevent the use of stale byte-code. Otherwise, it saves us a little IO time ;; ;; prevent the use of stale byte-code. Otherwise, it saves us a little IO time

View file

@ -7,6 +7,7 @@
;; threshold to temporarily prevent it from running, then reset it later by ;; threshold to temporarily prevent it from running, then reset it later by
;; enabling `gcmh-mode'. Not resetting it will cause stuttering/freezes. ;; enabling `gcmh-mode'. Not resetting it will cause stuttering/freezes.
(setq gc-cons-threshold 50000000) (setq gc-cons-threshold 50000000)
(message "set gc-cons-threshold to 50000000")
;; ;; In noninteractive sessions, prioritize non-byte-compiled source files to ;; ;; In noninteractive sessions, prioritize non-byte-compiled source files to
;; ;; prevent the use of stale byte-code. Otherwise, it saves us a little IO time ;; ;; prevent the use of stale byte-code. Otherwise, it saves us a little IO time

36
init.el
View file

@ -7,8 +7,6 @@
gcs-done)) gcs-done))
(add-hook 'emacs-startup-hook #'chris/display-startup-time) (add-hook 'emacs-startup-hook #'chris/display-startup-time)
(setq gc-cons-threshold 50000000)
(setq inhibit-startup-message t) (setq inhibit-startup-message t)
(scroll-bar-mode -1) (scroll-bar-mode -1)
@ -83,6 +81,33 @@
(which-key-mode) (which-key-mode)
:defer 1) :defer 1)
(let ((alist '((?! . "\\(?:!\\(?:==\\|[!=]\\)\\)")
(?# . "\\(?:#\\(?:###?\\|_(\\|[!#(:=?[_{]\\)\\)")
(?$ . "\\(?:\\$>\\)")
(?& . "\\(?:&&&?\\)")
(?* . "\\(?:\\*\\(?:\\*\\*\\|[/>]\\)\\)")
(?+ . "\\(?:\\+\\(?:\\+\\+\\|[+>]\\)\\)")
(?- . "\\(?:-\\(?:-[>-]\\|<<\\|>>\\|[<>|~-]\\)\\)")
(?. . "\\(?:\\.\\(?:\\.[.<]\\|[.=?-]\\)\\)")
(?/ . "\\(?:/\\(?:\\*\\*\\|//\\|==\\|[*/=>]\\)\\)")
(?: . "\\(?::\\(?:::\\|\\?>\\|[:<-?]\\)\\)")
(?\; . "\\(?:;;\\)")
(?< . "\\(?:<\\(?:!--\\|\\$>\\|\\*>\\|\\+>\\|-[<>|]\\|/>\\|<[<=-]\\|=\\(?:=>\\|[<=>|]\\)\\||\\(?:||::=\\|[>|]\\)\\|~[>~]\\|[$*+/:<=>|~-]\\)\\)")
(?= . "\\(?:=\\(?:!=\\|/=\\|:=\\|=[=>]\\|>>\\|[=>]\\)\\)")
(?> . "\\(?:>\\(?:=>\\|>[=>-]\\|[]:=-]\\)\\)")
(?? . "\\(?:\\?[.:=?]\\)")
(?\[ . "\\(?:\\[\\(?:||]\\|[<|]\\)\\)")
(?\ . "\\(?:\\\\/?\\)")
(?\] . "\\(?:]#\\)")
(?^ . "\\(?:\\^=\\)")
(?_ . "\\(?:_\\(?:|?_\\)\\)")
(?{ . "\\(?:{|\\)")
(?| . "\\(?:|\\(?:->\\|=>\\||\\(?:|>\\|[=>-]\\)\\|[]=>|}-]\\)\\)")
(?~ . "\\(?:~\\(?:~>\\|[=>@~-]\\)\\)"))))
(dolist (char-regexp alist)
(set-char-table-range composition-function-table (car char-regexp)
`([,(cdr char-regexp) 0 font-shape-gstring]))))
(use-package evil (use-package evil
:init :init
(setq evil-want-integration t (setq evil-want-integration t
@ -213,6 +238,13 @@
(setq format-all-formatters '("Emacs Lisp" emacs-lisp)) (setq format-all-formatters '("Emacs Lisp" emacs-lisp))
:defer 1) :defer 1)
(chris/leader-keys
"od" '(dired-jump :which-key "open dired here"))
(general-def 'normal dired-mode-map
"h" 'dired-up-directory
"l" 'dired-find-file
"q" 'kill-this-buffer)
(defun chris/org-mode-setup () (defun chris/org-mode-setup ()
(org-indent-mode +1) (org-indent-mode +1)
(toc-org-mode +1) (toc-org-mode +1)