mirror of
https://gitlab.com/dwt1/dotfiles.git
synced 2026-04-11 19:17:19 +10:00
Minor updates.
This commit is contained in:
204
.bashrc
204
.bashrc
@@ -6,47 +6,39 @@
|
||||
#
|
||||
# My bash config. Not much to see here; just some pretty standard stuff.
|
||||
|
||||
PATH="$HOME/.local/bin${PATH:+:${PATH}}" # adding .local/bin to $PATH
|
||||
# PATH="$HOME/.local/bin${PATH:+:${PATH}}" # adding .local/bin to $PATH
|
||||
|
||||
### EXPORT
|
||||
export TERM="xterm-256color" # getting proper colors
|
||||
export HISTCONTROL=ignoredups:erasedups # no duplicate entries
|
||||
export ALTERNATE_EDITOR="" # setting for emacsclient
|
||||
export EDITOR="emacsclient -t -a ''" # $EDITOR use Emacs in terminal
|
||||
export VISUAL="emacsclient -c -a emacs" # $VISUAL use Emacs in GUI mode
|
||||
|
||||
# sets vim as manpager
|
||||
export MANPAGER="/bin/sh -c \"col -b | vim --not-a-term -c 'set ft=man ts=8 nomod nolist noma' -\""
|
||||
|
||||
### SET VI MODE IN BASH SHELL
|
||||
set -o vi
|
||||
|
||||
# If not running interactively, don't do anything
|
||||
[[ $- != *i* ]] && return
|
||||
|
||||
colors() {
|
||||
local fgc bgc vals seq0
|
||||
### PROMPT
|
||||
PS1='[\u@\h \W]\$ '
|
||||
|
||||
printf "Color escapes are %s\n" '\e[${value};...;${value}m'
|
||||
printf "Values 30..37 are \e[33mforeground colors\e[m\n"
|
||||
printf "Values 40..47 are \e[43mbackground colors\e[m\n"
|
||||
printf "Value 1 gives a \e[1mbold-faced look\e[m\n\n"
|
||||
### PATH
|
||||
if [ -d "$HOME/.bin" ] ;
|
||||
then PATH="$HOME/.bin:$PATH"
|
||||
fi
|
||||
|
||||
# foreground colors
|
||||
for fgc in {30..37}; do
|
||||
# background colors
|
||||
for bgc in {40..47}; do
|
||||
fgc=${fgc#37} # white
|
||||
bgc=${bgc#40} # black
|
||||
if [ -d "$HOME/.local/bin" ] ;
|
||||
then PATH="$HOME/.local/bin:$PATH"
|
||||
fi
|
||||
|
||||
vals="${fgc:+$fgc;}${bgc}"
|
||||
vals=${vals%%;}
|
||||
|
||||
seq0="${vals:+\e[${vals}m}"
|
||||
printf " %-9s" "${seq0:-(default)}"
|
||||
printf " ${seq0}TEXT\e[m"
|
||||
printf " \e[${vals:+${vals+$vals;}}1mBOLD\e[m"
|
||||
done
|
||||
echo; echo
|
||||
done
|
||||
}
|
||||
|
||||
[ -r /usr/share/bash-completion/bash_completion ] && . /usr/share/bash-completion/bash_completion
|
||||
|
||||
# Change the window title of X terminals
|
||||
### CHANGE TITLE OF TERMINALS
|
||||
case ${TERM} in
|
||||
xterm*|rxvt*|Eterm*|aterm|kterm|gnome*|interix|konsole*)
|
||||
xterm*|rxvt*|Eterm*|aterm|kterm|gnome*|alacritty|st|konsole*)
|
||||
PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/\~}\007"'
|
||||
;;
|
||||
screen*)
|
||||
@@ -54,72 +46,20 @@ case ${TERM} in
|
||||
;;
|
||||
esac
|
||||
|
||||
use_color=true
|
||||
### SHOPT
|
||||
shopt -s autocd # change to named directory
|
||||
shopt -s cdspell # autocorrects cd misspellings
|
||||
shopt -s cmdhist # save multi-line commands in history as single line
|
||||
shopt -s dotglob
|
||||
shopt -s histappend # do not overwrite history
|
||||
shopt -s expand_aliases # expand aliases
|
||||
shopt -s checkwinsize # checks term size when bash regains control
|
||||
|
||||
# Set colorful PS1 only on colorful terminals.
|
||||
# dircolors --print-database uses its own built-in database
|
||||
# instead of using /etc/DIR_COLORS. Try to use the external file
|
||||
# first to take advantage of user additions. Use internal bash
|
||||
# globbing instead of external grep binary.
|
||||
safe_term=${TERM//[^[:alnum:]]/?} # sanitize TERM
|
||||
match_lhs=""
|
||||
[[ -f ~/.dir_colors ]] && match_lhs="${match_lhs}$(<~/.dir_colors)"
|
||||
[[ -f /etc/DIR_COLORS ]] && match_lhs="${match_lhs}$(</etc/DIR_COLORS)"
|
||||
[[ -z ${match_lhs} ]] \
|
||||
&& type -P dircolors >/dev/null \
|
||||
&& match_lhs=$(dircolors --print-database)
|
||||
[[ $'\n'${match_lhs} == *$'\n'"TERM "${safe_term}* ]] && use_color=true
|
||||
#ignore upper and lowercase when TAB completion
|
||||
bind "set completion-ignore-case on"
|
||||
|
||||
if ${use_color} ; then
|
||||
# Enable colors for ls, etc. Prefer ~/.dir_colors #64489
|
||||
if type -P dircolors >/dev/null ; then
|
||||
if [[ -f ~/.dir_colors ]] ; then
|
||||
eval $(dircolors -b ~/.dir_colors)
|
||||
elif [[ -f /etc/DIR_COLORS ]] ; then
|
||||
eval $(dircolors -b /etc/DIR_COLORS)
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ ${EUID} == 0 ]] ; then
|
||||
PS1='\[\033[01;31m\][\h\[\033[01;36m\] \W\[\033[01;31m\]]\$\[\033[00m\] '
|
||||
else
|
||||
PS1='\[\033[01;32m\][\u@\h\[\033[01;37m\] \W\[\033[01;32m\]]\$\[\033[00m\] '
|
||||
fi
|
||||
|
||||
grep='grep --colour=auto' \
|
||||
egrep='egrep --colour=auto' \
|
||||
fgrep='fgrep --colour=auto'
|
||||
else
|
||||
if [[ ${EUID} == 0 ]] ; then
|
||||
# show root@ when we don't have colors
|
||||
PS1='\u@\h \W \$ '
|
||||
else
|
||||
PS1='\u@\h \w \$ '
|
||||
fi
|
||||
fi
|
||||
|
||||
unset use_color safe_term match_lhs sh
|
||||
|
||||
xhost +local:root > /dev/null 2>&1
|
||||
|
||||
complete -cf sudo
|
||||
|
||||
# Bash won't get SIGWINCH if another process is in the foreground.
|
||||
# Enable checkwinsize so that bash will check the terminal size when
|
||||
# it regains control. #65623
|
||||
# http://cnswww.cns.cwru.edu/~chet/bash/FAQ (E11)
|
||||
shopt -s checkwinsize
|
||||
|
||||
shopt -s expand_aliases
|
||||
|
||||
# export QT_SELECT=4
|
||||
|
||||
# Enable history appending instead of overwriting. #139609
|
||||
shopt -s histappend
|
||||
|
||||
#
|
||||
# # ex - archive extractor
|
||||
# # usage: ex <file>
|
||||
### ARCHIVE EXTRACTION
|
||||
# usage: ex <file>
|
||||
ex ()
|
||||
{
|
||||
if [ -f $1 ] ; then
|
||||
@@ -127,7 +67,7 @@ ex ()
|
||||
*.tar.bz2) tar xjf $1 ;;
|
||||
*.tar.gz) tar xzf $1 ;;
|
||||
*.bz2) bunzip2 $1 ;;
|
||||
*.rar) unrar x $1 ;;
|
||||
*.rar) unrar x $1 ;;
|
||||
*.gz) gunzip $1 ;;
|
||||
*.tar) tar xf $1 ;;
|
||||
*.tbz2) tar xjf $1 ;;
|
||||
@@ -135,6 +75,9 @@ ex ()
|
||||
*.zip) unzip $1 ;;
|
||||
*.Z) uncompress $1;;
|
||||
*.7z) 7z x $1 ;;
|
||||
*.deb) ar x $1 ;;
|
||||
*.tar.xz) tar xf $1 ;;
|
||||
*.tar.zst) unzstd $1 ;;
|
||||
*) echo "'$1' cannot be extracted via ex()" ;;
|
||||
esac
|
||||
else
|
||||
@@ -157,20 +100,30 @@ alias vim=nvim
|
||||
alias em="/usr/bin/emacs -nw"
|
||||
alias emacs="emacsclient -c -a ''"
|
||||
|
||||
# devour windows
|
||||
alias mpv="devour mpv"
|
||||
alias sxiv="devour sxiv"
|
||||
alias zathura="devour zathura"
|
||||
# get fastest mirrors
|
||||
alias mirror="sudo reflector -f 30 -l 30 --number 10 --verbose --save /etc/pacman.d/mirrorlist"
|
||||
alias mirrord="sudo reflector --latest 50 --number 20 --sort delay --save /etc/pacman.d/mirrorlist"
|
||||
alias mirrors="sudo reflector --latest 50 --number 20 --sort score --save /etc/pacman.d/mirrorlist"
|
||||
alias mirrora="sudo reflector --latest 50 --number 20 --sort age --save /etc/pacman.d/mirrorlist"
|
||||
|
||||
# broot
|
||||
alias br='br -dhp'
|
||||
alias bs='br --sizes'
|
||||
# pacman and yay
|
||||
alias pksyu='sudo pacman -Syyu' # update only standard pkgs
|
||||
alias pksua="yay -Sua --noconfirm" # update only AUR pkgs
|
||||
alias pksyua="yay -Syu --noconfirm" # update standard pkgs and AUR pkgs
|
||||
alias unlock="sudo rm /var/lib/pacman/db.lck" # remove pacman lock
|
||||
alias cleanup='sudo pacman -Rns $(pacman -Qtdq)' # remove orphaned packages
|
||||
|
||||
# Changing "ls" to "exa"
|
||||
alias ls='exa -al --color=always --group-directories-first' # my preferred listing
|
||||
alias la='exa -a --color=always --group-directories-first' # all files and dirs
|
||||
alias ll='exa -l --color=always --group-directories-first' # long format
|
||||
alias lt='exa -aT --color=always --group-directories-first' # tree listing
|
||||
alias l.='exa -a | egrep "^\."'
|
||||
|
||||
# Colorize grep output (good for log files)
|
||||
alias grep='grep --color=auto'
|
||||
alias egrep='egrep --color=auto'
|
||||
alias fgrep='fgrep --color=auto'
|
||||
|
||||
# adding flags
|
||||
alias cp="cp -i" # confirm before overwriting something
|
||||
@@ -179,6 +132,33 @@ alias free='free -m' # show sizes in MB
|
||||
alias lynx='lynx -cfg=~/.lynx/lynx.cfg -lss=~/.lynx/lynx.lss -vikeys'
|
||||
alias vifm='./.config/vifm/scripts/vifmrun'
|
||||
|
||||
# shutdown or reboot
|
||||
alias ssn="sudo shutdown now"
|
||||
alias sr="sudo reboot"
|
||||
|
||||
# Merge Xresources
|
||||
alias merge='xrdb -merge ~/.Xresources'
|
||||
|
||||
# get error messages from journalctl
|
||||
alias jctl="journalctl -p 3 -xb"
|
||||
|
||||
# gpg encryption
|
||||
# verify signature for isos
|
||||
alias gpg-check="gpg2 --keyserver-options auto-key-retrieve --verify"
|
||||
# receive the key of a developer
|
||||
alias gpg-retrieve="gpg2 --keyserver-options auto-key-retrieve --receive-keys"
|
||||
|
||||
# youtube-dl
|
||||
alias yta-aac="youtube-dl --extract-audio --audio-format aac "
|
||||
alias yta-best="youtube-dl --extract-audio --audio-format best "
|
||||
alias yta-flac="youtube-dl --extract-audio --audio-format flac "
|
||||
alias yta-m4a="youtube-dl --extract-audio --audio-format m4a "
|
||||
alias yta-mp3="youtube-dl --extract-audio --audio-format mp3 "
|
||||
alias yta-opus="youtube-dl --extract-audio --audio-format opus "
|
||||
alias yta-vorbis="youtube-dl --extract-audio --audio-format vorbis "
|
||||
alias yta-wav="youtube-dl --extract-audio --audio-format wav "
|
||||
alias ytv-best="youtube-dl -f bestvideo+bestaudio "
|
||||
|
||||
# the terminal rickroll
|
||||
alias rr='curl -s -L https://raw.githubusercontent.com/keroserene/rickrollrc/master/roll.sh | bash'
|
||||
|
||||
@@ -188,27 +168,5 @@ alias config="/usr/bin/git --git-dir=$HOME/dotfiles --work-tree=$HOME"
|
||||
# termbin
|
||||
alias tb="nc termbin.com 9999"
|
||||
|
||||
alias wp="pacwall -b '#292d3e' -e '#82aaff' -d '#c792ea' -p '#c2e88d' -f '#ffcb6b' -u '#f07178' -s '#43475866'"
|
||||
|
||||
### SET VI MODE IN BASH SHELL
|
||||
set -o vi
|
||||
|
||||
### SET VIM AS MANPAGER ###
|
||||
export MANPAGER="/bin/sh -c \"col -b | vim --not-a-term -c 'set ft=man ts=8 nomod nolist noma' -\""
|
||||
|
||||
### BASH POWERLINE ###
|
||||
source ~/.bash-powerline.sh
|
||||
|
||||
### BASH INSULTER ###
|
||||
if [ -f /etc/bash.command-not-found ]; then
|
||||
. /etc/bash.command-not-found
|
||||
fi
|
||||
|
||||
### FORCE ALL KAKOUNE WINDOWS TO BE IN ONE SESSION
|
||||
alias kak="kak -c mysession"
|
||||
|
||||
### CLEAR THE TERMINAL
|
||||
# alias clear='[ $[$RANDOM % 10] = 0 ] && cd /home/dt/vt100 && ./slowcat.pl $(/bin/ls | grep .vt | shuf -n 1) || clear'
|
||||
|
||||
### RANDOM COLOR SCRIPT ###
|
||||
/opt/shell-color-scripts/colorscript.sh random
|
||||
|
||||
@@ -28,7 +28,7 @@ Config { font = "xft:Ubuntu:weight=bold:pixelsize=11:antialias=true:hinting=t
|
||||
, Run DiskU [("/", "<fn=1>\xf0c7</fn> hdd: <free> free")] [] 60
|
||||
-- Runs custom script to check for pacman updates.
|
||||
-- This script is in my dotfiles repo in .local/bin.
|
||||
, Run Com "pacupdate" [] "" 36000
|
||||
, Run Com "/home/dt/.local/bin/pacupdate" [] "pacupdate" 36000
|
||||
-- Runs a standard shell command 'uname -r' to get kernel version
|
||||
, Run Com "uname" ["-r"] "" 3600
|
||||
-- Prints out the left side items such as workspaces, layout, etc.
|
||||
@@ -37,5 +37,5 @@ Config { font = "xft:Ubuntu:weight=bold:pixelsize=11:antialias=true:hinting=t
|
||||
]
|
||||
, sepChar = "%"
|
||||
, alignSep = "}{"
|
||||
, template = " <action=`xdotool key control+alt+g`><icon=haskell_20.xpm/> </action><fc=#666666> |</fc> %UnsafeStdinReader% }{ <fc=#666666><fn=2>|</fn> </fc><fc=#b3afc2><fn=1></fn> %uname% </fc><fc=#666666> <fn=2>|</fn></fc> <fc=#FFB86C> %cpu% </fc><fc=#666666> <fn=2>|</fn></fc> <fc=#FF5555> %memory% </fc><fc=#666666> <fn=2>|</fn></fc> <fc=#82AAFF> %disku% </fc><fc=#666666> <fn=2>|</fn></fc> <fc=#c3e88d> %enp6s0% </fc><fc=#666666> <fn=2>|</fn></fc> <fc=#e1acff><fn=1></fn> %pacupdate%</fc><fc=#666666> <fn=2>|</fn></fc> <fc=#8BE9FD> %date% </fc>"
|
||||
, template = " <action=`xdotool key control+alt+g`><icon=haskell_20.xpm/> </action><fc=#666666> |</fc> %UnsafeStdinReader% }{ <fc=#666666><fn=2>|</fn> </fc><fc=#b3afc2><fn=1></fn> %uname% </fc><fc=#666666> <fn=2>|</fn></fc> <fc=#FFB86C> %cpu% </fc><fc=#666666> <fn=2>|</fn></fc> <fc=#FF5555> %memory% </fc><fc=#666666> <fn=2>|</fn></fc> <fc=#82AAFF> %disku% </fc><fc=#666666> <fn=2>|</fn></fc> <fc=#c3e88d> %enp6s0% </fc><fc=#666666> <fn=2>|</fn></fc> <fc=#e1acff><fn=1></fn> %pacupdate% </fc><fc=#666666> <fn=2>|</fn></fc> <fc=#8BE9FD> %date% </fc>"
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ Config { font = "xft:Ubuntu:weight=bold:pixelsize=11:antialias=true:hinting=t
|
||||
, Run DiskU [("/", "<fn=1>\xf0c7</fn> hdd: <free> free")] [] 60
|
||||
-- Runs custom script to check for pacman updates.
|
||||
-- This script is in my dotfiles repo in .local/bin.
|
||||
, Run Com "pacupdate" [] "" 36000
|
||||
, Run Com "/home/dt/.local/bin/pacupdate" [] "pacupdate" 36000
|
||||
-- Runs a standard shell command 'uname -r' to get kernel version
|
||||
, Run Com "uname" ["-r"] "" 3600
|
||||
-- Prints out the left side items such as workspaces, layout, etc.
|
||||
@@ -37,5 +37,5 @@ Config { font = "xft:Ubuntu:weight=bold:pixelsize=11:antialias=true:hinting=t
|
||||
]
|
||||
, sepChar = "%"
|
||||
, alignSep = "}{"
|
||||
, template = " <action=`xdotool key control+alt+g`><icon=haskell_20.xpm/> </action><fc=#666666> |</fc> %UnsafeStdinReader% }{ <fc=#666666><fn=2>|</fn> </fc><fc=#b3afc2><fn=1></fn> %uname% </fc><fc=#666666> <fn=2>|</fn></fc> <fc=#FFB86C> %cpu% </fc><fc=#666666> <fn=2>|</fn></fc> <fc=#FF5555> %memory% </fc><fc=#666666> <fn=2>|</fn></fc> <fc=#82AAFF> %disku% </fc><fc=#666666> <fn=2>|</fn></fc> <fc=#c3e88d> %enp6s0% </fc><fc=#666666> <fn=2>|</fn></fc> <fc=#e1acff><fn=1></fn> %pacupdate%</fc><fc=#666666> <fn=2>|</fn></fc> <fc=#8BE9FD> %date% </fc>"
|
||||
, template = " <action=`xdotool key control+alt+g`><icon=haskell_20.xpm/> </action><fc=#666666> |</fc> %UnsafeStdinReader% }{ <fc=#666666><fn=2>|</fn> </fc><fc=#b3afc2><fn=1></fn> %uname% </fc><fc=#666666> <fn=2>|</fn></fc> <fc=#FFB86C> %cpu% </fc><fc=#666666> <fn=2>|</fn></fc> <fc=#FF5555> %memory% </fc><fc=#666666> <fn=2>|</fn></fc> <fc=#82AAFF> %disku% </fc><fc=#666666> <fn=2>|</fn></fc> <fc=#c3e88d> %enp6s0% </fc><fc=#666666> <fn=2>|</fn></fc> <fc=#e1acff><fn=1></fn> %pacupdate% </fc><fc=#666666> <fn=2>|</fn></fc> <fc=#8BE9FD> %date% </fc>"
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ Config { font = "xft:Ubuntu:weight=bold:pixelsize=11:antialias=true:hinting=t
|
||||
, Run DiskU [("/", "<fn=1>\xf0c7</fn> hdd: <free> free")] [] 60
|
||||
-- Runs custom script to check for pacman updates.
|
||||
-- This script is in my dotfiles repo in .local/bin.
|
||||
, Run Com "pacupdate" [] "" 36000
|
||||
, Run Com "/home/dt/.local/bin/pacupdate" [] "pacupdate" 36000
|
||||
-- Runs a standard shell command 'uname -r' to get kernel version
|
||||
, Run Com "uname" ["-r"] "" 3600
|
||||
-- Script that dynamically adjusts xmobar padding depending on number of trayer icons.
|
||||
@@ -39,5 +39,5 @@ Config { font = "xft:Ubuntu:weight=bold:pixelsize=11:antialias=true:hinting=t
|
||||
]
|
||||
, sepChar = "%"
|
||||
, alignSep = "}{"
|
||||
, template = " <action=`xdotool key control+alt+g`><icon=haskell_20.xpm/> </action><fc=#666666> |</fc> %UnsafeStdinReader% }{ <fc=#666666><fn=2>|</fn> </fc><fc=#b3afc2><fn=1></fn> %uname% </fc><fc=#666666> <fn=2>|</fn></fc> <fc=#FFB86C> %cpu% </fc><fc=#666666> <fn=2>|</fn></fc> <fc=#FF5555> %memory% </fc><fc=#666666> <fn=2>|</fn></fc> <fc=#82AAFF> %disku% </fc><fc=#666666> <fn=2>|</fn></fc> <fc=#c3e88d> %enp6s0% </fc><fc=#666666> <fn=2>|</fn></fc> <fc=#e1acff><fn=1></fn> %pacupdate%</fc><fc=#666666> <fn=2>|</fn></fc> <fc=#8BE9FD> %date% </fc><fc=#666666><fn=2>|</fn></fc>%trayerpad%"
|
||||
, template = " <action=`xdotool key control+alt+g`><icon=haskell_20.xpm/> </action><fc=#666666> |</fc> %UnsafeStdinReader% }{ <fc=#666666><fn=2>|</fn> </fc><fc=#b3afc2><fn=1></fn> %uname% </fc><fc=#666666> <fn=2>|</fn></fc> <fc=#FFB86C> %cpu% </fc><fc=#666666> <fn=2>|</fn></fc> <fc=#FF5555> %memory% </fc><fc=#666666> <fn=2>|</fn></fc> <fc=#82AAFF> %disku% </fc><fc=#666666> <fn=2>|</fn></fc> <fc=#c3e88d> %enp6s0% </fc><fc=#666666> <fn=2>|</fn></fc> <fc=#e1acff><fn=1></fn> %pacupdate% </fc><fc=#666666> <fn=2>|</fn></fc> <fc=#8BE9FD> %date% </fc><fc=#666666><fn=2>|</fn></fc>%trayerpad%"
|
||||
}
|
||||
|
||||
@@ -56,6 +56,9 @@ Force splits to open on the right
|
||||
(add-hook 'markdown-mode-hook 'prefer-horizontal-split)
|
||||
#+END_SRC
|
||||
|
||||
#+RESULTS:
|
||||
| prefer-horizontal-split | evil-markdown-mode | doom--enable-+lua-love-mode-in-markdown-mode-h | doom--enable-+javascript-npm-mode-in-markdown-mode-h |
|
||||
|
||||
** FILE MANAGER (dired)
|
||||
Image previews in dired
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
|
||||
@@ -57,3 +57,7 @@
|
||||
(package! tldr)
|
||||
(package! treemacs)
|
||||
(package! md4rd)
|
||||
(package! muse)
|
||||
(package! wc-mode)
|
||||
(package! writegood-mode)
|
||||
(package! writeroom-mode)
|
||||
|
||||
@@ -2,8 +2,9 @@
|
||||
":"; exec emacs --quick --script "$0" -- "$@" # -*- mode: emacs-lisp; lexical-binding: t; -*-
|
||||
;;; bin/org-tangle
|
||||
|
||||
;; Tangles source blocks from org files. Debug/info messages are directed to
|
||||
;; stderr and can be ignored.
|
||||
;; Tangles source blocks from org files. Also expands #+INCLUDE directives,
|
||||
;; unlike vanilla `ob-tangle'. Debug/info messages are directed to stderr and
|
||||
;; can be ignored.
|
||||
;;
|
||||
;; -l/--lang LANG
|
||||
;; Only include blocks in the specified language (e.g. emacs-lisp).
|
||||
@@ -25,6 +26,7 @@
|
||||
;; org-tangle --and tagA --and tagB my/literate/config.org
|
||||
|
||||
(require 'cl-lib)
|
||||
(require 'ox)
|
||||
(require 'ob-tangle)
|
||||
|
||||
(defun usage ()
|
||||
@@ -140,5 +142,18 @@ trees with the :notangle: tag."
|
||||
(_ (error "Unknown option or file: %s" arg)))))
|
||||
|
||||
(dolist (file srcs)
|
||||
(org-babel-tangle-file file nil lang))
|
||||
(let ((backup (make-temp-file (file-name-base file) nil ".backup.org")))
|
||||
(unwind-protect
|
||||
;; Prevent slow hooks from interfering
|
||||
(let (org-mode-hook)
|
||||
;; We do the ol' switcheroo because `org-babel-tangle' writes
|
||||
;; changes to the current file, which would be imposing on the user.
|
||||
(copy-file file backup t)
|
||||
(with-current-buffer (find-file-noselect file)
|
||||
;; Tangling doesn't expand #+INCLUDE directives, so we do it
|
||||
;; ourselves, since includes are so useful for literate configs!
|
||||
(org-export-expand-include-keyword)
|
||||
(org-babel-tangle nil nil lang)))
|
||||
(ignore-errors (copy-file backup file t))
|
||||
(ignore-errors (delete-file backup)))))
|
||||
(kill-emacs 0))
|
||||
|
||||
@@ -264,6 +264,13 @@ See `doom-real-buffer-p' for an explanation for real buffers."
|
||||
;;
|
||||
;; Interactive commands
|
||||
|
||||
;;;###autoload
|
||||
(defun doom/save-and-kill-buffer ()
|
||||
"Save the current buffer to file, then kill it."
|
||||
(interactive)
|
||||
(save-buffer)
|
||||
(kill-current-buffer))
|
||||
|
||||
;;;###autoload
|
||||
(defun doom/kill-this-buffer-in-all-windows (buffer &optional dont-save)
|
||||
"Kill BUFFER globally and ensure all windows previously showing this buffer
|
||||
|
||||
@@ -55,19 +55,18 @@ And jumps to your `doom!' block."
|
||||
|
||||
(defmacro doom--if-compile (command on-success &optional on-failure)
|
||||
(declare (indent 2))
|
||||
(let ((windowsym (make-symbol "doom-sync-window")))
|
||||
`(with-current-buffer (compile ,command t)
|
||||
(let ((,windowsym (get-buffer-window (current-buffer))))
|
||||
(select-window ,windowsym)
|
||||
(add-hook
|
||||
'compilation-finish-functions
|
||||
(lambda (_buf status)
|
||||
(if (equal status "finished\n")
|
||||
(progn
|
||||
(delete-window ,windowsym)
|
||||
,on-success)
|
||||
,on-failure))
|
||||
nil 'local)))))
|
||||
`(with-current-buffer (compile ,command t)
|
||||
(let ((w (get-buffer-window (current-buffer))))
|
||||
(select-window w)
|
||||
(add-hook
|
||||
'compilation-finish-functions
|
||||
(lambda (_buf status)
|
||||
(if (equal status "finished\n")
|
||||
(progn
|
||||
(delete-window w)
|
||||
,on-success)
|
||||
,on-failure))
|
||||
nil 'local))))
|
||||
|
||||
;;;###autoload
|
||||
(defun doom/reload ()
|
||||
|
||||
@@ -20,11 +20,9 @@
|
||||
;;;###autoload
|
||||
(define-minor-mode doom-debug-mode
|
||||
"Toggle `debug-on-error' and `doom-debug-p' for verbose logging."
|
||||
:init-value doom-debug-p
|
||||
:init-value nil
|
||||
:global t
|
||||
(let ((value
|
||||
(cond ((eq arg 'toggle) (not doom-debug-mode))
|
||||
((> (prefix-numeric-value arg) 0)))))
|
||||
(let ((value doom-debug-mode))
|
||||
(mapc (doom-rpartial #'set value) doom-debug-variables)
|
||||
(message "Debug mode %s" (if value "on" "off"))))
|
||||
|
||||
|
||||
@@ -28,8 +28,7 @@ This is used by `file-exists-p!' and `project-file-exists-p!'."
|
||||
(mapcar (doom-rpartial #'doom--resolve-path-forms directory)
|
||||
(cdr spec)))
|
||||
(let ((filevar (make-symbol "file")))
|
||||
`(let* ((file-name-handler-alist nil)
|
||||
(,filevar ,spec))
|
||||
`(let ((,filevar ,spec))
|
||||
(and (stringp ,filevar)
|
||||
,(if directory
|
||||
`(let ((default-directory ,directory))
|
||||
@@ -38,21 +37,19 @@ This is used by `file-exists-p!' and `project-file-exists-p!'."
|
||||
,filevar)))))
|
||||
|
||||
(defun doom--path (&rest segments)
|
||||
(let (file-name-handler-alist)
|
||||
(let ((dir (pop segments)))
|
||||
(unless segments
|
||||
(setq dir (expand-file-name dir)))
|
||||
(while segments
|
||||
(setq dir (expand-file-name (car segments) dir)
|
||||
segments (cdr segments)))
|
||||
dir)))
|
||||
(let ((dir (pop segments)))
|
||||
(unless segments
|
||||
(setq dir (expand-file-name dir)))
|
||||
(while segments
|
||||
(setq dir (expand-file-name (car segments) dir)
|
||||
segments (cdr segments)))
|
||||
dir))
|
||||
|
||||
;;;###autoload
|
||||
(defun doom-glob (&rest segments)
|
||||
"Construct a path from SEGMENTS and expand glob patterns.
|
||||
Returns nil if the path doesn't exist."
|
||||
(let* (case-fold-search
|
||||
file-name-handler-alist
|
||||
(dir (apply #'doom--path segments)))
|
||||
(if (string-match-p "[[*?]" dir)
|
||||
(file-expand-wildcards dir t)
|
||||
@@ -105,7 +102,7 @@ be relative to it.
|
||||
The search recurses up to DEPTH and no further. DEPTH is an integer.
|
||||
|
||||
MATCH is a string regexp. Only entries that match it will be included."
|
||||
(let (result file-name-handler-alist)
|
||||
(let (result)
|
||||
(dolist (file (mapcan (doom-rpartial #'doom-glob "*") (doom-enlist paths)))
|
||||
(cond ((file-directory-p file)
|
||||
(appendq!
|
||||
|
||||
@@ -214,7 +214,7 @@ selection of all minor-modes, active or not."
|
||||
"*.org" doom-emacs-dir)
|
||||
#'ignore))
|
||||
:query initial-input
|
||||
:args '("-g" "*.org")
|
||||
:args '("-t" "org")
|
||||
:in doom-emacs-dir
|
||||
:prompt "Search documentation for: "))
|
||||
|
||||
@@ -633,7 +633,11 @@ config blocks in your private config."
|
||||
(unless (executable-find "rg")
|
||||
(user-error "Can't find ripgrep on your system"))
|
||||
(if (fboundp 'counsel-rg)
|
||||
(let ((counsel-rg-base-command (append counsel-rg-base-command dirs)))
|
||||
(let ((counsel-rg-base-command
|
||||
(if (stringp counsel-rg-base-command)
|
||||
(format counsel-rg-base-command
|
||||
(concat "%s " (mapconcat #'shell-quote-argument dirs " ")))
|
||||
(append counsel-rg-base-command dirs))))
|
||||
(counsel-rg query nil "-Lz" prompt))
|
||||
;; TODO Add helm support?
|
||||
(grep-find
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
;;; Bump commands
|
||||
|
||||
(defun doom--package-full-recipe (package plist)
|
||||
(require 'straight)
|
||||
(doom-plist-merge
|
||||
(plist-get plist :recipe)
|
||||
(or (cdr (straight-recipes-retrieve package))
|
||||
|
||||
@@ -106,9 +106,14 @@ in some cases."
|
||||
(thing
|
||||
(thing-at-point thing t))
|
||||
((require 'xref nil t)
|
||||
;; A little smarter than using `symbol-at-point', though in most cases,
|
||||
;; xref ends up using `symbol-at-point' anyway.
|
||||
(xref-backend-identifier-at-point (xref-find-backend)))
|
||||
;; Eglot defines a dummy for `xref-find-backend', so we need a special
|
||||
;; case to avoid xref when using eglot. See
|
||||
;; https://github.com/joaotavora/eglot/issues/503
|
||||
(if (eq (xref-find-backend) 'eglot)
|
||||
(thing-at-point 'symbol t)
|
||||
;; A little smarter than using `symbol-at-point', though in most
|
||||
;; cases, xref ends up using `symbol-at-point' anyway.
|
||||
(xref-backend-identifier-at-point (xref-find-backend))))
|
||||
(prompt
|
||||
(read-string (if (stringp prompt) prompt "")))))
|
||||
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
;;; core/cli/env.el -*- lexical-binding: t; -*-
|
||||
|
||||
(defcli! env
|
||||
((allow ["-a" "--allow" regexp] "An envvar whitelist regexp")
|
||||
(reject ["-r" "--reject" regexp] "An envvar blacklist regexp")
|
||||
(clear-p ["-c" "--clear"] "Clear and delete your envvar file")
|
||||
(outputfile ["-o" path]
|
||||
((allow ["-a" "--allow" regexp] "An additive envvar whitelist regexp")
|
||||
(reject ["-r" "--reject" regexp] "An additive envvar blacklist regexp")
|
||||
(allow-only ["-A" regexp] "Blacklist everything but REGEXP")
|
||||
(reject-only ["-R" regexp] "Whitelist everything but REGEXP")
|
||||
(clear-p ["-c" "--clear"] "Clear and delete your envvar file")
|
||||
(outputfile ["-o" path]
|
||||
"Generate the envvar file at PATH. Envvar files that aren't in
|
||||
`doom-env-file' won't be loaded automatically at startup. You will need to load
|
||||
them manually from your private config with the `doom-load-envvars-file'
|
||||
@@ -42,7 +44,11 @@ Why this over exec-path-from-shell?
|
||||
(let ((env-file (expand-file-name (or outputfile doom-env-file))))
|
||||
(if (null clear-p)
|
||||
(doom-cli-reload-env-file
|
||||
'force env-file (list allow) (list reject))
|
||||
'force env-file
|
||||
(append (if reject-only (list "."))
|
||||
(delq nil (list allow allow-only)))
|
||||
(append (if allow-only (list "."))
|
||||
(delq nil (list reject reject-only))))
|
||||
(unless (file-exists-p env-file)
|
||||
(user-error! "%S does not exist to be cleared"
|
||||
(path env-file)))
|
||||
|
||||
@@ -1,20 +1,13 @@
|
||||
;; -*- no-byte-compile: t; -*-
|
||||
;;; core/cli/packages.el
|
||||
|
||||
(defcli! (update u)
|
||||
((discard-p ["--discard"] "All local changes to packages are discarded"))
|
||||
"Updates packages.
|
||||
|
||||
This works by fetching all installed package repos and checking the distance
|
||||
between HEAD and FETCH_HEAD. This can take a while.
|
||||
|
||||
This excludes packages whose `package!' declaration contains a non-nil :freeze
|
||||
or :ignore property."
|
||||
(straight-check-all)
|
||||
(let ((doom-auto-discard discard-p))
|
||||
(when (doom-cli-packages-update)
|
||||
(doom-autoloads-reload))
|
||||
t))
|
||||
(defcli! (update u) (&rest _)
|
||||
"This command was removed."
|
||||
:hidden t
|
||||
(print! (error "This command has been removed.\n"))
|
||||
(print-group!
|
||||
(print! "To update Doom run 'doom upgrade'. To only update packages run 'doom sync -u'."))
|
||||
nil)
|
||||
|
||||
(defcli! (build b)
|
||||
((rebuild-p ["-r"] "Only rebuild packages that need rebuilding"))
|
||||
@@ -122,6 +115,74 @@ list remains lean."
|
||||
(setq straight--recipe-lookup-cache (make-hash-table :test #'eq)
|
||||
doom--cli-updated-recipes t)))
|
||||
|
||||
(defvar doom--expected-eln-files nil)
|
||||
|
||||
(defun doom--elc-file-outdated-p (file)
|
||||
(let ((elc-file (byte-compile-dest-file file)))
|
||||
;; NOTE Ignore missing elc files, they could be missing due to
|
||||
;; `no-byte-compile'. Rebuilding unnecessarily is expensive.
|
||||
(when (and (file-exists-p elc-file)
|
||||
(file-newer-than-file-p file elc-file))
|
||||
(doom-log "%s is newer than %s" file elc-file)
|
||||
t)))
|
||||
|
||||
(defun doom--eln-file-outdated-p (file)
|
||||
(when-let* ((eln-file (comp-output-filename file))
|
||||
(error-file (concat eln-file ".error")))
|
||||
(push eln-file doom--expected-eln-files)
|
||||
(cond ((file-exists-p eln-file)
|
||||
(when (file-newer-than-file-p file eln-file)
|
||||
(doom-log "%s is newer than %s" file eln-file)
|
||||
t))
|
||||
((file-exists-p error-file)
|
||||
(when (file-newer-than-file-p file error-file)
|
||||
(doom-log "%s is newer than %s" file error-file)
|
||||
t))
|
||||
(t
|
||||
(doom-log "%s doesn't exist" eln-file)
|
||||
t))))
|
||||
|
||||
(defun doom--native-compile-done-h (file)
|
||||
(when-let* ((file)
|
||||
(eln-file (comp-output-filename file))
|
||||
(error-file (concat eln-file ".error")))
|
||||
(if (file-exists-p eln-file)
|
||||
(doom-log "Compiled %s" eln-file)
|
||||
(make-directory (file-name-directory error-file) 'parents)
|
||||
(write-region "" nil error-file)
|
||||
(doom-log "Compiled %s" error-file))))
|
||||
|
||||
(defun doom--native-compile-jobs ()
|
||||
"How many async native compilation jobs are queued or in-progress."
|
||||
(if (and (boundp 'comp-files-queue)
|
||||
(fboundp 'comp-async-runnings))
|
||||
(+ (length comp-files-queue)
|
||||
(comp-async-runnings))
|
||||
0))
|
||||
|
||||
(defun doom--wait-for-compile-jobs ()
|
||||
"Wait for all pending async native compilation jobs."
|
||||
(cl-loop for pending = (doom--native-compile-jobs)
|
||||
for tick = 0 then (% (1+ tick) 15)
|
||||
with previous = 0
|
||||
while (not (zerop pending))
|
||||
if (and (zerop tick) (/= previous pending)) do
|
||||
(print! "- Waiting for %d async jobs..." pending)
|
||||
(setq previous pending)
|
||||
else do
|
||||
(let ((inhibit-message t))
|
||||
(sleep-for 0.1)))
|
||||
;; HACK Write .error files for any missing files which still don't exist.
|
||||
;; We'll just assume there was some kind of error...
|
||||
(cl-loop for eln-file in doom--expected-eln-files
|
||||
for error-file = (concat eln-file ".error")
|
||||
unless (or (file-exists-p eln-file)
|
||||
(file-exists-p error-file)) do
|
||||
(make-directory (file-name-directory error-file) 'parents)
|
||||
(write-region "" nil error-file)
|
||||
(doom-log "Compiled %s" error-file))
|
||||
(setq doom--expected-eln-files nil))
|
||||
|
||||
|
||||
(defun doom-cli-packages-install ()
|
||||
"Installs missing packages.
|
||||
@@ -132,6 +193,7 @@ declaration) or dependency thereof that hasn't already been."
|
||||
(print! (start "Installing packages..."))
|
||||
(let ((pinned (doom-package-pinned-list)))
|
||||
(print-group!
|
||||
(add-hook 'comp-async-cu-done-hook #'doom--native-compile-done-h)
|
||||
(if-let (built
|
||||
(doom--with-package-recipes (doom-package-recipe-list)
|
||||
(recipe package type local-repo)
|
||||
@@ -143,11 +205,21 @@ declaration) or dependency thereof that hasn't already been."
|
||||
(when-let (commit (cdr (assoc pkg pinned)))
|
||||
(print! (info "Checked out %s") commit)))
|
||||
straight-use-package-pre-build-functions)))
|
||||
(straight-use-package (intern package)))
|
||||
(straight-use-package (intern package))
|
||||
;; HACK Line encoding issues can plague repos with dirty
|
||||
;; worktree prompts when updating packages or "Local
|
||||
;; variables entry is missing the suffix" errors when
|
||||
;; installing them (see hlissner/doom-emacs#2637), so
|
||||
;; have git handle conversion by force.
|
||||
(when (and IS-WINDOWS (stringp local-repo))
|
||||
(let ((default-directory (straight--repos-dir local-repo)))
|
||||
(when (file-in-directory-p default-directory straight-base-dir)
|
||||
(straight--call "git" "config" "core.autocrlf" "true")))))
|
||||
(error
|
||||
(signal 'doom-package-error (list package e))))))
|
||||
(print! (success "Installed %d packages")
|
||||
(length built))
|
||||
(progn
|
||||
(doom--wait-for-compile-jobs)
|
||||
(print! (success "Installed %d packages") (length built)))
|
||||
(print! (info "No packages need to be installed"))
|
||||
nil))))
|
||||
|
||||
@@ -170,6 +242,7 @@ declaration) or dependency thereof that hasn't already been."
|
||||
(or (if force-p :all straight--packages-to-rebuild)
|
||||
(make-hash-table :test #'equal)))
|
||||
(recipes (doom-package-recipe-list)))
|
||||
(add-hook 'comp-async-cu-done-hook #'doom--native-compile-done-h)
|
||||
(unless force-p
|
||||
(straight--make-build-cache-available))
|
||||
(if-let (built
|
||||
@@ -178,25 +251,27 @@ declaration) or dependency thereof that hasn't already been."
|
||||
;; Ensure packages with outdated files/bytecode are rebuilt
|
||||
(let ((build-dir (straight--build-dir package))
|
||||
(repo-dir (straight--repos-dir local-repo)))
|
||||
(and (or (file-newer-than-file-p repo-dir build-dir)
|
||||
(and (not (plist-get recipe :no-build))
|
||||
(or (file-newer-than-file-p repo-dir build-dir)
|
||||
(file-exists-p (straight--modified-dir (or local-repo package)))
|
||||
;; Doesn't make sense to compare el and elc files
|
||||
;; when the former isn't a symlink to their source.
|
||||
(when straight-use-symlinks
|
||||
(cl-loop for file
|
||||
in (doom-files-in build-dir :match "\\.el$" :full t)
|
||||
for elc-file = (byte-compile-dest-file file)
|
||||
if (and (file-exists-p elc-file)
|
||||
(file-newer-than-file-p file elc-file))
|
||||
return t)))
|
||||
(not (plist-get recipe :no-build))
|
||||
(cl-loop with want-byte = (straight--byte-compile-package-p recipe)
|
||||
with want-native = (if (require 'comp nil t) (straight--native-compile-package-p recipe))
|
||||
with outdated = nil
|
||||
for file in (doom-files-in build-dir :match "\\.el$" :full t)
|
||||
if (or (if want-byte (doom--elc-file-outdated-p file))
|
||||
(if want-native (doom--eln-file-outdated-p file)))
|
||||
do (setq outdated t)
|
||||
finally return outdated))
|
||||
(puthash package t straight--packages-to-rebuild))))
|
||||
(straight-use-package (intern package))))
|
||||
(print! (success "Rebuilt %d package(s)") (length built))
|
||||
(progn
|
||||
(doom--wait-for-compile-jobs)
|
||||
(print! (success "Rebuilt %d package(s)") (length built)))
|
||||
(print! (success "No packages need rebuilding"))
|
||||
nil))))
|
||||
|
||||
|
||||
|
||||
(defun doom-cli-packages-update ()
|
||||
"Updates packages."
|
||||
(doom-initialize-packages)
|
||||
|
||||
@@ -26,7 +26,7 @@ following shell commands:
|
||||
(print! (info "Reloading Doom Emacs"))
|
||||
(doom-cli-execute-after "doom" "upgrade" "-p" (if force-p "-f")))
|
||||
|
||||
((print! "Nothing to do. Doom is up-to-date!")))))
|
||||
((print! "Doom is up-to-date!")))))
|
||||
|
||||
|
||||
;;
|
||||
@@ -47,7 +47,6 @@ following shell commands:
|
||||
|
||||
(defun doom-cli-upgrade (&optional auto-accept-p force-p)
|
||||
"Upgrade Doom to the latest version non-destructively."
|
||||
(require 'vc-git)
|
||||
(let ((default-directory doom-emacs-dir)
|
||||
process-file-side-effects)
|
||||
(print! (start "Preparing to upgrade Doom Emacs and its packages..."))
|
||||
@@ -84,8 +83,8 @@ following shell commands:
|
||||
(or (zerop (car (setq result (doom-call-process "git" "fetch" "--tags" doom-repo-remote branch))))
|
||||
(error "Failed to fetch from upstream"))
|
||||
|
||||
(let ((this-rev (vc-git--rev-parse "HEAD"))
|
||||
(new-rev (vc-git--rev-parse target-remote)))
|
||||
(let ((this-rev (cdr (doom-call-process "git" "rev-parse" "HEAD")))
|
||||
(new-rev (cdr (doom-call-process "git" "rev-parse" target-remote))))
|
||||
(cond
|
||||
((and (null this-rev)
|
||||
(null new-rev))
|
||||
@@ -114,9 +113,9 @@ following shell commands:
|
||||
(print! (start "Upgrading Doom Emacs..."))
|
||||
(print-group!
|
||||
(doom-clean-byte-compiled-files)
|
||||
(unless (and (zerop (car (doom-call-process "git" "reset" "--hard" target-remote)))
|
||||
(equal (vc-git--rev-parse "HEAD") new-rev))
|
||||
(error "Failed to check out %s" (substring new-rev 0 10)))
|
||||
(or (and (zerop (car (doom-call-process "git" "reset" "--hard" target-remote)))
|
||||
(equal (cdr (doom-call-process "git" "rev-parse" "HEAD")) new-rev))
|
||||
(error "Failed to check out %s" (substring new-rev 0 10)))
|
||||
(print! (info "%s") (cdr result))
|
||||
t))))))
|
||||
(ignore-errors
|
||||
|
||||
@@ -18,6 +18,9 @@
|
||||
(require 'core-packages)
|
||||
(doom-initialize-core-packages)
|
||||
|
||||
;; Don't generate superfluous files when writing temp buffers
|
||||
(setq make-backup-files nil)
|
||||
|
||||
|
||||
;;
|
||||
;;; Variables
|
||||
|
||||
@@ -91,6 +91,8 @@ possible."
|
||||
backup-directory-alist `((".*" . ,(concat doom-cache-dir "backup/"))))
|
||||
|
||||
(after! tramp
|
||||
;; Backing up files on remotes can be incredibly slow and prone to a variety
|
||||
;; of IO errors. Better to disable it altogether in tramp buffers:
|
||||
(add-to-list 'backup-directory-alist (cons tramp-file-name-regexp nil)))
|
||||
|
||||
(add-hook! 'after-save-hook
|
||||
@@ -159,23 +161,16 @@ possible."
|
||||
;; non-X systems (like Windows or macOS), where only `STRING' is used.
|
||||
(setq x-select-request-type '(UTF8_STRING COMPOUND_TEXT TEXT STRING))
|
||||
|
||||
;; Fixes the clipboard in tty Emacs by piping clipboard I/O through xclip, xsel,
|
||||
;; pb{copy,paste}, wl-copy, termux-clipboard-get, or getclip (cygwin); depending
|
||||
;; on what is available.
|
||||
(unless IS-WINDOWS
|
||||
(add-hook! 'tty-setup-hook
|
||||
(defun doom-init-clipboard-in-tty-emacs-h ()
|
||||
(and (require 'clipetty nil t)
|
||||
(global-clipetty-mode +1)))))
|
||||
|
||||
|
||||
;;
|
||||
;;; Extra file extensions to support
|
||||
|
||||
(push '("/LICENSE\\'" . text-mode) auto-mode-alist)
|
||||
(push '("\\.log\\'" . text-mode) auto-mode-alist)
|
||||
(push '("rc\\'" . conf-mode) auto-mode-alist)
|
||||
(push '("\\.\\(?:hex\\|nes\\)\\'" . hexl-mode) auto-mode-alist)
|
||||
(nconc
|
||||
auto-mode-alist
|
||||
'(("/LICENSE\\'" . text-mode)
|
||||
("\\.log\\'" . text-mode)
|
||||
("rc\\'" . conf-mode)
|
||||
("\\.\\(?:hex\\|nes\\)\\'" . hexl-mode)))
|
||||
|
||||
|
||||
;;
|
||||
@@ -258,9 +253,12 @@ possible."
|
||||
(setq savehist-file (concat doom-cache-dir "savehist"))
|
||||
:config
|
||||
(setq savehist-save-minibuffer-history t
|
||||
savehist-autosave-interval nil ; save on kill only
|
||||
savehist-additional-variables '(kill-ring search-ring regexp-search-ring))
|
||||
(add-hook! 'kill-emacs-hook
|
||||
savehist-autosave-interval nil ; save on kill only
|
||||
savehist-additional-variables
|
||||
'(kill-ring ; persist clipboard
|
||||
mark-ring global-mark-ring ; persist marks
|
||||
search-ring regexp-search-ring)) ; persist searches
|
||||
(add-hook! 'savehist-save-hook
|
||||
(defun doom-unpropertize-kill-ring-h ()
|
||||
"Remove text properties from `kill-ring' for a smaller savehist file."
|
||||
(setq kill-ring (cl-loop for item in kill-ring
|
||||
@@ -312,6 +310,7 @@ files, so we replace calls to `pp' with the much faster `prin1'."
|
||||
(use-package! better-jumper
|
||||
:hook (doom-first-input . better-jumper-mode)
|
||||
:hook (better-jumper-post-jump . recenter)
|
||||
:commands doom-set-jump-a doom-set-jump-maybe-a doom-set-jump-h
|
||||
:preface
|
||||
;; REVIEW Suppress byte-compiler warning spawning a *Compile-Log* buffer at
|
||||
;; startup. This can be removed once gilbertw1/better-jumper#2 is merged.
|
||||
@@ -542,7 +541,7 @@ files, so we replace calls to `pp' with the much faster `prin1'."
|
||||
(if visual-line-mode
|
||||
(* so-long-threshold
|
||||
(if (derived-mode-p 'text-mode)
|
||||
3
|
||||
4
|
||||
2))
|
||||
so-long-threshold)))
|
||||
(so-long-detected-long-line-p)))
|
||||
|
||||
@@ -251,13 +251,17 @@ or aliases."
|
||||
(declare (doc-string 1) (pure t) (side-effect-free t))
|
||||
`(lambda (&rest _) (interactive) ,@body))
|
||||
|
||||
(defmacro cmd!! (command &rest args)
|
||||
(defmacro cmd!! (command &optional prefix-arg &rest args)
|
||||
"Expands to a closure that interactively calls COMMAND with ARGS.
|
||||
A factory for quickly producing interactive, prefixed commands for keybinds or
|
||||
aliases."
|
||||
(declare (doc-string 1) (pure t) (side-effect-free t))
|
||||
`(lambda (&rest _) (interactive)
|
||||
(funcall-interactively ,command ,@args)))
|
||||
`(lambda (arg &rest _) (interactive "P")
|
||||
(let ((current-prefix-arg (or ,prefix-arg arg)))
|
||||
(,(if args
|
||||
'funcall-interactively
|
||||
'call-interactively)
|
||||
,command ,@args))))
|
||||
|
||||
(defmacro cmds! (&rest branches)
|
||||
"Expands to a `menu-item' dispatcher for keybinds."
|
||||
@@ -324,7 +328,7 @@ The current file is the file from which `add-to-load-path!' is used."
|
||||
`(let ((default-directory ,(dir!))
|
||||
file-name-handler-alist)
|
||||
(dolist (dir (list ,@dirs))
|
||||
(cl-pushnew (expand-file-name dir) load-path))))
|
||||
(cl-pushnew (expand-file-name dir) load-path :test #'string=))))
|
||||
|
||||
(defmacro after! (package &rest body)
|
||||
"Evaluate BODY after PACKAGE have loaded.
|
||||
@@ -486,7 +490,10 @@ advised)."
|
||||
(defmacro add-hook-trigger! (hook-var &rest targets)
|
||||
"TODO"
|
||||
`(let ((fn (intern (format "%s-h" ,hook-var))))
|
||||
(fset fn (lambda (&rest _) (run-hooks ,hook-var) (set ,hook-var nil)))
|
||||
(fset
|
||||
fn (lambda (&rest _)
|
||||
(run-hook-wrapped ,hook-var #'doom-try-run-hook)
|
||||
(set ,hook-var nil)))
|
||||
(put ,hook-var 'permanent-local t)
|
||||
(dolist (on (list ,@targets))
|
||||
(if (functionp on)
|
||||
@@ -632,7 +639,7 @@ testing advice (when combined with `rotate-text').
|
||||
;;
|
||||
;;; Backports
|
||||
|
||||
(when! (not EMACS27+)
|
||||
(when! (version< emacs-version "27.0.90")
|
||||
;; DEPRECATED Backported from Emacs 27
|
||||
(defmacro setq-local (&rest pairs)
|
||||
"Make variables in PAIRS buffer-local and assign them the corresponding values.
|
||||
|
||||
@@ -119,7 +119,8 @@ non-nil."
|
||||
(unless no-config-p
|
||||
(maphash (doom-module-loader doom-module-config-file) doom-modules)
|
||||
(run-hook-wrapped 'doom-init-modules-hook #'doom-try-run-hook)
|
||||
(load! "config" doom-private-dir t)))))
|
||||
(load! "config" doom-private-dir t)
|
||||
(load custom-file 'noerror (not doom-debug-mode))))))
|
||||
|
||||
|
||||
;;
|
||||
@@ -200,7 +201,7 @@ This doesn't require modules to be enabled. For enabled modules us
|
||||
for default-directory in doom-modules-dirs
|
||||
for path = (concat category "/" module "/" file)
|
||||
if (file-exists-p path)
|
||||
return (expand-file-name path)))
|
||||
return (file-truename path)))
|
||||
|
||||
(defun doom-module-from-path (&optional path enabled-only)
|
||||
"Returns a cons cell (CATEGORY . MODULE) derived from PATH (a file path).
|
||||
@@ -329,7 +330,9 @@ This value is cached. If REFRESH-P, then don't use the cached value."
|
||||
;; packages with package.el, by copying over old `use-package' declarations with
|
||||
;; an :ensure t property. Doom doesn't use package.el, so this will throw an
|
||||
;; error that will confuse beginners, so we disable `:ensure'.
|
||||
(setq use-package-ensure-function #'ignore)
|
||||
(setq use-package-ensure-function
|
||||
(lambda (name &rest _)
|
||||
(message "Ignoring ':ensure t' in '%s' config" name)))
|
||||
;; ...On the other hand, if the user has loaded `package', then we should assume
|
||||
;; they know what they're doing and restore the old behavior:
|
||||
(add-transient-hook! 'package-initialize
|
||||
@@ -463,7 +466,7 @@ to least)."
|
||||
`(unless doom-interactive-p
|
||||
(doom-module-mplist-map
|
||||
(lambda (category module &rest plist)
|
||||
(if (plist-get plist :path)
|
||||
(if (plist-member plist :path)
|
||||
(apply #'doom-module-set category module plist)
|
||||
(message "WARNING Couldn't find the %s %s module" category module)))
|
||||
,@(if (keywordp (car modules))
|
||||
|
||||
@@ -61,9 +61,9 @@ uses a straight or package.el command directly).")
|
||||
;; than pulled, so packages are often out of date with upstream.
|
||||
package-archives
|
||||
(let ((proto (if gnutls-verify-error "https" "http")))
|
||||
`(("gnu" . ,(concat proto "://elpa.gnu.org/packages/"))
|
||||
("melpa" . ,(concat proto "://melpa.org/packages/"))
|
||||
("org" . ,(concat proto "://orgmode.org/elpa/")))))
|
||||
(list (cons "gnu" (concat proto "://elpa.gnu.org/packages/"))
|
||||
(cons "melpa" (concat proto "://melpa.org/packages/"))
|
||||
(cons "org" (concat proto "://orgmode.org/elpa/")))))
|
||||
|
||||
;; package.el has no business modifying the user's init.el
|
||||
(advice-add #'package--ensure-init-file :override #'ignore)
|
||||
@@ -97,7 +97,9 @@ uses a straight or package.el command directly).")
|
||||
;; we don't have to deal with them at all.
|
||||
autoload-compute-prefixes nil
|
||||
;; We handle it ourselves
|
||||
straight-fix-org nil)
|
||||
straight-fix-org nil
|
||||
;; HACK Disable native-compilation for some troublesome files
|
||||
comp-deferred-compilation-black-list '("/evil-collection-vterm\\.el$"))
|
||||
|
||||
(defadvice! doom--read-pinned-packages-a (orig-fn &rest args)
|
||||
"Read `:pin's in `doom-packages' on top of straight's lockfiles."
|
||||
@@ -234,10 +236,6 @@ processed."
|
||||
nil-value)
|
||||
plist)))
|
||||
|
||||
(defun doom-package-build-time (package)
|
||||
"TODO"
|
||||
(car (gethash (symbol-name package) straight--build-cache)))
|
||||
|
||||
(defun doom-package-dependencies (package &optional recursive _noerror)
|
||||
"Return a list of dependencies for a package."
|
||||
(let ((deps (nth 1 (gethash (symbol-name package) straight--build-cache))))
|
||||
@@ -293,18 +291,6 @@ installed."
|
||||
((locate-library (symbol-name package))
|
||||
'other)))
|
||||
|
||||
(defun doom-package-changed-recipe-p (name)
|
||||
"Return t if a package named NAME (a symbol) has a different recipe than it
|
||||
was installed with."
|
||||
(cl-check-type name symbol)
|
||||
;; TODO
|
||||
;; (when (doom-package-installed-p name)
|
||||
;; (when-let* ((doom-recipe (assq name doom-packages))
|
||||
;; (install-recipe (doom-package-recipe)))
|
||||
;; (not (equal (cdr quelpa-recipe)
|
||||
;; (cdr (plist-get (cdr doom-recipe) :recipe))))))
|
||||
)
|
||||
|
||||
|
||||
;;; Package getters
|
||||
(defun doom--read-packages (file &optional noeval noerror)
|
||||
@@ -380,21 +366,6 @@ ones."
|
||||
nil 'remove #'equal)
|
||||
(unless unpin pin)))))))
|
||||
|
||||
(defun doom-package-unpinned-list ()
|
||||
"Return an alist mapping package names (strings) to pinned commits (strings)."
|
||||
(let (alist)
|
||||
(dolist (package doom-packages alist)
|
||||
(cl-destructuring-bind
|
||||
(_ &key recipe disable ignore pin unpin &allow-other-keys)
|
||||
package
|
||||
(when (and (not ignore)
|
||||
(not disable)
|
||||
(or unpin
|
||||
(and (plist-member recipe :pin)
|
||||
(null pin))))
|
||||
(cl-pushnew (doom-package-recipe-repo (car package)) alist
|
||||
:test #'equal))))))
|
||||
|
||||
(defun doom-package-recipe-list ()
|
||||
"Return straight recipes for non-builtin packages with a local-repo."
|
||||
(let (recipes)
|
||||
@@ -406,16 +377,6 @@ ones."
|
||||
(push recipe recipes))))
|
||||
(nreverse recipes)))
|
||||
|
||||
(defun doom-package-state-list ()
|
||||
"TODO"
|
||||
(let (alist)
|
||||
(dolist (recipe (hash-table-values straight--repo-cache) alist)
|
||||
(cl-destructuring-bind (&key local-repo type &allow-other-keys)
|
||||
recipe
|
||||
(when (and local-repo (not (eq type 'built-in)))
|
||||
(setf (alist-get local-repo alist nil nil #'equal)
|
||||
(straight-vc-get-commit type local-repo)))))))
|
||||
|
||||
|
||||
;;
|
||||
;;; Module package macros
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
;;; core-projects.el -*- lexical-binding: t; -*-
|
||||
|
||||
(defvar doom-projectile-cache-limit 25000
|
||||
(defvar doom-projectile-cache-limit 10000
|
||||
"If any project cache surpasses this many files it is purged when quitting
|
||||
Emacs.")
|
||||
|
||||
@@ -11,9 +11,9 @@ Emacs.")
|
||||
"If non-nil, non-projects are purged from the cache on `kill-emacs-hook'.")
|
||||
|
||||
(defvar doom-projectile-fd-binary
|
||||
(or (cl-find-if #'executable-find '("fdfind" "fd"))
|
||||
"fd")
|
||||
"name of `fd-find' executable binary")
|
||||
(cl-find-if #'executable-find (list "fdfind" "fd"))
|
||||
"The filename of the `fd' executable. On some distros it's 'fdfind' (ubuntu,
|
||||
debian, and derivatives). On most it's 'fd'.")
|
||||
|
||||
|
||||
;;
|
||||
@@ -26,8 +26,11 @@ Emacs.")
|
||||
projectile-locate-dominating-file)
|
||||
:init
|
||||
(setq projectile-cache-file (concat doom-cache-dir "projectile.cache")
|
||||
;; Auto-discovery is slow to do by default. Better to update the list
|
||||
;; when you need to (`projectile-discover-projects-in-search-path').
|
||||
projectile-auto-discover nil
|
||||
projectile-enable-caching doom-interactive-p
|
||||
projectile-globally-ignored-files '(".DS_Store" "Icon
|
||||
projectile-globally-ignored-files '(".DS_Store" "TAGS")
|
||||
projectile-globally-ignored-file-suffixes '(".elc" ".pyc" ".o")
|
||||
projectile-kill-buffers-filter 'kill-only-files
|
||||
projectile-known-projects-file (concat doom-cache-dir "projectile.projects")
|
||||
@@ -39,6 +42,12 @@ Emacs.")
|
||||
:config
|
||||
(projectile-mode +1)
|
||||
|
||||
;; Auto-discovery on `projectile-mode' is slow and premature. Let's defer it
|
||||
;; until it's actually needed. Also clean up non-existing projects too!
|
||||
(add-transient-hook! 'projectile-relevant-known-projects
|
||||
(projectile-cleanup-known-projects)
|
||||
(projectile-discover-projects-in-search-path))
|
||||
|
||||
;; Projectile runs four functions to determine the root (in this order):
|
||||
;;
|
||||
;; + `projectile-root-local' -> checks the `projectile-project-root' variable
|
||||
@@ -102,7 +111,9 @@ b) represent blacklisted directories that are too big, change too often or are
|
||||
private. (see `doom-projectile-cache-blacklist'),
|
||||
c) are not valid projectile projects."
|
||||
(when (and (bound-and-true-p projectile-projects-cache)
|
||||
projectile-enable-caching
|
||||
doom-interactive-p)
|
||||
(projectile-cleanup-known-projects)
|
||||
(cl-loop with blacklist = (mapcar #'file-truename doom-projectile-cache-blacklist)
|
||||
for proot in (hash-table-keys projectile-projects-cache)
|
||||
if (or (not (stringp proot))
|
||||
@@ -130,55 +141,54 @@ c) are not valid projectile projects."
|
||||
projectile-project-root-files)
|
||||
projectile-project-root-files-bottom-up nil)))
|
||||
|
||||
;; Some utilities have issues with windows-style paths in MSYS, so emit
|
||||
;; unix-style paths instead.
|
||||
(when IS-WINDOWS
|
||||
(setenv "MSYS_NO_PATHCONV" "1"))
|
||||
|
||||
;; HACK Don't rely on VCS-specific commands to generate our file lists. That's
|
||||
;; 7 commands to maintain, versus the more generic, reliable and
|
||||
;; performant `fd' or `ripgrep'.
|
||||
;; performant `fd' or `ripgrep'.
|
||||
(defadvice! doom--only-use-generic-command-a (vcs)
|
||||
"Only use `projectile-generic-command' for indexing project files.
|
||||
And if it's a function, evaluate it."
|
||||
And if it's a function, evaluate it."
|
||||
:override #'projectile-get-ext-command
|
||||
(if (functionp projectile-generic-command)
|
||||
(funcall projectile-generic-command vcs)
|
||||
projectile-generic-command))
|
||||
|
||||
|
||||
(cond
|
||||
;; If fd exists, use it for git and generic projects. fd is a rust program
|
||||
;; that is significantly faster than git ls-files or find, and it respects
|
||||
;; .gitignore. This is recommended in the projectile docs.
|
||||
((executable-find doom-projectile-fd-binary)
|
||||
(setq projectile-generic-command
|
||||
;; `projectile-generic-command' doesn't typically support a function.
|
||||
;; My `doom--only-use-generic-command-a' advice allows this. I do it
|
||||
;; this way so that future changes to
|
||||
;; `projectile-globally-ignored-directories' are respected.
|
||||
(lambda (_)
|
||||
(concat (format "%s . -0 -H -E .git --color=never --type file --type symlink --follow"
|
||||
doom-projectile-fd-binary)
|
||||
(cl-loop for dir in projectile-globally-ignored-directories
|
||||
concat " -E "
|
||||
concat (shell-quote-argument dir))
|
||||
(if IS-WINDOWS " --path-separator=//")))
|
||||
projectile-git-submodule-command nil
|
||||
;; ensure Windows users get fd's benefits
|
||||
projectile-indexing-method 'alien))
|
||||
|
||||
;; Otherwise, resort to ripgrep, which is also faster than find
|
||||
((executable-find "rg")
|
||||
(setq projectile-generic-command
|
||||
(lambda (_)
|
||||
(concat "rg -0 --files --follow --color=never --hidden"
|
||||
(cl-loop for dir in projectile-globally-ignored-directories
|
||||
concat " --glob "
|
||||
concat (shell-quote-argument (concat "!" dir)))
|
||||
(if IS-WINDOWS " --path-separator //")))
|
||||
projectile-git-submodule-command nil
|
||||
;; ensure Windows users get rg's benefits
|
||||
projectile-indexing-method 'alien))
|
||||
|
||||
;; Fix breakage on windows in git projects with submodules, since Windows
|
||||
;; doesn't have tr
|
||||
(IS-WINDOWS
|
||||
;; `projectile-generic-command' doesn't typically support a function, but my
|
||||
;; `doom--only-use-generic-command-a' advice allows this. I do it this way so
|
||||
;; that projectile can adapt to remote systems (over TRAMP), rather then look
|
||||
;; for fd/ripgrep on the remote system simply because it exists on the host.
|
||||
;; It's faster too.
|
||||
(setq projectile-git-submodule-command nil
|
||||
projectile-indexing-method 'hybrid
|
||||
projectile-generic-command
|
||||
(lambda (_)
|
||||
(let ((find-exe-fn
|
||||
(if EMACS27+
|
||||
(doom-rpartial #'executable-find t)
|
||||
#'executable-find)))
|
||||
;; If fd exists, use it for git and generic projects. fd is a rust
|
||||
;; program that is significantly faster than git ls-files or find, and
|
||||
;; it respects .gitignore. This is recommended in the projectile docs.
|
||||
(cond
|
||||
((when-let
|
||||
(bin (if (ignore-errors (file-remote-p default-directory nil t))
|
||||
(cl-find-if find-exe-fn (list "fdfind" "fd"))
|
||||
doom-projectile-fd-binary))
|
||||
(concat (format "%s . -0 -H -E .git --color=never --type file --type symlink --follow"
|
||||
bin)
|
||||
(if IS-WINDOWS " --path-separator=/"))))
|
||||
;; Otherwise, resort to ripgrep, which is also faster than find
|
||||
((funcall find-exe-fn "rg")
|
||||
(concat "rg -0 --files --follow --color=never --hidden"
|
||||
(cl-loop for dir in projectile-globally-ignored-directories
|
||||
concat " --glob "
|
||||
concat (shell-quote-argument (concat "!" dir)))
|
||||
(if IS-WINDOWS " --path-separator /")))
|
||||
("find . -type f -print0")))))
|
||||
|
||||
(defadvice! doom--projectile-default-generic-command-a (orig-fn &rest args)
|
||||
"If projectile can't tell what kind of project you're in, it issues an error
|
||||
@@ -189,16 +199,7 @@ when using many of projectile's command, e.g. `projectile-compile-command',
|
||||
This suppresses the error so these commands will still run, but prompt you for
|
||||
the command instead."
|
||||
:around #'projectile-default-generic-command
|
||||
:around #'projectile-default-generic-command
|
||||
(ignore-errors (apply orig-fn args)))
|
||||
|
||||
;; Projectile root-searching functions can cause an infinite loop on TRAMP
|
||||
;; connections, so disable them.
|
||||
;; TODO Is this still necessary?
|
||||
(defadvice! doom--projectile-locate-dominating-file-a (file _name)
|
||||
"Don't traverse the file system if on a remote connection."
|
||||
:before-while #'projectile-locate-dominating-file
|
||||
(and (stringp file)
|
||||
(ignore-errors (apply orig-fn args))))
|
||||
|
||||
|
||||
;;
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
;;; Variables
|
||||
|
||||
(defvar doom-init-theme-p nil
|
||||
"If non-nil, a theme as been loaded.")
|
||||
"If non-nil, a theme has been loaded.")
|
||||
|
||||
(defvar doom-theme nil
|
||||
"A symbol representing the Emacs theme to load at startup.
|
||||
@@ -13,9 +13,7 @@ This is changed by `load-theme'.")
|
||||
|
||||
(defvar doom-font nil
|
||||
"The default font to use.
|
||||
|
||||
Expects either a `font-spec', font object, an XFT font string or an XLFD font
|
||||
string.
|
||||
Must be a `font-spec', a font object, an XFT font string, or an XLFD string.
|
||||
|
||||
This affects the `default' and `fixed-pitch' faces.
|
||||
|
||||
@@ -24,38 +22,33 @@ Examples:
|
||||
(setq doom-font \"Terminus (TTF):pixelsize=12:antialias=off\")")
|
||||
|
||||
(defvar doom-variable-pitch-font nil
|
||||
"The font to use for variable-pitch text.
|
||||
|
||||
Expects either a `font-spec', font object, a XFT font string or XLFD string. See
|
||||
"The default font to use for variable-pitch text.
|
||||
Must be a `font-spec', a font object, an XFT font string, or an XLFD string. See
|
||||
`doom-font' for examples.
|
||||
|
||||
It is recommended you don't set specify a font-size, as to inherit `doom-font's
|
||||
size.")
|
||||
An omitted font size means to inherit `doom-font''s size.")
|
||||
|
||||
(defvar doom-serif-font nil
|
||||
"The default font to use for the `fixed-pitch-serif' face.
|
||||
|
||||
Expects either a `font-spec', font object, a XFT font string or XLFD string. See
|
||||
Must be a `font-spec', a font object, an XFT font string, or an XLFD string. See
|
||||
`doom-font' for examples.
|
||||
|
||||
It is recommended you don't set specify a font-size, as to inherit `doom-font's
|
||||
size.")
|
||||
An omitted font size means to inherit `doom-font''s size.")
|
||||
|
||||
(defvar doom-unicode-font
|
||||
(if IS-MAC
|
||||
(font-spec :family "Apple Color Emoji")
|
||||
(font-spec :family "Symbola"))
|
||||
"Fallback font for unicode glyphs.
|
||||
"Fallback font for Unicode glyphs.
|
||||
Must be a `font-spec', a font object, an XFT font string, or an XLFD string. See
|
||||
`doom-font' for examples.
|
||||
|
||||
It defaults to Apple Color Emoji on MacOS and Symbola on Linux. Expects either a
|
||||
`font-spec', font object, a XFT font string or XLFD string. See `doom-font' for
|
||||
examples.
|
||||
The defaults on macOS and Linux are Apple Color Emoji and Symbola, respectively.
|
||||
|
||||
It is recommended you don't set specify a font-size, as to inherit `doom-font's
|
||||
size.")
|
||||
An omitted font size means to inherit `doom-font''s size.")
|
||||
|
||||
(defvar doom-unicode-extra-fonts nil
|
||||
"Fonts to inject into the unicode charset before `doom-unicode-font'.")
|
||||
"Fonts to inject into the Unicode charset before `doom-unicode-font'.")
|
||||
|
||||
|
||||
;;
|
||||
@@ -139,24 +132,24 @@ size.")
|
||||
(not (eq (current-buffer) (doom-fallback-buffer))))
|
||||
|
||||
(defun doom-highlight-non-default-indentation-h ()
|
||||
"Highlight whitespace that doesn't match your `indent-tabs-mode' setting.
|
||||
"Highlight whitespace at odds with `indent-tabs-mode'.
|
||||
That is, highlight tabs if `indent-tabs-mode' is `nil', and highlight spaces at
|
||||
the beginnings of lines if `indent-tabs-mode' is `t'. The purpose is to make
|
||||
incorrect indentation in the current buffer obvious to you.
|
||||
|
||||
e.g. If you indent with spaces by default, tabs will be highlighted. If you
|
||||
indent with tabs, spaces at BOL are highlighted.
|
||||
|
||||
Does nothing if `whitespace-mode' or 'global-whitespace-mode' is already
|
||||
active or if the current buffer is read-only or not file-visiting."
|
||||
Does nothing if `whitespace-mode' or `global-whitespace-mode' is already active
|
||||
or if the current buffer is read-only or not file-visiting."
|
||||
(unless (or (eq major-mode 'fundamental-mode)
|
||||
buffer-read-only
|
||||
(bound-and-true-p global-whitespace-mode)
|
||||
(null buffer-file-name))
|
||||
(require 'whitespace)
|
||||
(set (make-local-variable 'whitespace-style)
|
||||
(let ((style (if indent-tabs-mode '(indentation) '(tabs tab-mark))))
|
||||
(if whitespace-mode
|
||||
(cl-union style whitespace-active-style)
|
||||
style)))
|
||||
(cl-pushnew 'face whitespace-style)
|
||||
(cl-union (if indent-tabs-mode
|
||||
'(indentation)
|
||||
'(tabs tab-mark))
|
||||
(when whitespace-mode
|
||||
(remq 'face whitespace-active-style))))
|
||||
(cl-pushnew 'face whitespace-style) ; must be first
|
||||
(whitespace-mode +1)))
|
||||
|
||||
|
||||
@@ -178,8 +171,10 @@ active or if the current buffer is read-only or not file-visiting."
|
||||
;; middle-click paste at point, not at click
|
||||
(setq mouse-yank-at-point t)
|
||||
|
||||
;; Enable mouse in terminal Emacs
|
||||
(add-hook 'tty-setup-hook #'xterm-mouse-mode)
|
||||
;; Larger column width for function name in profiler reports
|
||||
(after! profiler
|
||||
(setf (caar profiler-report-cpu-line-format) 80
|
||||
(caar profiler-report-memory-line-format) 80))
|
||||
|
||||
|
||||
;;
|
||||
@@ -222,12 +217,6 @@ active or if the current buffer is read-only or not file-visiting."
|
||||
;; Don't blink the paren matching the one at point, it's too distracting.
|
||||
(setq blink-matching-paren nil)
|
||||
|
||||
;; Some terminals offer two different cursors: a “visible” static cursor and a
|
||||
;; “very visible” blinking one. By default, Emacs uses the very visible cursor
|
||||
;; and switches to it when you start or resume Emacs. If `visible-cursor' is nil
|
||||
;; when Emacs starts or resumes, it uses the normal cursor.
|
||||
(setq visible-cursor nil)
|
||||
|
||||
;; Don't stretch the cursor to fit wide characters, it is disorienting,
|
||||
;; especially for tabs.
|
||||
(setq x-stretch-cursor nil)
|
||||
@@ -255,25 +244,30 @@ windows, switch to `doom-fallback-buffer'. Otherwise, delegate to original
|
||||
(message "Can't kill the fallback buffer.")
|
||||
t)
|
||||
((doom-real-buffer-p buf)
|
||||
(if (and buffer-file-name
|
||||
(buffer-modified-p buf)
|
||||
(not (y-or-n-p
|
||||
(format "Buffer %s is modified; kill anyway?" buf))))
|
||||
(message "Aborted")
|
||||
(set-buffer-modified-p nil)
|
||||
(let (buffer-list-update-hook)
|
||||
(when (or ;; if there aren't more real buffers than visible buffers,
|
||||
;; then there are no real, non-visible buffers left.
|
||||
(not (cl-set-difference (doom-real-buffer-list)
|
||||
(doom-visible-buffers)))
|
||||
;; if we end up back where we start (or previous-buffer
|
||||
;; returns nil), we have nowhere left to go
|
||||
(memq (switch-to-prev-buffer nil t) (list buf 'nil)))
|
||||
(switch-to-buffer (doom-fallback-buffer)))
|
||||
(unless (delq (selected-window) (get-buffer-window-list buf nil t))
|
||||
(kill-buffer buf)))
|
||||
(run-hooks 'buffer-list-update-hook))
|
||||
t))))
|
||||
(let ((visible-p (delq (selected-window) (get-buffer-window-list buf nil t)))
|
||||
(doom-inhibit-switch-buffer-hooks t)
|
||||
(inhibit-redisplay t)
|
||||
buffer-list-update-hook)
|
||||
(unless visible-p
|
||||
(when (and (buffer-modified-p buf)
|
||||
(not (y-or-n-p
|
||||
(format "Buffer %s is modified; kill anyway?"
|
||||
buf))))
|
||||
(user-error "Aborted")))
|
||||
(when (or ;; if there aren't more real buffers than visible buffers,
|
||||
;; then there are no real, non-visible buffers left.
|
||||
(not (cl-set-difference (doom-real-buffer-list)
|
||||
(doom-visible-buffers)))
|
||||
;; if we end up back where we start (or previous-buffer
|
||||
;; returns nil), we have nowhere left to go
|
||||
(memq (switch-to-prev-buffer nil t) (list buf 'nil)))
|
||||
(switch-to-buffer (doom-fallback-buffer)))
|
||||
(unless visible-p
|
||||
(with-current-buffer buf
|
||||
(restore-buffer-modified-p nil))
|
||||
(kill-buffer buf))
|
||||
(run-hooks 'buffer-list-update-hook)
|
||||
t)))))
|
||||
|
||||
|
||||
;;
|
||||
@@ -399,6 +393,10 @@ windows, switch to `doom-fallback-buffer'. Otherwise, delegate to original
|
||||
(setq ansi-color-for-comint-mode t)
|
||||
|
||||
|
||||
(after! comint
|
||||
(setq comint-prompt-read-only t))
|
||||
|
||||
|
||||
(after! compile
|
||||
(setq compilation-always-kill t ; kill compilation process before starting another
|
||||
compilation-ask-about-save nil ; save all buffers on `compile'
|
||||
|
||||
@@ -48,6 +48,12 @@
|
||||
(setq file-name-handler-alist doom--initial-file-name-handler-alist))
|
||||
(add-hook 'emacs-startup-hook #'doom-reset-file-handler-alist-h))
|
||||
|
||||
;; REVIEW Fixes 'void-variable tab-prefix-map' errors caused by packages that
|
||||
;; prematurely use this variable before it was introduced. Remove this in
|
||||
;; a year.
|
||||
(unless (boundp 'tab-prefix-map)
|
||||
(defvar tab-prefix-map (make-sparse-keymap)))
|
||||
|
||||
;; Just the bare necessities
|
||||
(require 'subr-x)
|
||||
(require 'cl-lib)
|
||||
@@ -160,8 +166,8 @@ users).")
|
||||
(set-charset-priority 'unicode)) ; pretty
|
||||
(prefer-coding-system 'utf-8) ; pretty
|
||||
(setq locale-coding-system 'utf-8) ; please
|
||||
;; The clipboard's on Windows could be in an encoding that's wider (or thinner)
|
||||
;; than utf-8, so let Emacs/the OS decide what encoding to use there.
|
||||
;; The clipboard's on Windows could be in a wider (or thinner) encoding than
|
||||
;; utf-8 (likely UTF-16), so let Emacs/the OS decide what encoding to use there.
|
||||
(unless IS-WINDOWS
|
||||
(setq selection-coding-system 'utf-8)) ; with sugar on top
|
||||
|
||||
@@ -169,7 +175,7 @@ users).")
|
||||
;; we do about them, besides changing packages upstream?
|
||||
(setq ad-redefinition-action 'accept)
|
||||
|
||||
;; Make apropos omnipotent. It's more useful this way.
|
||||
;; Make `apropos' et co search more extensively. They're more useful this way.
|
||||
(setq apropos-do-all t)
|
||||
|
||||
;; A second, case-insensitive pass over `auto-mode-alist' is time wasted, and
|
||||
@@ -177,17 +183,19 @@ users).")
|
||||
;; insensitivity).
|
||||
(setq auto-mode-case-fold nil)
|
||||
|
||||
;; Less noise at startup. The dashboard/empty scratch buffer is good enough.
|
||||
;; Reduce *Message* noise at startup. An empty scratch buffer (or the dashboard)
|
||||
;; is more than enough.
|
||||
(setq inhibit-startup-message t
|
||||
inhibit-startup-echo-area-message user-login-name
|
||||
inhibit-default-init t
|
||||
;; Avoid pulling in many packages by starting the scratch buffer in
|
||||
;; `fundamental-mode', rather than, say, `org-mode' or `text-mode'.
|
||||
;; Shave seconds off startup time by starting the scratch buffer in
|
||||
;; `fundamental-mode', rather than, say, `org-mode' or `text-mode', which
|
||||
;; pull in a ton of packages.
|
||||
initial-major-mode 'fundamental-mode
|
||||
initial-scratch-message nil)
|
||||
|
||||
;; Get rid of "For information about GNU Emacs..." message at startup, unless
|
||||
;; we're in a daemon session, where it'll say "Starting Emacs daemon." instead,
|
||||
;; we're in a daemon session where it'll say "Starting Emacs daemon." instead,
|
||||
;; which isn't so bad.
|
||||
(unless (daemonp)
|
||||
(advice-add #'display-startup-echo-area-message :override #'ignore))
|
||||
@@ -233,7 +241,7 @@ users).")
|
||||
(setq abbrev-file-name (concat doom-local-dir "abbrev.el")
|
||||
async-byte-compile-log-file (concat doom-etc-dir "async-bytecomp.log")
|
||||
bookmark-default-file (concat doom-etc-dir "bookmarks")
|
||||
custom-file (concat doom-private-dir "config.el")
|
||||
custom-file (concat doom-private-dir "custom.el")
|
||||
custom-theme-directory (concat doom-private-dir "themes/")
|
||||
desktop-dirname (concat doom-etc-dir "desktop")
|
||||
desktop-base-file-name "autosave"
|
||||
@@ -271,6 +279,11 @@ config.el instead."
|
||||
(setq-default bidi-display-reordering 'left-to-right
|
||||
bidi-paragraph-direction 'left-to-right)
|
||||
|
||||
;; Disabling the BPA makes redisplay faster, but might produce incorrect display
|
||||
;; reordering of bidirectional text with embedded parentheses and other bracket
|
||||
;; characters whose 'paired-bracket' Unicode property is non-nil.
|
||||
(setq bidi-inhibit-bpa t) ; Emacs 27 only
|
||||
|
||||
;; Reduce rendering/line scan work for Emacs by not rendering cursors or regions
|
||||
;; in non-focused windows.
|
||||
(setq-default cursor-in-non-selected-windows nil)
|
||||
@@ -294,10 +307,10 @@ config.el instead."
|
||||
;; been determined, but we inhibit it there anyway.
|
||||
(setq inhibit-compacting-font-caches t)
|
||||
|
||||
;; Performance on Windows is considerably worse than elsewhere, especially if
|
||||
;; WSL is involved. We'll need everything we can get.
|
||||
;; Performance on Windows is considerably worse than elsewhere. We'll need
|
||||
;; everything we can get.
|
||||
(when IS-WINDOWS
|
||||
(setq w32-get-true-file-attributes nil ; slightly faster IO
|
||||
(setq w32-get-true-file-attributes nil ; decrease file IO workload
|
||||
w32-pipe-read-delay 0 ; faster ipc
|
||||
w32-pipe-buffer-size (* 64 1024))) ; read more at a time (was 4K)
|
||||
|
||||
@@ -333,10 +346,14 @@ config.el instead."
|
||||
;; File+dir local variables are initialized after the major mode and its hooks
|
||||
;; have run. If you want hook functions to be aware of these customizations, add
|
||||
;; them to MODE-local-vars-hook instead.
|
||||
(defvar doom--inhibit-local-var-hooks nil)
|
||||
|
||||
(defun doom-run-local-var-hooks-h ()
|
||||
"Run MODE-local-vars-hook after local variables are initialized."
|
||||
(run-hook-wrapped (intern-soft (format "%s-local-vars-hook" major-mode))
|
||||
#'doom-try-run-hook))
|
||||
(unless doom--inhibit-local-var-hooks
|
||||
(set (make-local-variable 'doom--inhibit-local-var-hooks) t)
|
||||
(run-hook-wrapped (intern-soft (format "%s-local-vars-hook" major-mode))
|
||||
#'doom-try-run-hook)))
|
||||
|
||||
;; If the user has disabled `enable-local-variables', then
|
||||
;; `hack-local-variables-hook' is never triggered, so we trigger it at the end
|
||||
@@ -502,13 +519,17 @@ to least)."
|
||||
(file-missing
|
||||
;; If the autoloads file fails to load then the user forgot to sync, or
|
||||
;; aborted a doom command midway!
|
||||
(signal 'doom-error
|
||||
(list "Doom is in an incomplete state"
|
||||
"run 'bin/doom sync' on the command line to repair it"))))
|
||||
(if (equal (nth 3 e) doom-autoload-file)
|
||||
(signal 'doom-error
|
||||
(list "Doom is in an incomplete state"
|
||||
"run 'bin/doom sync' on the command line to repair it"))
|
||||
;; Otherwise, something inside the autoloads file is triggering this
|
||||
;; error; forward it!
|
||||
(apply #'doom-autoload-error e))))
|
||||
|
||||
;; Load shell environment, optionally generated from 'doom env'. No need
|
||||
;; to do so if we're in terminal Emacs, where Emacs correctly inherits
|
||||
;; your shell environment there.
|
||||
;; your shell environment.
|
||||
(if (or (display-graphic-p)
|
||||
(daemonp))
|
||||
(doom-load-envvars-file doom-env-file 'noerror))
|
||||
@@ -517,9 +538,9 @@ to least)."
|
||||
;; to configure their packages.
|
||||
(require 'core-modules)
|
||||
|
||||
;; There's a chance the user will want to use package.el or straight later
|
||||
;; on in this interactive session. If that's the case, make sure they're
|
||||
;; properly initialized when they do.
|
||||
;; There's a chance the user will later use package.el or straight in this
|
||||
;; interactive session. If they do, make sure they're properly initialized
|
||||
;; when they do.
|
||||
(autoload 'doom-initialize-packages "core-packages")
|
||||
(autoload 'doom-initialize-core-packages "core-packages")
|
||||
(with-eval-after-load 'package (require 'core-packages))
|
||||
@@ -537,7 +558,7 @@ to least)."
|
||||
(add-hook 'window-setup-hook #'doom-display-benchmark-h 'append)
|
||||
(if doom-debug-p (doom-debug-mode +1))
|
||||
|
||||
;; Load core/core-*.el, the user's private init.el and their config.el
|
||||
;; Load core/core-*.el, the user's private init.el, then their config.el
|
||||
(doom-initialize-modules force-p))
|
||||
|
||||
doom-init-p)
|
||||
|
||||
@@ -14,12 +14,12 @@
|
||||
:local-repo "straight.el"
|
||||
:files ("straight*.el")
|
||||
:no-build t)
|
||||
:pin "09cfa1b344cbeeea7da2e075df7c19262fb2b9e6")
|
||||
:pin "fc077dda27dc603c6a287d9cffe0bf0ba5018d66")
|
||||
|
||||
;; core-modules.el
|
||||
(package! use-package
|
||||
:type 'core
|
||||
:pin "d2640fec376a8458a669e7526e63e5870d875118")
|
||||
:pin "7d925367ef0857d513d62eab4cb57b7436b9ffe9")
|
||||
|
||||
;; core-ui.el
|
||||
(package! all-the-icons :pin "ed8e44de4fa601309d2bba902c3b37cb73e4daa0")
|
||||
@@ -48,14 +48,10 @@
|
||||
;; optimizations (the original has been abandoned).
|
||||
:recipe (:host github :repo "hlissner/ws-butler")
|
||||
:pin "2bb49d3ee7d2cba133bc7e9cdac416cd1c5e4fe0")
|
||||
(unless IS-WINDOWS
|
||||
(package! clipetty
|
||||
:recipe (:host github :repo "spudlyo/clipetty")
|
||||
:pin "01b39044b9b65fa4ea7d3166f8b1ffab6f740362"))
|
||||
|
||||
;; core-projects.el
|
||||
(package! projectile :pin "7e552b6d876014ca5b4609318ca8a202b2a89014")
|
||||
(package! projectile :pin "bbcf781d3fddb8e00d0dc10eb68bc2528fb409b3")
|
||||
|
||||
;; core-keybinds.el
|
||||
(package! general :pin "a0b17d207badf462311b2eef7c065b884462cb7c")
|
||||
(package! which-key :pin "8b49ae978cceca65967f3544c236f32964ddbed0")
|
||||
(package! which-key :pin "3642c11d5ef9be3c6fb9edb8fd5ec3c370abd889")
|
||||
|
||||
@@ -13,7 +13,7 @@ But before you doom yourself, here are some things you should know:
|
||||
3. Use 'doom upgrade' to update Doom. Doing it any other way will require
|
||||
additional steps. Run 'doom help upgrade' to understand those extra steps.
|
||||
|
||||
4. Access Doom's documentation from within Emacs via 'SPC h D' or 'C-h D' (or
|
||||
'M-x doom/help')
|
||||
4. Access Doom's documentation from within Emacs via 'SPC h d h' or 'C-h d h'
|
||||
(or 'M-x doom/help')
|
||||
|
||||
Have fun!
|
||||
|
||||
@@ -36,6 +36,7 @@ It is integrated into Helpful, in Doom.
|
||||
- [[#center-emacs-initial-frame-with-a-fixed-size][Center Emacs' initial frame with a fixed size]]
|
||||
- [[#persist-emacs-initial-frame-position-dimensions-andor-full-screen-state-across-sessions][Persist Emacs' initial frame position, dimensions and/or full-screen state across sessions]]
|
||||
- [[#update-cursor-shape-under-terminal-emacs][Update cursor shape under terminal Emacs]]
|
||||
- [[#create-a-paste-transient-state-to-cycle-through-kill-ring-on-paste][Create a paste-transient-state to cycle through kill ring on paste]]
|
||||
|
||||
* Examples for Doom's library
|
||||
** core-lib
|
||||
@@ -292,7 +293,7 @@ Or to create aliases for functions that behave differently:
|
||||
|
||||
(:when IS-MAC
|
||||
:n "M-s" 'some-fn
|
||||
:i "M-o" (lambda (interactive) (message "Hi"))))
|
||||
:i "M-o" (cmd! (message "Hi"))))
|
||||
|
||||
(map! (:when (featurep! :completion company) ; Conditional loading
|
||||
:i "C-@" #'+company/complete
|
||||
@@ -316,8 +317,8 @@ These are side-by-side comparisons, showing how to bind keys with and without
|
||||
(map! "C-x y" #'do-something)
|
||||
|
||||
;; bind a key on a keymap
|
||||
(define-key emacs-lisp-mode (kbd "C-c p") #'do-something)
|
||||
(map! :map emacs-lisp-mode "C-c p" #'do-something)
|
||||
(define-key emacs-lisp-mode-map (kbd "C-c p") #'do-something)
|
||||
(map! :map emacs-lisp-mode-map "C-c p" #'do-something)
|
||||
|
||||
;; unbind a key defined elsewhere
|
||||
(define-key lua-mode-map (kbd "SPC m b") nil)
|
||||
@@ -515,13 +516,15 @@ These are side-by-side comparisons, showing how to bind keys with and without
|
||||
* Interesting snippets
|
||||
** Center Emacs' initial frame with a fixed size
|
||||
#+BEGIN_SRC elisp
|
||||
(let ((display-height (display-pixel-height))
|
||||
(display-width (display-pixel-width)))
|
||||
(let ((width 500)
|
||||
(height 250)
|
||||
(display-height (display-pixel-height))
|
||||
(display-width (display-pixel-width)))
|
||||
(pushnew! initial-frame-alist
|
||||
`(left . ,(/ display-width 2))
|
||||
`(top . ,(/ display-height 2))
|
||||
`(width . ,display-width)
|
||||
`(height . ,display-height)))
|
||||
`(left . ,(- (/ display-width 2) (/ width 2)))
|
||||
`(top . ,(- (/ display-height 2) (/ height 2)))
|
||||
`(width text-pixels ,width)
|
||||
`(height text-pixels ,height)))
|
||||
#+END_SRC
|
||||
|
||||
** Persist Emacs' initial frame position, dimensions and/or full-screen state across sessions
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
#+TITLE: Frequently Asked Questions
|
||||
#+STARTUP: nofold
|
||||
|
||||
* Table of Contents :TOC:
|
||||
- [[#general][General]]
|
||||
- [[#why-is-it-called-doom][Why is it called Doom?]]
|
||||
- [[#is-doom-a-fork-of-spacemacspreludeetc][Is Doom a fork of Spacemacs/Prelude/etc?]]
|
||||
- [[#does-doom-work-on-windows][Does Doom work on Windows?]]
|
||||
- [[#is-doom-only-for-vimmers][Is Doom only for vimmers?]]
|
||||
- [[#i-am-a-beginner-can-i-use-doom][I am a beginner. Can I use Doom?]]
|
||||
@@ -16,10 +16,10 @@
|
||||
- [[#what-is-the-meaning-behind-dooms-naming-convention-in-its-source-code][What is the meaning behind Doom's naming convention in its source code?]]
|
||||
- [[#what-version-of-doom-am-i-running][What version of Doom am I running?]]
|
||||
- [[#is-discord-the-only-option-for-interacting-with-your-community][Is Discord the only option for interacting with your community?]]
|
||||
- [[#why-is-scrolling-slow-in-emacsdoom][Why is scrolling slow in Emacs/Doom?]]
|
||||
- [[#why-is-emacsdoom-slow][Why is Emacs/Doom slow?]]
|
||||
- [[#configuration][Configuration]]
|
||||
- [[#does-doom-respect-xdg-conventions][Does Doom respect XDG conventions]]
|
||||
- [[#how-do-i-configure-doom-emacs][How do I configure Doom Emacs?]]
|
||||
- [[#does-doom-respect-xdg-directory-conventions][Does Doom respect XDG directory conventions]]
|
||||
- [[#how-do-i-enable-or-disable-a-doom-module][How do I enable or disable a Doom module?]]
|
||||
- [[#how-do-i-change-the-theme][How do I change the theme?]]
|
||||
- [[#how-do-i-change-the-fonts][How do I change the fonts?]]
|
||||
@@ -29,6 +29,7 @@
|
||||
- [[#how-do-i-change-the-style-of-line-numbers-or-disable-them-altogether][How do I change the style of line-numbers (or disable them altogether)?]]
|
||||
- [[#how-do-i-change-the-behavior-and-appearance-of-popup-windows][How do I change the behavior and appearance of popup windows?]]
|
||||
- [[#how-do-i-customize-a-theme-or-faces][How do I customize a theme or face(s)?]]
|
||||
- [[#how-do-i-make-a-new-theme][How do I make a new theme?]]
|
||||
- [[#can-doom-be-customized-without-restarting-emacs][Can Doom be customized without restarting Emacs?]]
|
||||
- [[#can-vimevil-be-removed-for-a-more-vanilla-emacs-experience][Can Vim/Evil be removed for a more vanilla Emacs experience?]]
|
||||
- [[#when-should-and-shouldnt-i-use-bindoom][When should and shouldn't I use ~bin/doom~?]]
|
||||
@@ -36,6 +37,9 @@
|
||||
- [[#how-to-suppress-confirmation-prompts-while-bindoom-is-running][How to suppress confirmation prompts while ~bin/doom~ is running]]
|
||||
- [[#which-terminal-should-i-use][Which terminal should I use?]]
|
||||
- [[#how-do-i-enable-lsp-support-for-insert-language-here][How do I enable LSP support for <insert language here>?]]
|
||||
- [[#how-to-disable-smartparensautomatic-parentheses-completion][How to disable smartparens/automatic parentheses completion?]]
|
||||
- [[#how-do-i-maximizefullscreen-emacs-on-startup][How do I maximize/fullscreen Emacs on startup?]]
|
||||
- [[#how-do-i-sharesync-my-config-between-multiple-computers][How do I share/sync my config between multiple computers?]]
|
||||
- [[#package-management][Package Management]]
|
||||
- [[#how-do-i-install-a-package-from-elpa][How do I install a package from ELPA?]]
|
||||
- [[#how-do-i-install-a-package-from-githubanother-source][How do I install a package from github/another source?]]
|
||||
@@ -49,6 +53,8 @@
|
||||
- [[#why-do-non-evil-users-get-expand-region-but-not-evil-users][Why do non-evil users get expand-region, but not evil users?]]
|
||||
- [[#why-not-use-exec-path-from-shell-instead-of-doom-env][Why not use exec-path-from-shell instead of ~doom env~?]]
|
||||
- [[#why-wsbutler-over-delete-trailing-whitespace-or-whitespace-cleanup][Why wsbutler over delete-trailing-whitespace or whitespace-cleanup?]]
|
||||
- [[#emacs-lisp][Emacs Lisp]]
|
||||
- [[#why-do-you-quote-some-symbols-with-symbol][Why do you quote some symbols with ~#'symbol~?]]
|
||||
- [[#common-issues][Common Issues]]
|
||||
- [[#i-get-the-vanilla-emacs-splash-screen-at-startup][I get the vanilla Emacs splash screen at startup]]
|
||||
- [[#i-see-a-blank-scratch-buffer-at-startup][I see a blank scratch buffer at startup]]
|
||||
@@ -65,44 +71,64 @@
|
||||
- [[#an-upstream-package-was-broken-and-i-cant-update-it][An upstream package was broken and I can't update it]]
|
||||
- [[#why-do-i-see-ugly-indentation-highlights-for-tabs][Why do I see ugly indentation highlights for tabs?]]
|
||||
- [[#clipetty--emit-opening-output-file-permission-denied-devpts29-error]["clipetty--emit: Opening output file: Permission denied, /dev/pts/29" error]]
|
||||
- [[#the-directory-emacsdserver-is-unsafe-error-at-startup]["The directory ~/.emacs.d/server is unsafe" error at startup]]
|
||||
- [[#my-new-keybinds-dont-work][My new keybinds don't work]]
|
||||
|
||||
* General
|
||||
** Why is it called Doom?
|
||||
It's an homage to idsoftware's classic game, whose source code was Henrik's
|
||||
(Doom's maintainer) first exposure to programming, back in the Cretaceous period
|
||||
(1999).
|
||||
It's an homage to idsoftware's classic game, whose [[https://github.com/id-Software/DOOM][source code]] was my first
|
||||
exposure to programming, back in the Cretaceous period (1999).
|
||||
|
||||
And if you're obsessed enough with a text editor that you write a community
|
||||
config for it, you're doomed from the start.
|
||||
Also, Emacs is an all consuming black hole. Its users doom themselves,
|
||||
eternally.
|
||||
|
||||
** Is Doom a fork of Spacemacs/Prelude/etc?
|
||||
No. I started it from scratch in mid-2014. I hadn't heard of other distros until
|
||||
some years later, when a Doom user suggested this was a Spacemacs fork. I still
|
||||
see this misconception pop up from time to time.
|
||||
|
||||
However, that's not to say Doom hasn't taken any inspiration from these since.
|
||||
Early versions of Doom drew inspiration from prelude's project structure (until
|
||||
Doom introduced a module system) and some concepts (like SPC as a leader key)
|
||||
were adopted from Spacemacs or PRed from migrating users.
|
||||
|
||||
As our userbase grows, more similarities (and differences) will no doubt emerge.
|
||||
|
||||
** Does Doom work on Windows?
|
||||
Windows support is weaker and will lag behind Linux/MacOS support, but your
|
||||
mileage will vary. Many have reported success using Doom Emacs on Windows (using
|
||||
WSL, WSL2 or scoop/chocolatey). You'll find install instructions in the [[file:getting_started.org::On Windows][Getting
|
||||
Starting guide]].
|
||||
It does, /but/ there are caveats:
|
||||
|
||||
If you're a Windows user, help us improve our documentation!
|
||||
+ Emacs is inherently slower on Windows.
|
||||
+ There are more steps to setting up Emacs (and Doom) on Windows.
|
||||
+ Windows support will always lag behind macOS/Linux support, because I (and
|
||||
many of Doom's users) don't use Windows. That means fewer guinea p--I mean,
|
||||
pioneers, willing to test Doom on Windows.
|
||||
|
||||
That said, Doom does have happy Windows users (using WSL or scoop/chocolatey).
|
||||
The [[file:getting_started.org::On Windows][Getting Starting guide]] will walk you through what we know.
|
||||
|
||||
Help us improve our documentation if you managed to get Doom running on Windows!
|
||||
|
||||
** Is Doom only for vimmers?
|
||||
No, but its maintainer /is/ a dyed-in-the-wool vimmer with almost two decades of
|
||||
vim muscle memory, so the non-vim experience will be less polished. Still, Doom
|
||||
has a growing user base of non-vim users, who continue to improve the situation,
|
||||
and we welcome suggestions and contributions!
|
||||
No, *vim/evil emulation is optional*. However, its maintainer /is/ a
|
||||
dyed-in-the-wool vimmer with almost two decades of vim muscle memory, so the
|
||||
non-vim experience will be less polished. Still, our growing user base of
|
||||
non-vim users continue to improve the situation, and we welcome suggestions and
|
||||
contributions!
|
||||
|
||||
If you'd still like a go at it, see the [[file:../modules/editor/evil/README.org::Removing evil-mode][removing evil-mode]] section in the
|
||||
[[file:../modules/editor/evil/README.org][:editor evil]] module's documentation.
|
||||
If you'd like a go at it, see the [[file:../modules/editor/evil/README.org::Removing evil-mode][removing evil-mode]] section in the [[file:../modules/editor/evil/README.org][:editor evil]]
|
||||
module's documentation.
|
||||
|
||||
** I am a beginner. Can I use Doom?
|
||||
This isn't a choice I can make for you. Generally, if you're new to the
|
||||
terminal, to programming, or Emacs and/or vim, then Doom (and Emacs, for that
|
||||
matter) will be a rough place to start. Neither Doom nor Emacs are particularly
|
||||
beginner friendly. Emacs' main draw is its unparalleled extensibility, but
|
||||
anything so extensible has a learning curve.
|
||||
This isn't a choice I can make for you. How new is "new"? Are you new to the
|
||||
shell? To programming in general? Or just Emacs/vim?
|
||||
|
||||
That's not to say it's impossible, or that we won't help you if you ask, but
|
||||
expect a hefty commitment and a bumpy journey. And don't pass up on the
|
||||
[[file:index.org][Documentation]], which will walk you through setting up Doom, and includes links
|
||||
to external resources created by our community.
|
||||
If all of the above is true then Emacs is a rough place to start. Doom or not.
|
||||
|
||||
Emacs' main draw is its unparalleled extensibility, but anything so extensible
|
||||
has a learning curve. Not to suggest it's impossible -- and we'll try to help
|
||||
you [[https://discord.gg/qvGgnVx][if you ask]] -- but expect a hefty commitment and a bumpy journey. Don't pass
|
||||
up on the [[file:index.org][Documentation]]: it'll work you through setting Doom up and includes
|
||||
links to external resources created by myself or the community.
|
||||
|
||||
** How does Doom compare to Spacemacs?
|
||||
To paraphrase (and expand upon) a [[https://www.reddit.com/r/emacs/comments/6pa0oq/quickstart_tutorial_for_emacs_newbies_with_doom/dkp1bhd/][reddit answer]] to this question by [[https://github.com/gilbertw1][@gilbertw1]]:
|
||||
@@ -128,8 +154,8 @@ To paraphrase (and expand upon) a [[https://www.reddit.com/r/emacs/comments/6pa0
|
||||
functionality externally, like org tangling or batch processing.
|
||||
+ *Doom's package manager is declarative and rolling release is opt-in.* Doom
|
||||
takes a little after nix, striving for as much config reproducibility as Emacs
|
||||
(and git) will permit. Spacemacs uses package.el, which is rolling release
|
||||
only.
|
||||
(and git) will permit. Spacemacs uses package.el, which is only rolling
|
||||
release.
|
||||
|
||||
** Why such a complicated package management system?
|
||||
Doom had +four+ *five* goals for its package management system:
|
||||
@@ -149,10 +175,10 @@ Doom had +four+ *five* goals for its package management system:
|
||||
installation) is easier to manage.
|
||||
5. *Reproducibility:* Emacs is a tumultuous ecosystem; packages break left and
|
||||
right, and we rely on hundreds of them. By pinning our packages we achieve a
|
||||
degree of config reproducibility and significantly limit the damage upstream
|
||||
changes can do. Better yet, we stave off having to deal with those issues
|
||||
until we are ready to. Although technical limitations prevent us from
|
||||
achieving true reproducibility, this is better than nothing.
|
||||
degree of (optional) config reproducibility and significantly limit the
|
||||
damage upstream changes can do. Better yet, we stave off having to deal with
|
||||
those issues until we are ready to. Although technical limitations prevent us
|
||||
from achieving true reproducibility, this is better than nothing.
|
||||
|
||||
** How does Doom start up so quickly?
|
||||
Doom employs a number of techniques to cut down startup time. Here are its most
|
||||
@@ -347,12 +373,15 @@ find more about it in:
|
||||
+ [[http://nullprogram.com/blog/2016/12/22/]["Some Performance Advantages of Lexical Scope."]]
|
||||
|
||||
** Why is startup time important? Why not use the daemon?
|
||||
The central motivation for a config that starts up fast (aside from the learning
|
||||
experience) was to have a viable alternative to vim for quick, one-shot editing
|
||||
in the terminal (without ~-Q~).
|
||||
It /isn't/ terribly important, but I believe a) faster software is a better user
|
||||
experience, b) Emacs doesn't have to be slower than it needs to be, and c) we
|
||||
shouldn't have to manage yet-another-tool simply to get sane startup times out
|
||||
of Emacs.
|
||||
|
||||
Besides that, it happens to facilitate:
|
||||
A fast startup time also facilitates:
|
||||
|
||||
- Emacs as a viable alternative to vim for quick, one-shot editing in the
|
||||
terminal (without ~-Q~).
|
||||
- Running multiple, independent instances of Emacs (e.g. on a per-project basis,
|
||||
or for nix-shell users, or to isolate one instance for IRC from an instance
|
||||
for writing code, etc).
|
||||
@@ -361,16 +390,16 @@ Besides that, it happens to facilitate:
|
||||
- Faster integration with "edit in Emacs" solutions (like [[https://github.com/alpha22jp/atomic-chrome][atomic-chrome]]), and
|
||||
without a daemon.
|
||||
|
||||
What's more, I believe a daemon shouldn't be necessary to get a sane startup
|
||||
time out of Emacs.
|
||||
It's up to you to decide if these are good enough reasons not to use a daemon,
|
||||
but it's nice to have more options, isn't it?
|
||||
|
||||
** How do I use Doom alongside other Emacs configs?
|
||||
I recommend [[https://github.com/plexus/chemacs][Chemacs]]. You can think of it as a bootloader for Emacs. You'll [[file:getting_started.org::*Alongside other Emacs configs (with Chemacs)][find
|
||||
I recommend [[https://github.com/plexus/chemacs][Chemacs]]. Think of it as a bootloader for Emacs. You'll [[file:getting_started.org::*Alongside other Emacs configs (with Chemacs)][find
|
||||
instructions on how to use it with Doom in the user manual]].
|
||||
|
||||
You'll still need a separate folder for personal configuration (=~/.doom.d= or
|
||||
=~/.config/doom= by default), but the =--doomdir PATH= switch (or ~DOOMDIR~
|
||||
environment variable) will allow you to use a different location:
|
||||
You will need a separate folder for personal configuration (=~/.doom.d= or
|
||||
=~/.config/doom= by default). Use the ~DOOMDIR~ environment variable to use
|
||||
another location:
|
||||
|
||||
#+BEGIN_SRC bash
|
||||
# First install Doom somewhere
|
||||
@@ -390,32 +419,31 @@ bin/doom run
|
||||
|
||||
#+begin_quote
|
||||
Warning: the way ~bin/doom run~ starts Doom bypasses many of its startup
|
||||
optimizations. Treat it as a convenience for testing Doom, rather than a
|
||||
permanent entry point.
|
||||
optimizations. Treat it as a convenience for testing rather than a permanent
|
||||
entry point.
|
||||
#+end_quote
|
||||
|
||||
** Why should I use Doom instead of rolling my own config?
|
||||
Time. If you care about personalizing the software you use on a daily basis,
|
||||
even half as much as I do, then you probably need professional help, but you
|
||||
also know it is time consuming. Emacs out-of-the-box is a barren wasteland with
|
||||
archaic defaults. Building anything out here and getting a feel for it will take
|
||||
/a lot/ of time. Time that I've already wasted and can never get back.
|
||||
Two reasons:
|
||||
|
||||
Time you could otherwise spend attending your daughter's dance recitals, that
|
||||
baseball game your son's team almost won last Thursday, or answering the court
|
||||
summons to fight for custody of your kids.
|
||||
1. *Doom's package manager.* It's powered by straight.el, is declarative,
|
||||
non-rolling release and (nominally) reproducible; which is unique on the Emacs
|
||||
distro scene. Don't let upstream issues surprise you. Roll back or re-pin
|
||||
packages when you don't have the time to deal with issues.
|
||||
|
||||
+ Doom has solved many problems big and small you'll likely run into at some
|
||||
point in your Emacs career. And the problems don't end there! Let someone else
|
||||
worry about the menial things.
|
||||
+ Doom will be faster than most hand-rolled configs. Startup is one thing, but
|
||||
Doom invests a lot of effort to improve runtime performance as well.
|
||||
+ Doom's package manager (powered by straight.el) is declarative, non-rolling
|
||||
release and (nominally) reproducible; which is unique on the Emacs distro
|
||||
scene. Don't let upstream issues surprise you. Roll back or re-pin packages
|
||||
when you don't have the time to deal with issues.
|
||||
+ It facilitates integration with the command line, which makes it easy to
|
||||
integrate external tools with Emacs via the =bin/doom= script.
|
||||
It also integrates with command line workflows, so automate to your heart's
|
||||
content!
|
||||
|
||||
2. *Time.* If you care about personalizing the software you use on a daily
|
||||
basis, even half as much as I do, then you need professional help, but you
|
||||
also know it is time consuming. Emacs out-of-the-box is a wasteland of
|
||||
archaic defaults, full of plugins rife with gotchas and oddities that may or
|
||||
may not be abandonware. It will be an uphill battle. Let Doom deal with all
|
||||
that noise. Save yourself some time.
|
||||
|
||||
Time you could otherwise spend attending your daughter's dance recitals, that
|
||||
baseball game your son's team almost won last Thursday, or answering the court
|
||||
summons to fight for custody of your kids.
|
||||
|
||||
Also, Doom's fast yo.
|
||||
|
||||
@@ -423,20 +451,24 @@ Also, Doom's fast yo.
|
||||
You'll find [[file:contributing.org::*Conventions][an overview of Doom's code conventions]] in the [[file:contributing.org][contributing guide]].
|
||||
|
||||
** What version of Doom am I running?
|
||||
You'll find the current version displayed in the modeline on the dashboard. It
|
||||
The current version of Doom is displayed in the modeline on the dashboard. It
|
||||
can also be retrieved using ~M-x doom/version~ (bound to =SPC h d v= or =C-h d
|
||||
v= by default) or ~bin/doom version~ on the command line.
|
||||
|
||||
** Is Discord the only option for interacting with your community?
|
||||
Yes. Discord is already woven into my social and work life, and was selected to
|
||||
maximize my availability to the community. I have no plans to extend it to other
|
||||
maximize my availability to the community. I don't want to juggle multiple
|
||||
platforms (like Matrix, IRC or Slack), or add bridges for them, even if they are
|
||||
better suited to the task. I already have my hands full managing the one.
|
||||
|
||||
Email is a possible alternative, but is constantly swamped; expect a long
|
||||
turn-around time.
|
||||
I /am/ considering a [[https://www.discourse.org][discourse]], so we have a public knowledge base of workflows
|
||||
and inter-user support (since Discord isn't a great archive), but it will be
|
||||
some time until this is set up.
|
||||
|
||||
** Why is scrolling slow in Emacs/Doom?
|
||||
Email is a possible alternative, but is constantly swamped; expect a turn-around
|
||||
time of weeks.
|
||||
|
||||
** Why is Emacs/Doom slow?
|
||||
This comes up often. The first thing folks fresh off the boat from other editors
|
||||
will notice is that Emacs has a low threshold for performance issues. It doesn't
|
||||
take much to get it to scroll like molasses.
|
||||
@@ -448,21 +480,27 @@ that's before we factor in plugins and poorly optimized major modes.
|
||||
|
||||
There is an unfortunate but necessary adjustment of expectations new users must
|
||||
undergo, when they adopt Emacs. Doom has inherited this curse. It's raison
|
||||
d'etre is to improve the situation, but I can only go so far. You /will/ find
|
||||
cases where Emacs just scrolls slowly.
|
||||
d'etre is to improve the situation, but I can only go so far, especially if you
|
||||
choose to enable all the most expensive features. You will unavoidable find
|
||||
cases where Emacs *is just slow*.
|
||||
|
||||
What can you do about it?
|
||||
|
||||
1. Disable some of Doom's slowest modules. The biggest offenders tend to be:
|
||||
=:ui tabs=, =:ui indent-guides=, =:ui pretty-code=, and =:ui word-wrap=.
|
||||
2. Turn off line numbers ~(setq display-line-numbers-type nil)~. It's known to
|
||||
1. Upgrade to Emacs 27. This should yield a noteworthy gain in general
|
||||
performance, particularly for LSP users.
|
||||
2. Try out [[http://akrl.sdf.org/gccemacs.html][gccemacs]], which promises significant strides in Emacs performance,
|
||||
but can be a bit of a hassle to set up. There are packages available for
|
||||
[[https://aur.archlinux.org/packages/emacs-native-comp-git/][Arch Linux]], [[https://github.com/flatwhatson/guix-channel][Guix]] and [[https://github.com/nix-community/emacs-overlay][Nix users]]. [[https://www.emacswiki.org/emacs/GccEmacs][More information available on EmacsWiki]].
|
||||
3. Disable some of Doom's slowest modules. The biggest offenders tend to be:
|
||||
=:ui tabs=, =:ui indent-guides=, =:ui pretty-code=, =:ui word-wrap= and =:ui
|
||||
vc-gutter=.
|
||||
4. Turn off line numbers ~(setq display-line-numbers-type nil)~. It's known to
|
||||
slow down scrolling, in particular.
|
||||
3. Org users can turn off ~org-superstar-mode~: ~(remove-hook 'org-mode-hook
|
||||
5. Org users can turn off ~org-superstar-mode~: ~(remove-hook 'org-mode-hook
|
||||
#'org-superstar-mode)~. It's an aesthetic plugin that offers fancier bullets.
|
||||
Emacs seems to struggle to display those characters with some fonts.
|
||||
|
||||
Org uses can also turn off the rest of org's eye candy:
|
||||
|
||||
#+BEGIN_SRC elisp
|
||||
(after! org
|
||||
(setq org-fontify-quote-and-verse-blocks nil
|
||||
@@ -470,23 +508,18 @@ What can you do about it?
|
||||
org-hide-leading-stars nil
|
||||
org-startup-indented nil))
|
||||
#+END_SRC
|
||||
4. Turn on =M-x so-long-minor-mode=. This is a minor mode that disables
|
||||
6. Turn on =M-x so-long-minor-mode=. This is a minor mode that disables
|
||||
non-essential functionality and can be used to temporarily view files that
|
||||
would be too slow otherwise. =M-x so-long-mode= is its extreme version; it
|
||||
turns off /everything/, including syntax highlighting.
|
||||
5. Try replacing the =:ui modeline= module with =:ui (modeline +light)=. There
|
||||
7. Try replacing the =:ui modeline= module with =:ui (modeline +light)=. There
|
||||
are aspects of the default modeline that can be unpredictably slow.
|
||||
6. Don't mash =j= (or =C-n=) to scroll. Evil users can scroll long distances
|
||||
with =C-d= and =C-u=, for instance, to avoid that slowness. Otherwise, use
|
||||
search mechanisms to move around, like isearch (=C-s=) or evil-search (=/=).
|
||||
8. Don't mash =j= (or =C-n=) to scroll. Evil users can scroll long distances
|
||||
with =C-d= and =C-u=, for instance, or evil-easymotion under =gs=, to avoid
|
||||
that slowness. Otherwise, use search mechanisms to move around, like isearch
|
||||
(=C-s=) or evil-search (=/=).
|
||||
|
||||
* Configuration
|
||||
** Does Doom respect XDG conventions
|
||||
Yes. Your private config (normally in =~/.doom.d=) can be moved to
|
||||
=~/.config/doom=.
|
||||
|
||||
And as of Emacs 27, you can move =~/.emacs.d= to =~/.config/emacs=.
|
||||
|
||||
** How do I configure Doom Emacs?
|
||||
Canonically, your private config is kept in =~/.doom.d/= (or =~/.config/doom/=).
|
||||
This directory is referred to as your ~$DOOMDIR~.
|
||||
@@ -502,6 +535,12 @@ to achieve something, it can be considered a bug.
|
||||
|
||||
Check out the [[file:getting_started.org::Customize][Customize section]] in the [[file:getting_started.org][Getting Started]] guide for details.
|
||||
|
||||
** Does Doom respect XDG directory conventions
|
||||
Yes. Your private config (normally in =~/.doom.d=) can be moved to
|
||||
=~/.config/doom=.
|
||||
|
||||
And as of Emacs 27, =~/.emacs.d= can be moved to =~/.config/emacs=.
|
||||
|
||||
** How do I enable or disable a Doom module?
|
||||
Comment or uncomment the module in your ~doom!~ block, found in
|
||||
=~/.doom.d/init.el=.
|
||||
@@ -554,7 +593,8 @@ Doom exposes five (optional) variables for controlling fonts in Doom, they are:
|
||||
+ ~doom-font~
|
||||
+ ~doom-variable-pitch-font~
|
||||
+ ~doom-serif-font~
|
||||
+ ~doom-unicode-font~
|
||||
+ ~doom-unicode-font~ (the fallback font for unicode symbols that your default
|
||||
font doesn't support)
|
||||
+ ~doom-big-font~ (used for ~doom-big-font-mode~)
|
||||
|
||||
They all accept either a =font-spec=, font string (="Input Mono-12"=), or [[https://wiki.archlinux.org/index.php/X_Logical_Font_Description][xlfd
|
||||
@@ -570,15 +610,19 @@ e.g.
|
||||
#+END_SRC
|
||||
|
||||
** How do I bind my own keys (or change existing ones)?
|
||||
The ~map!~ macro is recommended; it is a convenience macro that wraps around
|
||||
Emacs' (and evil's) keybinding API, i.e. ~define-key~, ~global-set-key~,
|
||||
~local-set-key~ and ~evil-define-key~.
|
||||
There are many options. Emacs provides a number of keybind functions:
|
||||
|
||||
You'll find comprehensive examples of ~map!~'s usage in its documentation (via
|
||||
=SPC h f map!= or =C-h f map!= -- also found [[file:api.org][in docs/api]]).
|
||||
+ ~define-key KEYMAP KEY DEF~
|
||||
+ ~global-set-key KEY DEF~
|
||||
+ ~local-set-key KEY DEF~
|
||||
+ ~evil-define-key STATES KEYMAP KEY DEF &rest ...~
|
||||
|
||||
You'll find a more comprehensive example of ~map!~'s usage in
|
||||
[[file:../modules/config/default/+evil-bindings.el][config/default/+evil-bindings.el]].
|
||||
However, Doom provides a ~map!~ macro, which conveniently wraps up the above
|
||||
four into a more succinct syntax. Comprehensive examples of ~map!~'s usage can
|
||||
be found in its documentation (via =SPC h f map\!= or =C-h f map\!= -- or [[file:api.org][in
|
||||
docs/api]]).
|
||||
|
||||
There are also live examples ~map!~'s usage in [[file:../modules/config/default/+evil-bindings.el][config/default/+evil-bindings.el]].
|
||||
|
||||
** How do I get motions to treat underscores as word delimiters?
|
||||
(This explanation comes from [[https://github.com/emacs-evil/evil#underscore-_-is-not-a-word-character][emacs-evil/evil]]'s readme)
|
||||
@@ -699,6 +743,23 @@ customize-face~. *Do not use these commands.* Doom does not support them and
|
||||
their settings could break any time.
|
||||
#+end_quote
|
||||
|
||||
** How do I make a new theme?
|
||||
Doom will look for themes in =~/.doom.d/themes/= (determined by
|
||||
~custom-theme-directory~).
|
||||
|
||||
Its filename must take the format =XYZ-theme.el=, where =XYZ= is the theme's
|
||||
name declared in that theme's ~deftheme~ or ~def-doom-theme~ call. The theme can
|
||||
then be loaded with:
|
||||
|
||||
#+BEGIN_SRC elisp
|
||||
;; add to ~/.doom.d/config.el
|
||||
(setq doom-theme 'XYZ)
|
||||
|
||||
;; or
|
||||
|
||||
(load-theme 'XYZ t)
|
||||
#+END_SRC
|
||||
|
||||
** Can Doom be customized without restarting Emacs?
|
||||
Short answer: You can, but you shouldn't.
|
||||
|
||||
@@ -786,21 +847,27 @@ Looking for a terminal in Emacs? Doom offers four modules:
|
||||
|
||||
But which do you choose?
|
||||
|
||||
+ =eshell= is the Emacs Lisp shell. It's stable, works anywhere Emacs runs (on
|
||||
any OS) and has no external dependencies, /but/ lacks features you'll expect
|
||||
from mature shells and tends to be slower than them.
|
||||
+ =eshell= is a shell completely implemented in Emacs Lisp. It's stable, works
|
||||
anywhere Emacs runs (on any OS) and has no external dependencies, /but/ lacks
|
||||
features you'll expect from mature shells, tends to be slower than them, and
|
||||
does not support command line tools with TUIs (e.g. curses, ncdu, nmtui, top,
|
||||
etc).
|
||||
+ =shell= is a shell /for/ your shell. Think of it like a REPL for bash/zsh,
|
||||
rather than terminal emulation. Due to its simplicity, you're less likely to
|
||||
rather than a terminal emulator. Due to its simplicity, you're less likely to
|
||||
encounter edge cases (e.g. against your shell config), but it has the smallest
|
||||
feature set. It also won't work with TUI programs like htop or vim.
|
||||
+ =term= is Emacs' built-in terminal emulator. It's alright when it works, awful
|
||||
when it doesn't. =vterm= is almost always a better option.
|
||||
+ =vterm= is as good as terminal emulation gets in Emacs atm, but has a few
|
||||
extra steps to get going. a) Emacs must be built with dynamic modules support
|
||||
and b) you'll need to compile vterm-module.so, which has external dependencies
|
||||
(libvterm). It is automatically built when you first open =vterm=, but this
|
||||
will fail on Windows, NixOS and Guix out of the box -- you're on your own
|
||||
there!
|
||||
+ =term= is Emacs' built-in terminal emulator. Term runs a shell and understand
|
||||
many (but not all) terminal escape codes, so many TUI programs (like top or
|
||||
vim) will work. However, term's performance is inferior to standalone
|
||||
terminals, especially with large bursts of output.
|
||||
+ =vterm= is as good as terminal emulation gets in Emacs (at the time of
|
||||
writing), and is the most performant, as it is an external library written
|
||||
in C. However, it requires extra steps to set up. a) Emacs must be built with
|
||||
dynamic modules support and b) you'll need to compile vterm-module.so, which
|
||||
has external dependencies (libvterm). It is automatically built when you first
|
||||
open =vterm=, but this will fail on Windows, NixOS and Guix out of the box.
|
||||
Except for Windows, you'll find install instructions for nix/guix in [[file:../modules/term/vterm/README.org][the :term
|
||||
vterm module's documentation]].
|
||||
|
||||
For a terminal in Emacs, =eshell= and =vterm= are generally the best options.
|
||||
|
||||
@@ -823,6 +890,38 @@ these languages, add this to =$DOOMDIR/config.el=:
|
||||
;; Where =MAJOR-MODE= is the major mode you're targeting. e.g.
|
||||
;; lisp-mode-local-vars-hook
|
||||
#+END_SRC
|
||||
** How to disable smartparens/automatic parentheses completion?
|
||||
Some outdated sources may tell you to do this, *but it is no longer correct*:
|
||||
|
||||
#+BEGIN_SRC elisp
|
||||
(after! smartparens
|
||||
(smartparens-global-mode -1))
|
||||
#+END_SRC
|
||||
|
||||
Instead, use the following:
|
||||
#+BEGIN_SRC elisp
|
||||
(remove-hook 'doom-first-buffer-hook #'smartparens-global-mode)
|
||||
#+END_SRC
|
||||
|
||||
Note that the package itself cannot be disabled with ~package!~, because it is a
|
||||
core package. This may change one day, but not in the near future.
|
||||
** How do I maximize/fullscreen Emacs on startup?
|
||||
#+BEGIN_SRC elisp
|
||||
(add-to-list 'initial-frame-alist '(fullscreen . maximized))
|
||||
#+END_SRC
|
||||
|
||||
Some window managers may not understand/work with =maximized= (or may not
|
||||
produce the desired effect), in that case try ~fullboth~ or ~fullscreen~.
|
||||
|
||||
** How do I share/sync my config between multiple computers?
|
||||
TL;DR: it is perfectly safe to sync =~/.doom.d=, but not =~/.emacs.d=.
|
||||
|
||||
Long answer: =~/.emacs.d/.local= can contain baked-in absolute paths and
|
||||
non-portable byte-code. It is never a good idea to sync it across multiple
|
||||
computers.
|
||||
|
||||
If you must, for some reason, copy =~/.emacs.d= from one system to another,
|
||||
remember to run ~doom sync && doom build~ on the target machine.
|
||||
|
||||
* Package Management
|
||||
** How do I install a package from ELPA?
|
||||
@@ -843,9 +942,9 @@ See the "[[file:getting_started.org::*Disabling packages][disabling packages]]"
|
||||
See the "[[file:getting_started.org::*Configuring packages][configuring packages]]" section of the Getting Started guide.
|
||||
|
||||
** Where does straight clone/build packages to?
|
||||
Straight clones packages to =~/.emacs.d/.local/straight/repos/REPO-NAME=, then
|
||||
later symlinks and byte-compiles them to
|
||||
=~/.emacs.d/.local/straight/build/PACKAGE-NAME= when they are "built".
|
||||
Doom has configured straight to clone packages to
|
||||
=~/.emacs.d/.local/straight/repos/REPO-NAME=. It then builds (byte-compiles and
|
||||
symlinks) them to =~/.emacs.d/.local/straight/build/PACKAGE-NAME=.
|
||||
|
||||
* Defaults
|
||||
** Why Ivy over Helm?
|
||||
@@ -856,7 +955,7 @@ comparing the two, but as far as I'm concerned they are equal in both respects
|
||||
(not all across the board, but on average).
|
||||
|
||||
Instead, maintainability is most important for someone that frequently tinkers
|
||||
with their editor. When I have an issue, I spend a disproportionately more time
|
||||
with their editor. When I have an issue, I spend disproportionately more time
|
||||
dealing helm than I do ivy, for little or no gain. Though both frameworks are
|
||||
excellent, the difference in complexity is reflected in their plugin ecosystems;
|
||||
ivy plugins tend to be lighter, simpler, more consistent and significantly
|
||||
@@ -945,6 +1044,7 @@ yourself:
|
||||
(when (display-graphic-p)
|
||||
(exec-path-from-shell-initialize))
|
||||
#+END_SRC
|
||||
|
||||
** Why wsbutler over delete-trailing-whitespace or whitespace-cleanup?
|
||||
TL;DR: =ws-butler= is less imposing.
|
||||
|
||||
@@ -966,6 +1066,20 @@ cleanup work.
|
||||
In any case, if you had used =ws-butler= from the beginning, trailing whitespace
|
||||
and newlines would never be a problem!
|
||||
|
||||
* Emacs Lisp
|
||||
** Why do you quote some symbols with ~#'symbol~?
|
||||
~#'symbol~ is short for ~(function symbol)~, the same way ~'symbol~ is short for
|
||||
~(quote symbol)~.
|
||||
|
||||
In elisp there is no /functional/ difference between the two syntaxes, but the
|
||||
sharp-quote does hint to the byte-compiler that "this symbol refers to a
|
||||
function", which it can perform additional checks on when the code is
|
||||
byte-compiled.
|
||||
|
||||
My reason for using it is to make it explicit to readers how I intend (or
|
||||
expect) the symbol to be used. No sharp-quote means I'm using the symbol as a
|
||||
literal data value.
|
||||
|
||||
* Common Issues
|
||||
** I get the vanilla Emacs splash screen at startup
|
||||
The most common cause for this is a =~/.emacs= file. If it exists, Emacs will
|
||||
@@ -1079,6 +1193,7 @@ known fix for this. To work around it, you must either:
|
||||
support it),
|
||||
|
||||
3. Install Emacs via the =emacs-mac= homebrew formula.
|
||||
|
||||
** Doom crashes when...
|
||||
Here are a few common causes for random crashes:
|
||||
|
||||
@@ -1127,8 +1242,10 @@ Emacs will search for this file in ~custom-theme-load-path~ and
|
||||
suffix.
|
||||
3. Did you run ~doom sync~ after adding your third party theme plugin's
|
||||
~package!~ declaration to =~/.doom.d/packages.el=?
|
||||
|
||||
** TRAMP connections hang forever when connecting
|
||||
You'll find solutions [[https://www.emacswiki.org/emacs/TrampMode#toc7][on the emacswiki]].
|
||||
|
||||
** An upstream package was broken and I can't update it
|
||||
Sometimes, if you've installed a [[https://github.com/hlissner/doom-emacs/issues/2213][broken package]] which was subsequently fixed
|
||||
upstream, you can't run ~doom update~ to get the latest fixes due to evaluation
|
||||
@@ -1177,6 +1294,47 @@ There are a couple ways to address this:
|
||||
when you open a file (that isn't in a project with an editorconfig file).
|
||||
This isn't foolproof, and won't work for files that have no content in them,
|
||||
but it can help in one-off scenarios.
|
||||
|
||||
** "clipetty--emit: Opening output file: Permission denied, /dev/pts/29" error
|
||||
This applies to tmux users, in particular. See
|
||||
https://github.com/spudlyo/clipetty/issues/15 for a solution.
|
||||
|
||||
** "The directory ~/.emacs.d/server is unsafe" error at startup
|
||||
If you're getting this error you must reset the owner of
|
||||
=C:\Users\USERNAME\.emacs.d= to your own account:
|
||||
|
||||
1. Right-click the =~/.emacs.d/server= directory in Windows Explorer,
|
||||
2. Click Properties,
|
||||
3. Select the "Security" tab,
|
||||
4. Click the "Advanced" button,
|
||||
5. Select the "Owner" tab
|
||||
6. Change the owner to your account name
|
||||
|
||||
([[https://stackoverflow.com/questions/885793/emacs-error-when-calling-server-start][source]])
|
||||
|
||||
** My new keybinds don't work
|
||||
Emacs has a complex and hierarchical keybinding system. If a global keybind
|
||||
doesn't take effect, it's likely that another keymap is in effect with higher
|
||||
priority than the global keymap. For example, non-evil users may have tried
|
||||
something like this, to rebind =C-left= and =C-right=:
|
||||
#+BEGIN_SRC elisp
|
||||
(map! "<C-left>" #'something
|
||||
"<C-right>" #'something)
|
||||
#+END_SRC
|
||||
|
||||
Just to find that the rebinding had no effect (i.e. ~C-h k C-left~ reports that
|
||||
it's still bound to ~sp-backward-slurp-sexp~). That's because these keys are
|
||||
bound in ~smartparens-mode-map~. They need to be unbound for your global
|
||||
keybinds to work:
|
||||
|
||||
#+BEGIN_SRC elisp
|
||||
(map! :after smartparens
|
||||
:map smartparens-mode-map
|
||||
[C-right] nil
|
||||
[C-left] nil)
|
||||
#+END_SRC
|
||||
|
||||
#+begin_quote
|
||||
I use ~[C-left]~ because it is easier to type than ~"<C-left>"~, but are
|
||||
equivalent; two different ways to refer to the same key.
|
||||
#+end_quote
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -40,7 +40,7 @@
|
||||
ophints ; highlight the region an operation acts on
|
||||
(popup +defaults) ; tame sudden yet inevitable temporary windows
|
||||
;;pretty-code ; ligatures or substitute text with pretty symbols
|
||||
;;tabs ; an tab bar for Emacs
|
||||
;;tabs ; a tab bar for Emacs
|
||||
;;treemacs ; a project drawer, like neotree but cooler
|
||||
;;unicode ; extended unicode support for various languages
|
||||
vc-gutter ; vcs diff in the fringe
|
||||
@@ -104,6 +104,9 @@
|
||||
;;tmux ; an API for interacting with tmux
|
||||
;;upload ; map local to remote projects via ssh/ftp
|
||||
|
||||
:os
|
||||
;;tty ; improve the terminal Emacs experience
|
||||
|
||||
:lang
|
||||
;;agda ; types of types of types of types...
|
||||
;;cc ; C/C++/Obj-C madness
|
||||
@@ -120,7 +123,7 @@
|
||||
;;erlang ; an elegant language for a more civilized age
|
||||
;;ess ; emacs speaks statistics
|
||||
;;faust ; dsp, but you get to keep your soul
|
||||
;;fsharp ; ML stands for Microsoft's Language
|
||||
;;fsharp ; ML stands for Microsoft's Language
|
||||
;;fstar ; (dependent) types and (monadic) effects and Z3
|
||||
;;gdscript ; the language you waited for
|
||||
;;(go +lsp) ; the hipster dialect
|
||||
|
||||
@@ -34,7 +34,8 @@ calendar data from:
|
||||
(cfw:open-calendar-buffer
|
||||
:contents-sources
|
||||
(list
|
||||
(cfw:org-create-source "Green") ; orgmode source
|
||||
(cfw:org-create-source "Green") ; org-agenda source
|
||||
(cfw:org-create-file-source "cal" "/path/to/cal.org" "Cyan") ; other org source
|
||||
(cfw:howm-create-source "Blue") ; howm source
|
||||
(cfw:cal-create-source "Orange") ; diary source
|
||||
(cfw:ical-create-source "Moon" "~/moon.ics" "Gray") ; ICS source1
|
||||
@@ -42,23 +43,6 @@ calendar data from:
|
||||
)))
|
||||
#+END_SRC
|
||||
|
||||
To control what org files ~clfw:org-create-source~ will use, ~let~-bind
|
||||
~org-agenda-files~ around a call to ~+calendar/open-calendar~ like so:
|
||||
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
;;;###autoload
|
||||
(defun cfw:open-org-calendar-with-cal1 ()
|
||||
(interactive)
|
||||
(let ((org-agenda-files '("/path/to/org/" "/path/to/cal1.org")))
|
||||
(call-interactively #'+calendar/open-calendar)))
|
||||
|
||||
;;;###autoload
|
||||
(defun cfw:open-org-calendar-with-cal2 ()
|
||||
(interactive)
|
||||
(let ((org-agenda-files '("/path/to/org/" "/path/to/cal2.org")))
|
||||
(call-interactively #'+calendar/open-calendar)))
|
||||
#+END_SRC
|
||||
|
||||
The [[https://github.com/kiwanami/emacs-calfw][kiwanami/emacs-calfw]] project readme contains more examples.
|
||||
|
||||
** Synchronizing Org and Google Calendar
|
||||
|
||||
@@ -33,9 +33,16 @@
|
||||
(use-package! calfw-org
|
||||
:commands (cfw:open-org-calendar
|
||||
cfw:org-create-source
|
||||
cfw:org-create-file-source
|
||||
cfw:open-org-calendar-withkevin
|
||||
my-open-calendar))
|
||||
|
||||
(use-package! calfw-cal
|
||||
:commands (cfw:cal-create-source))
|
||||
|
||||
(use-package! calfw-ical
|
||||
:commands (cfw:ical-create-source))
|
||||
|
||||
|
||||
(use-package! org-gcal
|
||||
:commands (org-gcal-sync
|
||||
|
||||
@@ -3,4 +3,6 @@
|
||||
|
||||
(package! calfw :pin "03abce97620a4a7f7ec5f911e669da9031ab9088")
|
||||
(package! calfw-org :pin "03abce97620a4a7f7ec5f911e669da9031ab9088")
|
||||
(package! calfw-cal :pin "03abce97620a4a7f7ec5f911e669da9031ab9088")
|
||||
(package! calfw-ical :pin "03abce97620a4a7f7ec5f911e669da9031ab9088")
|
||||
(package! org-gcal :pin "744505832b34e07b44a5d97d8720b2d7492d7fc9")
|
||||
|
||||
@@ -34,7 +34,6 @@ https://assets.doomemacs.org/completion/company/overlay.png
|
||||
** Plugins
|
||||
+ [[https://github.com/company-mode/company-mode][company-mode]]
|
||||
+ [[https://github.com/hlissner/emacs-company-dict][company-dict]]
|
||||
+ [[https://github.com/raxod502/prescient.el][company-prescient]]
|
||||
+ [[https://github.com/sebastiencs/company-box][company-box]]* (=+childframe=)
|
||||
|
||||
* Prerequisites
|
||||
|
||||
@@ -9,17 +9,18 @@
|
||||
company-tooltip-limit 14
|
||||
company-tooltip-align-annotations t
|
||||
company-require-match 'never
|
||||
company-global-modes
|
||||
'(not erc-mode message-mode help-mode gud-mode)
|
||||
company-global-modes '(not erc-mode message-mode help-mode gud-mode)
|
||||
company-frontends '(company-pseudo-tooltip-frontend
|
||||
company-echo-metadata-frontend)
|
||||
|
||||
;; Buffer-local backends will be computed when loading a major mode, so
|
||||
;; only specify a global default here.
|
||||
company-backends '(company-capf)
|
||||
company-backends '(company-capf)
|
||||
|
||||
;; Company overrides `company-active-map' based on
|
||||
;; `company-auto-complete-chars'; no magic please!
|
||||
;; These auto-complete the current selection when
|
||||
;; `company-auto-complete-chars' is typed. This is too magical. We
|
||||
;; already have the much more explicit RET and TAB.
|
||||
company-auto-complete nil
|
||||
company-auto-complete-chars nil
|
||||
|
||||
;; Only search the current buffer for `company-dabbrev' (a backend that
|
||||
@@ -75,14 +76,6 @@
|
||||
(add-to-list 'company-files--regexps "file:\\(\\(?:\\.\\{1,2\\}/\\|~/\\|/\\)[^\]\n]*\\)"))
|
||||
|
||||
|
||||
(use-package! company-prescient
|
||||
:hook (company-mode . company-prescient-mode)
|
||||
:config
|
||||
;; NOTE prescient config duplicated with `ivy'
|
||||
(setq prescient-save-file (concat doom-cache-dir "prescient-save.el"))
|
||||
(prescient-persist-mode +1))
|
||||
|
||||
|
||||
(use-package! company-box
|
||||
:when (featurep! +childframe)
|
||||
:hook (company-mode . company-box-mode)
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
;; -*- no-byte-compile: t; -*-
|
||||
;;; completion/company/packages.el
|
||||
|
||||
(package! company :pin "6333fc4ebbbf4d28e834de8715561e984f149ecb")
|
||||
(package! company :pin "5eb7d868c2a13bbfb14060b79d69f0d59f6a5f60")
|
||||
(package! company-dict :pin "cd7b8394f6014c57897f65d335d6b2bd65dab1f4")
|
||||
(package! company-prescient :pin "0f4a89bdec61395138d968a38d375e63ccfbed63")
|
||||
(when (featurep! +childframe)
|
||||
(package! company-box :pin "3814fcb14e92f4b85b19e664e216a7c8d5c7144d"))
|
||||
(package! company-box :pin "889d723786df2de27d248c9965149d04af44273a"))
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
;; -*- no-byte-compile: t; -*-
|
||||
;;; completion/helm/packages.el
|
||||
|
||||
(package! helm :pin "b6db9fb47a8900704394e63b795f4a54cb4701a8")
|
||||
(package! helm-rg :pin "785a80fe5cc87e27c5ea3d00a70049028d9e2847")
|
||||
(package! helm-c-yasnippet :pin "65ca732b510bfc31636708aebcfe4d2d845b59b0")
|
||||
(package! helm :pin "5d224cb889aea8f090c82c5ae572b8db276bcf80")
|
||||
(package! helm-rg :pin "ee0a3c09da0c843715344919400ab0a0190cc9dc")
|
||||
(package! helm-c-yasnippet :pin "89cc8561e7e57e9d1070ee3641df019c7f49c5dd")
|
||||
(package! helm-company :pin "6eb5c2d730a60e394e005b47c1db018697094dde")
|
||||
(package! helm-describe-modes
|
||||
:recipe (:host github :repo "emacs-helm/helm-describe-modes")
|
||||
:pin "11fb36af119b784539d31c6160002de1957408aa")
|
||||
(package! helm-projectile :pin "5328b74dddcee8d1913803ca8167868831a07463")
|
||||
(package! helm-projectile :pin "2f3a2a03d6cb9419c25b432637aa11c8d2f9f3b7")
|
||||
(package! swiper-helm :pin "93fb6db87bc6a5967898b5fd3286954cc72a0008")
|
||||
(when (featurep! +fuzzy)
|
||||
(package! helm-flx :pin "6640fac5cb16bee73c95b8ed1248a4e5e113690e"))
|
||||
(when (featurep! +childframe)
|
||||
(package! posframe :pin "093b29a53cbeda6d637ccc9ef4dfc47123e79b9e"))
|
||||
(package! posframe :pin "922e4d239f7a083213d856de67a9686a091b1e27"))
|
||||
(when (featurep! :lang org)
|
||||
(package! helm-org :pin "b7a18dfc17e8b933956d61d68c435eee03a96c24"))
|
||||
(package! helm-descbinds :pin "b72515982396b6e336ad7beb6767e95a80fca192")
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
;;; completion/ido/packages.el
|
||||
|
||||
(package! flx-ido :pin "17f5c9cb2af18aa6f52910ff4a5a63591261ced5")
|
||||
(package! ido-completing-read+ :pin "98d3a6e56b1d3652da7b47f49f76d77f82ea80ba")
|
||||
(package! ido-completing-read+ :pin "b9ca2566b867464c25b720e2148d240961c110e7")
|
||||
(package! ido-sort-mtime :pin "f638ff0c922af862f5211779f2311a27fde428eb")
|
||||
(package! ido-vertical-mode :pin "16c4c1a112796ee0bcf401ea39d3e2643a89feaf")
|
||||
(package! crm-custom :pin "f1aaccf64306a5f99d9bf7ba815d7ea41c15518d")
|
||||
|
||||
@@ -77,6 +77,26 @@ Buffers that are considered unreal (see `doom-real-buffer-p') are dimmed with
|
||||
((format "%s" val)))
|
||||
t)))
|
||||
|
||||
;;;###autoload
|
||||
(defun +ivy-format-function-line-or-arrow (cands)
|
||||
"Transform CANDS into a string for minibuffer.
|
||||
|
||||
If in terminal, prefix candidates with a chevron to make it more obvious which
|
||||
one you're selecting, especially in themes that can't set a good background for
|
||||
`ivy-current-match'. This is a combination of `ivy-format-function-line' and
|
||||
`ivy-format-function-arrow'.
|
||||
|
||||
In the GUI, this is the same as `ivy-format-function-line'."
|
||||
(if (display-graphic-p)
|
||||
(ivy-format-function-line cands)
|
||||
(ivy--format-function-generic
|
||||
(lambda (str)
|
||||
(ivy--add-face (concat "> " str "\n") 'ivy-current-match))
|
||||
(lambda (str)
|
||||
(concat " " str "\n"))
|
||||
cands
|
||||
"")))
|
||||
|
||||
|
||||
;;
|
||||
;; Library
|
||||
|
||||
@@ -69,7 +69,7 @@ results buffer.")
|
||||
;; Highlight each ivy candidate including the following newline, so that it
|
||||
;; extends to the right edge of the window
|
||||
(setf (alist-get 't ivy-format-functions-alist)
|
||||
#'ivy-format-function-line)
|
||||
#'+ivy-format-function-line-or-arrow)
|
||||
|
||||
;; Integrate `ivy' with `better-jumper'; ensure a jump point is registered
|
||||
;; before jumping to new locations with ivy
|
||||
@@ -278,11 +278,11 @@ evil-ex-specific constructs, so we disable it solely in evil-ex."
|
||||
"Change `counsel-file-jump' to use fd or ripgrep, if they are available."
|
||||
:override #'counsel--find-return-list
|
||||
(cl-destructuring-bind (find-program . args)
|
||||
(cond ((executable-find doom-projectile-fd-binary)
|
||||
(append (list doom-projectile-fd-binary
|
||||
"--color=never" "-E" ".git"
|
||||
"--type" "file" "--type" "symlink" "--follow")
|
||||
(if IS-WINDOWS '("--path-separator=/"))))
|
||||
(cond ((when-let (fd (executable-find (or doom-projectile-fd-binary "fd")))
|
||||
(append (list fd
|
||||
"--color=never" "-E" ".git"
|
||||
"--type" "file" "--type" "symlink" "--follow")
|
||||
(if IS-WINDOWS '("--path-separator=/")))))
|
||||
((executable-find "rg")
|
||||
(append (list "rg" "--files" "--follow" "--color=never" "--hidden" "--no-messages")
|
||||
(cl-loop for dir in projectile-globally-ignored-directories
|
||||
@@ -296,10 +296,9 @@ evil-ex-specific constructs, so we disable it solely in evil-ex."
|
||||
(cons find-program args)
|
||||
(lambda ()
|
||||
(goto-char (point-min))
|
||||
(let ((offset (if (member find-program (list "rg" doom-projectile-fd-binary)) 0 2))
|
||||
files)
|
||||
(let (files)
|
||||
(while (< (point) (point-max))
|
||||
(push (buffer-substring (+ offset (line-beginning-position)) (line-end-position))
|
||||
(push (buffer-substring (line-beginning-position) (line-end-position))
|
||||
files)
|
||||
(forward-line 1))
|
||||
(nreverse files)))))))
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
;; -*- no-byte-compile: t; -*-
|
||||
;;; completion/ivy/packages.el
|
||||
|
||||
(package! swiper :pin "544e7de63a4543a74596c5d95efa0bb9da25791e")
|
||||
(package! swiper :pin "c6b60d34ac37bf4d91a25f16d22e528f85e06938")
|
||||
(package! ivy)
|
||||
(package! ivy-hydra)
|
||||
(package! counsel)
|
||||
|
||||
(package! amx :pin "7fb7b874291e0cdeb1f0acb18564a686ec86788d")
|
||||
(package! amx :pin "ccfc92c600df681df5e8b5fecec328c462ceb71e")
|
||||
(package! counsel-projectile :pin "77392cbbc42e98fc137b43f1db1b111ba6e2dd75")
|
||||
(package! ivy-rich :pin "10970130b41c6ef9570893cdab8dfbe720e2b1a9")
|
||||
(package! wgrep :pin "f0ef9bfa44db503cdb2f83fcfbd2fa4e2382ef1f")
|
||||
|
||||
(if (featurep! +prescient)
|
||||
(package! ivy-prescient :pin "3ab7605d997fb8337bf5ded2ad960b98ac0e1fd7")
|
||||
(package! ivy-prescient :pin "b11d79b10df12c58edc3487371c2c47dfb9b50e6")
|
||||
(when (featurep! +fuzzy)
|
||||
(package! flx :pin "17f5c9cb2af18aa6f52910ff4a5a63591261ced5")))
|
||||
|
||||
|
||||
@@ -34,8 +34,10 @@
|
||||
:desc "Evaluate buffer/region" "e" #'+eval/buffer-or-region
|
||||
:desc "Evaluate & replace region" "E" #'+eval/region-and-replace
|
||||
:desc "Format buffer/region" "f" #'+format/region-or-buffer
|
||||
:desc "Find implementations" "i" #'+lookup/implementations
|
||||
:desc "Jump to documentation" "k" #'+lookup/documentation
|
||||
:desc "Send to repl" "s" #'+eval/send-region-to-repl
|
||||
:desc "Find type definition" "t" #'+lookup/type-definition
|
||||
:desc "Delete trailing whitespace" "w" #'delete-trailing-whitespace
|
||||
:desc "Delete trailing newlines" "W" #'doom/delete-trailing-newlines
|
||||
:desc "List errors" "x" #'flymake-show-diagnostics-buffer
|
||||
@@ -43,7 +45,7 @@
|
||||
:desc "List errors" "x" #'flycheck-list-errors)
|
||||
(:when (and (featurep! :tools lsp) (not (featurep! :tools lsp +eglot)))
|
||||
:desc "LSP Code actions" "a" #'lsp-execute-code-action
|
||||
:desc "LSP Organize imports" "i" #'lsp-organize-imports
|
||||
:desc "LSP Organize imports" "o" #'lsp-organize-imports
|
||||
:desc "LSP Rename" "r" #'lsp-rename
|
||||
(:after lsp-mode
|
||||
:desc "LSP" "l" lsp-command-map)
|
||||
@@ -55,10 +57,8 @@
|
||||
:desc "Jump to symbol in any workspace" "J" #'helm-lsp-global-workspace-symbol))
|
||||
(:when (featurep! :tools lsp +eglot)
|
||||
:desc "LSP Execute code action" "a" #'eglot-code-actions
|
||||
:desc "LSP Format buffer/region" "F" #'eglot-format
|
||||
:desc "LSP Rename" "r" #'eglot-rename
|
||||
:desc "LSP Find declaration" "j" #'eglot-find-declaration
|
||||
:desc "LSP Find implementation" "J" #'eglot-find-implementation))
|
||||
:desc "LSP Find declaration" "j" #'eglot-find-declaration))
|
||||
|
||||
;;; <leader> f --- file
|
||||
(:prefix-map ("f" . "file")
|
||||
@@ -118,8 +118,7 @@
|
||||
:desc "Look up in all docsets" "K" #'+lookup/in-all-docsets
|
||||
:desc "Search project" "p" #'+default/search-project
|
||||
:desc "Search other project" "P" #'+default/search-other-project
|
||||
:desc "Search buffer" "s" #'swiper-isearch
|
||||
:desc "Search buffer for thing at point" "S" #'swiper-isearch-thing-at-point
|
||||
:desc "Search buffer" "s" #'+default/search-buffer
|
||||
:desc "Dictionary" "t" #'+lookup/dictionary-definition
|
||||
:desc "Thesaurus" "T" #'+lookup/synonyms)
|
||||
|
||||
@@ -140,8 +139,8 @@
|
||||
(cond ((featurep! :completion ivy) #'ivy-bibtex)
|
||||
((featurep! :completion helm) #'helm-bibtex)))
|
||||
|
||||
:desc "Toggle org-clock" "c" #'+org/toggle-clock
|
||||
:desc "Cancel org-clock" "C" #'org-clock-cancel
|
||||
:desc "Toggle last org-clock" "c" #'+org/toggle-last-clock
|
||||
:desc "Cancel current org-clock" "C" #'org-clock-cancel
|
||||
:desc "Open deft" "d" #'deft
|
||||
(:when (featurep! :lang org +noter)
|
||||
:desc "Org noter" "e" #'org-noter)
|
||||
@@ -165,12 +164,13 @@
|
||||
:desc "Search Forever" "s" #'org-journal-search-forever))
|
||||
(:when (featurep! :lang org +roam)
|
||||
(:prefix ("r" . "roam")
|
||||
:desc "Switch to buffer" "b" #'org-roam-switch-to-buffer
|
||||
:desc "Org Roam Capture" "c" #'org-roam-capture
|
||||
:desc "Find file" "f" #'org-roam-find-file
|
||||
:desc "Show graph" "g" #'org-roam-graph
|
||||
:desc "Insert" "i" #'org-roam-insert
|
||||
:desc "Org Roam" "r" #'org-roam
|
||||
:desc "Switch to buffer" "b" #'org-roam-switch-to-buffer
|
||||
:desc "Org Roam Capture" "c" #'org-roam-capture
|
||||
:desc "Find file" "f" #'org-roam-find-file
|
||||
:desc "Show graph" "g" #'org-roam-graph
|
||||
:desc "Insert" "i" #'org-roam-insert
|
||||
:desc "Insert (skipping org-capture)" "I" #'org-roam-insert-immediate
|
||||
:desc "Org Roam" "r" #'org-roam
|
||||
(:prefix ("d" . "by date")
|
||||
:desc "Arbitrary date" "d" #'org-roam-dailies-date
|
||||
:desc "Today" "t" #'org-roam-dailies-today
|
||||
@@ -277,7 +277,7 @@
|
||||
(:when (featurep! :ui minimap)
|
||||
:desc "Minimap mode" "m" #'minimap-mode)
|
||||
(:when (featurep! :lang org +present)
|
||||
:desc "org-tree-slide mode" "p" #'+org-present/start)
|
||||
:desc "org-tree-slide mode" "p" #'org-tree-slide-mode)
|
||||
:desc "Read-only mode" "r" #'read-only-mode
|
||||
(:when (featurep! :checkers spell)
|
||||
:desc "Flyspell" "s" #'flyspell-mode)
|
||||
@@ -342,31 +342,32 @@
|
||||
|
||||
;;; <leader> w --- workspaces/windows
|
||||
(:prefix-map ("w" . "workspaces/windows")
|
||||
(:when (featurep! :ui workspaces)
|
||||
:desc "Display workspaces" "d" #'+workspace/display
|
||||
:desc "Rename workspace" "r" #'+workspace/rename
|
||||
:desc "Create workspace" "c" #'+workspace/new
|
||||
:desc "Delete workspace" "k" #'+workspace/delete
|
||||
:desc "Save workspace" "S" #'+workspace/save
|
||||
:desc "Switch to other workspace" "o" #'+workspace/other
|
||||
:desc "Switch to left workspace" "p" #'+workspace/switch-left
|
||||
:desc "Switch to right workspace" "n" #'+workspace/switch-right
|
||||
:desc "Switch to" "w" #'+workspace/switch-to
|
||||
:desc "Switch to workspace 1" "1" #'+workspace/switch-to-0
|
||||
:desc "Switch to workspace 2" "2" #'+workspace/switch-to-1
|
||||
:desc "Switch to workspace 3" "3" #'+workspace/switch-to-2
|
||||
:desc "Switch to workspace 4" "4" #'+workspace/switch-to-3
|
||||
:desc "Switch to workspace 5" "5" #'+workspace/switch-to-4
|
||||
:desc "Switch to workspace 6" "6" #'+workspace/switch-to-5
|
||||
:desc "Switch to workspace 7" "7" #'+workspace/switch-to-6
|
||||
:desc "Switch to workspace 8" "8" #'+workspace/switch-to-7
|
||||
:desc "Switch to workspace 9" "9" #'+workspace/switch-to-8
|
||||
:desc "Switch to last workspace" "0" #'+workspace/switch-to-final)
|
||||
:desc "Autosave session" "a" #'doom/quicksave-session
|
||||
:desc "Display workspaces" "d" #'+workspace/display
|
||||
:desc "Rename workspace" "r" #'+workspace/rename
|
||||
:desc "Create workspace" "c" #'+workspace/new
|
||||
:desc "Delete workspace" "k" #'+workspace/delete
|
||||
:desc "Save session" "s" #'doom/save-session
|
||||
:desc "Save workspace" "S" #'+workspace/save
|
||||
:desc "Load session" "l" #'doom/load-session
|
||||
:desc "Load last autosaved session" "L" #'doom/quickload-session
|
||||
:desc "Switch to other workspace" "o" #'+workspace/other
|
||||
:desc "Undo window config" "u" #'winner-undo
|
||||
:desc "Redo window config" "U" #'winner-redo
|
||||
:desc "Switch to left workspace" "p" #'+workspace/switch-left
|
||||
:desc "Switch to right workspace" "n" #'+workspace/switch-right
|
||||
:desc "Switch to" "w" #'+workspace/switch-to
|
||||
:desc "Switch to workspace 1" "1" #'+workspace/switch-to-0
|
||||
:desc "Switch to workspace 2" "2" #'+workspace/switch-to-1
|
||||
:desc "Switch to workspace 3" "3" #'+workspace/switch-to-2
|
||||
:desc "Switch to workspace 4" "4" #'+workspace/switch-to-3
|
||||
:desc "Switch to workspace 5" "5" #'+workspace/switch-to-4
|
||||
:desc "Switch to workspace 6" "6" #'+workspace/switch-to-5
|
||||
:desc "Switch to workspace 7" "7" #'+workspace/switch-to-6
|
||||
:desc "Switch to workspace 8" "8" #'+workspace/switch-to-7
|
||||
:desc "Switch to workspace 9" "9" #'+workspace/switch-to-8
|
||||
:desc "Switch to last workspace" "0" #'+workspace/switch-to-final)
|
||||
:desc "Redo window config" "U" #'winner-redo)
|
||||
|
||||
;;; <leader> m --- multiple cursors
|
||||
(:when (featurep! :editor multiple-cursors)
|
||||
@@ -417,17 +418,10 @@
|
||||
(map! "C-'" #'imenu
|
||||
|
||||
;;; Text scaling
|
||||
[C-mouse-4] #'text-scale-increase
|
||||
[C-mouse-5] #'text-scale-decrease
|
||||
[C-down-mouse-2] (cmd! (text-scale-set 0))
|
||||
"M-+" #'doom/reset-font-size
|
||||
"M-=" #'doom/increase-font-size
|
||||
"M--" #'doom/decrease-font-size
|
||||
|
||||
;;; newlines
|
||||
[remap newline] #'newline-and-indent
|
||||
"C-j" #'+default/newline
|
||||
|
||||
;;; search
|
||||
(:when (featurep! :completion ivy)
|
||||
"C-S-s" #'swiper
|
||||
|
||||
@@ -50,10 +50,6 @@
|
||||
(not (memq (char-after) (list ?\( ?\[ ?\{ ?\} ?\] ?\))))))
|
||||
#'yas-insert-snippet)
|
||||
|
||||
;; Smarter newlines
|
||||
:i [remap newline] #'newline-and-indent ; auto-indent on newline
|
||||
:i "C-j" #'+default/newline ; default behavior
|
||||
|
||||
(:after help :map help-mode-map
|
||||
:n "o" #'link-hint-open-link)
|
||||
(:after helpful :map helpful-mode-map
|
||||
@@ -69,6 +65,8 @@
|
||||
[escape] #'View-quit-all)
|
||||
(:after man :map Man-mode-map
|
||||
:n "q" #'kill-current-buffer)
|
||||
(:after geiser-doc :map geiser-doc-mode-map
|
||||
:n "o" #'link-hint-open-link)
|
||||
|
||||
(:after (evil-org evil-easymotion)
|
||||
:map evil-org-mode-map
|
||||
@@ -108,8 +106,8 @@
|
||||
|
||||
;;; :completion
|
||||
(map! (:when (featurep! :completion company)
|
||||
:i "C-@" #'+company/complete
|
||||
:i "C-SPC" #'+company/complete
|
||||
:i "C-@" (cmds! (not (minibufferp)) #'+company/complete)
|
||||
:i "C-SPC" (cmds! (not (minibufferp)) #'+company/complete)
|
||||
(:after company
|
||||
(:map company-active-map
|
||||
"C-w" nil ; don't interfere with `evil-delete-backward-word'
|
||||
@@ -342,9 +340,9 @@
|
||||
|
||||
;;; <leader> c --- code
|
||||
(:prefix-map ("c" . "code")
|
||||
(:unless (featurep! :tools lsp +eglot)
|
||||
(:when (and (featurep! :tools lsp) (not (featurep! :tools lsp +eglot)))
|
||||
:desc "LSP Execute code action" "a" #'lsp-execute-code-action
|
||||
:desc "LSP Organize imports" "i" #'lsp-organize-imports
|
||||
:desc "LSP Organize imports" "o" #'lsp-organize-imports
|
||||
(:when (featurep! :completion ivy)
|
||||
:desc "Jump to symbol in current workspace" "j" #'lsp-ivy-workspace-symbol
|
||||
:desc "Jump to symbol in any workspace" "J" #'lsp-ivy-global-workspace-symbol)
|
||||
@@ -356,10 +354,8 @@
|
||||
:desc "LSP" "l" lsp-command-map))
|
||||
(:when (featurep! :tools lsp +eglot)
|
||||
:desc "LSP Execute code action" "a" #'eglot-code-actions
|
||||
:desc "LSP Format buffer/region" "F" #'eglot-format
|
||||
:desc "LSP Rename" "r" #'eglot-rename
|
||||
:desc "LSP Find declaration" "j" #'eglot-find-declaration
|
||||
:desc "LSP Find implementation" "J" #'eglot-find-implementation)
|
||||
:desc "LSP Find declaration" "j" #'eglot-find-declaration)
|
||||
:desc "Compile" "c" #'compile
|
||||
:desc "Recompile" "C" #'recompile
|
||||
:desc "Jump to definition" "d" #'+lookup/definition
|
||||
@@ -367,8 +363,10 @@
|
||||
:desc "Evaluate buffer/region" "e" #'+eval/buffer-or-region
|
||||
:desc "Evaluate & replace region" "E" #'+eval:replace-region
|
||||
:desc "Format buffer/region" "f" #'+format/region-or-buffer
|
||||
:desc "Find implementations" "i" #'+lookup/implementations
|
||||
:desc "Jump to documentation" "k" #'+lookup/documentation
|
||||
:desc "Send to repl" "s" #'+eval/send-region-to-repl
|
||||
:desc "Find type definition" "t" #'+lookup/type-definition
|
||||
:desc "Delete trailing whitespace" "w" #'delete-trailing-whitespace
|
||||
:desc "Delete trailing newlines" "W" #'doom/delete-trailing-newlines
|
||||
:desc "List errors" "x" #'flymake-show-diagnostics-buffer
|
||||
@@ -379,7 +377,7 @@
|
||||
(:prefix-map ("f" . "file")
|
||||
:desc "Open project editorconfig" "c" #'editorconfig-find-current-editorconfig
|
||||
:desc "Copy this file" "C" #'doom/copy-this-file
|
||||
:desc "Find directory" "d" #'dired
|
||||
:desc "Find directory" "d" #'+default/dired
|
||||
:desc "Delete this file" "D" #'doom/delete-this-file
|
||||
:desc "Find file in emacs.d" "e" #'+default/find-in-emacsd
|
||||
:desc "Browse emacs.d" "E" #'+default/browse-emacsd
|
||||
@@ -475,8 +473,8 @@
|
||||
(cond ((featurep! :completion ivy) #'ivy-bibtex)
|
||||
((featurep! :completion helm) #'helm-bibtex)))
|
||||
|
||||
:desc "Toggle org-clock" "c" #'+org/toggle-clock
|
||||
:desc "Cancel org-clock" "C" #'org-clock-cancel
|
||||
:desc "Toggle last org-clock" "c" #'+org/toggle-last-clock
|
||||
:desc "Cancel current org-clock" "C" #'org-clock-cancel
|
||||
:desc "Open deft" "d" #'deft
|
||||
(:when (featurep! :lang org +noter)
|
||||
:desc "Org noter" "e" #'org-noter)
|
||||
@@ -497,12 +495,13 @@
|
||||
|
||||
(:when (featurep! :lang org +roam)
|
||||
(:prefix ("r" . "roam")
|
||||
:desc "Switch to buffer" "b" #'org-roam-switch-to-buffer
|
||||
:desc "Org Roam Capture" "c" #'org-roam-capture
|
||||
:desc "Find file" "f" #'org-roam-find-file
|
||||
:desc "Show graph" "g" #'org-roam-graph
|
||||
:desc "Insert" "i" #'org-roam-insert
|
||||
:desc "Org Roam" "r" #'org-roam
|
||||
:desc "Switch to buffer" "b" #'org-roam-switch-to-buffer
|
||||
:desc "Org Roam Capture" "c" #'org-roam-capture
|
||||
:desc "Find file" "f" #'org-roam-find-file
|
||||
:desc "Show graph" "g" #'org-roam-graph
|
||||
:desc "Insert" "i" #'org-roam-insert
|
||||
:desc "Insert (skipping org-capture)" "I" #'org-roam-insert-immediate
|
||||
:desc "Org Roam" "r" #'org-roam
|
||||
(:prefix ("d" . "by date")
|
||||
:desc "Arbitrary date" "d" #'org-roam-dailies-date
|
||||
:desc "Today" "t" #'org-roam-dailies-today
|
||||
@@ -645,8 +644,7 @@
|
||||
:desc "Search project" "p" #'+default/search-project
|
||||
:desc "Search other project" "P" #'+default/search-other-project
|
||||
:desc "Jump to mark" "r" #'evil-show-marks
|
||||
:desc "Search buffer" "s" #'swiper-isearch
|
||||
:desc "Search buffer for thing at point" "S" #'swiper-isearch-thing-at-point
|
||||
:desc "Search buffer" "s" #'+default/search-buffer
|
||||
:desc "Dictionary" "t" #'+lookup/dictionary-definition
|
||||
:desc "Thesaurus" "T" #'+lookup/synonyms)
|
||||
|
||||
|
||||
@@ -427,11 +427,30 @@ Continues comments if executed from a commented line. Consults
|
||||
;; which ctrl+RET will add a new "item" below the current one and
|
||||
;; cmd+RET (Mac) / meta+RET (elsewhere) will add a new, blank line below
|
||||
;; the current one.
|
||||
:gn [C-return] #'+default/newline-below
|
||||
:gn [C-S-return] #'+default/newline-above
|
||||
|
||||
;; C-<mouse-scroll-up> = text scale increase
|
||||
;; C-<mouse-scroll-down> = text scale decrease
|
||||
[C-down-mouse-2] (cmd! (text-scale-set 0))
|
||||
|
||||
;; auto-indent on newline by default
|
||||
:gi [remap newline] #'newline-and-indent
|
||||
;; insert literal newline
|
||||
:gi "S-RET" #'+default/newline
|
||||
:gi [S-return] #'+default/newline
|
||||
:gi "C-j" #'+default/newline
|
||||
|
||||
;; Add new item below current (without splitting current line).
|
||||
:gi "C-RET" #'+default/newline-below
|
||||
:gn [C-return] #'+default/newline-below
|
||||
;; Add new item above current (without splitting current line)
|
||||
:gi "C-S-RET" #'+default/newline-above
|
||||
:gn [C-S-return] #'+default/newline-above
|
||||
|
||||
(:when IS-MAC
|
||||
:gn [s-return] #'+default/newline-below
|
||||
:gn [S-s-return] #'+default/newline-above)))
|
||||
:gn "s-RET" #'+default/newline-below
|
||||
:gn [s-return] #'+default/newline-below
|
||||
:gn "S-s-RET" #'+default/newline-above
|
||||
:gn [S-s-return] #'+default/newline-above)))
|
||||
|
||||
|
||||
;;
|
||||
|
||||
@@ -9,43 +9,81 @@
|
||||
"The file path that `+literate-config-file' will be tangled to, then
|
||||
byte-compiled from.")
|
||||
|
||||
;;;###autoload
|
||||
(defun +literate-tangle-h (&optional force-p)
|
||||
"Tangles `+literate-config-file' if it has changed."
|
||||
(let ((default-directory doom-private-dir))
|
||||
(when (or (file-newer-than-file-p +literate-config-file
|
||||
+literate-config-cache-file)
|
||||
force-p)
|
||||
(print! (start "Compiling your literate config..."))
|
||||
(print-group!
|
||||
(let* ((org (expand-file-name +literate-config-file))
|
||||
(dest (concat (file-name-sans-extension +literate-config-file) ".el"))
|
||||
(output (get-buffer-create "*org-tangle*")))
|
||||
(unwind-protect
|
||||
;; We tangle in a separate, blank process because loading it here
|
||||
;; would load all of :lang org (very expensive!).
|
||||
(and (require 'ob-tangle)
|
||||
(letf! (defun message (msg &rest args)
|
||||
(print! (info "%s") (apply #'format msg args)))
|
||||
(org-babel-tangle-file org dest))
|
||||
;; Write the cache file to serve as our mtime cache
|
||||
(with-temp-file +literate-config-cache-file))
|
||||
(kill-buffer output)))))))
|
||||
(defvar org-mode-hook)
|
||||
(defvar org-inhibit-startup)
|
||||
|
||||
|
||||
;;;###autoload
|
||||
(after! org
|
||||
;; Recompile our literate config if we modify it
|
||||
(add-hook 'after-save-hook #'+literate-recompile-maybe-h))
|
||||
(defun +literate-tangle-h ()
|
||||
"Tangles `+literate-config-file' if it has changed."
|
||||
(print! (start "Compiling your literate config..."))
|
||||
(print-group!
|
||||
(let* ((default-directory doom-private-dir)
|
||||
(org (expand-file-name +literate-config-file))
|
||||
(dest (concat (file-name-sans-extension +literate-config-file) ".el")))
|
||||
(and (require 'ox)
|
||||
(require 'ob-tangle)
|
||||
(letf! (;; Operate on a copy because `org-babel-tangle' has
|
||||
;; side-effects we need to undo immediately as not to
|
||||
;; overwrite the user's config; it's bad ettiquite.
|
||||
(backup (make-temp-file (concat (file-name-nondirectory org) ".")))
|
||||
;; A hack to prevent ob-tangle from operating relative to the
|
||||
;; backup file and thus tangling to the wrong destinations.
|
||||
(defun org-babel-tangle-single-block (&rest args)
|
||||
(let* ((spec (apply org-babel-tangle-single-block args))
|
||||
(file (nth 1 spec))
|
||||
(file (if (file-equal-p file backup) org file))
|
||||
(file (if org-babel-tangle-use-relative-file-links
|
||||
(file-relative-name file)
|
||||
file)))
|
||||
(setf (nth 1 spec) file)
|
||||
spec))
|
||||
;; Ensure output conforms to the formatting of all doom CLIs
|
||||
(defun message (msg &rest args)
|
||||
(when msg
|
||||
(print! (info "%s") (apply #'format msg args)))))
|
||||
(unwind-protect
|
||||
(with-temp-file backup
|
||||
(insert-file-contents org)
|
||||
(let ((buffer-file-name backup)
|
||||
;; Prevent unwanted entries in recentf, or formatters, or
|
||||
;; anything that could be on these hooks, really. Nothing
|
||||
;; else should be touching these files (particularly in
|
||||
;; interactive sessions).
|
||||
(write-file-functions nil)
|
||||
(before-save-hook nil)
|
||||
(after-save-hook nil)
|
||||
;; Prevent infinite recursion due to recompile-on-save
|
||||
;; hooks later, and speed up `org-mode' init.
|
||||
(org-mode-hook nil)
|
||||
(org-inhibit-startup t))
|
||||
(org-mode)
|
||||
(with-silent-modifications
|
||||
;; Tangling won't ordinarily expand #+INCLUDE directives,
|
||||
;; so I do it myself.
|
||||
(org-export-expand-include-keyword)
|
||||
(org-babel-tangle nil dest))))
|
||||
(ignore-errors (delete-file backup)))
|
||||
;; Write an empty file to serve as our mtime cache
|
||||
(with-temp-file +literate-config-cache-file)
|
||||
t)))))
|
||||
|
||||
;;;###autoload
|
||||
(add-hook 'org-mode-hook #'+literate-enable-recompile-h)
|
||||
|
||||
;;;###autoload
|
||||
(defalias '+literate/reload #'doom/reload)
|
||||
|
||||
;;;###autoload
|
||||
(defun +literate-enable-recompile-h ()
|
||||
"Enable literate-compiling-on-save in the current buffer."
|
||||
(add-hook 'after-save-hook #'+literate-recompile-maybe-h nil 'local))
|
||||
|
||||
;;;###autoload
|
||||
(defun +literate-recompile-maybe-h ()
|
||||
"Recompile config.org if we're editing an org file in our DOOMDIR.
|
||||
"Recompile literate config to `doom-private-dir'.
|
||||
|
||||
We assume any org file in `doom-private-dir' is connected to your literate
|
||||
config, and should trigger a recompile if changed."
|
||||
(when (and (eq major-mode 'org-mode)
|
||||
(file-in-directory-p buffer-file-name doom-private-dir))
|
||||
(+literate-tangle-h 'force)))
|
||||
(when (file-in-directory-p buffer-file-name doom-private-dir)
|
||||
(+literate-tangle-h)))
|
||||
|
||||
@@ -4,7 +4,9 @@
|
||||
"The keys to use for universal repeating motions.
|
||||
|
||||
This is a cons cell whose CAR is the key for repeating a motion forward, and
|
||||
whose CDR is for repeating backward. They should both be `kbd'-able strings.")
|
||||
whose CDR is for repeating backward. They should both be `kbd'-able strings.
|
||||
|
||||
Set this to `nil' to disable universal-repeating on these keys.")
|
||||
|
||||
(defvar +evil-want-o/O-to-continue-comments t
|
||||
"If non-nil, the o/O keys will continue comment lines if the point is on a
|
||||
@@ -32,7 +34,6 @@ directives. By default, this only recognizes C directives.")
|
||||
:preface
|
||||
(setq evil-want-visual-char-semi-exclusive t
|
||||
evil-ex-search-vim-style-regexp t
|
||||
evil-ex-substitute-global t
|
||||
evil-ex-visual-char-range t ; column range for ex commands
|
||||
evil-mode-line-format 'nil
|
||||
;; more vim-like behavior
|
||||
@@ -45,12 +46,15 @@ directives. By default, this only recognizes C directives.")
|
||||
evil-visual-state-cursor 'hollow
|
||||
;; Only do highlighting in selected window so that Emacs has less work
|
||||
;; to do highlighting them all.
|
||||
evil-ex-interactive-search-highlight 'selected-window)
|
||||
evil-ex-interactive-search-highlight 'selected-window
|
||||
;; It's infuriating that innocuous "beginning of line" or "end of line"
|
||||
;; errors will abort macros, so suppress them:
|
||||
evil-kbd-macro-suppress-motion-error t)
|
||||
|
||||
;; Slow this down from 0.02 to prevent blocking in large or folded buffers
|
||||
;; like magit while incrementally highlighting matches.
|
||||
(setq-hook! 'magit-mode-hook evil-ex-hl-update-delay 0.2)
|
||||
(setq-hook! 'so-long-minor-mode-hook evil-ex-hl-update-delay 0.25)
|
||||
(setq-hook! '(magit-mode-hook so-long-minor-mode-hook)
|
||||
evil-ex-hl-update-delay 0.25)
|
||||
|
||||
:config
|
||||
(evil-select-search-module 'evil-search-module 'evil-search)
|
||||
@@ -325,7 +329,7 @@ directives. By default, this only recognizes C directives.")
|
||||
evil-snipe-repeat-scope 'visible
|
||||
evil-snipe-char-fold t)
|
||||
:config
|
||||
(pushnew! evil-snipe-disabled-modes 'Info-mode 'calc-mode)
|
||||
(pushnew! evil-snipe-disabled-modes 'Info-mode 'calc-mode 'treemacs-mode)
|
||||
(evil-snipe-mode +1)
|
||||
(evil-snipe-override-mode +1))
|
||||
|
||||
@@ -368,42 +372,6 @@ directives. By default, this only recognizes C directives.")
|
||||
;;
|
||||
;;; Keybinds
|
||||
|
||||
(defmacro set-repeater! (command next-func prev-func)
|
||||
"Makes ; and , the universal repeat-keys in evil-mode.
|
||||
To change these keys see `+evil-repeat-keys'."
|
||||
`(defadvice! ,(intern (format "+evil--repeat-%s-a" (doom-unquote command))) (&rest _)
|
||||
:after-while #',command
|
||||
(when +evil-repeat-keys
|
||||
(evil-define-key* 'motion 'local
|
||||
(kbd (car +evil-repeat-keys)) #',next-func
|
||||
(kbd (cdr +evil-repeat-keys)) #',prev-func))))
|
||||
|
||||
;; n/N
|
||||
(set-repeater! evil-ex-search-next evil-ex-search-next evil-ex-search-previous)
|
||||
(set-repeater! evil-ex-search-previous evil-ex-search-next evil-ex-search-previous)
|
||||
(set-repeater! evil-ex-search-forward evil-ex-search-next evil-ex-search-previous)
|
||||
(set-repeater! evil-ex-search-backward evil-ex-search-next evil-ex-search-previous)
|
||||
|
||||
;; f/F/t/T/s/S
|
||||
(after! evil-snipe
|
||||
(setq evil-snipe-repeat-keys nil
|
||||
evil-snipe-override-evil-repeat-keys nil) ; causes problems with remapped ;
|
||||
(set-repeater! evil-snipe-f evil-snipe-repeat evil-snipe-repeat-reverse)
|
||||
(set-repeater! evil-snipe-F evil-snipe-repeat evil-snipe-repeat-reverse)
|
||||
(set-repeater! evil-snipe-t evil-snipe-repeat evil-snipe-repeat-reverse)
|
||||
(set-repeater! evil-snipe-T evil-snipe-repeat evil-snipe-repeat-reverse)
|
||||
(set-repeater! evil-snipe-s evil-snipe-repeat evil-snipe-repeat-reverse)
|
||||
(set-repeater! evil-snipe-S evil-snipe-repeat evil-snipe-repeat-reverse)
|
||||
(set-repeater! evil-snipe-x evil-snipe-repeat evil-snipe-repeat-reverse)
|
||||
(set-repeater! evil-snipe-X evil-snipe-repeat evil-snipe-repeat-reverse))
|
||||
|
||||
;; */#
|
||||
(set-repeater! evil-visualstar/begin-search-forward
|
||||
evil-ex-search-next evil-ex-search-previous)
|
||||
(set-repeater! evil-visualstar/begin-search-backward
|
||||
evil-ex-search-previous evil-ex-search-next)
|
||||
|
||||
|
||||
;; Keybinds that have no Emacs+evil analogues (i.e. don't exist):
|
||||
;; zq - mark word at point as good word
|
||||
;; zw - mark word at point as bad
|
||||
@@ -501,7 +469,7 @@ To change these keys see `+evil-repeat-keys'."
|
||||
:nv "zn" #'+evil:narrow-buffer
|
||||
:n "zN" #'doom/widen-indirectly-narrowed-buffer
|
||||
:n "zx" #'kill-current-buffer
|
||||
:n "ZX" #'bury-buffer
|
||||
:n "ZX" #'doom/save-and-kill-buffer
|
||||
;; don't leave visual mode after shifting
|
||||
:v "<" #'+evil/visual-dedent ; vnoremap < <gv
|
||||
:v ">" #'+evil/visual-indent ; vnoremap > >gv
|
||||
@@ -552,7 +520,7 @@ To change these keys see `+evil-repeat-keys'."
|
||||
"a" (evilem-create #'evil-forward-arg)
|
||||
"A" (evilem-create #'evil-backward-arg)
|
||||
"s" #'evil-avy-goto-char-2
|
||||
"SPC" (cmd!! #'evil-avy-goto-char-timer t)
|
||||
"SPC" (cmd! (let ((current-prefix-arg t)) (evil-avy-goto-char-timer)))
|
||||
"/" #'evil-avy-goto-char-timer))
|
||||
|
||||
;; evil-snipe
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
;; -*- no-byte-compile: t; -*-
|
||||
;;; editor/evil/packages.el
|
||||
|
||||
(package! evil :pin "25fc5c6647979357cf3e39f0667a9b7ae5266af9")
|
||||
(package! evil :pin "2bc6ca3587502fde67b93e411e329fc8224c916a")
|
||||
(package! evil-args :pin "758ad5ae54ad34202064fec192c88151c08cb387")
|
||||
(package! evil-easymotion :pin "f96c2ed38ddc07908db7c3c11bcd6285a3e8c2e9")
|
||||
(package! evil-embrace :pin "4379adea032b25e359d01a36301b4a5afdd0d1b7")
|
||||
@@ -11,12 +11,12 @@
|
||||
(package! evil-exchange :pin "3030e21ee16a42dfce7f7cf86147b778b3f5d8c1")
|
||||
(package! evil-indent-plus :pin "0c7501e6efed661242c3a20e0a6c79a6455c2c40")
|
||||
(package! evil-lion :pin "6b03593f5dd6e7c9ca02207f9a73615cf94c93ab")
|
||||
(package! evil-nerd-commenter :pin "1bd2de52011c39777a3e8779b14cee2790dc873b")
|
||||
(package! evil-nerd-commenter :pin "87734b9c7fcd047f73a072b9d03ec05f786eeb03")
|
||||
(package! evil-numbers
|
||||
:recipe (:host github :repo "janpath/evil-numbers")
|
||||
:pin "c2cfdd1eb1f193bea28ee79b191b78309677058a")
|
||||
:pin "006da406d175c05fedca4431cccd569e20bef92c")
|
||||
(package! evil-snipe :pin "6dcac7f2516c6137a2de532fc2c052f242559ee3")
|
||||
(package! evil-surround :pin "1c34944d8c98da4a2385d24ee89eef9cdf569a12")
|
||||
(package! evil-surround :pin "346d4d85fcf1f9517e9c4991c1efe68b4130f93a")
|
||||
(package! evil-textobj-anyblock :pin "ff00980f0634f95bf2ad9956b615a155ea8743be")
|
||||
(package! evil-traces :pin "bc25cae9fa5ab0ba1507827f0944f52ce0ca7462")
|
||||
(package! evil-visualstar :pin "06c053d8f7381f91c53311b1234872ca96ced752")
|
||||
@@ -33,4 +33,4 @@
|
||||
(package! neotree)
|
||||
(autoload 'neotree-make-executor "neotree" nil nil 'macro))
|
||||
|
||||
(package! evil-collection :pin "e065da3732f015428bd0068481dadad9e0e6d09c"))
|
||||
(package! evil-collection :pin "3e62b6b1312f7907081be41a032aaacffa732fef"))
|
||||
|
||||
@@ -89,6 +89,8 @@ evil is loaded and enabled)."
|
||||
(match-string 1 path))
|
||||
((file-in-directory-p path doom-emacs-dir)
|
||||
(file-relative-name path doom-emacs-dir))
|
||||
((file-in-directory-p path doom-private-dir)
|
||||
(file-relative-name path doom-private-dir))
|
||||
((abbreviate-file-name path))))))
|
||||
|
||||
|
||||
|
||||
@@ -201,16 +201,43 @@ See `+format/buffer' for the interactive version of this function, and
|
||||
;;
|
||||
;;; Commands
|
||||
|
||||
(defun +format--org-region (beg end)
|
||||
"Reformat the region within BEG and END.
|
||||
If nil, BEG and/or END will default to the boundaries of the src block at point."
|
||||
(let ((element (org-element-at-point)))
|
||||
(save-excursion
|
||||
(let* ((block-beg (save-excursion
|
||||
(goto-char (org-babel-where-is-src-block-head element))
|
||||
(line-beginning-position 2)))
|
||||
(block-end (save-excursion
|
||||
(goto-char (org-element-property :end element))
|
||||
(skip-chars-backward " \t\n")
|
||||
(line-beginning-position)))
|
||||
(beg (if beg (max beg block-beg) block-beg))
|
||||
(end (if end (min end block-end) block-end))
|
||||
(lang (org-element-property :language element))
|
||||
(major-mode (org-src-get-lang-mode lang)))
|
||||
(if (eq major-mode 'org-mode)
|
||||
(user-error "Cannot reformat an org src block in org-mode")
|
||||
(+format/region beg end))))))
|
||||
|
||||
;;;###autoload
|
||||
(defun +format/buffer ()
|
||||
"Reformat the current buffer using LSP or `format-all-buffer'."
|
||||
(interactive)
|
||||
(call-interactively
|
||||
(if (and +format-with-lsp
|
||||
(bound-and-true-p lsp-mode)
|
||||
(lsp-feature? "textDocument/formatting"))
|
||||
#'lsp-format-buffer
|
||||
#'format-all-buffer)))
|
||||
(if (and (eq major-mode 'org-mode)
|
||||
(org-in-src-block-p t))
|
||||
(+format--org-region nil nil)
|
||||
(call-interactively
|
||||
(cond ((and +format-with-lsp
|
||||
(bound-and-true-p lsp-mode)
|
||||
(lsp-feature? "textDocument/formatting"))
|
||||
#'lsp-format-buffer)
|
||||
((and +format-with-lsp
|
||||
(bound-and-true-p eglot--managed-mode)
|
||||
(eglot--server-capable :documentFormattingProvider))
|
||||
#'eglot-format-buffer)
|
||||
(#'format-all-buffer)))))
|
||||
|
||||
;;;###autoload
|
||||
(defun +format/region (beg end)
|
||||
@@ -220,14 +247,21 @@ WARNING: this may not work everywhere. It will throw errors if the region
|
||||
contains a syntax error in isolation. It is mostly useful for formatting
|
||||
snippets or single lines."
|
||||
(interactive "rP")
|
||||
(if (and +format-with-lsp
|
||||
(bound-and-true-p lsp-mode)
|
||||
(lsp-feature? "textDocument/rangeFormatting"))
|
||||
(call-interactively #'lsp-format-region)
|
||||
(save-restriction
|
||||
(narrow-to-region beg end)
|
||||
(let ((+format-region-p t))
|
||||
(+format/buffer)))))
|
||||
(if (and (eq major-mode 'org-mode)
|
||||
(org-in-src-block-p t))
|
||||
(+format--org-region beg end)
|
||||
(cond ((and +format-with-lsp
|
||||
(bound-and-true-p lsp-mode)
|
||||
(lsp-feature? "textDocument/rangeFormatting"))
|
||||
(call-interactively #'lsp-format-region))
|
||||
((and +format-with-lsp
|
||||
(bound-and-true-p eglot--managed-mode)
|
||||
(eglot--server-capable :documentRangeFormattingProvider))
|
||||
(call-interactively #'eglot-format))
|
||||
((save-restriction
|
||||
(narrow-to-region beg end)
|
||||
(let ((+format-region-p t))
|
||||
(+format/buffer)))))))
|
||||
|
||||
;;;###autoload
|
||||
(defun +format/region-or-buffer ()
|
||||
|
||||
@@ -120,3 +120,12 @@ FLAGS can be g and/or i; which mean the same thing they do in
|
||||
:key #'evil-mc-get-cursor-start))
|
||||
(message "No cursors to undo in region"))
|
||||
(evil-mc-undo-last-added-cursor)))
|
||||
|
||||
|
||||
;;;###autoload (autoload '+multiple-cursors-execute-default-operator-fn "editor/multiple-cursors/autoload/evil-mc" nil t)
|
||||
|
||||
(after! evil-mc
|
||||
(evil-mc-define-handler +multiple-cursors-execute-default-operator-fn ()
|
||||
:cursor-clear region
|
||||
(evil-mc-with-region-or-execute-macro region t
|
||||
(funcall (evil-mc-get-command-name) region-start region-end))))
|
||||
|
||||
@@ -67,20 +67,22 @@
|
||||
(company-complete-common . evil-mc-execute-default-complete)
|
||||
(doom/backward-to-bol-or-indent . evil-mc-execute-default-call)
|
||||
(doom/forward-to-last-non-comment-or-eol . evil-mc-execute-default-call)
|
||||
;; :emacs undo
|
||||
(undo-fu-only-undo . evil-mc-execute-default-undo)
|
||||
(undo-fu-only-redo . evil-mc-execute-default-redo)
|
||||
;; :editor evil
|
||||
(evil-delete-back-to-indentation . evil-mc-execute-default-call)
|
||||
;; Have evil-mc work with explicit `evil-escape' (on C-g)
|
||||
(evil-escape . evil-mc-execute-default-evil-normal-state)
|
||||
;; Add `evil-org' support
|
||||
(evil-org-delete . evil-mc-execute-default-evil-delete)
|
||||
(evil-org-delete-char . evil-mc-execute-default-evil-delete)
|
||||
(evil-org-delete-backward-char . evil-mc-execute-default-evil-delete)
|
||||
;; `evil-numbers'
|
||||
(evil-escape . evil-mc-execute-default-evil-normal-state) ; C-g
|
||||
(evil-numbers/inc-at-pt-incremental)
|
||||
(evil-numbers/dec-at-pt-incremental)))
|
||||
(cl-pushnew `(,(car fn) (:default . ,(or (cdr fn) #'evil-mc-execute-default-call-with-count)))
|
||||
evil-mc-custom-known-commands
|
||||
:test #'eq
|
||||
:key #'car))
|
||||
(evil-numbers/dec-at-pt-incremental)
|
||||
;; :tools eval
|
||||
(+eval:replace-region . +multiple-cursors-execute-default-operator-fn)
|
||||
;; :lang org
|
||||
(evil-org-delete . evil-mc-execute-default-evil-delete)))
|
||||
(setf (alist-get (car fn) evil-mc-custom-known-commands)
|
||||
(list (cons :default
|
||||
(or (cdr fn)
|
||||
#'evil-mc-execute-default-call-with-count)))))
|
||||
|
||||
;; HACK Allow these commands to be repeated by prefixing them with a numerical
|
||||
;; argument. See gabesoft/evil-mc#110
|
||||
@@ -102,12 +104,12 @@
|
||||
;; our multiple cursors
|
||||
(add-hook 'evil-insert-state-entry-hook #'evil-mc-resume-cursors)
|
||||
|
||||
;; evil-escape's escape key sequence leaves behind extraneous characters
|
||||
(cl-pushnew 'evil-escape-mode evil-mc-incompatible-minor-modes)
|
||||
;; Lispy commands don't register on more than 1 cursor. Lispyville is fine
|
||||
;; though.
|
||||
(when (featurep! :editor lispy)
|
||||
(cl-pushnew 'lispy-mode evil-mc-incompatible-minor-modes))
|
||||
(pushnew! evil-mc-incompatible-minor-modes
|
||||
;; evil-escape's escape key leaves behind extraneous characters
|
||||
'evil-escape-mode
|
||||
;; Lispy commands don't register on more than 1 cursor. Lispyville
|
||||
;; is fine though.
|
||||
'lispy-mode)
|
||||
|
||||
(add-hook! 'doom-escape-hook
|
||||
(defun +multiple-cursors-escape-multiple-cursors-h ()
|
||||
@@ -132,6 +134,9 @@
|
||||
(after! multiple-cursors-core
|
||||
(setq mc/list-file (concat doom-etc-dir "mc-lists.el"))
|
||||
|
||||
;; Can't use `mc/cmds-to-run-once' because mc-lists.el overwrites it
|
||||
(add-to-list 'mc--default-cmds-to-run-once 'swiper-mc)
|
||||
|
||||
;; TODO multiple-cursors config for Emacs users?
|
||||
|
||||
;; mc doesn't play well with evil, this attempts to assuage some of its
|
||||
|
||||
@@ -3,6 +3,9 @@
|
||||
|
||||
(cond
|
||||
((featurep! :editor evil)
|
||||
;; REVIEW Broken in 8abf2c1f4f0ade64cbb06c8f47055f04ab83e8d6 (latest commit at
|
||||
;; time of writing). Revisit later.
|
||||
(package! iedit :pin "77eb0a1e2e44b453e4ebf4c38409affa353f5139")
|
||||
(package! evil-multiedit :pin "9f271e0e6048297692f80ed6c5ae8994ac523abc")
|
||||
(package! evil-mc :pin "4d4c0172e4c7f80acc1d0e73d5fb3e536929b262"))
|
||||
|
||||
|
||||
@@ -11,9 +11,10 @@ This modules adds [[https://github.com/clemera/objed][objed]], a global minor-mo
|
||||
text objects. It combines the ideas of versor-mode and other editors like Vim or
|
||||
Kakoune and tries to align them with regular Emacs conventions.
|
||||
|
||||
Note that =objed= is intended as an *alternative* to =evil=, for people who
|
||||
prefer standard Emacs key-bindings and conventions. It's not recommended to use
|
||||
these modules together.
|
||||
#+begin_quote
|
||||
This module is incompatible with the =:editor evil=. Enabling them both will
|
||||
cause errors.
|
||||
#+end_quote
|
||||
|
||||
[[https://github.com/clemera/objed][See the objed project README]] for information on keybinds and usage.
|
||||
|
||||
|
||||
@@ -93,14 +93,39 @@
|
||||
:filter-return #'yas--all-templates
|
||||
(cl-delete-duplicates templates :test #'equal))
|
||||
|
||||
;; HACK Smartparens will interfere with snippets expanded by `hippie-expand`,
|
||||
;; so temporarily disable smartparens during snippet expansion.
|
||||
(after! hippie-exp
|
||||
(defvar +snippets--smartparens-enabled-p t)
|
||||
(defvar +snippets--expanding-p nil)
|
||||
|
||||
;; Is called for all snippet expansions,
|
||||
(add-hook! 'yas-before-expand-snippet-hook
|
||||
(defun +snippets--disable-smartparens-before-expand-h ()
|
||||
;; Remember the initial smartparens state only once, when expanding a
|
||||
;; top-level snippet.
|
||||
(unless +snippets--expanding-p
|
||||
(setq +snippets--expanding-p t
|
||||
+snippets--smartparens-enabled-p smartparens-mode))
|
||||
(when smartparens-mode
|
||||
(smartparens-mode -1))))
|
||||
|
||||
;; Is called only for the top level snippet, but not for the nested ones.
|
||||
;; Hence `+snippets--expanding-p'.
|
||||
(add-hook! 'yas-after-exit-snippet-hook
|
||||
(defun +snippets--restore-smartparens-after-expand-h ()
|
||||
(setq +snippets--expanding-p nil)
|
||||
(when +snippets--smartparens-enabled-p
|
||||
(smartparens-mode 1)))))
|
||||
|
||||
;; If in a daemon session, front-load this expensive work:
|
||||
(if (daemonp) (yas-reload-all)))
|
||||
|
||||
|
||||
(use-package! auto-yasnippet
|
||||
:defer t
|
||||
:init (setq aya-persist-snippets-dir (concat doom-etc-dir "auto-snippets/"))
|
||||
:config
|
||||
(setq aya-persist-snippets-dir +snippets-dir)
|
||||
(defadvice! +snippets--inhibit-yas-global-mode-a (orig-fn &rest args)
|
||||
"auto-yasnippet enables `yas-global-mode'. This is obnoxious for folks like
|
||||
us who use yas-minor-mode and enable yasnippet more selectively. This advice
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
;; -*- no-byte-compile: t; -*-
|
||||
;;; editor/snippets/packages.el
|
||||
|
||||
(package! yasnippet :pin "5b1217ab085fab4abeb1118dccb260691b446703")
|
||||
(package! yasnippet :pin "5cbdbf0d2015540c59ed8ee0fcf4788effdf75b6")
|
||||
(package! auto-yasnippet :pin "db9e0dd4335b2202cd5dac95bbbc87a1032d9bbe")
|
||||
(package! doom-snippets
|
||||
:recipe (:host github
|
||||
:repo "hlissner/doom-snippets"
|
||||
:files ("*.el" "*"))
|
||||
:pin "422f683adfbec1b01fe00524690b64dc9e702ae0")
|
||||
:pin "21b7c8d37224768091a34a6c3ede68d52d03fb18")
|
||||
|
||||
@@ -162,7 +162,7 @@ we have to clean it up ourselves."
|
||||
|
||||
|
||||
(use-package! fd-dired
|
||||
:when (executable-find doom-projectile-fd-binary)
|
||||
:when doom-projectile-fd-binary
|
||||
:defer t
|
||||
:init
|
||||
(global-set-key [remap find-dired] #'fd-dired)
|
||||
|
||||
@@ -3,10 +3,10 @@
|
||||
|
||||
(package! diredfl :pin "83567d00affce66a4e501563eddd0bd436ac48d0")
|
||||
(package! dired-git-info :pin "b47f2b0c3a6cb9b7a62a4ee2605a492e512d40a9")
|
||||
(package! diff-hl :pin "a625033fb1dde83f6e4c2fc21f632b22ec34b609")
|
||||
(package! diff-hl :pin "2281a89a3ddc6616073da6f190dda08d23b18ba6")
|
||||
(package! dired-rsync :pin "bfd5c155be1cb6b71c83e5f41116c81b6532b6d5")
|
||||
(when (featurep! +ranger)
|
||||
(package! ranger :pin "ae9b3816a6da927cca5beb62c45400103797a2da"))
|
||||
(package! ranger :pin "d7c18370981c9e585bc0fb78f7e55033457ca643"))
|
||||
(when (featurep! +icons)
|
||||
(package! all-the-icons-dired :pin "fc2dfa1e9eb8bf1c402a675e7089638d702a27a5"))
|
||||
(package! fd-dired :pin "001cc95effdd5c4d9974b3f2c40b2ddf1f0e3de2")
|
||||
(package! fd-dired :pin "5622041068d5fa2f299dbc8aa91fece0ba260086")
|
||||
|
||||
@@ -38,7 +38,7 @@ via IMAP) and ~mu~ (to index my mail into a format ~mu4e~ can understand).
|
||||
+ ~+gmail~ Enables gmail-specific configuration.
|
||||
|
||||
** Plugins
|
||||
This module install no plugins.
|
||||
+ [[https://github.com/jeremy-compostella/org-msg][org-msg]]
|
||||
|
||||
* Prerequisites
|
||||
This module requires:
|
||||
|
||||
@@ -7,9 +7,6 @@
|
||||
;;
|
||||
;;; Packages
|
||||
|
||||
(add-to-list 'auto-mode-alist '("\\.\\(?:offlineimap\\|mbsync\\)rc\\'" . conf-mode))
|
||||
|
||||
|
||||
(use-package! mu4e
|
||||
:commands mu4e mu4e-compose-new
|
||||
:init
|
||||
@@ -108,16 +105,13 @@
|
||||
:desc "attach" "a" #'mail-add-attachment))
|
||||
|
||||
|
||||
(use-package! org-mu4e
|
||||
:hook (mu4e-compose-mode . org-mu4e-compose-org-mode)
|
||||
(use-package! org-msg
|
||||
:hook (org-load . org-msg-mode)
|
||||
:config
|
||||
(setq org-mu4e-convert-to-html t)
|
||||
(when (version< mu4e-mu-version "1.4")
|
||||
(setq org-mu4e-link-query-in-headers-mode nil))
|
||||
(setq org-msg-startup "inlineimages"
|
||||
org-msg-greeting-name-limit 3
|
||||
org-msg-text-plain-alternative t))
|
||||
|
||||
;; Only render to html once. If the first send fails for whatever reason,
|
||||
;; org-mu4e would do so each time you try again.
|
||||
(setq-hook! 'message-send-hook org-mu4e-convert-to-html nil))
|
||||
|
||||
|
||||
;;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
;; -*- no-byte-compile: t; -*-
|
||||
;;; email/mu4e/packages.el
|
||||
|
||||
(package! org-msg :pin "2db6725c4a4f4342a9c61895b7c3c82795b01fee")
|
||||
|
||||
@@ -19,7 +19,9 @@
|
||||
(use-package! fcitx
|
||||
:after evil
|
||||
:config
|
||||
(when (executable-find "fcitx-remote")
|
||||
(when (setq fcitx-remote-command
|
||||
(or (executable-find "fcitx5-remote")
|
||||
(executable-find "fcitx-remote")))
|
||||
(fcitx-evil-turn-on)))
|
||||
|
||||
|
||||
@@ -38,14 +40,9 @@ when exporting org-mode to html."
|
||||
:filter-args #'org-html-paragraph
|
||||
(cl-destructuring-bind (paragraph contents info) args
|
||||
(let* ((fix-regexp "[[:multibyte:]]")
|
||||
(origin-contents
|
||||
(replace-regexp-in-string
|
||||
"<[Bb][Rr] */>"
|
||||
""
|
||||
contents))
|
||||
(fixed-contents
|
||||
(replace-regexp-in-string
|
||||
(concat "\\(" fix-regexp "\\) *\n *\\(" fix-regexp "\\)")
|
||||
"\\1\\2"
|
||||
origin-contents)))
|
||||
contents)))
|
||||
(list paragraph fixed-contents info))))
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
;; -*- no-byte-compile: t; -*-
|
||||
;;; input/chinese/packages.el
|
||||
|
||||
(package! pyim :pin "b934273bb33d6be6aea6e20e68930bc5aaf4a48a")
|
||||
(package! pyim :pin "e54153f462dd8cd8e9bb379e0483a2849ec94f42")
|
||||
(package! fcitx :pin "12dc2638ddd15c8f6cfaecb20e1f428ab2bb5624")
|
||||
(package! ace-pinyin :pin "8b2e9335b02486730ea4ceee790130cc5328f9ea")
|
||||
(package! pangu-spacing :pin "f92898949ba3bf991fd229416f3bbb54e9c6c223")
|
||||
|
||||
@@ -47,14 +47,9 @@ when exporting org-mode to html."
|
||||
:filter-args #'org-html-paragraph
|
||||
(cl-destructuring-bind (paragraph contents info) args
|
||||
(let* ((fix-regexp "[[:multibyte:]]")
|
||||
(origin-contents
|
||||
(replace-regexp-in-string
|
||||
"<[Bb][Rr] */>"
|
||||
""
|
||||
contents))
|
||||
(fixed-contents
|
||||
(replace-regexp-in-string
|
||||
(concat "\\(" fix-regexp "\\) *\n *\\(" fix-regexp "\\)")
|
||||
"\\1\\2"
|
||||
origin-contents)))
|
||||
contents)))
|
||||
(list paragraph fixed-contents info))))
|
||||
|
||||
@@ -3,5 +3,5 @@
|
||||
|
||||
(package! migemo :pin "f42832c8ac462ecbec9a16eb781194f876fba64a")
|
||||
(package! avy-migemo :pin "922a6dd82c0bfa316b0fbb56a9d4dd4ffa5707e7")
|
||||
(package! ddskk :pin "11d91b4cce988e15d7c5fc4345535c9d7a92d53b")
|
||||
(package! ddskk :pin "fe7f82ba568dc653431bf824a764993aa86a7aa3")
|
||||
(package! pangu-spacing :pin "f92898949ba3bf991fd229416f3bbb54e9c6c223")
|
||||
|
||||
@@ -6,11 +6,11 @@
|
||||
:recipe (:host github :repo "agda/agda"
|
||||
:files ("src/data/emacs-mode/agda-input.el")
|
||||
:nonrecursive t)
|
||||
:pin "ff9173e14e")
|
||||
:pin "8eb0d01811a663cf2b27b482b3b18690adfa094b")
|
||||
|
||||
(package! agda2-mode
|
||||
:recipe (:host github :repo "agda/agda"
|
||||
:files ("src/data/emacs-mode/*.el"
|
||||
(:exclude "agda-input.el"))
|
||||
:nonrecursive t)
|
||||
:pin "ff9173e14e"))
|
||||
:pin "8eb0d01811a663cf2b27b482b3b18690adfa094b"))
|
||||
|
||||
@@ -230,28 +230,26 @@ If rtags or rdm aren't available, fail silently instead of throwing a breaking e
|
||||
(add-hook! '(c-mode-local-vars-hook
|
||||
c++-mode-local-vars-hook
|
||||
objc-mode-local-vars-hook)
|
||||
(defun +cc-init-lsp-h ()
|
||||
(setq-local company-transformers nil)
|
||||
(setq-local company-lsp-async t)
|
||||
(setq-local company-lsp-cache-candidates nil)
|
||||
(lsp!))))
|
||||
#'lsp!)
|
||||
|
||||
(when (featurep! :tools lsp +eglot)
|
||||
;; Map eglot specific helper
|
||||
(map! :localleader
|
||||
:after cc-mode
|
||||
:map c++-mode-map
|
||||
:n :desc "Show type inheritance hierarchy" "ct" #'+cc/eglot-ccls-inheritance-hierarchy)
|
||||
|
||||
;; NOTE : This setting is untested yet
|
||||
(after! eglot
|
||||
;; IS-MAC custom configuration
|
||||
(when IS-MAC
|
||||
(add-to-list 'eglot-workspace-configuration
|
||||
`((:ccls . ((:clang . ,(list :extraArgs ["-isystem/Library/Developer/CommandLineTools/usr/include/c++/v1"
|
||||
"-isystem/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include"
|
||||
"-isystem/usr/local/include"]
|
||||
:resourceDir (string-trim (shell-command-to-string "clang -print-resource-dir"))))))))))))
|
||||
|
||||
(when (and (featurep! +lsp) (featurep! :tools lsp +eglot))
|
||||
;; Map eglot specific helper
|
||||
(map! :localleader
|
||||
:after cc-mode
|
||||
:map c++-mode-map
|
||||
:n :desc "Show type inheritance hierarchy" "ct" #'+cc/eglot-ccls-inheritance-hierarchy)
|
||||
|
||||
;; NOTE : This setting is untested yet
|
||||
(after! eglot
|
||||
;; IS-MAC custom configuration
|
||||
(when IS-MAC
|
||||
(add-to-list 'eglot-workspace-configuration
|
||||
`((:ccls . ((:clang . ,(list :extraArgs ["-isystem/Library/Developer/CommandLineTools/usr/include/c++/v1"
|
||||
"-isystem/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include"
|
||||
"-isystem/usr/local/include"]
|
||||
:resourceDir (string-trim (shell-command-to-string "clang -print-resource-dir")))))))))))
|
||||
|
||||
(use-package! ccls
|
||||
:when (and (featurep! +lsp) (not (featurep! :tools lsp +eglot)))
|
||||
|
||||
@@ -3,31 +3,31 @@
|
||||
|
||||
(package! cmake-mode
|
||||
:recipe (:host github :repo "emacsmirror/cmake-mode" :files (:defaults "*"))
|
||||
:pin "bfe85bc009")
|
||||
(package! cuda-mode :pin "9ae9eacfdb")
|
||||
(package! demangle-mode :pin "06903d731d")
|
||||
(package! disaster :pin "10a785facc")
|
||||
(package! modern-cpp-font-lock :pin "02f104701b")
|
||||
(package! opencl-mode :pin "55cb49c824")
|
||||
:pin "bfe85bc009c4778b44e246d5c27d0f888f0bfc0c")
|
||||
(package! cuda-mode :pin "9ae9eacfdba3559b5456342d0d03296290df8ff5")
|
||||
(package! demangle-mode :pin "697c1dbde93f164eac7ea0dc530d7e8b799272d6")
|
||||
(package! disaster :pin "10a785facc60d89d78e0d5177985ab1af1741bb4")
|
||||
(package! modern-cpp-font-lock :pin "865955d0035382a17a7f03add0d00d0bd812b103")
|
||||
(package! opencl-mode :pin "55cb49c8243e6420961d719faced035bc547c1ef")
|
||||
|
||||
(when (package! glsl-mode :pin "43d906688a")
|
||||
(when (package! glsl-mode :pin "b07112016436d9634cd4ef747f9af6b01366d136")
|
||||
(when (featurep! :completion company)
|
||||
(package! company-glsl
|
||||
:recipe (:host github :repo "Kaali/company-glsl")
|
||||
:pin "404cd0694a")))
|
||||
:pin "404cd0694ab34971f9c01eb22126cd2e7d3f9dc4")))
|
||||
|
||||
(if (featurep! +lsp)
|
||||
(unless (featurep! :tools lsp +eglot)
|
||||
;; ccls package is necessary only for lsp-mode.
|
||||
(package! ccls :pin "17ec7bb4cf"))
|
||||
(when (package! irony :pin "5f75fc0c92")
|
||||
(package! irony-eldoc :pin "0df5831eaa")
|
||||
(package! ccls :pin "b8e2f4d9b5bed5b5e8b387ac8e43eff723120b80"))
|
||||
(when (package! irony :pin "5f75fc0c9274f4622470e2324e2f4457087aa643")
|
||||
(package! irony-eldoc :pin "73e79a89fad982a2ba072f2fcc1b4e41f0aa2978")
|
||||
(when (featurep! :checkers syntax)
|
||||
(package! flycheck-irony :pin "42dbecd4a8"))
|
||||
(package! flycheck-irony :pin "42dbecd4a865cabeb301193bb4d660e26ae3befe"))
|
||||
(when (featurep! :completion company)
|
||||
(package! company-irony :pin "b44711dfce")
|
||||
(package! company-irony-c-headers :pin "72c386aeb0")))
|
||||
(when (package! rtags :pin "d370c09007")
|
||||
(package! company-irony :pin "b44711dfce445610c1ffaec4951c6ff3882b216a")
|
||||
(package! company-irony-c-headers :pin "72c386aeb079fb261d9ec02e39211272f76bbd97")))
|
||||
(when (package! rtags :pin "080cb0e6b025b5d3d40fe9f7aecc791c0ea53f36")
|
||||
(when (featurep! :completion ivy)
|
||||
(package! ivy-rtags))
|
||||
(when (featurep! :completion helm)
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
|
||||
(setq nrepl-hide-special-buffers t
|
||||
nrepl-log-messages nil
|
||||
cider-font-lock-dynamically '(macro core function var)
|
||||
cider-font-lock-dynamically '(macro core function var deprecated)
|
||||
cider-overlays-use-font-lock t
|
||||
cider-prompt-for-symbol nil
|
||||
cider-repl-history-display-duplicates nil
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
;;; lang/clojure/packages.el
|
||||
|
||||
(package! clojure-mode :pin "da9f1ec717dac1194404b4a4562dba6bd9a4ee3a")
|
||||
(package! cider :pin "2c8f510a5ae0e6c1bdb96195e04629f4791dea79")
|
||||
(package! clj-refactor :pin "8259791e054382457b87d1f78061b5e3ce948907")
|
||||
(package! cider :pin "9e117c2ff34b7a63eee87c8bfa93a800bb94add5")
|
||||
(package! clj-refactor :pin "97095682580bbc5bfebcbc5349f03f5bd7121c96")
|
||||
|
||||
(when (featurep! :checkers syntax)
|
||||
(package! flycheck-clj-kondo :pin "5472c26ffdf754a0661357564874ffd4f8598805"))
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
|
||||
(use-package! sly
|
||||
:defer t
|
||||
:hook (lisp-mode-local-vars . sly-editing-mode)
|
||||
:init
|
||||
(after! lisp-mode
|
||||
(set-repl-handler! 'lisp-mode #'sly-mrepl)
|
||||
@@ -89,7 +89,7 @@
|
||||
(:localleader
|
||||
:map lisp-mode-map
|
||||
:desc "Sly" "'" #'sly
|
||||
:desc "Sly (ask)" ";" (λ!! #'sly '-)
|
||||
:desc "Sly (ask)" ";" (cmd!! #'sly '-)
|
||||
:desc "Expand macro" "m" #'macrostep-expand
|
||||
(:prefix ("c" . "compile")
|
||||
:desc "Compile file" "c" #'sly-compile-file
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
;; -*- no-byte-compile: t; -*-
|
||||
;;; lang/common-lisp/packages.el
|
||||
|
||||
(package! sly :pin "1382bda945")
|
||||
(package! sly-macrostep :pin "5113e4e926")
|
||||
(package! sly-repl-ansi-color :pin "b9cd52d1cf")
|
||||
(package! sly :pin "becf7b72ec6ef1a8165ec796425e143282838a66")
|
||||
(package! sly-macrostep :pin "5113e4e926cd752b1d0bcc1508b3ebad5def5fad")
|
||||
(package! sly-repl-ansi-color :pin "b9cd52d1cf927bf7e08582d46ab0bcf1d4fb5048")
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
;; -*- no-byte-compile: t; -*-
|
||||
;;; lang/coq/packages.el
|
||||
|
||||
(package! proof-general :pin "9196749d55")
|
||||
(package! company-coq :pin "f9dba9ddff")
|
||||
(package! proof-general :pin "0f0bb2c00fb7b20fd187cb92d4d2c3f84c4c5987")
|
||||
(package! company-coq :pin "7ec80586fa23e2d8caa3f26ad223c803df8abb0f")
|
||||
|
||||
@@ -3,11 +3,7 @@
|
||||
(after! crystal-mode
|
||||
(set-lookup-handlers! 'crystal-mode
|
||||
:definition #'crystal-def-jump
|
||||
:references #'crystal-tool-imp)
|
||||
(set-eval-handler! 'crystal-mode
|
||||
'((:command . "crystal")
|
||||
(:exec . "%c %s")
|
||||
(:description . "Run Crystal script"))))
|
||||
:references #'crystal-tool-imp))
|
||||
|
||||
|
||||
(use-package! flycheck-crystal
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
;; -*- no-byte-compile: t; -*-
|
||||
;;; lang/crystal/packages.el
|
||||
|
||||
(package! crystal-mode :pin "2428b01624")
|
||||
(package! inf-crystal :pin "02007b2a2a")
|
||||
(package! crystal-mode :pin "f9e4db16ff9fdc6a296363aa35d19cfb4926e472")
|
||||
(package! inf-crystal :pin "02007b2a2a3bea44902d7c83c4acba1e39d278e3")
|
||||
(when (featurep! :checkers syntax)
|
||||
(package! flycheck-crystal :pin "2428b01624")
|
||||
(package! flycheck-ameba :pin "0c4925ae0e"))
|
||||
(package! flycheck-crystal :pin "f9e4db16ff9fdc6a296363aa35d19cfb4926e472")
|
||||
(package! flycheck-ameba :pin "0c4925ae0e998818326adcb47ed27ddf9761c7dc"))
|
||||
|
||||
@@ -20,6 +20,7 @@ LSP).
|
||||
|
||||
** Plugins
|
||||
+ [[https://github.com/josteink/csharp-mode][csharp-mode]]
|
||||
+ [[https://github.com/omajid/csproj-mode][csproj-mode]]
|
||||
+ [[https://github.com/OmniSharp/omnisharp-emacs][omnisharp]]* (not =+lsp=)
|
||||
+ [[https://github.com/midnightSuyama/shader-mode][shader-mode]]* (=+unity=)
|
||||
|
||||
|
||||
@@ -13,7 +13,15 @@
|
||||
:post-handlers '(("| " "SPC")))
|
||||
|
||||
(when (featurep! +lsp)
|
||||
(add-hook 'csharp-mode-local-vars-hook #'lsp!)))
|
||||
(add-hook 'csharp-mode-local-vars-hook #'lsp!))
|
||||
|
||||
(defadvice! +csharp-disable-clear-string-fences-a (orig-fn &rest args)
|
||||
"This turns off `c-clear-string-fences' for `csharp-mode'. When
|
||||
on for `csharp-mode' font lock breaks after an interpolated string
|
||||
or terminating simple string."
|
||||
:around #'csharp-disable-clear-string-fences
|
||||
(unless (eq major-mode 'csharp-mode)
|
||||
(apply orig-fn args))))
|
||||
|
||||
|
||||
(use-package! omnisharp
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
;; -*- no-byte-compile: t; -*-
|
||||
;;; lang/csharp/packages.el
|
||||
|
||||
(package! csharp-mode :pin "57bd21bda4")
|
||||
(package! csharp-mode :pin "48851778e0f01a2b0395e054e418a1d8a1687a06")
|
||||
(package! csproj-mode :pin "a7f0f4610c976a28c41b9b8299892f88b5d0336c")
|
||||
(unless (featurep! +lsp)
|
||||
(package! omnisharp :pin "e658a18a76"))
|
||||
(package! omnisharp :pin "e658a18a762438c3e1737612737b05d02a21ca2a"))
|
||||
(when (featurep! +unity)
|
||||
(package! shader-mode :pin "d7dc8d0d6f"))
|
||||
(package! shader-mode :pin "d7dc8d0d6fe8914e8b6d5cf2081ad61e6952359c"))
|
||||
|
||||
@@ -37,7 +37,12 @@
|
||||
(sp-local-pair "fn " " end" :unless '(sp-in-comment-p sp-in-string-p)))
|
||||
|
||||
(when (featurep! +lsp)
|
||||
(add-hook 'elixir-mode-local-vars-hook #'lsp!)))
|
||||
(add-hook 'elixir-mode-local-vars-hook #'lsp!))
|
||||
|
||||
(after! highlight-numbers
|
||||
(puthash 'elixir-mode
|
||||
"\\_<-?[[:digit:]]+\\(?:_[[:digit:]]\\{3\\}\\)*\\_>"
|
||||
highlight-numbers-modelist)))
|
||||
|
||||
|
||||
(use-package! flycheck-credo
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
;;; lang/elixir/packages.el
|
||||
|
||||
;; +elixir.el
|
||||
(package! elixir-mode :pin "231291ecad")
|
||||
(package! alchemist :pin "6f99367511")
|
||||
(package! elixir-mode :pin "02a3922711b7dc6a25895df6d2bf00360fda45cc")
|
||||
(package! alchemist :pin "6f99367511ae209f8fe2c990779764bbb4ccb6ed")
|
||||
(when (featurep! :checkers syntax)
|
||||
(package! flycheck-credo :pin "e88f11ead5"))
|
||||
(package! flycheck-credo :pin "e88f11ead53805c361ec7706e44c3dfee1daa19f"))
|
||||
|
||||
@@ -219,11 +219,10 @@ https://emacs.stackexchange.com/questions/10230/how-to-indent-keywords-aligned"
|
||||
verbosity when editing a file in `doom-private-dir' or `doom-emacs-dir'."
|
||||
(when (and (bound-and-true-p flycheck-mode)
|
||||
(eq major-mode 'emacs-lisp-mode)
|
||||
(or (not buffer-file-name)
|
||||
(cl-find-if (doom-partial #'file-in-directory-p buffer-file-name)
|
||||
(or (not default-directory)
|
||||
(cl-find-if (doom-partial #'file-in-directory-p default-directory)
|
||||
+emacs-lisp-disable-flycheck-in-dirs)))
|
||||
(add-to-list (make-local-variable 'flycheck-disabled-checkers)
|
||||
'emacs-lisp-checkdoc)
|
||||
(add-to-list 'flycheck-disabled-checkers 'emacs-lisp-checkdoc)
|
||||
(set (make-local-variable 'flycheck-emacs-lisp-check-form)
|
||||
(concat "(progn "
|
||||
(prin1-to-string
|
||||
@@ -251,7 +250,7 @@ verbosity when editing a file in `doom-private-dir' or `doom-emacs-dir'."
|
||||
(goto-char (match-beginning 0))
|
||||
(and (stringp (plist-get (sexp-at-point) :pin))
|
||||
(search-forward ":pin" nil t)
|
||||
(let ((start (re-search-forward "\"[^\"]\\{10\\}" nil t))
|
||||
(let ((start (re-search-forward "\"[^\"\n]\\{10\\}" nil t))
|
||||
(finish (and (re-search-forward "\"" (line-end-position) t)
|
||||
(match-beginning 0))))
|
||||
(when (and start finish)
|
||||
|
||||
@@ -46,7 +46,11 @@ employed so that flycheck still does *some* helpful linting.")
|
||||
("describe" "xdescribe")))
|
||||
|
||||
(setq-hook! 'emacs-lisp-mode-hook
|
||||
tab-width (or lisp-indent-offset 2)
|
||||
;; Emacs' built-in elisp files use a hybrid tab->space indentation scheme
|
||||
;; with a tab width of 8. Any smaller and the indentation will be
|
||||
;; unreadable. Since Emacs' lisp indenter doesn't respect this variable it's
|
||||
;; safe to ignore this setting otherwise.
|
||||
tab-width 8
|
||||
;; shorter name in modeline
|
||||
mode-name "Elisp"
|
||||
;; Don't treat autoloads or sexp openers as outline headers, we have
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
;; -*- no-byte-compile: t; -*-
|
||||
;;; lang/ess/packages.el
|
||||
|
||||
(package! ess :pin "625041ad51")
|
||||
(package! ess-R-data-view :pin "d6e98d3ae1")
|
||||
(package! polymode :pin "44265e3516")
|
||||
(package! poly-R :pin "51ffeb6ec4")
|
||||
(package! ess :pin "964bf64d8bb3c6dd710cd8f2259921099a50456a")
|
||||
(package! ess-R-data-view :pin "d6e98d3ae1e2a2ea39a56eebcdb73e99d29562e9")
|
||||
(package! polymode :pin "3284ff10017d280ba82f27dc20fe5223b0df709c")
|
||||
(package! poly-R :pin "51ffeb6ec45dd44eafa4d22ad2d6150cc4b248fc")
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
;; -*- no-byte-compile: t; -*-
|
||||
;;; lang/java/packages.el
|
||||
|
||||
(package! android-mode :pin "d5332e339a")
|
||||
(package! groovy-mode :pin "cafdd98e06")
|
||||
(package! android-mode :pin "d5332e339a1f5e30559a53feffb8442ca79265d6")
|
||||
(package! groovy-mode :pin "cafdd98e06a3bbff213f3ccb163de2c42d412b66")
|
||||
|
||||
(when (featurep! +meghanada)
|
||||
(package! meghanada :pin "70bfbf553c"))
|
||||
(package! meghanada :pin "e119c7b3271281d60892b80a0cc6488503baf38f"))
|
||||
|
||||
(when (featurep! +eclim)
|
||||
(package! eclim :pin "23f5b294f8")
|
||||
(package! eclim :pin "222ddd48fcf0ee01592dec77c58e0cf3f2ea1100")
|
||||
(when (featurep! :completion company)
|
||||
(package! company-emacs-eclim :pin "23f5b294f8")))
|
||||
(package! company-emacs-eclim :pin "222ddd48fcf0ee01592dec77c58e0cf3f2ea1100")))
|
||||
|
||||
(when (featurep! +lsp)
|
||||
(package! lsp-java :pin "6efb741845"))
|
||||
(package! lsp-java :pin "811760ad89a29939c28f47d0925f58d9eeea9fa3"))
|
||||
|
||||
@@ -6,11 +6,7 @@
|
||||
(setq ledger-clear-whole-transactions 1
|
||||
ledger-mode-should-check-version nil)
|
||||
|
||||
:config
|
||||
(setq ledger-binary-path
|
||||
(if (executable-find "hledger")
|
||||
"hledger"
|
||||
"ledger"))
|
||||
(set-company-backend! 'ledger-mode 'company-capf)
|
||||
|
||||
(defadvice! +ledger--check-version-a (orig-fn)
|
||||
"Fail gracefully if ledger binary isn't available."
|
||||
|
||||
@@ -24,20 +24,27 @@ lua-language-server.")
|
||||
(set-repl-handler! 'lua-mode #'+lua/open-repl)
|
||||
(set-company-backend! 'lua-mode '(company-lua company-yasnippet))
|
||||
|
||||
(set-eglot-client!
|
||||
'lua-mode
|
||||
;; The absolute path to lua-language-server binary is necessary because the
|
||||
;; bundled dependencies aren't found otherwise. The only reason this is a
|
||||
;; function is to dynamically change when/if lua-lsp-dir variable changed
|
||||
(list (doom-path lua-lsp-dir
|
||||
(cond (IS-MAC "bin/macOS")
|
||||
(IS-LINUX "bin/Linux")
|
||||
(IS-WINDOWS "bin/Windows"))
|
||||
"lua-language-server")
|
||||
"-E" "-e" "LANG=en"
|
||||
(doom-path lua-lsp-dir "main.lua")))
|
||||
|
||||
(when (featurep! +lsp)
|
||||
(defun +lua-generate-lsp-server-command ()
|
||||
;; The absolute path to lua-language-server binary is necessary because
|
||||
;; the bundled dependencies aren't found otherwise. The only reason this
|
||||
;; is a function is to dynamically change when/if `+lua-lsp-dir' does
|
||||
(list (doom-path +lua-lsp-dir
|
||||
(cond (IS-MAC "bin/macOS")
|
||||
(IS-LINUX "bin/Linux")
|
||||
(IS-WINDOWS "bin/Windows"))
|
||||
"lua-language-server")
|
||||
"-E" "-e" "LANG=en"
|
||||
(doom-path +lua-lsp-dir "main.lua")))
|
||||
|
||||
(if (featurep! :tools lsp +eglot)
|
||||
(set-eglot-client! 'lua-mode (+lua-generate-lsp-server-command))
|
||||
(after! lsp-mode
|
||||
(lsp-register-client
|
||||
(make-lsp-client :new-connection (lsp-stdio-connection '+lua-generate-lsp-server-command)
|
||||
:major-modes '(lua-mode)
|
||||
:priority -1
|
||||
:server-id 'lua-langserver))))
|
||||
(add-hook 'lua-mode-local-vars-hook #'lsp!)))
|
||||
|
||||
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
;; -*- no-byte-compile: t; -*-
|
||||
;;; lang/lua/packages.el
|
||||
|
||||
(package! lua-mode :pin "1f596a93b3")
|
||||
(package! lua-mode :pin "35b6e4c20b8b4eaf783ccc8e613d0dd06dbd165c")
|
||||
|
||||
(when (featurep! +moonscript)
|
||||
(package! moonscript :pin "56f90471e2")
|
||||
(package! moonscript :pin "56f90471e2ced2b0a177aed4d8c2f854797e9cc7")
|
||||
(when (featurep! :checkers syntax)
|
||||
(package! flycheck-moonscript
|
||||
:recipe (:host github :repo "hlissner/emacs-flycheck-moonscript") :pin "fcb99e5efc")))
|
||||
:recipe (:host github :repo "hlissner/emacs-flycheck-moonscript")
|
||||
:pin "fcb99e5efcf31db05f236f02eaa575986a57172d")))
|
||||
|
||||
(when (featurep! :completion company)
|
||||
(package! company-lua :pin "29f6819de4"))
|
||||
(package! company-lua :pin "29f6819de4d691e5fd0b62893a9f4fbc1c6fcb52"))
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
;; -*- no-byte-compile: t; -*-
|
||||
;;; lang/markdown/packages.el
|
||||
|
||||
(package! markdown-mode :pin "770e3aa7cdfc9d731119b9425e8a7c8ac6dd5f93")
|
||||
(package! markdown-mode :pin "fa9fa20e3236006c2cf278209356f60cc4175120")
|
||||
(package! markdown-toc :pin "9565eeaa1d26bc0ab83eb65bd30470888f724044")
|
||||
(package! edit-indirect :pin "935ded353b9ed3da67bc61abf245c21b58d88864")
|
||||
|
||||
(when (featurep! +grip)
|
||||
(package! grip-mode :pin "9615c4774727a719d38313a679d70f2a2c6aca68"))
|
||||
(package! grip-mode :pin "52768a0187f8ce9b42010dc45bbc432551aeccee"))
|
||||
|
||||
(when (featurep! :editor evil +everywhere)
|
||||
(package! evil-markdown
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
;; -*- no-byte-compile: t; -*-
|
||||
;;; lang/nix/packages.el
|
||||
|
||||
(package! nix-mode :pin "5b5961780f3b1c1b62453d2087f775298980f10d")
|
||||
(package! nix-mode :pin "a00b3f776de65b5af7571976a73213ca2a5c683e")
|
||||
(package! nix-update :pin "fc6c39c2da3fcfa62f4796816c084a6389c8b6e7")
|
||||
|
||||
(when (featurep! :completion company)
|
||||
|
||||
@@ -1,25 +1,24 @@
|
||||
;; -*- no-byte-compile: t; -*-
|
||||
;;; lang/ocaml/packages.el
|
||||
|
||||
(package! tuareg :pin "c12061eb80")
|
||||
(package! tuareg :pin "ccde45bbc292123ec20617f1af7f7e19f7481545")
|
||||
|
||||
(unless (featurep! +lsp)
|
||||
(package! merlin :pin "37e38e44f5")
|
||||
(package! merlin-eldoc :pin "db7fab1edd")
|
||||
(package! merlin :pin "3751cbfff75022c396c4ff4dc1729048f80daa4f")
|
||||
(package! merlin-eldoc :pin "db7fab1eddfe34781b7e79694f8923b285698032")
|
||||
(when (featurep! :checkers syntax)
|
||||
(package! flycheck-ocaml :pin "8707a7bf54")))
|
||||
(package! flycheck-ocaml :pin "8707a7bf545a8639a6a5c600a98d9a2ea1487dc9")))
|
||||
|
||||
(package! ocp-indent :pin "9e26c0a269")
|
||||
(package! ocp-indent :pin "9e26c0a2699b7076cebc04ece59fb354eb84c11c")
|
||||
|
||||
(when (featurep! :tools eval)
|
||||
(package! utop :pin "30c77ce4d7"))
|
||||
(package! utop :pin "7bc5117d3449fc19f5c706a6decfdb2a30984507"))
|
||||
|
||||
(when (featurep! :editor format)
|
||||
;; by default quelpa generated a version 0pre0.20180929.192844, which got
|
||||
;; parsed into (0 -1 0 ...), which when compared with version nil (0) in
|
||||
;; package-installed-p always yielded false
|
||||
(package! ocamlformat :recipe
|
||||
(:host github :repo "ocaml-ppx/ocamlformat" :files ("emacs/*.el")) :pin "5282e047bb"))
|
||||
(package! ocamlformat
|
||||
:recipe (:host github :repo "ocaml-ppx/ocamlformat" :files ("emacs/*.el"))
|
||||
:pin "27a49cc289dc99cfbe32e90aafc8d9e3cb32a059"))
|
||||
|
||||
(package! dune :recipe
|
||||
(:host github :repo "ocaml/dune" :files ("editor-integration/emacs/*.el")) :pin "1944d0fb52")
|
||||
(package! dune
|
||||
:recipe (:host github :repo "ocaml/dune" :files ("editor-integration/emacs/*.el"))
|
||||
:pin "66cfb3a2fb5a507f8c58e0ca516bfa20ca14d544")
|
||||
|
||||
@@ -70,12 +70,15 @@ https://www.mfoot.com/blog/2015/11/22/literate-emacs-configuration-with-org-mode
|
||||
+ =+pomodoro= Enables a pomodoro timer for clocking time on tasks.
|
||||
+ =+present= Enables integration with reveal.js, beamer and org-tree-slide, so
|
||||
Emacs can be used for presentations.
|
||||
+ =+roam= Enables org-roam integration.
|
||||
+ =+pretty= Enables pretty unicode symbols for bullets and priorities, and
|
||||
better syntax highlighting for latex. Keep in mind: this can be expensive. If
|
||||
org becomes too slow, it'd be wise to disable this flag.
|
||||
+ =+roam= Enables org-roam integration. This requires ~sqlite3~ to be installed
|
||||
on your system.
|
||||
|
||||
** Plugins
|
||||
+ [[https://github.com/hniksic/emacs-htmlize][htmlize]]
|
||||
+ [[https://github.com/astahlman/ob-async][ob-async]]
|
||||
+ [[https://github.com/integral-dw/org-superstar-mode][org-superstar]]
|
||||
+ [[https://github.com/rexim/org-cliplink][org-cliplink]]
|
||||
+ [[https://github.com/magit/orgit][orgit]]
|
||||
+ [[https://orgmode.org/][org-plus-contrib]]
|
||||
@@ -121,6 +124,9 @@ https://www.mfoot.com/blog/2015/11/22/literate-emacs-configuration-with-org-mode
|
||||
+ [[https://github.com/anler/centered-window-mode][centered-window]]
|
||||
+ [[https://github.com/takaxp/org-tree-slide][org-tree-slide]]
|
||||
+ [[https://gitlab.com/oer/org-re-reveal][org-re-reveal]]
|
||||
+ =+pretty=
|
||||
+ [[https://github.com/integral-dw/org-superstar-mode][org-superstar]]
|
||||
+ [[https://github.com/harrybournis/org-fancy-priorities][org-fancy-priorities]]
|
||||
+ =+roam=
|
||||
+ [[https://github.com/org-roam/org-roam][org-roam]]
|
||||
+ [[https://github.com/org-roam/company-org-roam][company-org-roam]]
|
||||
@@ -162,12 +168,13 @@ https://www.mfoot.com/blog/2015/11/22/literate-emacs-configuration-with-org-mode
|
||||
Org has a few soft dependencies that you will need to make use of Org's more
|
||||
esoteric features:
|
||||
|
||||
+ For inline LaTeX previews, you need ~latex~ and ~dvipng~.
|
||||
+ For rendering GNUPlot images (with =+gnuplot= flag) you need the ~gnuplot~
|
||||
program installed.
|
||||
+ To run babel code blocks, you need whatever dependencies those languages need.
|
||||
It is recommended you enable the associated =:lang= module and ensure its
|
||||
dependencies are met, e.g. install the =ruby= executable for ruby support.
|
||||
+ For inline LaTeX previews, ~latex~ and ~dvipng~ is needed.
|
||||
+ To render GNUPlot images (with =+gnuplot= flag) the ~gnuplot~ program is
|
||||
needed.
|
||||
+ To execute babel code blocks, you need whatever dependencies those languages
|
||||
need. It is recommended you enable the associated =:lang= module and ensure
|
||||
its dependencies are met, e.g. install the =ruby= executable for ruby support.
|
||||
+ =org-roam= (with the =+roam= flag) requires =sqlite3= to be installed.
|
||||
|
||||
** MacOS
|
||||
#+BEGIN_SRC sh
|
||||
|
||||
@@ -74,8 +74,9 @@ exist, and `org-link' otherwise."
|
||||
;;;###autoload
|
||||
(defun +org-http-image-data-fn (protocol link _description)
|
||||
"Interpret LINK as an URL to an image file."
|
||||
(when (image-type-from-file-name link)
|
||||
(if-let* ((buf (url-retrieve-synchronously (concat protocol ":" link))))
|
||||
(when (and (image-type-from-file-name link)
|
||||
(not (eq org-display-remote-inline-images 'skip)))
|
||||
(if-let (buf (url-retrieve-synchronously (concat protocol ":" link)))
|
||||
(with-current-buffer buf
|
||||
(goto-char (point-min))
|
||||
(re-search-forward "\r?\n\r?\n" nil t)
|
||||
|
||||
@@ -3,82 +3,82 @@
|
||||
;;
|
||||
;;; Helpers
|
||||
|
||||
(defun +org--refresh-inline-images-in-subtree ()
|
||||
"Refresh image previews in the current heading/tree."
|
||||
(if (> (length org-inline-image-overlays) 0)
|
||||
(org-remove-inline-images)
|
||||
(org-display-inline-images
|
||||
t t
|
||||
(if (org-before-first-heading-p)
|
||||
(line-beginning-position)
|
||||
(save-excursion (org-back-to-heading) (point)))
|
||||
(if (org-before-first-heading-p)
|
||||
(line-end-position)
|
||||
(save-excursion (org-end-of-subtree) (point))))))
|
||||
(defun +org--toggle-inline-images-in-subtree (&optional beg end refresh)
|
||||
"Refresh inline image previews in the current heading/tree."
|
||||
(let ((beg (or beg
|
||||
(if (org-before-first-heading-p)
|
||||
(line-beginning-position)
|
||||
(save-excursion (org-back-to-heading) (point)))))
|
||||
(end (or end
|
||||
(if (org-before-first-heading-p)
|
||||
(line-end-position)
|
||||
(save-excursion (org-end-of-subtree) (point)))))
|
||||
(overlays (cl-remove-if-not (lambda (ov) (overlay-get ov 'org-image-overlay))
|
||||
(ignore-errors (overlays-in beg end)))))
|
||||
(dolist (ov overlays nil)
|
||||
(delete-overlay ov)
|
||||
(setq org-inline-image-overlays (delete ov org-inline-image-overlays)))
|
||||
(when (or refresh (not overlays))
|
||||
(org-display-inline-images t t beg end)
|
||||
t)))
|
||||
|
||||
(defun +org--insert-item (direction)
|
||||
(let* ((context
|
||||
(save-excursion
|
||||
(when (bolp)
|
||||
(back-to-indentation)
|
||||
(forward-char))
|
||||
(org-element-lineage
|
||||
(org-element-context)
|
||||
'(table table-row headline inlinetask item plain-list)
|
||||
t)))
|
||||
(type (org-element-type context)))
|
||||
(cond ((memq type '(item plain-list))
|
||||
(let ((marker (org-element-property :bullet context))
|
||||
(pad (save-excursion
|
||||
(org-beginning-of-item)
|
||||
(back-to-indentation)
|
||||
(- (point) (line-beginning-position)))))
|
||||
(save-match-data
|
||||
(pcase direction
|
||||
(`below
|
||||
(org-end-of-item)
|
||||
(backward-char)
|
||||
(end-of-line)
|
||||
(if (and marker (string-match "\\([0-9]+\\)\\([).] *\\)" marker))
|
||||
(let ((l (line-number-at-pos)))
|
||||
(org-insert-item)
|
||||
(when (= l (line-number-at-pos))
|
||||
(org-next-item)
|
||||
(org-end-of-line)))
|
||||
(insert "\n" (make-string pad 32) (or marker ""))))
|
||||
(`above
|
||||
(org-beginning-of-item)
|
||||
(if (and marker (string-match-p "[0-9]+[).]" marker))
|
||||
(org-insert-item)
|
||||
(insert (make-string pad 32) (or marker ""))
|
||||
(save-excursion (insert "\n")))))))
|
||||
(when (org-element-property :checkbox context)
|
||||
(insert "[ ] ")))
|
||||
(let ((context (org-element-lineage
|
||||
(org-element-context)
|
||||
'(table table-row headline inlinetask item plain-list)
|
||||
t)))
|
||||
(pcase (org-element-type context)
|
||||
;; Add a new list item (carrying over checkboxes if necessary)
|
||||
((or `item `plain-list)
|
||||
;; Position determines where org-insert-todo-heading and org-insert-item
|
||||
;; insert the new list item.
|
||||
(if (eq direction 'above)
|
||||
(org-beginning-of-item)
|
||||
(org-end-of-item)
|
||||
(backward-char))
|
||||
(org-insert-item (org-element-property :checkbox context))
|
||||
;; Handle edge case where current item is empty and bottom of list is
|
||||
;; flush against a new heading.
|
||||
(when (and (eq direction 'below)
|
||||
(eq (org-element-property :contents-begin context)
|
||||
(org-element-property :contents-end context)))
|
||||
(org-end-of-item)
|
||||
(org-end-of-line)))
|
||||
|
||||
((memq type '(table table-row))
|
||||
(pcase direction
|
||||
('below (save-excursion (org-table-insert-row t))
|
||||
(org-table-next-row))
|
||||
('above (save-excursion (org-shiftmetadown))
|
||||
(+org/table-previous-row))))
|
||||
;; Add a new table row
|
||||
((or `table `table-row)
|
||||
(pcase direction
|
||||
('below (save-excursion (org-table-insert-row t))
|
||||
(org-table-next-row))
|
||||
('above (save-excursion (org-shiftmetadown))
|
||||
(+org/table-previous-row))))
|
||||
|
||||
((let ((level (or (org-current-level) 1)))
|
||||
(pcase direction
|
||||
(`below
|
||||
(let (org-insert-heading-respect-content)
|
||||
(goto-char (line-end-position))
|
||||
(org-end-of-subtree)
|
||||
(insert "\n" (make-string level ?*) " ")))
|
||||
(`above
|
||||
(org-back-to-heading)
|
||||
(insert (make-string level ?*) " ")
|
||||
(save-excursion (insert "\n"))))
|
||||
(when-let* ((todo-keyword (org-element-property :todo-keyword context))
|
||||
(todo-type (org-element-property :todo-type context)))
|
||||
(org-todo (cond ((eq todo-type 'done)
|
||||
(car (+org-get-todo-keywords-for todo-keyword)))
|
||||
(todo-keyword)
|
||||
('todo)))))))
|
||||
;; Otherwise, add a new heading, carrying over any todo state, if
|
||||
;; necessary.
|
||||
(_
|
||||
(let ((level (or (org-current-level) 1)))
|
||||
;; I intentionally avoid `org-insert-heading' and the like because they
|
||||
;; impose unpredictable whitespace rules depending on the cursor
|
||||
;; position. It's simpler to express this command's responsibility at a
|
||||
;; lower level than work around all the quirks in org's API.
|
||||
(pcase direction
|
||||
(`below
|
||||
(let (org-insert-heading-respect-content)
|
||||
(goto-char (line-end-position))
|
||||
(org-end-of-subtree)
|
||||
(insert "\n" (make-string level ?*) " ")))
|
||||
(`above
|
||||
(org-back-to-heading)
|
||||
(insert (make-string level ?*) " ")
|
||||
(save-excursion (insert "\n"))))
|
||||
(when-let* ((todo-keyword (org-element-property :todo-keyword context))
|
||||
(todo-type (org-element-property :todo-type context)))
|
||||
(org-todo
|
||||
(cond ((eq todo-type 'done)
|
||||
;; Doesn't make sense to create more "DONE" headings
|
||||
(car (+org-get-todo-keywords-for todo-keyword)))
|
||||
(todo-keyword)
|
||||
('todo)))))))
|
||||
|
||||
(when (org-invisible-p)
|
||||
(org-show-hidden-entry))
|
||||
@@ -147,7 +147,8 @@ current file). Only scans first 2048 bytes of the document."
|
||||
If on a:
|
||||
- checkbox list item or todo heading: toggle it.
|
||||
- clock: update its time.
|
||||
- headline: toggle latex fragments and inline images underneath.
|
||||
- headline: cycle ARCHIVE subtrees, toggle latex fragments and inline images in
|
||||
subtree; update statistics cookies/checkboxes and ToCs.
|
||||
- footnote reference: jump to the footnote's definition
|
||||
- footnote definition: jump to the first reference of this footnote
|
||||
- table-row or a TBLFM: recalculate the table's formulas
|
||||
@@ -167,7 +168,8 @@ If on a:
|
||||
type (org-element-type context)))
|
||||
(pcase type
|
||||
(`headline
|
||||
(cond ((memq (bound-and-true-p org-goto-map) (current-active-maps))
|
||||
(cond ((memq (bound-and-true-p org-goto-map)
|
||||
(current-active-maps))
|
||||
(org-goto-ret))
|
||||
((and (fboundp 'toc-org-insert-toc)
|
||||
(member "TOC" (org-get-tags)))
|
||||
@@ -181,11 +183,32 @@ If on a:
|
||||
(if (eq (org-element-property :todo-type context) 'done)
|
||||
(or (car (+org-get-todo-keywords-for (org-element-property :todo-keyword context)))
|
||||
'todo)
|
||||
'done)))
|
||||
(t
|
||||
(+org--refresh-inline-images-in-subtree)
|
||||
(org-clear-latex-preview)
|
||||
(org-latex-preview '(4)))))
|
||||
'done))))
|
||||
;; Update any metadata or inline previews in this subtree
|
||||
(org-update-checkbox-count)
|
||||
(let (org-hierarchical-todo-statistics)
|
||||
(org-update-parent-todo-statistics))
|
||||
(when (and (fboundp 'toc-org-insert-toc)
|
||||
(member "TOC" (org-get-tags)))
|
||||
(toc-org-insert-toc)
|
||||
(message "Updating table of contents"))
|
||||
(let* ((beg (if (org-before-first-heading-p)
|
||||
(line-beginning-position)
|
||||
(save-excursion (org-back-to-heading) (point))))
|
||||
(end (if (org-before-first-heading-p)
|
||||
(line-end-position)
|
||||
(save-excursion (org-end-of-subtree) (point))))
|
||||
(overlays (ignore-errors (overlays-in beg end)))
|
||||
(latex-overlays
|
||||
(cl-find-if (lambda (o) (eq (overlay-get o 'org-overlay-type) 'org-latex-overlay))
|
||||
overlays))
|
||||
(image-overlays
|
||||
(cl-find-if (lambda (o) (overlay-get o 'org-image-overlay))
|
||||
overlays)))
|
||||
(+org--toggle-inline-images-in-subtree beg end)
|
||||
(if (or image-overlays latex-overlays)
|
||||
(org-clear-latex-preview beg end)
|
||||
(org--latex-preview-region beg end))))
|
||||
|
||||
(`clock (org-clock-update-time-maybe))
|
||||
|
||||
@@ -230,7 +253,9 @@ If on a:
|
||||
(path (org-element-property :path lineage)))
|
||||
(if (or (equal (org-element-property :type lineage) "img")
|
||||
(and path (image-type-from-file-name path)))
|
||||
(+org--refresh-inline-images-in-subtree)
|
||||
(+org--toggle-inline-images-in-subtree
|
||||
(org-element-property :begin lineage)
|
||||
(org-element-property :end lineage))
|
||||
(org-open-at-point arg))))
|
||||
|
||||
((guard (org-element-property :checkbox (org-element-lineage context '(item) t)))
|
||||
@@ -242,12 +267,23 @@ If on a:
|
||||
(org-in-regexp org-tsr-regexp-both nil t)
|
||||
(org-in-regexp org-link-any-re nil t))
|
||||
(call-interactively #'org-open-at-point)
|
||||
(+org--refresh-inline-images-in-subtree))))))
|
||||
(+org--toggle-inline-images-in-subtree
|
||||
(org-element-property :begin context)
|
||||
(org-element-property :end context)))))))
|
||||
|
||||
;;;###autoload
|
||||
(defun +org/shift-return (&optional arg)
|
||||
"Insert a literal newline, or dwim in tables.
|
||||
Executes `org-table-copy-down' if in table."
|
||||
(interactive "p")
|
||||
(if (org-at-table-p)
|
||||
(org-table-copy-down arg)
|
||||
(org-return nil arg)))
|
||||
|
||||
|
||||
;; I use this instead of `org-insert-item' or `org-insert-heading' which are too
|
||||
;; opinionated and perform this simple task incorrectly (e.g. whitespace in the
|
||||
;; wrong places).
|
||||
;; I use these instead of `org-insert-item' or `org-insert-heading' because they
|
||||
;; impose bizarre whitespace rules depending on cursor location and many
|
||||
;; settings. These commands have a much simpler responsibility.
|
||||
;;;###autoload
|
||||
(defun +org/insert-item-below (count)
|
||||
"Inserts a new heading, table cell or item below the current one."
|
||||
@@ -262,37 +298,24 @@ If on a:
|
||||
|
||||
|
||||
;;;###autoload
|
||||
(defun +org/dedent ()
|
||||
"TODO"
|
||||
(interactive)
|
||||
(cond ((org-at-item-p)
|
||||
(org-list-indent-item-generic
|
||||
-1 nil
|
||||
(save-excursion
|
||||
(when (org-region-active-p)
|
||||
(goto-char (region-beginning)))
|
||||
(org-list-struct))))
|
||||
((org-at-heading-p)
|
||||
(ignore-errors (org-promote)))
|
||||
((call-interactively #'self-insert-command))))
|
||||
(defun +org/toggle-last-clock (arg)
|
||||
"Toggles last clocked item.
|
||||
|
||||
;;;###autoload
|
||||
(defun +org/toggle-clock (arg)
|
||||
"Toggles clock on the last clocked item.
|
||||
Clock out if an active clock is running (or cancel it if prefix ARG is non-nil).
|
||||
|
||||
Clock out if an active clock is running. Clock in otherwise.
|
||||
|
||||
If in an org file, clock in on the item at point. Otherwise clock into the last
|
||||
task you clocked into.
|
||||
|
||||
See `org-clock-out', `org-clock-in' and `org-clock-in-last' for details on how
|
||||
the prefix ARG changes this command's behavior."
|
||||
If no clock is active, then clock into the last item. See `org-clock-in-last' to
|
||||
see how ARG affects this command."
|
||||
(interactive "P")
|
||||
(if (org-clocking-p)
|
||||
(if arg
|
||||
(org-clock-cancel)
|
||||
(org-clock-out))
|
||||
(org-clock-in-last arg)))
|
||||
(cond ((org-clocking-p)
|
||||
(if arg
|
||||
(org-clock-cancel)
|
||||
(org-clock-out)))
|
||||
((and (null org-clock-history)
|
||||
(or (org-on-heading-p)
|
||||
(org-at-item-p))
|
||||
(y-or-n-p "No active clock. Clock in on current item?"))
|
||||
(org-clock-in))
|
||||
((org-clock-in-last arg))))
|
||||
|
||||
|
||||
;;; Folds
|
||||
@@ -390,15 +413,15 @@ Made for `org-tab-first-hook' in evil-mode."
|
||||
|
||||
;;;###autoload
|
||||
(defun +org-update-cookies-h ()
|
||||
"Update counts in headlines (aka \"cookies\")."
|
||||
"Update statistics cookies/todo statistics in headlines."
|
||||
(when (and buffer-file-name (file-exists-p buffer-file-name))
|
||||
(let (org-hierarchical-todo-statistics)
|
||||
(org-update-parent-todo-statistics))))
|
||||
|
||||
;;;###autoload
|
||||
(defun +org-yas-expand-maybe-h ()
|
||||
"Tries to expand a yasnippet snippet, if one is available. Made for
|
||||
`org-tab-first-hook'."
|
||||
"Expand a yasnippet snippet, if trigger exists at point or region is active.
|
||||
Made for `org-tab-first-hook'."
|
||||
(when (bound-and-true-p yas-minor-mode)
|
||||
(and (let ((major-mode (if (org-in-src-block-p t)
|
||||
(org-src-get-lang-mode (org-eldoc-get-src-lang))
|
||||
@@ -422,8 +445,14 @@ Made for `org-tab-first-hook' in evil-mode."
|
||||
|
||||
;;;###autoload
|
||||
(defun +org-cycle-only-current-subtree-h (&optional arg)
|
||||
"Toggle the local fold at the point (as opposed to cycling through all levels
|
||||
with `org-cycle')."
|
||||
"Toggle the local fold at the point, and no deeper.
|
||||
`org-cycle's standard behavior is to cycle between three levels: collapsed,
|
||||
subtree and whole document. This is slow, especially in larger org buffer. Most
|
||||
of the time I just want to peek into the current subtree -- at most, expand
|
||||
*only* the current subtree.
|
||||
|
||||
All my (performant) foldings needs are met between this and `org-show-subtree'
|
||||
(on zO for evil users), and `org-cycle' on shift-TAB if I need it."
|
||||
(interactive "P")
|
||||
(unless (eq this-command 'org-shifttab)
|
||||
(save-excursion
|
||||
@@ -439,19 +468,14 @@ with `org-cycle')."
|
||||
(org-cycle-internal-local)
|
||||
t)))))
|
||||
|
||||
;;;###autoload
|
||||
(defun +org-clear-babel-results-h ()
|
||||
"Remove the results block for the org babel block at point."
|
||||
(when (and (org-in-src-block-p t)
|
||||
(org-babel-where-is-src-block-result))
|
||||
(org-babel-remove-result)
|
||||
t))
|
||||
|
||||
;;;###autoload
|
||||
(defun +org-make-last-point-visible-h ()
|
||||
"Unfold subtree around point if saveplace places it to a folded region."
|
||||
(and (not org-agenda-inhibit-startup)
|
||||
(outline-invisible-p)
|
||||
"Unfold subtree around point if saveplace places us in a folded region."
|
||||
(and (not org-inhibit-startup)
|
||||
(not org-inhibit-startup-visibility-stuff)
|
||||
(org-invisible-p nil 'folding-only)
|
||||
(or (not (org-on-heading-p))
|
||||
(not (member "ARCHIVE" (org-get-tags))))
|
||||
(ignore-errors
|
||||
(save-excursion
|
||||
(outline-previous-visible-heading 1)
|
||||
|
||||
@@ -74,15 +74,24 @@ Is relative to `org-directory', unless it is absolute. Is used in Doom's default
|
||||
(unless org-agenda-files
|
||||
(setq org-agenda-files (list org-directory)))
|
||||
(setq-default
|
||||
;; Different colors for different priority levels
|
||||
org-agenda-deadline-faces
|
||||
'((1.001 . error)
|
||||
(1.0 . org-warning)
|
||||
(0.5 . org-upcoming-deadline)
|
||||
(0.0 . org-upcoming-distant-deadline))
|
||||
;; Don't monopolize the whole frame just for the agenda
|
||||
org-agenda-window-setup 'current-window
|
||||
org-agenda-skip-unavailable-files t
|
||||
;; Move the agenda to show the previous 3 days and the next 7 days for a bit
|
||||
;; better context instead of just the current week which is a bit confusing
|
||||
;; on, for example, a sunday
|
||||
;; Shift the agenda to show the previous 3 days and the next 7 days for
|
||||
;; better context on your week. The past is less important than the future.
|
||||
org-agenda-span 10
|
||||
org-agenda-start-on-weekday nil
|
||||
org-agenda-start-day "-3d"))
|
||||
org-agenda-start-day "-3d"
|
||||
;; Optimize `org-agenda' by inhibiting extra work while opening agenda
|
||||
;; buffers in the background. They'll be "restarted" if the user switches to
|
||||
;; them anyway (see `+org-exclude-agenda-buffers-from-workspace-h')
|
||||
org-agenda-inhibit-startup t))
|
||||
|
||||
|
||||
(defun +org-init-appearance-h ()
|
||||
@@ -93,11 +102,13 @@ Is relative to `org-directory', unless it is absolute. Is used in Doom's default
|
||||
org-entities-user
|
||||
'(("flat" "\\flat" nil "" "" "266D" "♭")
|
||||
("sharp" "\\sharp" nil "" "" "266F" "♯"))
|
||||
org-fontify-done-headline t
|
||||
org-fontify-quote-and-verse-blocks t
|
||||
org-fontify-whole-heading-line t
|
||||
org-footnote-auto-label 'plain
|
||||
org-hide-leading-stars t
|
||||
org-image-actual-width nil
|
||||
org-imenu-depth 8
|
||||
org-priority-faces
|
||||
'((?A . error)
|
||||
(?B . warning)
|
||||
@@ -200,10 +211,27 @@ This forces it to read the background before rendering."
|
||||
(defadvice! +org-fix-newline-and-indent-in-src-blocks-a (&optional indent _arg _interactive)
|
||||
"Mimic `newline-and-indent' in src blocks w/ lang-appropriate indentation."
|
||||
:after #'org-return
|
||||
(when (and indent (org-in-src-block-p t))
|
||||
(when (and indent
|
||||
org-src-tab-acts-natively
|
||||
(org-in-src-block-p t))
|
||||
(org-babel-do-in-edit-buffer
|
||||
(call-interactively #'indent-for-tab-command))))
|
||||
|
||||
(defadvice! +org-inhibit-mode-hooks-a (orig-fn datum name &optional initialize &rest args)
|
||||
"Prevent potentially expensive mode hooks in `org-babel-do-in-edit-buffer' ops."
|
||||
:around #'org-src--edit-element
|
||||
(apply orig-fn datum name
|
||||
(if (and (eq org-src-window-setup 'switch-invisibly)
|
||||
(functionp initialize))
|
||||
;; org-babel-do-in-edit-buffer is used to execute quick, one-off
|
||||
;; logic in the context of another major mode. Initializing this
|
||||
;; major mode can be terribly expensive (particular its mode
|
||||
;; hooks), so we inhibit them.
|
||||
(lambda ()
|
||||
(quiet! (delay-mode-hooks (funcall initialize))))
|
||||
initialize)
|
||||
args))
|
||||
|
||||
;; Refresh inline images after executing src blocks (useful for plantuml or
|
||||
;; ipython, where the result could be an image)
|
||||
(add-hook 'org-babel-after-execute-hook #'org-redisplay-inline-images)
|
||||
@@ -344,10 +372,7 @@ relative to `org-directory', unless it is an absolute path."
|
||||
(propertize (abbreviate-file-name (buffer-file-name (buffer-base-buffer)))
|
||||
'face 'font-lock-string-face)
|
||||
org-eldoc-breadcrumb-separator
|
||||
header-line-format))))
|
||||
|
||||
(when (featurep! :editor evil)
|
||||
(add-hook 'org-capture-mode-hook #'evil-insert-state)))
|
||||
header-line-format)))))
|
||||
|
||||
|
||||
(defun +org-init-capture-frame-h ()
|
||||
@@ -413,19 +438,27 @@ relative to `org-directory', unless it is an absolute path."
|
||||
(+org-define-basic-link "doom-docs" 'doom-docs-dir)
|
||||
(+org-define-basic-link "doom-modules" 'doom-modules-dir)
|
||||
|
||||
;; Allow inline image previews of http(s)? urls or data uris
|
||||
;; Allow inline image previews of http(s)? urls or data uris.
|
||||
;; `+org-http-image-data-fn' will respect `org-display-remote-inline-images'.
|
||||
(setq org-display-remote-inline-images 'download) ; TRAMP urls
|
||||
(org-link-set-parameters "http" :image-data-fun #'+org-http-image-data-fn)
|
||||
(org-link-set-parameters "https" :image-data-fun #'+org-http-image-data-fn)
|
||||
(org-link-set-parameters "img" :image-data-fun #'+org-inline-image-data-fn)
|
||||
|
||||
;; Add support for youtube links + previews
|
||||
(require 'org-yt nil t))
|
||||
(require 'org-yt nil t)
|
||||
|
||||
(defadvice! +org-dont-preview-if-disabled-a (&rest _)
|
||||
"Make `org-yt' respect `org-display-remote-inline-images'."
|
||||
:before-while #'org-yt-image-data-fun
|
||||
(not (eq org-display-remote-inline-images 'skip))))
|
||||
|
||||
|
||||
(defun +org-init-export-h ()
|
||||
"TODO"
|
||||
(setq org-export-with-smart-quotes t
|
||||
org-html-validation-link nil)
|
||||
org-html-validation-link nil
|
||||
org-latex-prefer-user-labels t)
|
||||
|
||||
(when (featurep! :lang markdown)
|
||||
(add-to-list 'org-export-backends 'md))
|
||||
@@ -514,7 +547,7 @@ eldoc string."
|
||||
(funcall orig-fn
|
||||
(cl-loop for part in path
|
||||
;; Remove full link syntax
|
||||
for fixedpart = (replace-regexp-in-string org-link-any-re "\\4" part)
|
||||
for fixedpart = (replace-regexp-in-string org-link-any-re "\\4" (or part ""))
|
||||
for n from 0
|
||||
for face = (nth (% n org-n-level-faces) org-level-faces)
|
||||
collect
|
||||
@@ -538,24 +571,25 @@ eldoc string."
|
||||
|
||||
(add-hook! 'org-agenda-finalize-hook
|
||||
(defun +org-exclude-agenda-buffers-from-workspace-h ()
|
||||
"Prevent temporarily-opened agenda buffers from being associated with the
|
||||
current workspace (and clean them up)."
|
||||
(when (and org-agenda-new-buffers (bound-and-true-p persp-mode))
|
||||
(unless org-agenda-sticky
|
||||
(let (persp-autokill-buffer-on-remove)
|
||||
(persp-remove-buffer org-agenda-new-buffers
|
||||
(get-current-persp)
|
||||
nil)))
|
||||
(dolist (buffer org-agenda-new-buffers)
|
||||
(with-current-buffer buffer
|
||||
;; HACK Org agenda opens temporary agenda incomplete org-mode
|
||||
;; buffers. These are great for extracting agenda information
|
||||
;; from, but what if the user tries to visit one of these
|
||||
;; buffers? Then we remove it from the to-be-cleaned queue and
|
||||
;; restart `org-mode' so they can grow up to be full-fledged
|
||||
;; org-mode buffers.
|
||||
(add-hook 'doom-switch-buffer-hook #'+org--restart-mode-h
|
||||
nil 'local))))))
|
||||
"Prevent temporary agenda buffers being associated with current
|
||||
workspace."
|
||||
(when (and org-agenda-new-buffers
|
||||
(bound-and-true-p persp-mode)
|
||||
(not org-agenda-sticky))
|
||||
(let (persp-autokill-buffer-on-remove)
|
||||
(persp-remove-buffer org-agenda-new-buffers
|
||||
(get-current-persp)
|
||||
nil))))
|
||||
(defun +org-defer-mode-in-agenda-buffers-h ()
|
||||
"Org agenda opens temporary agenda incomplete org-mode buffers.
|
||||
These are great for extracting agenda information from, but what if the user
|
||||
tries to visit one of these buffers? Then we remove it from the to-be-cleaned
|
||||
queue and restart `org-mode' so they can grow up to be full-fledged org-mode
|
||||
buffers."
|
||||
(dolist (buffer org-agenda-new-buffers)
|
||||
(with-current-buffer buffer
|
||||
(add-hook 'doom-switch-buffer-hook #'+org--restart-mode-h
|
||||
nil 'local)))))
|
||||
|
||||
(defadvice! +org--exclude-agenda-buffers-from-recentf-a (orig-fn file)
|
||||
"Prevent temporarily opened agenda buffers from polluting recentf."
|
||||
@@ -606,6 +640,7 @@ between the two."
|
||||
"C-c C-S-l" #'+org/remove-link
|
||||
"C-c C-i" #'org-toggle-inline-images
|
||||
;; textmate-esque newline insertion
|
||||
"S-RET" #'+org/shift-return
|
||||
"C-RET" #'+org/insert-item-below
|
||||
"C-S-RET" #'+org/insert-item-above
|
||||
"C-M-RET" #'org-insert-subheading
|
||||
@@ -692,7 +727,8 @@ between the two."
|
||||
"e" #'org-clock-modify-effort-estimate
|
||||
"E" #'org-set-effort
|
||||
"g" #'org-clock-goto
|
||||
"G" (λ! (org-clock-goto 'select))
|
||||
"G" (cmd! (org-clock-goto 'select))
|
||||
"l" #'+org/toggle-last-clock
|
||||
"i" #'org-clock-in
|
||||
"I" #'org-clock-in-last
|
||||
"o" #'org-clock-out
|
||||
@@ -715,7 +751,7 @@ between the two."
|
||||
"g" #'helm-org-in-buffer-headings
|
||||
"G" #'helm-org-agenda-files-headings)
|
||||
"c" #'org-clock-goto
|
||||
"C" (λ! (org-clock-goto 'select))
|
||||
"C" (cmd! (org-clock-goto 'select))
|
||||
"i" #'org-id-goto
|
||||
"r" #'org-refile-goto-last-stored
|
||||
"v" #'+org/goto-visible
|
||||
@@ -729,6 +765,12 @@ between the two."
|
||||
"s" #'org-store-link
|
||||
"S" #'org-insert-last-stored-link
|
||||
"t" #'org-toggle-link-display)
|
||||
(:prefix ("P" . "publish")
|
||||
"a" #'org-publish-all
|
||||
"f" #'org-publish-current-file
|
||||
"p" #'org-publish
|
||||
"P" #'org-publish-current-project
|
||||
"s" #'org-publish-sitemap)
|
||||
(:prefix ("r" . "refile")
|
||||
"." #'+org/refile-to-current-file
|
||||
"c" #'+org/refile-to-running-clock
|
||||
@@ -757,7 +799,6 @@ between the two."
|
||||
"p" #'org-priority
|
||||
"u" #'org-priority-up)))
|
||||
|
||||
|
||||
(map! :after org-agenda
|
||||
:map org-agenda-mode-map
|
||||
:m "C-SPC" #'org-agenda-show-and-scroll-up
|
||||
@@ -852,25 +893,6 @@ compelling reason, so..."
|
||||
(set-marker p nil)))))
|
||||
|
||||
|
||||
(use-package! org-superstar ; "prettier" bullets
|
||||
:hook (org-mode . org-superstar-mode)
|
||||
:config
|
||||
;; Make leading stars truly invisible, by rendering them as spaces!
|
||||
(setq org-superstar-leading-bullet ?\s
|
||||
org-superstar-leading-fallback ?\s
|
||||
org-hide-leading-stars nil)
|
||||
;; Don't do anything special for item bullets or TODOs by default; these slow
|
||||
;; down larger org buffers.
|
||||
(setq org-superstar-prettify-item-bullets nil
|
||||
org-superstar-special-todo-items nil
|
||||
;; ...but configure it in case the user wants it later
|
||||
org-superstar-todo-bullet-alist
|
||||
'(("TODO" . 9744)
|
||||
("[ ]" . 9744)
|
||||
("DONE" . 9745)
|
||||
("[X]" . 9745))))
|
||||
|
||||
|
||||
(use-package! org-crypt ; built-in
|
||||
:commands org-encrypt-entries org-encrypt-entry org-decrypt-entries org-decrypt-entry
|
||||
:hook (org-reveal-start . org-decrypt-entry)
|
||||
@@ -925,6 +947,7 @@ compelling reason, so..."
|
||||
(use-package! evil-org
|
||||
:when (featurep! :editor evil +everywhere)
|
||||
:hook (org-mode . evil-org-mode)
|
||||
:hook (org-capture-mode . evil-insert-state)
|
||||
:init
|
||||
(defvar evil-org-retain-visual-state-on-shift t)
|
||||
(defvar evil-org-special-o/O '(table-row))
|
||||
@@ -940,24 +963,25 @@ compelling reason, so..."
|
||||
:ni [C-return] #'+org/insert-item-below
|
||||
:ni [C-S-return] #'+org/insert-item-above
|
||||
;; navigate table cells (from insert-mode)
|
||||
:i "C-l" (general-predicate-dispatch 'org-end-of-line
|
||||
(org-at-table-p) 'org-table-next-field)
|
||||
:i "C-h" (general-predicate-dispatch 'org-beginning-of-line
|
||||
(org-at-table-p) 'org-table-previous-field)
|
||||
:i "C-k" (general-predicate-dispatch 'org-up-element
|
||||
(org-at-table-p) '+org/table-previous-row)
|
||||
:i "C-j" (general-predicate-dispatch 'org-down-element
|
||||
(org-at-table-p) 'org-table-next-row)
|
||||
;; moving/(de|pro)moting subtress & expanding tables (prepend/append columns/rows)
|
||||
:ni "C-S-l" #'org-shiftright
|
||||
:ni "C-S-h" #'org-shiftleft
|
||||
:ni "C-S-k" #'org-shiftup
|
||||
:ni "C-S-j" #'org-shiftdown
|
||||
:i "C-l" (cmds! (org-at-table-p) #'org-table-next-field
|
||||
#'org-end-of-line)
|
||||
:i "C-h" (cmds! (org-at-table-p) #'org-table-previous-field
|
||||
#'org-beginning-of-line)
|
||||
:i "C-k" (cmds! (org-at-table-p) #'+org/table-previous-row
|
||||
#'org-up-element)
|
||||
:i "C-j" (cmds! (org-at-table-p) #'org-table-next-row
|
||||
#'org-down-element)
|
||||
:ni "C-S-l" #'org-shiftright
|
||||
:ni "C-S-h" #'org-shiftleft
|
||||
:ni "C-S-k" #'org-shiftup
|
||||
:ni "C-S-j" #'org-shiftdown
|
||||
;; more intuitive RET keybinds
|
||||
:i [return] (λ! (org-return t))
|
||||
:i "RET" (λ! (org-return t))
|
||||
:n [return] #'+org/dwim-at-point
|
||||
:n "RET" #'+org/dwim-at-point
|
||||
:n [return] #'+org/dwim-at-point
|
||||
:n "RET" #'+org/dwim-at-point
|
||||
:i [return] (cmd! (org-return electric-indent-mode))
|
||||
:i "RET" (cmd! (org-return electric-indent-mode))
|
||||
:i [S-return] #'+org/shift-return
|
||||
:i "S-RET" #'+org/shift-return
|
||||
;; more vim-esque org motion keys (not covered by evil-org-mode)
|
||||
:m "]h" #'org-forward-heading-same-level
|
||||
:m "[h" #'org-backward-heading-same-level
|
||||
@@ -966,8 +990,6 @@ compelling reason, so..."
|
||||
:m "]c" #'org-babel-next-src-block
|
||||
:m "[c" #'org-babel-previous-src-block
|
||||
:n "gQ" #'org-fill-paragraph
|
||||
:n "gr" #'org-ctrl-c-ctrl-c
|
||||
:n "gR" #'org-babel-execute-buffer
|
||||
;; sensible vim-esque folding keybinds
|
||||
:n "za" #'+org/toggle-fold
|
||||
:n "zA" #'org-shifttab
|
||||
@@ -1011,16 +1033,18 @@ compelling reason, so..."
|
||||
org-list org-pcomplete org-src org-footnote org-macro ob org org-agenda
|
||||
org-capture
|
||||
:preface
|
||||
;; Set these to nil now so we can detect user changes to them later (and fall
|
||||
;; back on defaults otherwise)
|
||||
;; Set to nil so we can detect user changes to them later (and fall back on
|
||||
;; defaults otherwise).
|
||||
(defvar org-directory nil)
|
||||
(defvar org-attach-id-dir nil)
|
||||
|
||||
(setq org-publish-timestamp-directory (concat doom-cache-dir "org-timestamps/")
|
||||
org-preview-latex-image-directory (concat doom-cache-dir "org-latex/"))
|
||||
org-preview-latex-image-directory (concat doom-cache-dir "org-latex/")
|
||||
;; Recognize a), A), a., A., etc -- must be set before org is loaded.
|
||||
org-list-allow-alphabetical t)
|
||||
|
||||
;; Make most of the default modules opt-in, because I sincerely doubt most
|
||||
;; users use all of them.
|
||||
;; Make most of the default modules opt-in to lighten its first-time load
|
||||
;; delay. I sincerely doubt most users use them all.
|
||||
(defvar org-modules
|
||||
'(;; ol-w3m
|
||||
;; ol-bbdb
|
||||
@@ -1081,7 +1105,19 @@ compelling reason, so..."
|
||||
(run-hooks 'org-load-hook))
|
||||
|
||||
:config
|
||||
(setq org-archive-subtree-save-file-p t) ; save target buffer after archiving
|
||||
(set-company-backend! 'org-mode 'company-capf 'company-dabbrev)
|
||||
(set-eval-handler! 'org-mode #'+org-eval-handler)
|
||||
(set-lookup-handlers! 'org-mode
|
||||
:definition #'+org-lookup-definition-handler
|
||||
:references #'+org-lookup-references-handler
|
||||
:documentation #'+org-lookup-documentation-handler)
|
||||
|
||||
;; Save target buffer after archiving a node.
|
||||
(setq org-archive-subtree-save-file-p t)
|
||||
|
||||
;; Prevent modifications made in invisible sections of an org document, as
|
||||
;; unintended changes can easily go unseen otherwise.
|
||||
(setq org-catch-invisible-edits 'smart)
|
||||
|
||||
;; Global ID state means we can have ID links anywhere. This is required for
|
||||
;; `org-brain', however.
|
||||
|
||||
@@ -9,16 +9,16 @@
|
||||
;; delay on the first file the user opens, because calling the autoloaded
|
||||
;; `org-journal-is-journal' pulls all of `org' with it. So, we replace it
|
||||
;; with our own, extra layer of heuristics.
|
||||
(setq magic-mode-alist (assq-delete-all 'org-journal-is-journal magic-mode-alist))
|
||||
(add-to-list 'magic-mode-alist '(+org-journal-p . org-journal-mode))
|
||||
|
||||
(defun +org-journal-p ()
|
||||
(when-let (buffer-file-name (buffer-file-name (buffer-base-buffer)))
|
||||
(and (file-in-directory-p
|
||||
buffer-file-name (expand-file-name org-journal-dir org-directory))
|
||||
(delq! '+org-journal-p magic-mode-alist 'assq)
|
||||
(require 'org-journal nil t)
|
||||
(org-journal-is-journal))))
|
||||
(if (or (featurep 'org-journal)
|
||||
(and (file-in-directory-p
|
||||
buffer-file-name (expand-file-name org-journal-dir org-directory))
|
||||
(delq! '+org-journal-p magic-mode-alist 'assq)
|
||||
(require 'org-journal nil t)))
|
||||
(org-journal-is-journal))))
|
||||
|
||||
;; `org-journal-dir' defaults to "~/Documents/journal/", which is an odd
|
||||
;; default, so we change it to {org-directory}/journal (we expand it after
|
||||
@@ -27,12 +27,20 @@
|
||||
org-journal-cache-file (concat doom-cache-dir "org-journal"))
|
||||
|
||||
:config
|
||||
;; Remove the orginal journal file detector and rely on `+org-journal-p'
|
||||
;; instead, to avoid loading org-journal until the last possible moment.
|
||||
(setq magic-mode-alist (assq-delete-all 'org-journal-is-journal magic-mode-alist))
|
||||
|
||||
;; `org-journal' can't deal with symlinks, so resolve them here.
|
||||
(setq org-journal-dir (expand-file-name org-journal-dir org-directory)
|
||||
;; Doom opts for an "open in a popup or here" strategy as a default.
|
||||
;; Open in "other window" is less predictable, and can replace a window
|
||||
;; we wanted to keep visible.
|
||||
org-journal-find-file #'find-file)
|
||||
|
||||
;; Setup carryover to include all configured TODO states.
|
||||
(setq org-journal-carryover-items "TODO=\"TODO\"|TODO=\"PROJ\"|TODO=\"STRT\"|TODO=\"WAIT\"|TODO=\"HOLD\"")
|
||||
|
||||
|
||||
(set-popup-rule! "^\\*Org-journal search" :select t :quit t)
|
||||
|
||||
|
||||
@@ -10,6 +10,8 @@
|
||||
(alert-add-rule :category "org-pomodoro"
|
||||
:style (cond (alert-growl-command
|
||||
'growl)
|
||||
(alert-notifier-command
|
||||
'notifier)
|
||||
(alert-libnotify-command
|
||||
'libnotify)
|
||||
(alert-default-style))))
|
||||
|
||||
@@ -14,7 +14,8 @@
|
||||
(use-package! org-re-reveal
|
||||
:after ox
|
||||
:init
|
||||
(setq org-re-reveal-root "https://revealjs.com"))
|
||||
(setq org-re-reveal-root "https://cdnjs.cloudflare.com/ajax/libs/reveal.js/3.9.2"
|
||||
org-re-reveal-revealjs-version "3.8"))
|
||||
|
||||
|
||||
(use-package! org-tree-slide
|
||||
|
||||
@@ -6,5 +6,7 @@
|
||||
(warn! "Couldn't find gnuplot. org-plot/gnuplot will not work")))
|
||||
|
||||
(when (featurep! +roam)
|
||||
(unless (executable-find "sqlite3")
|
||||
(warn! "Couldn't find the sqlite3 executable. org-roam will not work."))
|
||||
(unless (executable-find "dot")
|
||||
(warn! "Couldn't find the dot executable (from graphviz). org-roam will not be able to generate graph visuallizations.")))
|
||||
|
||||
@@ -27,18 +27,17 @@
|
||||
:recipe (:host github
|
||||
:repo "emacs-straight/org-mode"
|
||||
:files ("*.el" "lisp/*.el" "contrib/lisp/*.el"))
|
||||
:pin "c709187173ff2bb72c0f902c0299998c8c5a4260")
|
||||
:pin "a1e5bee5cb9c34ceb8226597605a49638bee7cec")
|
||||
;; ...And prevent other packages from pulling org; org-plus-contrib satisfies
|
||||
;; the dependency already: https://github.com/raxod502/straight.el/issues/352
|
||||
(package! org :recipe (:local-repo nil))
|
||||
|
||||
(package! avy)
|
||||
(package! htmlize :pin "86f22f211e9230857197c42a9823d3f05381deed")
|
||||
(package! org-superstar :pin "09ddc28383d363a4b353348a433e24535b4af0e3")
|
||||
(package! org-yt
|
||||
:recipe (:host github :repo "TobiasZawada/org-yt")
|
||||
:pin "40cc1ac76d741055cbefa13860d9f070a7ade001")
|
||||
(package! ox-clip :pin "bd36f9fb4e3b1b9e8686b993b02ccd780ff75a96")
|
||||
(package! ox-clip :pin "f5eac28734ea33d0b7a3dbe10b777907a91cf9f9")
|
||||
(package! toc-org :pin "5deaec41ed0e5c51715737d7f74c5ae1b3c00387")
|
||||
(package! org-cliplink :pin "82402cae7e118d67de7328417fd018a18f95fac2")
|
||||
|
||||
@@ -49,11 +48,11 @@
|
||||
(when (featurep! :tools pdf)
|
||||
(package! org-pdftools :pin "8cc15bb8014ed1f047eecc0abd8bf447f86c0505"))
|
||||
(when (featurep! :tools magit)
|
||||
(package! orgit :pin "e147f055772cc934fe1f1d8619059badeb647c93"))
|
||||
(package! orgit :pin "ac9b1a42863a864fde9d225890ef5464bffdc646"))
|
||||
(when (featurep! +brain)
|
||||
(package! org-brain :pin "6b2ec93ec92b4a244af9d600433e0d0a02eb5f1e"))
|
||||
(package! org-brain :pin "671db0e08b91c7d2637d765a7afca8b2561275c8"))
|
||||
(when (featurep! +dragndrop)
|
||||
(package! org-download :pin "40c8a1db186a4ec79d87805018237234c0aad878"))
|
||||
(package! org-download :pin "768716b6fcc814b06360b99ad70bce44c0eb4a32"))
|
||||
(when (featurep! +gnuplot)
|
||||
(package! gnuplot :pin "f0001c30010b2899e36d7d89046322467e923088")
|
||||
(package! gnuplot-mode :pin "601f6392986f0cba332c87678d31ae0d0a496ce7"))
|
||||
@@ -62,21 +61,24 @@
|
||||
(when (featurep! +jupyter)
|
||||
(package! jupyter :pin "785edbbff65abb0c929dc2fbd8b8305c77fd529e"))
|
||||
(when (featurep! +journal)
|
||||
(package! org-journal :pin "0d6d81234a20ac800d24373b89159ee33a69f6c3"))
|
||||
(package! org-journal :pin "a6378dc484ed8df7d2d2f05ac70bd9196aa6f4c0"))
|
||||
(when (featurep! +noter)
|
||||
(package! org-noter :pin "9ead81d42dd4dd5074782d239b2efddf9b8b7b3d"))
|
||||
(when (featurep! +pomodoro)
|
||||
(package! org-pomodoro :pin "aa07c11318f91219336197e62c47bc7a3d090479"))
|
||||
(when (featurep! +pretty)
|
||||
(package! org-superstar :pin "17481852c1bd09afea877635a3185261fc19fd64")
|
||||
(package! org-fancy-priorities :pin "819bb993b71e7253cefef7047306ab4e0f9d0a86"))
|
||||
(when (featurep! +present)
|
||||
(package! centered-window
|
||||
:recipe (:host github :repo "anler/centered-window-mode")
|
||||
:pin "f50859941ab5c7cbeaee410f2d38716252b552ac")
|
||||
(package! org-tree-slide :pin "7126a4365072a32898f169ead8fb59265dabc605")
|
||||
(package! org-re-reveal :pin "a9e9d4ef88417b3af7741a8d8f444ece820e7a3b"))
|
||||
(package! org-re-reveal :pin "c548e239898e97e700f7c1d3f34a148ccbedb820"))
|
||||
(when (featurep! +roam)
|
||||
(package! org-roam :pin "9cf26494e86b1cc18267fd70abf942d2fb75c774")
|
||||
(package! org-roam :pin "0aa0a7c05a78e9b29881570604c24381b658fe2a")
|
||||
(when (featurep! :completion company)
|
||||
(package! company-org-roam :pin "674c2bd493f571c5323d69279557a6c18ccbd14e")))
|
||||
(package! company-org-roam :pin "5d7ccd944519ae1d03f5e17ddfe33dcd8a0cc71e")))
|
||||
|
||||
;;; Babel
|
||||
(package! ob-async :pin "80a30b96a007d419ece12c976a81804ede340311")
|
||||
@@ -103,6 +105,6 @@
|
||||
(when (featurep! +hugo)
|
||||
(package! ox-hugo
|
||||
:recipe (:host github :repo "kaushalmodi/ox-hugo" :nonrecursive t)
|
||||
:pin "5de3da970f9ead05930781dd0b73b5011310b2ba"))
|
||||
:pin "75b849e9561c4a6022babf6eaf0e037310ded7c1"))
|
||||
(when (featurep! :lang rst)
|
||||
(package! ox-rst :pin "9158bfd18096c559e0a225ae62ab683f1c98a547"))
|
||||
|
||||
@@ -92,6 +92,7 @@ The features in this module optionally depend on the following php packages:
|
||||
+ ~boris~ (REPL)
|
||||
+ ~phpctags~ (better code completion)
|
||||
+ ~phpunit~ (unit test commands)
|
||||
+ ~php-cs-fixer~ (for code formatting)
|
||||
|
||||
#+BEGIN_SRC sh
|
||||
composer global require \
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user