exec-path-from-shell flymake-swi-prolog ggtags git-blamed
git-timemachine gitconfig-mode gitignore-mode
gnu-elpa-keyring-update gnuplot gnuplot-mode go-mode
- graphviz-dot-mode highlight-escape-sequences htmlize
- ialign keyfreq keycast iedit lin list-unicode-display
+ graphviz-dot-mode haskell-mode highlight-escape-sequences
+ htmlize ialign keyfreq keycast iedit lin list-unicode-display
logos lorem-ipsum magit marginalia markdown-mode move-dup
no-littering ns-auto-titlebar ob-prolog olivetti orderless
org-modern paredit pdf-tools rainbow-delimiters rg slack
(byte-compile-file esy/target-path)))
(add-hook 'kill-emacs-hook #'esy/tangle-and-compile-config)
+
+ (defun esy/find-esy-org ()
+ "Open my Emacs configuration."
+ (interactive)
+ (find-file esy/source-path))
#+end_src
** Org-mode basic settings
#+begin_src emacs-lisp
(defvar esy/org-capture-to-project-heading-history-list nil
- "History list for 'esy/org-capture-to-project-heading'.")
+ "History list for `esy/org-capture-to-project-heading'.")
(with-eval-after-load 'savehist
(add-to-list 'savehist-additional-variables
(keymap-set ctl-x-map "l" #'org-store-link)
(keymap-set ctl-x-map "c" #'org-capture)
(keymap-set ctl-x-map "o" #'ace-window)
+ (keymap-set ctl-x-map "F" #'esy/find-esy-org)
(keymap-set ctl-x-map "O" #'other-window)
(keymap-set ctl-x-map "w" #'esy/eww)
+ (keymap-set ctl-x-map "S" #'esy/vterm-at)
(keymap-set ctl-x-map "V" #'vertalen-at-point)
(keymap-set ctl-x-map "G" #'gnus)
(keymap-set ctl-x-map "E" #'elfeed)
#+begin_src emacs-lisp
(defun esy/customize-search-map ()
"Configure the `search-map' keymap."
+ (keymap-set search-map "r" #'rg)
+ (keymap-set search-map "l" #'rg-literal)
(keymap-set search-map "b" #'some-button))
(add-hook 'after-init-hook #'esy/customize-search-map)
:CUSTOM_ID: applications
:END:
+** tramp
+:PROPERTIES:
+:CUSTOM_ID: tramp-optimization
+:END:
+#+begin_src emacs-lisp
+ (with-eval-after-load 'tramp
+ (tramp-set-completion-function "ssh" '((tramp-parse-netrc "~/.authinfo"))))
+
+ (define-advice project--find-in-directory (:override (dir) no-remote-projects)
+ (unless (file-remote-p dir)
+ (run-hook-with-args-until-success 'project-find-functions dir)))
+
+ (define-advice completion-file-name-table (:filter-args (args) no-remote-file-name-completion)
+ (let ((string (car args))
+ (pred (cadr args))
+ (action (caddr args)))
+ (if (and (file-remote-p string) (eq pred #'file-exists-p))
+ (list string nil action)
+ (list string pred action))))
+#+end_src
+
** Dired
:PROPERTIES:
:CUSTOM_ID: dired
(add-hook 'dired-mode-hook #'all-the-icons-dired-mode)
#+end_src
+** vterm :cmd:
+:PROPERTIES:
+:CUSTOM_ID: remote-vtrem
+:END:
+Start =vterm= in a given directory and with a given shell, possibly
+over ssh for remote connections.
+
+#+begin_src emacs-lisp
+ (setq vterm-shell "/bin/bash")
+
+ (defun esy/vterm-with (arg shell)
+ (interactive
+ (list current-prefix-arg
+ (completing-read
+ "Start vterm with shell: "
+ '("bash" "zsh" "sh")
+ nil t nil nil "bash")))
+ (require 'vterm)
+ (let ((vterm-shell (concat "/bin/" shell)))
+ (vterm arg)))
+
+ (defun esy/vterm-at (arg dir)
+ (interactive
+ (list current-prefix-arg (read-directory-name "Start vterm in directory: " )))
+ (require 'vterm)
+ (let ((default-directory dir))
+ (vterm arg)))
+#+end_src
+
** Elfeed
:PROPERTIES:
:CUSTOM_ID: elfeed
(setq elfeed-feeds
'("https://lwn.net/headlines/rss"
"https://reddit.com/r/prolog/.rss"
+ "https://matt-rickard.com/rss"
"https://www.haskellforall.com/feeds/posts/default"
"https://cestlaz.github.io/rss.xml"
"https://drewdevault.com/blog/index.xml"
(let ((bs (bounds-of-thing-at-point 'filename)))
(when bs
(let* ((start (car bs))
- (end (cdr bs))
- (file (buffer-substring-no-properties start end)))
+ (end (cdr bs)))
`(,start ,end completion--file-name-table . (:exclusive no))))))
(defun esy/margin-formatter (metadata)
(add-hook 'lisp-data-mode-hook #'esy/setup-lisp)
#+end_src
+** Haskell specific settings
+:PROPERTIES:
+:CUSTOM_ID: haskell
+:END:
+
+#+begin_src emacs-lisp
+ (add-hook 'haskell-mode-hook #'interactive-haskell-mode)
+ (add-hook 'haskell-mode-hook #'haskell-decl-scan-mode)
+ (add-hook 'haskell-mode-hook #'haskell-doc-mode)
+#+end_src
+
** Prolog specific settings
:PROPERTIES:
:CUSTOM_ID: prolog
(add-hook 'prolog-mode-hook #'esy/setup-prolog)
#+end_src
+*** Make =rg= regard =.pl= files as Prolog rather than Perl
+:PROPERTIES:
+:CUSTOM_ID: rg-pl-is-prolog-not-perl
+:END:
+
+#+begin_src emacs-lisp
+ (with-eval-after-load 'rg
+ (add-to-list 'rg-custom-type-aliases '("Prolog" . "*.pl *.plt *.pro *.prolog")))
+#+end_src
+
+
+*** Per project Prolog top-level history :hook:
+:PROPERTIES:
+:CUSTOM_ID: per-project-prolog-history
+:CreatedAt: <2022-08-04 Thu>
+:CapturedAt:
+:CapturedAs: Emacs configuration fragment
+:END:
+
+#+begin_src emacs-lisp
+ (defconst esy/prolog-input-ring-file-name ".swipl_history")
+
+ (defun esy/setup-project-prolog-history ()
+ "Setup per-project Prolog top-level history."
+ (if-let ((project (project-current)))
+ (progn
+ (add-hook 'kill-buffer-hook #'comint-write-input-ring nil t)
+ (setq comint-input-ring-file-name (expand-file-name esy/prolog-input-ring-file-name (project-root project))
+ comint-input-ignoredups t)
+ (comint-read-input-ring t))))
+
+ (add-hook 'prolog-inferior-mode-hook #'esy/setup-project-prolog-history)
+#+end_src
+
* LaTeX and PDF settings
:PROPERTIES:
:CUSTOM_ID: latex-and-pdf
(with-eval-after-load 'project
(add-to-list 'project-switch-commands '(project-compile "Compile"))
(when (boundp 'project-prefix-map)
+ (define-key project-prefix-map "R" #'rg-project)
(define-key project-prefix-map "m" #'magit-project-status)
+ (add-to-list 'project-switch-commands '(rg-project "rg") t)
(add-to-list 'project-switch-commands '(magit-project-status "Magit") t)))
#+end_src
(logos--mode 'flymake-mode -1))
(with-eval-after-load 'olivetti
- (setq olivetti-body-width 90))
+ (setq-default olivetti-body-width 100))
(with-eval-after-load 'logos
(setq-default logos-olivetti t