@ -3,7 +3,9 @@
#+email : jacopods@math.utoronto.ca
#+options : *:t ::t
* TODO Make indentation uniform
* COMMENT About indentation in this file
This file will be indented with ~org-adapt-indentation~ set to t
* TODO Look at tangling at
[http://thewanderingcoder.com/2015/02/literate-emacs-configuration/ ]
@ -29,12 +31,14 @@
way complicated; I can do everything by hand as soon as it is neatly
~org~ -anized. In the end we use a few, but I plan to phase them out and
replace them with git submodules
* Files and dirs
Move ~Customize~ to a separate file
#+begin_src emacs-lisp
(setq custom-file "~/.emacs.d/custom.el")
(load custom-file 'noerror)
#+end_src
Add relevant dirs to load path [This is somewhat undesirable; I should
uniformize the path-loading business at some point…]
#+begin_src emacs-lisp
@ -49,6 +53,7 @@
"highlight-parentheses.el")))
#+end_src
Put autosave files (ie #foo#) and backup files (ie foo~) in ~ /.emacs.d/ .
create the autosave dir if necessary, since emacs won't.
#+begin_src emacs-lisp
@ -63,10 +68,11 @@
(load-theme 'lunarized t)
#+end_src
Use patched terminus font (this overrides the settings in Customize, but I
never could it to work otherwise). See the special treatment later on for
dealing with bold weight. To avoid flickering one should also set the font
in .Xresources
Use patched terminus font (this overrides the settings in Customize,
but I never could it work otherwise). See the special treatment
later on for dealing with bold weight. To avoid flickering one
should also set the font in .Xresources
#+begin_src emacs-lisp
(set-face-font 'default "-xos4-hackminus-medium-r-normal--20-200-72-72-c-100-ISO10646-1")
(set-face-font 'fixed-pitch "-xos4-hackminus-medium-r-normal--20-200-72-72-c-100-ISO10646-1")
@ -411,25 +417,25 @@
Additionally, unbind the ~C-x o~ binding to force me using ~ace-window~
Finally, unbind the ~C-SPC~ to mark the point, as I am using LR-shift
Note that I will use ~C-SPC~ as a hydra below to deal with parenthesis
#+begin_src emacs-lisp
#+begin_src emacs-lisp
(dolist (ch '("C-c C-x" "C-x C-r" "C-z" "C-x f" "C-x C-f" "<M-f4 >" "C-M-u" "C-M-d" "C-x o" "C-SPC"))
(global-unset-key (kbd ch)))
#+end_src
#+end_src
Change {up,down}-list
#+begin_src emacs-lisp
#+begin_src emacs-lisp
(global-set-key (kbd "C-M-i") 'down-list) ;; -i stands for /in/
(global-set-key (kbd "C-M-o") 'up-list) ;; -o stands for /out/
#+end_src
#+end_src
Add some opinionated bindings
#+begin_src emacs-lisp
#+begin_src emacs-lisp
(global-set-key-alist
'(("C-M-d" . kill-sexp)
("C-M-<backspace >" . backward-kill-sexp)
("C-x k" . kill-this-buffer)
("C-S-v" . scroll-down-command)
("C-M-u" . universal-argument)))
#+end_src
#+end_src
** Disable commands
Enable narrow commands
#+begin_src emacs-lisp
@ -482,9 +488,9 @@
#+end_src
*** TODO find out if there are better options out there
** Load hydra
#+begin_src emacs-lisp
(require 'hydra)
#+end_src
#+begin_src emacs-lisp
(require 'hydra)
#+end_src
** Abbrevs
Set up abbrevs
@ -512,8 +518,8 @@
** Fringe treatment
*** TODO try linum-relative
#+begin_src emacs-lisp
; (require 'linum-relative)
; (linum-relative-mode 1)
; (require 'linum-relative)
; (linum-relative-mode 1)
#+end_src
Add line numbers globally
#+begin_src emacs-lisp
@ -521,8 +527,8 @@
#+end_src
Highlight also the linum in the fringe
#+begin_src emacs-lisp
; (require 'hlinum)
; (hlinum-activate)
; (require 'hlinum)
; (hlinum-activate)
#+end_src
Add marker for current line in the margin (see
[https://github.com/kyanagi/fringe-current-line] and
@ -580,11 +586,11 @@
** Use local proxy
I need this to route bibretrieve requests through my local proxy,
that in turn routes requests to ~mathscinet~ through the University network
#+begin_src emacs-lisp
#+begin_src emacs-lisp
;; Use system proxy
(setq url-proxy-services '(("http" . "127.0.0.1:8118")
("https" . "127.0.0.1:8118")))
#+end_src
#+end_src
** Indicator
Change cursor color to reflect different layers on the keyboard
This is the handler
@ -845,7 +851,7 @@
;(require 'helm-org)
;(add-to-list 'helm-completing-read-handlers-alist '(org-capture . helm-org-completing-read-tags))
; (add-to-list 'helm-completing-read-handlers-alist '(org-set-tags-command . helm-org-completing-read-tags))
; (add-to-list 'helm-completing-read-handlers-alist '(org-set-tags-command . helm-org-completing-read-tags))
; (add-to-list 'helm-completing-read-handlers-alist '(org-set-tags
; . helm-org-completing-read-tags))
#+end_src
@ -1289,7 +1295,7 @@
(define-key org-agenda-mode-map (kbd "Z") 'org-revert-all-orgzly-buffers)
#+end_src
*** Hydras for timestamps
#+begin_src emacs-lisp
#+begin_src emacs-lisp
(defun hydra-timestamp/hl-paren-force-fix ()
;;; This is needed b/c hl-parent caches the point position and
;;; refuses to update if the point did not move
@ -1319,7 +1325,7 @@
("s" (progn
(org-timestamp-down-day 7)
(hydra-timestamp/hl-paren-force-fix)) "-1W")))
#+end_src
#+end_src
*** Hydras for refiling
This bit evolved from [[https://www.mollermara.com/blog/Fast-refiling-in-org-mode-with-hydras/ ][this post ]]; see more at [[https://gist.github.com/mm--/60e0790bcbf8447160cc87a66dc949ab ][this gist ]].
#+begin_src emacs-lisp
@ -1330,15 +1336,15 @@
(org-refile arg nil (list headline file nil pos)))
(switch-to-buffer (current-buffer)))
#+end_src
#+begin_src emacs-lisp
#+begin_src emacs-lisp
(defhydra wilder/hydra-org-refile (:foreign-keys run)
"Refile"
("g" (wilder/refile "hack.org" "emacs") "Refile to Hack-emacs")
("q" nil "cancel"))
(define-key org-mode-map (kbd "C-x \\") 'wilder/hydra-org-refile/body)
#+end_src
#+end_src
*** Hydras for moving headlines around
#+begin_src emacs-lisp
#+begin_src emacs-lisp
(defhydra wilder/hydra-org-move ()
"Move subtree"
("f" org-backward-heading-same-level "move up" :column "Movement")
@ -1350,7 +1356,7 @@
("e" org-move-subtree-down "bubble down")
("q" nil "cancel"))
(define-key org-mode-map (kbd "C-x SPC") 'wilder/hydra-org-move/body)
#+end_src
#+end_src
*** Capture
Set default keybinding
@ -1383,15 +1389,15 @@
"* TODO Attend %(format-zoom-meeting)\n%a" :immediate-finish t)))
#+end_src
*** LaTeX export
#+begin_src emacs-lisp
; (add-to-list 'org-latex-classes
; '("amsart" "\\documentclass[11pt]{amsart}"
; ("\\section{%s}" . "\\section*{%s}")
; ("\\subsection{%s}" . "\\subsection*{%s}")
; ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
; ("\\paragraph{%s}" . "\\paragraph*{%s}")
; ("\\subparagraph{%s}" . "\\subparagraph*{%s}")))
#+end_src
#+begin_src emacs-lisp
; (add-to-list 'org-latex-classes
; '("amsart" "\\documentclass[11pt]{amsart}"
; ("\\section{%s}" . "\\section*{%s}")
; ("\\subsection{%s}" . "\\subsection*{%s}")
; ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
; ("\\paragraph{%s}" . "\\paragraph*{%s}")
; ("\\subparagraph{%s}" . "\\subparagraph*{%s}")))
#+end_src
*** Source blocks
Add template for a source block in a few selected languages; for
now I have
@ -1415,13 +1421,13 @@
(setq org-src-fontify-natively t)
#+end_src
This makes scheme src blocks work
#+begin_src emacs-lisp
#+begin_src emacs-lisp
(org-babel-do-load-languages
'org-babel-load-languages
'((python . t)
(scheme . t)
(emacs-lisp . t)))
#+end_src
#+end_src
Patch ~ob-scheme.el~ while waiting for upstream
#+begin_src emacs-lisp
(defun org-babel-scheme-execute-with-geiser (code output impl repl)
@ -1614,7 +1620,7 @@
(dolist (file files)
(with-current-buffer (find-file-noselect file)
(org-babel-tangle)
; (unless nokill (kill-buffer))
; (unless nokill (kill-buffer))
)))
#+end_src
*** Export file
@ -1641,16 +1647,16 @@
*** ox-export
Load ox-hugo
#+begin_src emacs-lisp
(with-eval-after-load 'ox
#+begin_src emacs-lisp
(with-eval-after-load 'ox
(require 'ox-hugo))
#+end_src
#+end_src
*** ~org-roam~ setup
#+begin_src emacs-lisp
#+begin_src emacs-lisp
(setq org-roam-directory (file-truename "~/org-roam"))
(org-roam-db-autosync-mode)
(global-set-key (kbd "C-c n f") 'org-roam-node-find)
#+end_src
#+end_src
** elisp
*** Paredit
#+begin_src emacs-lisp
@ -1708,14 +1714,14 @@
(add-to-list 'auto-mode-alist '("\\.qml\\'" . qml-mode))
#+end_src
** Python
Silent offset warning
#+begin_src emacs-lisp
Silent offset warning
#+begin_src emacs-lisp
(setq python-indent-guess-indent-offset-verbose nil)
#+end_src
#+end_src
** C and C++
*** Hooks
#+begin_src emacs-lisp
;; (require 'doxymacs)
;; (require 'doxymacs)
(add-hook 'c-mode-hook
(lambda ()
@ -1840,7 +1846,7 @@ Silent offset warning
#+end_src
Add unicode quotes to the quote-list
#+begin_src emacs-lisp
; (defvar font-latex-quote-list '(("``" "''") ("“" "”") ("<<" " >>" french) ("«" "»" french)) ;
; (defvar font-latex-quote-list '(("``" "''") ("“" "”") ("<<" " >>" french) ("«" "»" french)) ;
#+end_src
Redefine fold ellipsis
#+begin_src emacs-lisp
@ -2125,7 +2131,7 @@ Silent offset warning
with font selection. The function below patches the annoying
behavior, by defaulting to the default behavior if the prefix
argument is 0
#+begin_src emacs-lisp
#+begin_src emacs-lisp
(defun wilder/TeX-font (replace what)
"Insert template for font change command.
If REPLACE is not nil, replace current font. WHAT determines the font
@ -2179,7 +2185,7 @@ Silent offset warning
(save-excursion
(insert after))))))
(advice-add 'TeX-font :override #'wilder/TeX-font)
#+end_src
#+end_src
*** The hook
#+begin_src emacs-lisp
(add-hook 'LaTeX-mode-hook
@ -2265,7 +2271,7 @@ Silent offset warning
I prefer to keep one server for each KDE activity, so
set the server name to be the name of the current activity
#+begin_src emacs-lisp
; (setq server-name (kde-current-activity-name))
; (setq server-name (kde-current-activity-name))
#+end_src
*** Journal
Setup ~org-journal~
@ -2376,6 +2382,7 @@ Silent offset warning
:append)
#+end_src
*** magit-todos
#+begin_src emacs-lisp
(require 'magit-todos)
#+end_src
@ -2623,7 +2630,7 @@ Silent offset warning
#+end_src
* Moving to colemak
Set up all possible combinations of modifiers
Set up all possible combinations of modifiers
#+begin_src emacs-lisp
(defun concat-recursive (b &optional a)
(if b
@ -2703,7 +2710,7 @@ Set up all possible combinations of modifiers
(reset-key-translation-map))
;; (untarmak-modifiers)
;; (untarmak-modifiers)
(tarmak-avy)
#+end_src
* Finale
@ -2724,5 +2731,5 @@ Set up all possible combinations of modifiers
#+end_src
** Start server
#+begin_src emacs-lisp
; (server-start)
; (server-start)
#+end_src