Merge branch 'hlissner:develop' into develop
This commit is contained in:
commit
85264fea5d
27 changed files with 85 additions and 420 deletions
|
@ -325,7 +325,7 @@
|
|||
:desc "Magit blame" "B" #'magit-blame-addition
|
||||
:desc "Magit clone" "C" #'magit-clone
|
||||
:desc "Magit fetch" "F" #'magit-fetch
|
||||
:desc "Magit buffer log" "L" #'magit-log
|
||||
:desc "Magit buffer log" "L" #'magit-log-buffer-file
|
||||
:desc "Git stage file" "S" #'magit-stage-file
|
||||
:desc "Git unstage file" "U" #'magit-unstage-file
|
||||
(:prefix ("f" . "find")
|
||||
|
|
|
@ -445,7 +445,7 @@
|
|||
:desc "Magit blame" "B" #'magit-blame-addition
|
||||
:desc "Magit clone" "C" #'magit-clone
|
||||
:desc "Magit fetch" "F" #'magit-fetch
|
||||
:desc "Magit buffer log" "L" #'magit-log
|
||||
:desc "Magit buffer log" "L" #'magit-log-buffer-file
|
||||
:desc "Git stage file" "S" #'magit-stage-file
|
||||
:desc "Git unstage file" "U" #'magit-unstage-file
|
||||
(:prefix ("f" . "find")
|
||||
|
|
|
@ -172,8 +172,8 @@ vim-seek/vim-sneak for 2-character versions of f/F/t/T).
|
|||
|
||||
To disable evil-snipe on s/S, you can either:
|
||||
|
||||
1. Disable ~evil-snipe-mode~ by adding ~(after! evil-snipe (evil-snipe-mode
|
||||
-1))~ to =$DOOMDIR/config.el=,
|
||||
1. Disable ~evil-snipe-mode~ by adding ~(remove-hook 'doom-first-input-hook
|
||||
#'evil-snipe-mode)~ to =$DOOMDIR/config.el=,
|
||||
2. Or disable =evil-snipe= completely with ~(package! evil-snipe :disable t)~
|
||||
added to =$DOOMDIR/packages.el=, but this will also disable incremental
|
||||
highlighting for the f/F/t/T motions keys.
|
||||
|
|
|
@ -16,6 +16,13 @@
|
|||
(use-package! sly
|
||||
:hook (lisp-mode-local-vars . sly-editing-mode)
|
||||
:init
|
||||
;; I moved this hook to `lisp-mode-local-vars', so it only affects
|
||||
;; `lisp-mode', and not every other derived lisp mode (like `fennel-mode').
|
||||
;; We run it twice because the hook is both autoloaded and evaluated at
|
||||
;; load-time, so it must be removed twice.
|
||||
(after! (:or emacs sly)
|
||||
(remove-hook 'lisp-mode-hook #'sly-editing-mode))
|
||||
|
||||
(after! lisp-mode
|
||||
(set-repl-handler! 'lisp-mode #'sly-mrepl)
|
||||
(set-eval-handler! 'lisp-mode #'sly-eval-region)
|
||||
|
|
|
@ -274,16 +274,7 @@ Also adds support for a `:sync' parameter to override `:async'."
|
|||
;; TODO Should be fixed upstream
|
||||
(let ((default-directory (org-find-library-dir "org-contribdir")))
|
||||
(setq org-ditaa-jar-path (expand-file-name "scripts/ditaa.jar")
|
||||
org-ditaa-eps-jar-path (expand-file-name "scripts/DitaaEps.jar"))))
|
||||
|
||||
;; NOTE Backported from Emacs 27.1
|
||||
;; DEPRECATED Remove when 26.x support is dropped
|
||||
(unless EMACS27+
|
||||
(defadvice! +org--dont-suppress-window-changes-a (orig-fn &rest args)
|
||||
:around #'org-babel-execute:emacs-lisp
|
||||
(letf! ((#'current-window-configuration #'ignore)
|
||||
(#'set-window-configuration #'ignore))
|
||||
(apply orig-fn args)))))
|
||||
org-ditaa-eps-jar-path (expand-file-name "scripts/DitaaEps.jar")))))
|
||||
|
||||
|
||||
(defun +org-init-babel-lazy-loader-h ()
|
||||
|
|
|
@ -56,59 +56,11 @@ need:
|
|||
|
||||
* Configuration
|
||||
** True-color and italic support
|
||||
#+begin_quote
|
||||
This advice only applies to Emacs 26.x. True color support is [[https://github.com/emacs-mirror/emacs/commit/7f6153d9563cfe7753083996f59eacc9f4c694df][built into 27.1+
|
||||
and newer]].
|
||||
#+end_quote
|
||||
Emacs 26.3 users should consult [[https://github.com/syl20bnr/spacemacs/wiki/Terminal][the spacemacs wiki]] for details on achieving true
|
||||
color support in terminal Emacs.
|
||||
|
||||
(credit goes to [[https://github.com/syl20bnr/spacemacs/wiki/Terminal][the spacemacs wiki]] for this information)
|
||||
|
||||
Create a =xterm-24bit.terminfo= file with the following contents:
|
||||
|
||||
#+BEGIN_SRC text
|
||||
xterm-24bit|xterm with 24-bit direct color mode,
|
||||
use=xterm-256color,
|
||||
sitm=\E[3m,
|
||||
ritm=\E[23m,
|
||||
setb24=\E[48;2;%p1%{65536}%/%d;%p1%{256}%/%{255}%&%d;%p1%{255}%&%dm,
|
||||
setf24=\E[38;2;%p1%{65536}%/%d;%p1%{256}%/%{255}%&%d;%p1%{255}%&%dm,
|
||||
#+END_SRC
|
||||
|
||||
#+begin_quote
|
||||
WARNING: Make sure you have a newline at end of file otherwise you will get
|
||||
errors!
|
||||
#+end_quote
|
||||
|
||||
Execute the following command on the command line:
|
||||
#+BEGIN_SRC sh
|
||||
tic -x -o ~/.terminfo xterm-24bit.terminfo
|
||||
#+END_SRC
|
||||
|
||||
Now set your ~$TERM~ variable to ~xterm-24bit~:
|
||||
#+BEGIN_SRC sh
|
||||
export TERM=xterm-24bit
|
||||
#+END_SRC
|
||||
|
||||
SSH might break if your remote machine does not have the same setup, you can
|
||||
work around this with the following alias.
|
||||
#+BEGIN_SRC sh
|
||||
alias ssh="TERM=xterm-256color ssh"
|
||||
#+END_SRC
|
||||
|
||||
If you use tmux, you need to make sure you installed a version with truecolor
|
||||
support, then add the following lines to your `.tmux.conf`:
|
||||
#+BEGIN_SRC conf
|
||||
set -g default-terminal "xterm-24bit"
|
||||
set -g terminal-overrides ',xterm-24bit:Tc'
|
||||
#+END_SRC
|
||||
|
||||
Also, make sure you have utf8 language variables if you want all characters to
|
||||
display correctly. For example:
|
||||
#+BEGIN_SRC bash
|
||||
export LC_ALL=en_US.UTF-8
|
||||
export LANG=en_US.UTF-8
|
||||
export LANGUAGE=en_US.UTF-8
|
||||
#+END_SRC
|
||||
Emacs 27.x users don't need todo anything, as true color support is [[https://github.com/emacs-mirror/emacs/commit/7f6153d9563cfe7753083996f59eacc9f4c694df][built into
|
||||
27.1+ and newer]].
|
||||
|
||||
* Troubleshooting
|
||||
# Common issues and their solution, or places to look for help.
|
||||
|
|
|
@ -26,7 +26,7 @@ buffer.")
|
|||
(defvar +eshell-aliases
|
||||
'(("q" "exit") ; built-in
|
||||
("f" "find-file $1")
|
||||
("ff" "find-file $1")
|
||||
("ff" "find-file-other-window $1")
|
||||
("d" "dired $1")
|
||||
("bd" "eshell-up $1")
|
||||
("rg" "rg --color=always $*")
|
||||
|
|
|
@ -2,56 +2,36 @@
|
|||
|
||||
(use-package! envrc
|
||||
:when (executable-find "direnv")
|
||||
:after-call doom-first-file-hook
|
||||
:hook (doom-first-file . envrc-global-mode)
|
||||
:config
|
||||
(add-to-list 'doom-debug-variables 'envrc-debug)
|
||||
|
||||
(set-popup-rule! "^\\*envrc\\*" :quit t :ttl 0)
|
||||
|
||||
;; I'm avoiding `global-envrc-mode' intentionally, because it has the
|
||||
;; potential to run too late in the mode startup process (and after, say,
|
||||
;; server hooks that may rely on that local direnv environment).
|
||||
(add-hook! 'change-major-mode-after-body-hook
|
||||
(defun +direnv-init-h ()
|
||||
(unless (or envrc-mode
|
||||
(minibufferp)
|
||||
(file-remote-p default-directory))
|
||||
(condition-case _
|
||||
(envrc-mode 1)
|
||||
(quit)))))
|
||||
|
||||
;; Ensure these local variables survive major mode changes, so envrc-mode is
|
||||
;; only "activated" once per buffer.
|
||||
(put 'envrc-mode 'permanent-local t)
|
||||
(put 'envrc--status 'permanent-local t)
|
||||
(put 'process-environment 'permanent-local t)
|
||||
(put 'exec-path 'permanent-local t)
|
||||
(put 'eshell-path-env 'permanent-local t)
|
||||
;; A globalized minor mode triggers on `after-change-major-mode-hook'
|
||||
;; normally, which runs after a major mode's body and hooks. If those hooks do
|
||||
;; any initialization work that's sensitive to environmental state set up by
|
||||
;; direnv, then you're gonna have a bad time, so I move the trigger to
|
||||
;; `change-major-mode-after-body-hook' instead. This runs before said hooks
|
||||
;; (but not the body; fingers crossed that no major mode does important env
|
||||
;; initialization there).
|
||||
(add-hook! 'envrc-global-mode-hook
|
||||
(defun +direnv-init-global-mode-earlier-h ()
|
||||
(let ((fn #'envrc-global-mode-enable-in-buffers))
|
||||
(if (not envrc-global-mode)
|
||||
(remove-hook 'change-major-mode-after-body-hook fn)
|
||||
(remove-hook 'after-change-major-mode-hook fn)
|
||||
(add-hook 'change-major-mode-after-body-hook fn 100)))))
|
||||
|
||||
(defadvice! +direnv--fail-gracefully-a (&rest _)
|
||||
"Don't try to use direnv if the executable isn't present."
|
||||
:before-while #'envrc-mode
|
||||
(or (executable-find "direnv")
|
||||
(or (get 'envrc-mode 'direnv-executable)
|
||||
(put 'envrc-mode 'direnv-executable (executable-find "direnv" t))
|
||||
(ignore (doom-log "Couldn't find direnv executable"))))
|
||||
|
||||
;; HACK envrc-mode only affects the current buffer's environment, which is
|
||||
;; generally what we want, except when we're running babel blocks in
|
||||
;; org-mode, because there may be state or envvars those blocks need to
|
||||
;; read. In order to perpetuate the org buffer's environment into the
|
||||
;; execution of the babel block we need to temporarily change the global
|
||||
;; environment. Let's hope it runs quickly enough that its effects aren't
|
||||
;; felt in other buffers in the meantime!
|
||||
(defvar +direnv--old-environment nil)
|
||||
(defadvice! +direnv-persist-environment-a (orig-fn &rest args)
|
||||
:around #'org-babel-execute-src-block
|
||||
(if +direnv--old-environment
|
||||
(apply orig-fn args)
|
||||
(setq-default +direnv--old-environment
|
||||
(cons (default-value 'process-environment)
|
||||
(default-value 'exec-path))
|
||||
exec-path exec-path
|
||||
process-environment process-environment)
|
||||
(unwind-protect (apply orig-fn args)
|
||||
(setq-default process-environment (car +direnv--old-environment)
|
||||
exec-path (cdr +direnv--old-environment)
|
||||
+direnv--old-environment nil)))))
|
||||
;; Ensure babel's execution environment matches the host buffer's.
|
||||
(advice-add #'org-babel-execute-src-block :around #'envrc-propagate-environment)
|
||||
|
||||
;; Make sure any envrc changes are propagated after a `doom/reload'
|
||||
(add-hook 'doom-after-reload-hook #'envrc-reload-all))
|
||||
|
|
|
@ -183,9 +183,9 @@ instead is more sensible."
|
|||
;; and there is a bug preventing Flycheck errors from being shown (the
|
||||
;; errors flash briefly and then disappear).
|
||||
lsp-ui-sideline-show-hover nil
|
||||
;; Some icons don't scale correctly on Emacs 26, so disable them there.
|
||||
lsp-ui-sideline-actions-icon ; DEPRECATED Remove later
|
||||
(if EMACS27+ lsp-ui-sideline-actions-icon-default)
|
||||
;; Re-enable icon scaling (it's disabled by default upstream for Emacs
|
||||
;; 26.x compatibility; see emacs-lsp/lsp-ui#573)
|
||||
lsp-ui-sideline-actions-icon lsp-ui-sideline-actions-icon-default
|
||||
;; REVIEW Temporarily disabled, due to immense slowness on every
|
||||
;; keypress. See emacs-lsp/lsp-ui#613
|
||||
lsp-ui-doc-enable nil)
|
||||
|
|
|
@ -5,12 +5,6 @@
|
|||
(package! password-store :pin "4e73cdc4c376ad61d2e4858bc87cf01eab0dd403")
|
||||
(package! password-store-otp :pin "04998c8578a060ab4a4e8f46f2ee0aafad4ab4d5")
|
||||
|
||||
;; an older version of `auto-source-pass' is built into Emacs 26+, so we must
|
||||
;; install the new version directly from the source and with a psuedonym.
|
||||
(package! auth-source-pass
|
||||
:recipe (:host github :repo "DamienCassou/auth-password-store")
|
||||
:pin "fa8b964494c1ef42035fad340ff5f29fcdbed21c")
|
||||
|
||||
(when (featurep! :completion ivy)
|
||||
(package! ivy-pass :pin "5b523de1151f2109fdd6a8114d0af12eef83d3c5"))
|
||||
(when (featurep! :completion helm)
|
||||
|
|
|
@ -72,56 +72,6 @@
|
|||
(add-hook 'doom-switch-buffer-hook #'+pdf-reload-midnight-minor-mode-h
|
||||
nil 'local))))))
|
||||
|
||||
;; Add retina support for MacOS users
|
||||
(eval-when! IS-MAC
|
||||
(defun +pdf-view-create-page-a (page &optional window)
|
||||
"Create an image of PAGE for display on WINDOW."
|
||||
:override #'pdf-view-create-page
|
||||
(let* ((size (pdf-view-desired-image-size page window))
|
||||
(width (if (not (pdf-view-use-scaling-p))
|
||||
(car size)
|
||||
(* 2 (car size))))
|
||||
(data (pdf-cache-renderpage
|
||||
page width width))
|
||||
(hotspots (pdf-view-apply-hotspot-functions
|
||||
window page size)))
|
||||
(pdf-view-create-image data
|
||||
:width width
|
||||
:scale (if (pdf-view-use-scaling-p) 0.5 1)
|
||||
:map hotspots
|
||||
:pointer 'arrow)))
|
||||
|
||||
(defvar +pdf--scaled-p nil)
|
||||
(defadvice! +pdf--scale-up-on-retina-display-a (orig-fn &rest args)
|
||||
"Scale up the PDF on retina displays."
|
||||
:around #'pdf-util-frame-scale-factor
|
||||
(cond ((not pdf-view-use-scaling) 1)
|
||||
((and (memq (pdf-view-image-type) '(imagemagick image-io))
|
||||
(fboundp 'frame-monitor-attributes))
|
||||
(funcall orig-fn))
|
||||
;; Add special support for retina displays on MacOS
|
||||
((and (eq (framep-on-display) 'ns)
|
||||
(not +pdf--scaled-p)
|
||||
EMACS27+)
|
||||
(setq-local +pdf--scaled-p t)
|
||||
2)
|
||||
(1)))
|
||||
|
||||
(defadvice! +pdf--use-scaling-on-ns-a ()
|
||||
:before-until #'pdf-view-use-scaling-p
|
||||
(and (eq (framep-on-display) 'ns)
|
||||
EMACS27+))
|
||||
|
||||
(defadvice! +pdf--supply-width-to-create-image-calls-a (orig-fn &rest args)
|
||||
:around '(pdf-annot-show-annotation
|
||||
pdf-isearch-hl-matches
|
||||
pdf-view-display-region)
|
||||
(letf! (defun create-image (file-or-data &optional type data-p &rest props)
|
||||
(apply create-image file-or-data type data-p
|
||||
:width (car (pdf-view-image-size))
|
||||
props))
|
||||
(apply orig-fn args))))
|
||||
|
||||
;; Silence "File *.pdf is large (X MiB), really open?" prompts for pdfs
|
||||
(defadvice! +pdf-suppress-large-file-prompts-a (orig-fn size op-type filename &optional offer-raw)
|
||||
:around #'abort-if-file-too-large
|
||||
|
|
|
@ -1,9 +1,5 @@
|
|||
;; -*- no-byte-compile: t; -*-
|
||||
;;; tools/pdf/packages.el
|
||||
|
||||
(package! pdf-tools
|
||||
:recipe (:host github
|
||||
:repo "vedang/pdf-tools")
|
||||
:pin "d262cf9e19d57c6567e06e51d109150c20753839")
|
||||
|
||||
(package! pdf-tools :pin "5f77dae43eb8f71e52e10ba8cf994883f74c3fb7")
|
||||
(package! saveplace-pdf-view :pin "54ed966b842501c3c092dbf57b372e37b033c578")
|
||||
|
|
|
@ -1,92 +0,0 @@
|
|||
#+TITLE: ui/fill-column
|
||||
#+DATE: August 23, 2020
|
||||
#+SINCE: 2.0.9
|
||||
#+STARTUP: inlineimages nofold
|
||||
|
||||
* Table of Contents :TOC_3:noexport:
|
||||
- [[#description][Description]]
|
||||
- [[#maintainers][Maintainers]]
|
||||
- [[#module-flags][Module Flags]]
|
||||
- [[#plugins][Plugins]]
|
||||
- [[#prerequisites][Prerequisites]]
|
||||
- [[#features][Features]]
|
||||
- [[#configuration][Configuration]]
|
||||
- [[#setting-fill-column-globally][Setting fill-column globally]]
|
||||
- [[#setting-fill-column-for-the-current-buffer-or-mode][Setting fill-column for the current buffer or mode]]
|
||||
- [[#hl-fill-column-only-configuring-the-look-of-the-indicator][(hl-fill-column only) Configuring the look of the indicator]]
|
||||
- [[#troubleshooting][Troubleshooting]]
|
||||
|
||||
* Description
|
||||
This module provides a fill column indicator to make it obvious when a line
|
||||
reaches or surpasses the 80th column. This serves as a reminder to keep lines
|
||||
short for accessibility and/or convenience. [[https://www.emacswiki.org/emacs/EightyColumnRule][Read more about this on the Emacs
|
||||
Wiki page]].
|
||||
|
||||
#+begin_quote
|
||||
This module is deprecated and will be removed once Doom drops Emacs 26.x
|
||||
support. This is because the built-in ~display-fill-column-indicator-mode~ (in
|
||||
27 and newer) replaces it, and enabling it is a trivial one-liner, which doesn't
|
||||
warrant a module: ~(global-display-fill-column-indicator-mode +1)~
|
||||
#+end_quote
|
||||
|
||||
** Maintainers
|
||||
This module has no dedicated maintainers.
|
||||
|
||||
** Module Flags
|
||||
This module provides no flags.
|
||||
|
||||
** Plugins
|
||||
+ [[https://github.com/laishulu/hl-fill-column][hl-fill-column]]* (unless Emacs >=27)
|
||||
|
||||
* Prerequisites
|
||||
This module has no prerequisites.
|
||||
|
||||
* Features
|
||||
The behavior of this module varies slightly depending on your version of Emacs:
|
||||
|
||||
+ In Emacs 26.x, text beyond ~fill-column~ will be highlighted.
|
||||
+ In Emacs 27 and newer, a line is drawn down the right side at column 80.
|
||||
|
||||
* Configuration
|
||||
** Setting fill-column globally
|
||||
This column limit is controlled by the ~fill-column~ variable (default: ~80~).
|
||||
|
||||
This variable is buffer-local, therefore, to change this globally, you must use
|
||||
~setq-default~:
|
||||
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(setq-default fill-column 100)
|
||||
#+END_SRC
|
||||
|
||||
~hl-fill-column-mode~ (or ~display-fill-column-indicator-mode~ on Emacs 27+)
|
||||
must be restarted to see the change.
|
||||
|
||||
** Setting fill-column for the current buffer or mode
|
||||
The ~setq-hook!~ convenience macro makes settings ~fill-column~ for a particular
|
||||
mode (or modes) easy:
|
||||
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(setq-hook! 'org-mode-hook fill-column 100)
|
||||
(setq-hook! 'python-mode-hook fill-column 72)
|
||||
(setq-hook! js2-mode fill-column 72)
|
||||
(setq-hook! '(ruby-mode rustic-mode python-mode-hook) fill-column 80)
|
||||
#+END_SRC
|
||||
|
||||
Any open buffers in these modes must be restarted to see the change.
|
||||
|
||||
** (hl-fill-column only) Configuring the look of the indicator
|
||||
To change the appears of hl-fill-column's highlight, change the
|
||||
~hl-fill-column-face~ face. Doom provides the ~custom-set-faces!~ macro to help
|
||||
you do this:
|
||||
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(custom-set-faces!
|
||||
'(hl-fill-column-face :background "red"
|
||||
:foreground "blue"
|
||||
:inverse-video t))
|
||||
#+END_SRC
|
||||
|
||||
See =M-x helpful-function RET custom-set-faces\!= for demos and documentation
|
||||
for this macro.
|
||||
|
||||
* TODO Troubleshooting
|
|
@ -1,15 +0,0 @@
|
|||
;;; ui/fill-column/autoload.el -*- lexical-binding: t; -*-
|
||||
|
||||
;;;###autoload
|
||||
(defalias '+fill-column/toggle
|
||||
(if (fboundp 'display-fill-column-indicator-mode)
|
||||
#'display-fill-column-indicator-mode ; Emacs 27 only
|
||||
(autoload 'hl-fill-column-mode "hl-fill-column" nil t)
|
||||
#'hl-fill-column-mode))
|
||||
|
||||
;;;###autoload
|
||||
(defalias '+fill-column-enable-h #'+fill-column/toggle)
|
||||
|
||||
;;;###autoload
|
||||
(add-hook! '(text-mode-hook prog-mode-hook conf-mode-hook)
|
||||
#'+fill-column-enable-h)
|
|
@ -1,6 +0,0 @@
|
|||
;; -*- no-byte-compile: t; -*-
|
||||
;;; ui/fill-column/packages.el
|
||||
|
||||
;; `hl-fill-column' is only used on Emacs versions before 27
|
||||
(unless (fboundp 'display-fill-column-indicator-mode)
|
||||
(package! hl-fill-column :pin "5782a91ba0182c4e562fa0db6379ff9dd472856b"))
|
Loading…
Add table
Add a link
Reference in a new issue