Adding Calendar, eshell, and some formatting
This commit is contained in:
parent
b4c9e64328
commit
ab3b1e014c
391
README.org
391
README.org
|
@ -16,7 +16,9 @@
|
||||||
- [[#format][Format]]
|
- [[#format][Format]]
|
||||||
- [[#file-management][File Management]]
|
- [[#file-management][File Management]]
|
||||||
- [[#org-mode][Org Mode]]
|
- [[#org-mode][Org Mode]]
|
||||||
|
- [[#calendar][Calendar]]
|
||||||
- [[#magit][Magit]]
|
- [[#magit][Magit]]
|
||||||
|
- [[#eshell][Eshell]]
|
||||||
- [[#pdf-tools][PDF-Tools]]
|
- [[#pdf-tools][PDF-Tools]]
|
||||||
- [[#garbage-collection][Garbage Collection]]
|
- [[#garbage-collection][Garbage Collection]]
|
||||||
- [[#early-init][Early Init]]
|
- [[#early-init][Early Init]]
|
||||||
|
@ -47,49 +49,50 @@ Let's also set the =gc-cons-threshold= variable to a high setting for the remain
|
||||||
#+end_src
|
#+end_src
|
||||||
** Keep Folders Clean
|
** Keep Folders Clean
|
||||||
|
|
||||||
Let's setup a backup and auto-save location to keep our main directory clean. The autosave directory needs to be created first.
|
Let's use =no-littering= in order to stop emacs from filling all our folders with junk.
|
||||||
#+begin_src emacs-lisp :tangle no
|
#+begin_src emacs-lisp :tangle no
|
||||||
|
(use-package no-littering)
|
||||||
|
|
||||||
(setq backup-directory-alist '(("." . "/home/chris/.dotemacs/tmp/backups/")))
|
;; no-littering doesn't set this by default so we must place
|
||||||
|
;; auto save files in the same path as it uses for sessions
|
||||||
(make-directory (expand-file-name "tmp/autosaves/" user-emacs-directory) t)
|
(setq auto-save-file-name-transforms
|
||||||
|
`((".*" ,(no-littering-expand-var-file-name "auto-save/") t)))
|
||||||
(setq auto-save-list-file-prefix (expand-file-name "tmp/autosaves/sessions/" user-emacs-directory)
|
|
||||||
auto-save-file-name-transforms '((".*" (expand-file-name "tmp/autosaves/" user-emacs-directory) t)))
|
|
||||||
|
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
** Set basic UI config
|
** Set basic UI config
|
||||||
Let's start by making some basic ui changes like turning off the scrollbar, toolbar, menu, tooltips, and setting our font and some things.
|
Let's start by making some basic ui changes like turning off the scrollbar, toolbar, menu, tooltips, and setting our font and some things.
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(setq inhibit-startup-message t)
|
(setq inhibit-startup-message t)
|
||||||
|
|
||||||
(scroll-bar-mode -1)
|
(scroll-bar-mode -1)
|
||||||
(tool-bar-mode -1)
|
(tool-bar-mode -1)
|
||||||
(tooltip-mode -1)
|
(tooltip-mode -1)
|
||||||
(set-fringe-mode 1)
|
(set-fringe-mode 1)
|
||||||
|
|
||||||
(menu-bar-mode -1)
|
(menu-bar-mode -1)
|
||||||
(blink-cursor-mode -1)
|
(blink-cursor-mode -1)
|
||||||
(column-number-mode +1)
|
(column-number-mode +1)
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
In order to have this config work on both my desktop with regular joe-schmoe monitors and my laptop with new-hotness HiDPI monitor, I will set the font size if my system is the laptop to much higher.
|
In order to have this config work on both my desktop with regular joe-schmoe monitors and my laptop with new-hotness HiDPI monitor, I will set the font size if my system is the laptop to much higher.
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(if (string-equal (system-name) "chris-linuxlaptop")
|
(if (string-equal (system-name) "chris-linuxlaptop")
|
||||||
(defvar chris/default-font-size 240)
|
(defvar chris/default-font-size 240)
|
||||||
(defvar chris/default-font-size 120))
|
(defvar chris/default-font-size 120))
|
||||||
|
|
||||||
(set-face-attribute 'default nil :font "VictorMono Nerd Font" :height chris/default-font-size)
|
(set-face-attribute 'default nil :font "VictorMono Nerd Font"
|
||||||
(set-face-attribute 'fixed-pitch nil :font "VictorMono Nerd Font" :height chris/default-font-size)
|
:height chris/default-font-size)
|
||||||
(set-face-attribute 'variable-pitch nil :font "Cantarell" :height chris/default-font-size :weight 'regular)
|
(set-face-attribute 'fixed-pitch nil :font "VictorMono Nerd Font"
|
||||||
|
:height chris/default-font-size)
|
||||||
|
(set-face-attribute 'variable-pitch nil :font "Cantarell"
|
||||||
|
:height chris/default-font-size :weight 'regular)
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
Then let's make sure line-numbers are relative and on. And let's turn on visual-line-mode globally.
|
Then let's make sure line-numbers are relative and on. And let's turn on visual-line-mode globally.
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(setq display-line-numbers-type 'relative)
|
(setq display-line-numbers-type 'relative)
|
||||||
(display-line-numbers-mode +1)
|
(display-line-numbers-mode +1)
|
||||||
(global-visual-line-mode +1)
|
(global-visual-line-mode +1)
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
Let's make doc-view better
|
Let's make doc-view better
|
||||||
|
@ -133,13 +136,13 @@ Also, real quick let's make sure that ~<escape>~ works as the same as ~<C-g>~
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package doom-modeline
|
(use-package doom-modeline
|
||||||
:ensure t
|
:ensure t
|
||||||
:init
|
:init
|
||||||
(doom-modeline-mode 1)
|
(doom-modeline-mode 1)
|
||||||
(setq doom-modeline-height 35
|
(setq doom-modeline-height 35
|
||||||
doom-modeline-bar-width 3
|
doom-modeline-bar-width 3
|
||||||
all-the-icons-scale-factor 0.9))
|
all-the-icons-scale-factor 0.9))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
|
@ -154,16 +157,23 @@ Also, real quick let's make sure that ~<escape>~ works as the same as ~<C-g>~
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package adaptive-wrap
|
(use-package smartparens
|
||||||
:defer t)
|
:defer 1
|
||||||
|
:config
|
||||||
|
(smartparens-global-mode +1))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package which-key
|
(use-package adaptive-wrap
|
||||||
:config
|
:defer t)
|
||||||
(setq which-key-idle-delay 0.3)
|
#+end_src
|
||||||
(which-key-mode)
|
|
||||||
:defer 1)
|
#+begin_src emacs-lisp
|
||||||
|
(use-package which-key
|
||||||
|
:config
|
||||||
|
(setq which-key-idle-delay 0.3)
|
||||||
|
(which-key-mode)
|
||||||
|
:defer 1)
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
** Ligatures
|
** Ligatures
|
||||||
|
@ -200,17 +210,17 @@ Here let's try to add ligatures to our font system since the VictorMono Nerd Fon
|
||||||
** 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
|
||||||
(use-package evil
|
(use-package evil
|
||||||
:init
|
:init
|
||||||
(setq evil-want-integration t
|
(setq evil-want-integration t
|
||||||
evil-want-keybinding nil
|
evil-want-keybinding nil
|
||||||
evil-want-C-i-jump nil
|
evil-want-C-i-jump nil
|
||||||
evil-want-C-u-scroll t
|
evil-want-C-u-scroll t
|
||||||
evil-respect-visual-line-mode t
|
evil-respect-visual-line-mode t
|
||||||
evil-want-C-u-delete t)
|
evil-want-C-u-delete t)
|
||||||
:config
|
:config
|
||||||
(evil-mode +1)
|
(evil-mode +1)
|
||||||
(setq evil-undo-system 'undo-tree))
|
(setq evil-undo-system 'undo-tree))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
This evil-collection package includes a lot of other evil based things.
|
This evil-collection package includes a lot of other evil based things.
|
||||||
|
@ -239,6 +249,7 @@ This evil-collection package includes a lot of other evil based things.
|
||||||
"n" '(:ignore t :which-key "notes")
|
"n" '(:ignore t :which-key "notes")
|
||||||
"bs" '(consult-buffer :which-key "buffer search")
|
"bs" '(consult-buffer :which-key "buffer search")
|
||||||
"bd" '(kill-this-buffer :which-key "kill buffer")
|
"bd" '(kill-this-buffer :which-key "kill buffer")
|
||||||
|
"bi" '(ibuffer :which-key "ibuffer")
|
||||||
"tt" '(consult-theme :which-key "choose theme")
|
"tt" '(consult-theme :which-key "choose theme")
|
||||||
"ff" '(find-file :which-key "find file")
|
"ff" '(find-file :which-key "find file")
|
||||||
"fr" '(consult-recent-file :which-key "recent file")
|
"fr" '(consult-recent-file :which-key "recent file")
|
||||||
|
@ -247,7 +258,6 @@ This evil-collection package includes a lot of other evil based things.
|
||||||
"hv" '(helpful-variable :which-key "describe-variable")
|
"hv" '(helpful-variable :which-key "describe-variable")
|
||||||
"hk" '(helpful-key :which-key "describe-key")
|
"hk" '(helpful-key :which-key "describe-key")
|
||||||
"hi" '(info :which-key "info manual")
|
"hi" '(info :which-key "info manual")
|
||||||
"od" '(dired-jump :which-key "dired jump")
|
|
||||||
"ss" '(consult-line :which-key "consult search")
|
"ss" '(consult-line :which-key "consult search")
|
||||||
"ww" '(other-window :which-key "other window")
|
"ww" '(other-window :which-key "other window")
|
||||||
"wd" '(delete-window :which-key "other window")
|
"wd" '(delete-window :which-key "other window")
|
||||||
|
@ -286,8 +296,8 @@ This evil-collection package includes a lot of other evil based things.
|
||||||
#+end_src
|
#+end_src
|
||||||
*** TOC-ORG
|
*** TOC-ORG
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package toc-org
|
(use-package toc-org
|
||||||
:after org)
|
:after org)
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
** Completion
|
** Completion
|
||||||
|
@ -297,34 +307,33 @@ My completion framework is a combination of packages so that everything remains
|
||||||
I prefer selectrum over Ivy or Helm for completions. It is using the basic completing read system and therefore it is more inline with basic emacs. Also, let's add prescient to be able to filter selectrum well. We'll add some keybindings too for easier navigation on the home row.
|
I prefer selectrum over Ivy or Helm for completions. It is using the basic completing read system and therefore it is more inline with basic emacs. Also, let's add prescient to be able to filter selectrum well. We'll add some keybindings too for easier navigation on the home row.
|
||||||
|
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
(use-package selectrum
|
(use-package selectrum
|
||||||
:init
|
:init
|
||||||
(selectrum-mode +1)
|
(selectrum-mode +1)
|
||||||
:config
|
:config
|
||||||
(general-define-key
|
(general-define-key
|
||||||
:keymaps 'selectrum-minibuffer-map
|
:keymaps 'selectrum-minibuffer-map
|
||||||
"C-j" 'selectrum-next-candidate
|
"C-j" 'selectrum-next-candidate
|
||||||
"C-k" 'selectrum-previous-candidate
|
"C-k" 'selectrum-previous-candidate
|
||||||
"C-S-j" 'selectrum-goto-end
|
"C-S-j" 'selectrum-goto-end
|
||||||
"C-S-k" 'selectrum-goto-beginning
|
"C-S-k" 'selectrum-goto-beginning
|
||||||
"TAB" 'selectrum-insert-current-candidate)
|
"TAB" 'selectrum-insert-current-candidate)
|
||||||
:commands completing-read)
|
:commands completing-read)
|
||||||
|
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
We need prescient so we can have smarter sorting and filtering by default. Ontop of that, setting persistance in prescient makes it get better over time.
|
We need prescient so we can have smarter sorting and filtering by default. Ontop of that, setting persistance in prescient makes it get better over time.
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package prescient
|
(use-package prescient
|
||||||
:config
|
:config
|
||||||
(prescient-persist-mode +1)
|
(prescient-persist-mode +1)
|
||||||
:after selectrum)
|
:after selectrum)
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
(use-package selectrum-prescient
|
(use-package selectrum-prescient
|
||||||
:init
|
:init
|
||||||
(selectrum-prescient-mode +1)
|
(selectrum-prescient-mode +1)
|
||||||
:after selectrum)
|
:after selectrum)
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
#+BEGIN_SRC elisp :tangle no
|
#+BEGIN_SRC elisp :tangle no
|
||||||
|
@ -359,79 +368,76 @@ Here we use posframe to make a prettier minibuffer. Posframe will work with EXWM
|
||||||
|
|
||||||
This is similar but using mini-frame. Mini-frame works well, but not if using exwm. With exwm the X windows get displayed above the mini-frame, so the minibuffer isn't visible. Best to let Selectrum or Consult push the frame up and view the vertical completions below the frame.
|
This is similar but using mini-frame. Mini-frame works well, but not if using exwm. With exwm the X windows get displayed above the mini-frame, so the minibuffer isn't visible. Best to let Selectrum or Consult push the frame up and view the vertical completions below the frame.
|
||||||
#+BEGIN_SRC elisp :tangle no
|
#+BEGIN_SRC elisp :tangle no
|
||||||
(mini-frame-mode +1)
|
(mini-frame-mode +1)
|
||||||
(mini-frame-mode -1)
|
(mini-frame-mode -1)
|
||||||
(setq resize-mini-frames t)
|
(setq resize-mini-frames t)
|
||||||
(custom-set-variables
|
(custom-set-variables
|
||||||
'(mini-frame-show-parameters
|
'(mini-frame-show-parameters
|
||||||
'((top . 400)
|
'((top . 400)
|
||||||
(width . 0.7)
|
(width . 0.7)
|
||||||
(left . 0.5))))
|
(left . 0.5))))
|
||||||
|
|
||||||
;; workaround bug#44080, should be fixed in version 27.2 and above, see #169
|
;; workaround bug#44080, should be fixed in version 27.2 and above, see #169
|
||||||
(define-advice fit-frame-to-buffer (:around (f &rest args) dont-skip-ws-for-mini-frame)
|
(define-advice fit-frame-to-buffer (:around (f &rest args) dont-skip-ws-for-mini-frame)
|
||||||
(cl-letf* ((orig (symbol-function #'window-text-pixel-size))
|
(cl-letf* ((orig (symbol-function #'window-text-pixel-size))
|
||||||
((symbol-function #'window-text-pixel-size)
|
((symbol-function #'window-text-pixel-size)
|
||||||
(lambda (win from to &rest args)
|
(lambda (win from to &rest args)
|
||||||
(apply orig
|
(apply orig
|
||||||
(append (list win from
|
(append (list win from
|
||||||
(if (and (window-minibuffer-p win)
|
(if (and (window-minibuffer-p win)
|
||||||
(frame-root-window-p win)
|
(frame-root-window-p win)
|
||||||
(eq t to))
|
(eq t to))
|
||||||
nil
|
nil
|
||||||
to))
|
to))
|
||||||
args)))))
|
args)))))
|
||||||
(apply f args)))
|
(apply f args)))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
#+RESULTS:
|
|
||||||
: fit-frame-to-buffer@dont-skip-ws-for-mini-frame
|
|
||||||
|
|
||||||
*** CONSULT
|
*** CONSULT
|
||||||
Consult has a lot of nice functions like Ivy's Counsel functions (enhanced searching functions), lets set some of them in the keymap so they are easily used.
|
Consult has a lot of nice functions like Ivy's Counsel functions (enhanced searching functions), lets set some of them in the keymap so they are easily used.
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package consult
|
(use-package consult
|
||||||
:after selectrum)
|
:after selectrum)
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
#+begin_src emacs-lisp :tangle no
|
#+begin_src emacs-lisp :tangle no
|
||||||
(map! :leader "s s" 'consult-line
|
(map! :leader "s s" 'consult-line
|
||||||
:leader "f r" 'consult-recent-file)
|
:leader "f r" 'consult-recent-file)
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
*** MARGINALIA
|
*** MARGINALIA
|
||||||
|
|
||||||
Marginalia makes for some great decoration to our minibuffer completion items. Works great with Selectrum which does not have this out of the box.
|
Marginalia makes for some great decoration to our minibuffer completion items. Works great with Selectrum which does not have this out of the box.
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package marginalia
|
(use-package marginalia
|
||||||
:bind (:map minibuffer-local-map
|
:bind (:map minibuffer-local-map
|
||||||
("C-M-a" . marginalia-cycle)
|
("C-M-a" . marginalia-cycle)
|
||||||
;; :map embark-general-map
|
;; :map embark-general-map
|
||||||
;; ("A" . marginalia-cycle)
|
;; ("A" . marginalia-cycle)
|
||||||
)
|
)
|
||||||
|
|
||||||
;; The :init configuration is always executed (Not lazy!)
|
;; The :init configuration is always executed (Not lazy!)
|
||||||
:init
|
:init
|
||||||
|
|
||||||
;; Must be in the :init section of use-package such that the mode gets
|
;; Must be in the :init section of use-package such that the mode gets
|
||||||
;; enabled right away. Note that this forces loading the package.
|
;; enabled right away. Note that this forces loading the package.
|
||||||
(marginalia-mode)
|
(marginalia-mode)
|
||||||
|
|
||||||
;; When using Selectrum, ensure that Selectrum is refreshed when cycling annotations.
|
;; When using Selectrum, ensure that Selectrum is refreshed when cycling annotations.
|
||||||
(advice-add #'marginalia-cycle :after
|
(advice-add #'marginalia-cycle :after
|
||||||
(lambda () (when (bound-and-true-p selectrum-mode) (selectrum-exhibit))))
|
(lambda () (when (bound-and-true-p selectrum-mode) (selectrum-exhibit))))
|
||||||
|
|
||||||
;; Prefer richer, more heavy, annotations over the lighter default variant.
|
;; Prefer richer, more heavy, annotations over the lighter default variant.
|
||||||
(setq marginalia-annotators '(marginalia-annotators-heavy marginalia-annotators-light nil))
|
(setq marginalia-annotators '(marginalia-annotators-heavy marginalia-annotators-light nil))
|
||||||
:after selectrum)
|
:after selectrum)
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
#+RESULTS:
|
|
||||||
** Help
|
** Help
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package helpful
|
(use-package helpful
|
||||||
:commands (helpful-callable helpful-variable helpful-command helpful-key))
|
:commands (helpful-callable helpful-variable helpful-command helpful-key))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
** Format
|
** Format
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package format-all
|
(use-package format-all
|
||||||
|
@ -440,18 +446,24 @@ 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
|
** File Management
|
||||||
|
|
||||||
*** Dired
|
*** Dired
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(chris/leader-keys
|
(use-package dired
|
||||||
"od" '(dired-jump :which-key "open dired here"))
|
:ensure nil
|
||||||
(general-def 'normal dired-mode-map
|
:straight nil
|
||||||
"h" 'dired-up-directory
|
:general
|
||||||
"l" 'dired-find-file
|
(chris/leader-keys
|
||||||
"q" 'kill-this-buffer)
|
"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
|
#+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.
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(defun chris/org-mode-setup ()
|
(defun chris/org-mode-setup ()
|
||||||
|
@ -625,6 +637,43 @@ In order to use it, I need to go to http://localhost:8080
|
||||||
(add-hook 'org-roam-mode-hook org-roam-server-mode t)
|
(add-hook 'org-roam-mode-hook org-roam-server-mode t)
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
|
** Calendar
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(use-package calfw
|
||||||
|
:commands chris/calfw-calendar-open
|
||||||
|
:config
|
||||||
|
(defun chris/calfw-calendar-open ()
|
||||||
|
(interactive)
|
||||||
|
(cfw:open-calendar-buffer
|
||||||
|
:contents-sources
|
||||||
|
(list
|
||||||
|
(cfw:org-create-source "Cyan") ; org-agenda source
|
||||||
|
(cfw:ical-create-source "NV" "https://www.nvhuskies.org/vnews/display.v?ical" "Green") ; School Calendar
|
||||||
|
(cfw:ical-create-source "Outlook" "https://outlook.office365.com/owa/calendar/62a0d491bec4430e825822afd2fd1c01@tfcconnection.org/9acc5bc27ca24ce7a900c57284959f9d8242340735661296952/S-1-8-2197686000-2519837503-3687200543-3873966527/reachcalendar.ics" "Yellow") ; Outlook Calendar
|
||||||
|
)))
|
||||||
|
:general
|
||||||
|
(chris/leader-keys
|
||||||
|
"ac" 'chris/calfw-calendar-open)
|
||||||
|
(general-def cfw:calendar-mode-map
|
||||||
|
"q" 'kill-this-buffer
|
||||||
|
"RET" 'cfw:show-details-command)
|
||||||
|
(general-def cfw:details-mode-map
|
||||||
|
"q" 'cfw:details-kill-buffer-command))
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
*** Calfw-Org
|
||||||
|
Here we can use org as a way to create calfw sources in the calendar view.
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(use-package calfw-org
|
||||||
|
:after calfw)
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
*** Calfw-ical
|
||||||
|
Here we setup an easy way to use ical as a source for calendar views.
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(use-package calfw-ical
|
||||||
|
:after calfw)
|
||||||
|
#+end_src
|
||||||
** Magit
|
** Magit
|
||||||
Use magit, because why wouldn't you? duh!
|
Use magit, because why wouldn't you? duh!
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
|
@ -636,6 +685,84 @@ Use magit, because why wouldn't you? duh!
|
||||||
(magit-display-buffer-function #'magit-display-buffer-same-window-except-diff-v1))
|
(magit-display-buffer-function #'magit-display-buffer-same-window-except-diff-v1))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
** Eshell
|
||||||
|
Let's add our own eshell prompt.
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(use-package eshell
|
||||||
|
:ensure nil
|
||||||
|
:straight nil
|
||||||
|
:config
|
||||||
|
(require 'em-tramp)
|
||||||
|
|
||||||
|
(with-eval-after-load 'esh-module ;; REVIEW: It used to work, but now the early `provide' seems to backfire.
|
||||||
|
(unless (boundp 'eshell-modules-list)
|
||||||
|
(load "esh-module")) ;; Don't print the banner.
|
||||||
|
(push 'eshell-tramp eshell-modules-list))
|
||||||
|
|
||||||
|
(setq password-cache t
|
||||||
|
password-cache-expiry 3600)
|
||||||
|
|
||||||
|
(setq eshell-history-size 1024)
|
||||||
|
|
||||||
|
;;; Extra execution information
|
||||||
|
(defvar chris/eshell-status-p t
|
||||||
|
"If non-nil, display status before prompt.")
|
||||||
|
(defvar chris/eshell-status--last-command-time nil)
|
||||||
|
(make-variable-buffer-local 'chris/eshell-status--last-command-time)
|
||||||
|
(defvar chris/eshell-status-min-duration-before-display 0
|
||||||
|
"If a command takes more time than this, display its duration.")
|
||||||
|
|
||||||
|
(defun chris/eshell-status-display ()
|
||||||
|
(if chris/eshell-status--last-command-time
|
||||||
|
(let ((duration (time-subtract (current-time) chris/eshell-status--last-command-time)))
|
||||||
|
(setq chris/eshell-status--last-command-time nil)
|
||||||
|
(when (> (time-to-seconds duration) chris/eshell-status-min-duration-before-display)
|
||||||
|
(format " %.3fs %s"
|
||||||
|
(time-to-seconds duration)
|
||||||
|
(format-time-string "| %F %T" (current-time)))))
|
||||||
|
(format " 0.000s")))
|
||||||
|
|
||||||
|
(defun chris/eshell-status-record ()
|
||||||
|
(setq chris/eshell-status--last-command-time (current-time)))
|
||||||
|
|
||||||
|
(add-hook 'eshell-pre-command-hook 'chris/eshell-status-record)
|
||||||
|
|
||||||
|
(setq eshell-prompt-function
|
||||||
|
(lambda nil
|
||||||
|
(let ((path (abbreviate-file-name (eshell/pwd))))
|
||||||
|
(concat
|
||||||
|
(if (or (string= system-name "archdesktop") (string= system-name "chris-linuxlaptop"))
|
||||||
|
nil
|
||||||
|
(format
|
||||||
|
(propertize "\n(%s@%s)" 'face '(:foreground "#606580"))
|
||||||
|
(propertize (user-login-name) 'face '(:inherit compilation-warning))
|
||||||
|
(propertize (system-name) 'face '(:inherit compilation-warning))))
|
||||||
|
(if (and (require 'magit nil t) (or (magit-get-current-branch) (magit-get-current-tag)))
|
||||||
|
(let* ((root (abbreviate-file-name (magit-rev-parse "--show-toplevel")))
|
||||||
|
(after-root (substring-no-properties path (min (length path) (1+ (length root))))))
|
||||||
|
(format
|
||||||
|
(propertize "\n[ %s | %s@%s ]" 'face font-lock-comment-face)
|
||||||
|
(propertize root 'face `(:inherit org-warning))
|
||||||
|
(propertize after-root 'face `(:inherit org-level-1))
|
||||||
|
(propertize (or (magit-get-current-branch) (magit-get-current-tag)) 'face `(:inherit org-macro))))
|
||||||
|
(format
|
||||||
|
(propertize "\n[%s]" 'face font-lock-comment-face)
|
||||||
|
(propertize path 'face `(:inherit org-level-1))))
|
||||||
|
(when chris/eshell-status-p
|
||||||
|
(propertize (or (chris/eshell-status-display) "") 'face font-lock-comment-face))
|
||||||
|
(propertize "\n" 'face '(:inherit org-todo :weight ultra-bold))
|
||||||
|
" "))))
|
||||||
|
|
||||||
|
;;; If the prompt spans over multiple lines, the regexp should match
|
||||||
|
;;; last line only.
|
||||||
|
(setq-default eshell-prompt-regexp "^ ")
|
||||||
|
:general
|
||||||
|
(chris/leader-keys
|
||||||
|
"oe" 'eshell)
|
||||||
|
(general-def '(normal insert) eshell-mode-map
|
||||||
|
"C-d" 'kill-this-buffer))
|
||||||
|
#+end_src
|
||||||
|
|
||||||
** PDF-Tools
|
** PDF-Tools
|
||||||
Let's use pdf-tools for a lot better interaction with pdfs.
|
Let's use pdf-tools for a lot better interaction with pdfs.
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
|
|
|
@ -1,3 +1,12 @@
|
||||||
make autoloads
|
make autoloads
|
||||||
make
|
make
|
||||||
exit
|
exit
|
||||||
|
ls
|
||||||
|
exit
|
||||||
|
ls
|
||||||
|
message hello
|
||||||
|
32
|
||||||
|
(32)
|
||||||
|
32
|
||||||
|
12
|
||||||
|
2
|
||||||
|
|
137
init.el
137
init.el
|
@ -19,12 +19,15 @@
|
||||||
(column-number-mode +1)
|
(column-number-mode +1)
|
||||||
|
|
||||||
(if (string-equal (system-name) "chris-linuxlaptop")
|
(if (string-equal (system-name) "chris-linuxlaptop")
|
||||||
(defvar chris/default-font-size 240)
|
(defvar chris/default-font-size 240)
|
||||||
(defvar chris/default-font-size 120))
|
(defvar chris/default-font-size 120))
|
||||||
|
|
||||||
(set-face-attribute 'default nil :font "VictorMono Nerd Font" :height chris/default-font-size)
|
(set-face-attribute 'default nil :font "VictorMono Nerd Font"
|
||||||
(set-face-attribute 'fixed-pitch nil :font "VictorMono Nerd Font" :height chris/default-font-size)
|
:height chris/default-font-size)
|
||||||
(set-face-attribute 'variable-pitch nil :font "Cantarell" :height chris/default-font-size :weight 'regular)
|
(set-face-attribute 'fixed-pitch nil :font "VictorMono Nerd Font"
|
||||||
|
:height chris/default-font-size)
|
||||||
|
(set-face-attribute 'variable-pitch nil :font "Cantarell"
|
||||||
|
:height chris/default-font-size :weight 'regular)
|
||||||
|
|
||||||
(setq display-line-numbers-type 'relative)
|
(setq display-line-numbers-type 'relative)
|
||||||
(display-line-numbers-mode +1)
|
(display-line-numbers-mode +1)
|
||||||
|
@ -72,6 +75,11 @@
|
||||||
(use-package rainbow-delimiters
|
(use-package rainbow-delimiters
|
||||||
:hook (prog-mode . rainbow-delimiters-mode))
|
:hook (prog-mode . rainbow-delimiters-mode))
|
||||||
|
|
||||||
|
(use-package smartparens
|
||||||
|
:defer 1
|
||||||
|
:config
|
||||||
|
(smartparens-global-mode +1))
|
||||||
|
|
||||||
(use-package adaptive-wrap
|
(use-package adaptive-wrap
|
||||||
:defer t)
|
:defer t)
|
||||||
|
|
||||||
|
@ -142,6 +150,7 @@
|
||||||
"n" '(:ignore t :which-key "notes")
|
"n" '(:ignore t :which-key "notes")
|
||||||
"bs" '(consult-buffer :which-key "buffer search")
|
"bs" '(consult-buffer :which-key "buffer search")
|
||||||
"bd" '(kill-this-buffer :which-key "kill buffer")
|
"bd" '(kill-this-buffer :which-key "kill buffer")
|
||||||
|
"bi" '(ibuffer :which-key "ibuffer")
|
||||||
"tt" '(consult-theme :which-key "choose theme")
|
"tt" '(consult-theme :which-key "choose theme")
|
||||||
"ff" '(find-file :which-key "find file")
|
"ff" '(find-file :which-key "find file")
|
||||||
"fr" '(consult-recent-file :which-key "recent file")
|
"fr" '(consult-recent-file :which-key "recent file")
|
||||||
|
@ -150,7 +159,6 @@
|
||||||
"hv" '(helpful-variable :which-key "describe-variable")
|
"hv" '(helpful-variable :which-key "describe-variable")
|
||||||
"hk" '(helpful-key :which-key "describe-key")
|
"hk" '(helpful-key :which-key "describe-key")
|
||||||
"hi" '(info :which-key "info manual")
|
"hi" '(info :which-key "info manual")
|
||||||
"od" '(dired-jump :which-key "dired jump")
|
|
||||||
"ss" '(consult-line :which-key "consult search")
|
"ss" '(consult-line :which-key "consult search")
|
||||||
"ww" '(other-window :which-key "other window")
|
"ww" '(other-window :which-key "other window")
|
||||||
"wd" '(delete-window :which-key "other window")
|
"wd" '(delete-window :which-key "other window")
|
||||||
|
@ -238,12 +246,16 @@
|
||||||
(setq format-all-formatters '("Emacs Lisp" emacs-lisp))
|
(setq format-all-formatters '("Emacs Lisp" emacs-lisp))
|
||||||
:defer 1)
|
:defer 1)
|
||||||
|
|
||||||
(chris/leader-keys
|
(use-package dired
|
||||||
"od" '(dired-jump :which-key "open dired here"))
|
:ensure nil
|
||||||
(general-def 'normal dired-mode-map
|
:straight nil
|
||||||
"h" 'dired-up-directory
|
:general
|
||||||
"l" 'dired-find-file
|
(chris/leader-keys
|
||||||
"q" 'kill-this-buffer)
|
"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)
|
||||||
|
@ -393,6 +405,33 @@
|
||||||
|
|
||||||
(add-hook 'org-roam-mode-hook org-roam-server-mode t)
|
(add-hook 'org-roam-mode-hook org-roam-server-mode t)
|
||||||
|
|
||||||
|
(use-package calfw
|
||||||
|
:commands chris/calfw-calendar-open
|
||||||
|
:config
|
||||||
|
(defun chris/calfw-calendar-open ()
|
||||||
|
(interactive)
|
||||||
|
(cfw:open-calendar-buffer
|
||||||
|
:contents-sources
|
||||||
|
(list
|
||||||
|
(cfw:org-create-source "Cyan") ; org-agenda source
|
||||||
|
(cfw:ical-create-source "NV" "https://www.nvhuskies.org/vnews/display.v?ical" "Green") ; School Calendar
|
||||||
|
(cfw:ical-create-source "Outlook" "https://outlook.office365.com/owa/calendar/62a0d491bec4430e825822afd2fd1c01@tfcconnection.org/9acc5bc27ca24ce7a900c57284959f9d8242340735661296952/S-1-8-2197686000-2519837503-3687200543-3873966527/reachcalendar.ics" "Yellow") ; Outlook Calendar
|
||||||
|
)))
|
||||||
|
:general
|
||||||
|
(chris/leader-keys
|
||||||
|
"ac" 'chris/calfw-calendar-open)
|
||||||
|
(general-def cfw:calendar-mode-map
|
||||||
|
"q" 'kill-this-buffer
|
||||||
|
"RET" 'cfw:show-details-command)
|
||||||
|
(general-def cfw:details-mode-map
|
||||||
|
"q" 'cfw:details-kill-buffer-command))
|
||||||
|
|
||||||
|
(use-package calfw-org
|
||||||
|
:after calfw)
|
||||||
|
|
||||||
|
(use-package calfw-ical
|
||||||
|
:after calfw)
|
||||||
|
|
||||||
(use-package magit
|
(use-package magit
|
||||||
:commands (magit-status magit-get-current-branch)
|
:commands (magit-status magit-get-current-branch)
|
||||||
:general
|
:general
|
||||||
|
@ -400,6 +439,80 @@
|
||||||
:custom
|
:custom
|
||||||
(magit-display-buffer-function #'magit-display-buffer-same-window-except-diff-v1))
|
(magit-display-buffer-function #'magit-display-buffer-same-window-except-diff-v1))
|
||||||
|
|
||||||
|
(use-package eshell
|
||||||
|
:ensure nil
|
||||||
|
:straight nil
|
||||||
|
:config
|
||||||
|
(require 'em-tramp)
|
||||||
|
|
||||||
|
(with-eval-after-load 'esh-module ;; REVIEW: It used to work, but now the early `provide' seems to backfire.
|
||||||
|
(unless (boundp 'eshell-modules-list)
|
||||||
|
(load "esh-module")) ;; Don't print the banner.
|
||||||
|
(push 'eshell-tramp eshell-modules-list))
|
||||||
|
|
||||||
|
(setq password-cache t
|
||||||
|
password-cache-expiry 3600)
|
||||||
|
|
||||||
|
(setq eshell-history-size 1024)
|
||||||
|
|
||||||
|
;;; Extra execution information
|
||||||
|
(defvar chris/eshell-status-p t
|
||||||
|
"If non-nil, display status before prompt.")
|
||||||
|
(defvar chris/eshell-status--last-command-time nil)
|
||||||
|
(make-variable-buffer-local 'chris/eshell-status--last-command-time)
|
||||||
|
(defvar chris/eshell-status-min-duration-before-display 0
|
||||||
|
"If a command takes more time than this, display its duration.")
|
||||||
|
|
||||||
|
(defun chris/eshell-status-display ()
|
||||||
|
(if chris/eshell-status--last-command-time
|
||||||
|
(let ((duration (time-subtract (current-time) chris/eshell-status--last-command-time)))
|
||||||
|
(setq chris/eshell-status--last-command-time nil)
|
||||||
|
(when (> (time-to-seconds duration) chris/eshell-status-min-duration-before-display)
|
||||||
|
(format " %.3fs %s"
|
||||||
|
(time-to-seconds duration)
|
||||||
|
(format-time-string "| %F %T" (current-time)))))
|
||||||
|
(format " 0.000s")))
|
||||||
|
|
||||||
|
(defun chris/eshell-status-record ()
|
||||||
|
(setq chris/eshell-status--last-command-time (current-time)))
|
||||||
|
|
||||||
|
(add-hook 'eshell-pre-command-hook 'chris/eshell-status-record)
|
||||||
|
|
||||||
|
(setq eshell-prompt-function
|
||||||
|
(lambda nil
|
||||||
|
(let ((path (abbreviate-file-name (eshell/pwd))))
|
||||||
|
(concat
|
||||||
|
(if (or (string= system-name "archdesktop") (string= system-name "chris-linuxlaptop"))
|
||||||
|
nil
|
||||||
|
(format
|
||||||
|
(propertize "\n(%s@%s)" 'face '(:foreground "#606580"))
|
||||||
|
(propertize (user-login-name) 'face '(:inherit compilation-warning))
|
||||||
|
(propertize (system-name) 'face '(:inherit compilation-warning))))
|
||||||
|
(if (and (require 'magit nil t) (or (magit-get-current-branch) (magit-get-current-tag)))
|
||||||
|
(let* ((root (abbreviate-file-name (magit-rev-parse "--show-toplevel")))
|
||||||
|
(after-root (substring-no-properties path (min (length path) (1+ (length root))))))
|
||||||
|
(format
|
||||||
|
(propertize "\n[ %s | %s@%s ]" 'face font-lock-comment-face)
|
||||||
|
(propertize root 'face `(:inherit org-warning))
|
||||||
|
(propertize after-root 'face `(:inherit org-level-1))
|
||||||
|
(propertize (or (magit-get-current-branch) (magit-get-current-tag)) 'face `(:inherit org-macro))))
|
||||||
|
(format
|
||||||
|
(propertize "\n[%s]" 'face font-lock-comment-face)
|
||||||
|
(propertize path 'face `(:inherit org-level-1))))
|
||||||
|
(when chris/eshell-status-p
|
||||||
|
(propertize (or (chris/eshell-status-display) "") 'face font-lock-comment-face))
|
||||||
|
(propertize "\n" 'face '(:inherit org-todo :weight ultra-bold))
|
||||||
|
" "))))
|
||||||
|
|
||||||
|
;;; If the prompt spans over multiple lines, the regexp should match
|
||||||
|
;;; last line only.
|
||||||
|
(setq-default eshell-prompt-regexp "^ ")
|
||||||
|
:general
|
||||||
|
(chris/leader-keys
|
||||||
|
"oe" 'eshell)
|
||||||
|
(general-def '(normal insert) eshell-mode-map
|
||||||
|
"C-d" 'kill-this-buffer))
|
||||||
|
|
||||||
(use-package pdf-tools
|
(use-package pdf-tools
|
||||||
:straight (:host github
|
:straight (:host github
|
||||||
:repo "flatwhatson/pdf-tools"
|
:repo "flatwhatson/pdf-tools"
|
||||||
|
|
Loading…
Reference in a new issue