diff --git a/bin/bin/autostart b/bin/bin/autostart index 51b65ac..8618f73 100755 --- a/bin/bin/autostart +++ b/bin/bin/autostart @@ -1,5 +1,5 @@ #!/usr/bin/env bash -#xset r rate 400 100 +xset r rate 180 40 ##emacs -fs & rm -rf ~/.cache/fontconfig @@ -25,6 +25,7 @@ source ~/.fehbg (sleep 1 && warpd)& killall wired (sleep 1 && wired ) & +(sleep 3 && greenclip daemon) & #(sleep 3 && optimus-manager-qt) & (sleep 3 && flameshot) & @@ -32,7 +33,9 @@ killall wired (sleep 6 && bspc rule -r KeePassXC ) & (sleep 5 && syncthing -no-browser) & -(sleep 100 && nextcloud --background) & +(sleep 5 && kdeconnect-indicator) & +(sleep 4 && kdeconnectd) & +#(sleep 100 && nextcloud --background) & #(sleep 5 && thunderbird ) & #(sleep 7 && bspc rule -r Thunderbird ) & @@ -61,6 +64,12 @@ killall goimapnotify # Japanses Input #(sleep 1 && fcitx -d ) & (sleep 0 && ~/bin/keyboard ) & +#(sleep 4 && ~/bin/battery-alert ) & + +(sleep 1 && udiskie --tray) & +(sleep 1 && nm-applet) & + +(sleep 2 && blueberry-tray) & ## Audio (sleep 0 && dbus-run-session pipewire ) & diff --git a/bin/bin/prayer-times b/bin/bin/prayer-times new file mode 100755 index 0000000..d5f389e --- /dev/null +++ b/bin/bin/prayer-times @@ -0,0 +1,354 @@ +#!/bin/bash + +# ----- Parameters ------ # +# Coordinates: https://www.mapcoordinates.net/en +# Set explicitly, or leave commented to get them automatically from ipinfo.io +# lat='100.00000' +# long='100.00000' +# Calculation Method: https://api.aladhan.com/v1/methods +method='4' +# Print Text Language (en/ar) +print_lang="ar" +# Notifcation Daemon +notify="mako" +# ----------------------- # +prayers_json="$HOME/.local/share/prayers.json" +prayers=("Fajr" "Dhuhr" "Asr" "Maghrib" "Isha") +declare -A date +declare -A epochtimes +declare -A prayers_ar +prayers_ar=( + ["Fajr"]="الفجر" + ["Sunrise"]="الشروق" + ["Dhuhr"]="الظهر" + ["Asr"]="العصر" + ["Maghrib"]="المغرب" + ["Isha"]="العشاء" +) +date=( + [day_idx]=$(($(date +%-d) - 1)) + [weekday]=$(date +%a) + [month]=$(date +%-m) + [year]=$(date +%Y) +) + +nameof() { + if [[ "$print_lang" != "en" ]]; then + local array_name="prayers_$print_lang" + eval "echo -n \${${array_name}[$1]}" + else + echo -n "$1" + fi +} + +check() { + local available_month + if [[ -r $prayers_json ]]; then + available_month=$(jq -r ".data[0].date.gregorian.month.number" "$prayers_json") + else + local fetch_prayers=1 + fi + + if [[ "$fetch_prayers" || "$available_month" != "${date[month]}" ]]; then + # Fetch the geolocation data from ipinfo.io + response=$(curl -s https://ipinfo.io) + + echo "-- fetching latitude and longitude" + # Parse the latitude and longitude + location=$(echo $response | jq -r '.loc') + + # Separate latitude and longitude + latitude=$(echo $location | cut -d',' -f1) + longitude=$(echo $location | cut -d',' -f2) + + # Set `lat` to `latitude`, or default to the specified value above + lat=${latitude:lat} + long=${longitude:long} + + echo "-- latitude: ${lat}, longitude: ${long}" + + echo "-- fetching current month prayer calendar (${date[month]}-${date[year]})" + # Documentation: https://aladhan.com/prayer-times-api#GetCalendar + curl -Lso "$prayers_json" "https://api.aladhan.com/v1/calendar/${date[year]}/${date[month]}?latitude=$lat&longitude=$long&method=$method" + fi +} + +add-jobs() { + # WARNING: THIS SCRIPTS REMOVES ALL JOBS IN QUEUE "P" SCHEDULED USING AT (ADJUST ACCORDINGLY) + echo "-- removing all jobs in queue 'p'" + if [[ "$(at -q p -l | wc -l)" != "0" ]]; then + for i in $(at -q p -l | awk '{ print $1 }'); do + atrm "$i" + done + fi + + for prayer in "${prayers[@]}"; do + echo "-- creating at job for $prayer prayer" + if [[ "$notify" == "mako" ]]; then + printf 'notify-send -t 30000 --icon="clock-applet-symbolic" "Prayer Times" "It is time for %s prayer 🕌"' "$prayer" | at -q p "$(timeof "$prayer" '%H:%M %F')" + else + printf '[ "$(dunstify --icon="clock-applet-symbolic" --action="Reply,reply" "Prayer Times" "Time for %s prayer 🕌" -t 30000)" = "2" ] && %s' "$prayer" "$HOME/.local/bin/toggle-athan" | at -q p "$(timeof "$prayer" '%H:%M %F')" + fi + done +} + +timeof() { + [[ "$#" -lt "1" ]] && echo "atleast 1 argument is needed" && return 1 + echo -n "$(date -d "$(jq -r ".data[${date[day_idx]}].timings.$1" "$prayers_json")" "+${2:-%I:%M}")" +} + +hijri() { + case "$1" in + weekday) + if [[ "$print_lang" == "ar" ]]; then + echo -n "$(jq -r ".data[${date[day_idx]}].date.hijri.weekday.ar" "$prayers_json")" + else + echo -n "$(jq -r ".data[${date[day_idx]}].date.hijri.weekday.en" "$prayers_json")" + fi + ;; + day) + echo -n "$(jq -r ".data[${date[day_idx]}].date.hijri.day" "$prayers_json")" + ;; + month) + if [[ "$print_lang" == "ar" ]]; then + echo -n "$(jq -r ".data[${date[day_idx]}].date.hijri.month.ar" "$prayers_json")" + else + echo -n "$(jq -r ".data[${date[day_idx]}].date.hijri.month.en" "$prayers_json")" + fi + ;; + year) + echo -n "$(jq -r ".data[${date[day_idx]}].date.hijri.year" "$prayers_json")" + ;; + *) + echo "unsupported argument: $1" && return 1 + ;; + esac +} + +settimes() { + # return if array already populated + [[ "${#epochtimes[@]}" -gt 0 ]] && return 0 + + epochtimes=( + [now]=$(date +%s) + [fajr]=$(timeof Fajr %s) + [dhuhr]=$(timeof Dhuhr %s) + [asr]=$(timeof Asr %s) + [maghrib]=$(timeof Maghrib %s) + [isha]=$(timeof Isha %s) + ) + + local nxt_idx=0 + local curr_idx=4 + for i in {4..0}; do + local prayer_key="${prayers[$i],,}" + if [[ "${epochtimes[now]}" -ge "${epochtimes[$prayer_key]}" ]]; then + [[ "$i" -lt "4" ]] && curr_idx=$i && nxt_idx=$((i + 1)) + break + fi + done + + local next_key="${prayers[$nxt_idx],,}" + epochtimes[next]="${epochtimes[$next_key]}" + currentprayer="${prayers[$curr_idx]}" + nextprayer="${prayers[$nxt_idx]}" + if [[ "$nxt_idx" == "1" && "${date[weekday]}" == "Fri" ]]; then + nextprayer="Jumuaa" + fi +} + +timeto() { + [[ "$#" -lt "1" ]] && echo "atleast 1 argument are needed" && return 1 + settimes + remain="$((epochtimes["${1,,}"] - epochtimes[now]))" + [[ "$remain" -lt "0" ]] && remain="$((remain + 86400))" + date -u -d"@$remain" "+${2:-%H:%M}" +} + +print() { + local format="📅 %s،%s\n%-12s%-10s\n%-12s%-10s\n%-12s%-10s\n%-12s%-10s\n%-12s%-10s\n%-12s%-10s\n" + if [[ "$print_lang" == "ar" ]]; then + format="📅 %s،%s\n%s%11s\n%s%10s\n%s%11s\n%s%11s\n%s%10s\n%s%10s\n" + fi + + printf "$format" \ + "$(hijri weekday)" \ + "$(hijri day)-$(hijri month)-$(hijri year)" \ + "۞ $(nameof Fajr)" "$(timeof Fajr)" \ + "۞ $(nameof Sunrise)" "$(timeof Sunrise)" \ + "۞ $(nameof Dhuhr)" "$(timeof Dhuhr)" \ + "۞ $(nameof Asr)" "$(timeof Asr)" \ + "۞ $(nameof Maghrib)" "$(timeof Maghrib)" \ + "۞ $(nameof Isha)" "$(timeof Isha)" +} + +yad-en() { + yad \ + --text-width=10 \ + --on-top \ + --text \ + "📅 $(hijri weekday),$(hijri day)-$(hijri month)-$(hijri year)" \ + --list \ + --width=300 \ + --posx=550 \ + --posy=20 \ + --height=270 \ + --title="Prayers" \ + --column="Prayer" \ + --column="Time" \ + --expand-column=1 \ + --no-buttons \ + --no-click \ + --no-selection \ + "$(nameof Fajr)" "$(timeof Fajr)" \ + "$(nameof Sunrise)" "$(timeof Sunrise)" \ + "$(nameof Dhuhr)" "$(timeof Dhuhr)" \ + "$(nameof Asr)" "$(timeof Asr)" \ + "$(nameof Maghrib)" "$(timeof Maghrib)" \ + "$(nameof Isha)" "$(timeof Isha)" +} + +yad-ar() { + yad \ + --text-width=10 \ + --on-top \ + --text-align='right' \ + --text \ + "📅 $(hijri weekday),$(hijri day)-$(hijri month)-$(hijri year)" \ + --list \ + --width=250 \ + --posx=550 \ + --posy=20 \ + --height=280 \ + --title="Prayers" \ + --column="الوقت" \ + --column="الصلاة" \ + --expand-column=1 \ + --no-buttons \ + --no-click \ + --no-selection \ + "$(timeof Fajr)" "$(nameof Fajr)" \ + "$(timeof Sunrise)" "$(nameof Sunrise)" \ + "$(timeof Dhuhr)" "$(nameof Dhuhr)" \ + "$(timeof Asr)" "$(nameof Asr)" \ + "$(timeof Maghrib)" "$(nameof Maghrib)" \ + "$(timeof Isha)" "$(nameof Isha)" +} + +yad-toggle() { + local yad_pid + yad_pid=$(pgrep -f 'yad.*Prayers') + + if [[ -z "$yad_pid" ]]; then + if [[ "$print_lang" == "ar" ]]; then + yad-ar + else + yad-en + fi + + else + kill "$yad_pid" + fi +} + +current() { + settimes + echo "$currentprayer" +} + +next() { + settimes + echo "$nextprayer" +} + +remaining() { + settimes + timeto next "%H:%M:%S" +} + +status() { + settimes + local remain + remain="$(timeto next)" + echo "$nextprayer in $remain" +} + +waybar-status() { + settimes + local remain + remain="$(timeto next)" + local next_text="$nextprayer in $remain" + printf '{ "text": "%s", "class": "%s" }' "$next_text" "$nextprayer" +} + +case "$1" in +check) + check + ;; +jobs) + add-jobs + ;; +sync) + check + add-jobs + ;; +print) + print + ;; +current) + current + ;; +next) + next + ;; +remaining) + remaining + ;; +status) + status + ;; +yad) + yad-toggle + ;; +waybar) + waybar-status + ;; +timeto) + if [[ -n "$2" ]]; then + if [[ "$2" == "next" ]]; then + valid=1 + else + for p in "${prayers[@]}"; do + if [[ "${2^}" == "$p" ]]; then + valid=1 + break + fi + done + fi + fi + + if [[ -z "$valid" ]]; then + IFS='|' + echo "Usage: $(basename "$0") timeto (next|${prayers[*],,})" + exit 1 + fi + + timeto "$2" + ;; +*) + echo "Usage: $(basename "$0") [command]" + echo "Command:" + echo " check Check if prayer time data needs to be fetched" + echo " jobs Add prayer time notifications as at jobs" + echo " sync Check and sync prayer time data, and add notifications" + echo " print Print prayer times" + echo " current Get the current prayer" + echo " next Get the next prayer" + echo " remaining Get the remaining time for the next prayer" + echo " status Get the status message indicating the next prayer" + echo " timeto Get the time remaining for a prayer" + echo " yad Toggle the yad window showing prayer times" + echo " waybar Print waybar JSON-formatted status" + exit 1 + ;; +esac diff --git a/bin/bin/rofi_bin_launcher.py b/bin/bin/rofi_bin_launcher.py index 2c3843a..aa376f2 100755 --- a/bin/bin/rofi_bin_launcher.py +++ b/bin/bin/rofi_bin_launcher.py @@ -44,7 +44,9 @@ import subprocess commands = ['isbn to bibtex', 'emoji', - 'c'] + 'calc', + 'spellcheck', + 'nvidia rofi'] rofi_process = subprocess.Popen(['rofi', '-dmenu'], stdin=subprocess.PIPE, stdout=subprocess.PIPE, text=True) @@ -58,12 +60,20 @@ if selected_command: clipboard = read_clipboard() isbn = bash_it(f"echo \"{clipboard}\n'Esc to Cancel'\" | rofi -dmenu") exit(0) if not isbn else False - isbn = isbn.replace("\n", ",") + isbn = isbn.replace("\n", " ") + eprint("isbn:", isbn) res = bash_it('echo ' + isbn + '| isbn_to_bibtex.py') + eprint(res) write_to_clipboard(res) send_notif("status", "done!: "+ res) - elif selected_command == 'emoji': + elif selected_command == 'emoji': bash_it("rofi -show emoji") + elif selected_command == 'calc': + bash_it("rofi -show calc -modi calc -no-show-match -no-sort") + elif selected_command == 'spellcheck': + bash_it("rofi -show spell -modes \"spell:rofi-spellcheck.sh\"") + elif selected_command == 'nvidia rofi': + bash_it("nvidia-offload ~/.config/polybar/forest/scripts/launcher.sh") else: send_notif("Failure", "Unkown Command") exit(1) diff --git a/bspwm/.config/bspwm/bspwmrc b/bspwm/.config/bspwm/bspwmrc index 37b4a61..b0e816f 100755 --- a/bspwm/.config/bspwm/bspwmrc +++ b/bspwm/.config/bspwm/bspwmrc @@ -8,7 +8,7 @@ pgrep ~/bin/wm/bspswallow || ~/bin/wm/bspswallow & # not sure if I can count using Roman Numerals :) -bspc monitor -d I II III IV V VI VII VIII IX X +bspc monitor eDP1 -d I II III IV V VI VII VIII IX X #bspc config ignore_ewmh_fullscreen all bspc config ignore_ewmh_focus true @@ -27,18 +27,24 @@ bspc config single_monocle true bspc config focus_follows_pointer true bspc config pointer_follows_focus true +bspc config remove_unplugged_monitors true +bspc config remove_disabled_monitors true + # bspc rule -a Gimp desktop='^8' state=floating follow=on #bspc rule -a Chromium desktop='^1' # these 2 rules are removed after the program starts, in ~/bin/autostart bspc rule -a Thunderbird desktop='^8' -bspc rule -a KeePassXC desktop='^8' +bspc rule -a KeePassXC desktop='^9' # the confirm dialog -bspc rule -a "KeePassXC:*:Confirm Auto-Type" sticky=on +bspc rule -a "keepassxc:*:Confirm Auto-Type" sticky=on bspc rule -a "Dragon-drop" sticky=on +bspc rule -a "No Title Yet:*:*" state=floating # for ngscopeclient +bspc rule -a "*:*:Quick Format Citation" state=floating # for ngscopeclient bspc rule -a Dino desktop='^8' bspc rule -a Peek state=floating +bspc rule -a Qalculate-gtk state=floating bspc rule -a Connman-gtk state=floating bspc rule -a mplayer2 state=floating bspc rule -a Emacs state=tiled @@ -50,6 +56,11 @@ bspc rule -a wmpin sticky=on bspc rule -a Floating state=floating bspc rule -a \*:\*:org-capture state=floating +# Fix MATLAB https://github.com/baskerville/bspwm/issues/1204 +#bspc rule -a 'MATLAB R2024a - academic use:sun-awt-X11-XWindowPeer:DefaultOverlayManager.JWindow' manage=off +#bspc rule -a 'MATLAB R2024a - academic use:sun-awt-X11-XWindowPeer:TabCompletionPopup' manage=off +bspc rule -a 'MATLAB*:TabCompletionPopup' manage=off +bspc rule -a 'MATLAB*:DefaultOverlayManager.JWindow' manage=off ~/bin/autostart xsetroot -cursor_name left_ptr & diff --git a/emacs.mine/.config/emacs.mine/emacs.org b/emacs.mine/.config/emacs.mine/emacs.org index 5a0a95b..1b82334 100644 --- a/emacs.mine/.config/emacs.mine/emacs.org +++ b/emacs.mine/.config/emacs.mine/emacs.org @@ -4,57 +4,57 @@ * README: After the first run that installs things, run the following #+begin_src emacs-lisp :tangle no - ; code-block not tangled - (all-the-icons-install-fonts) - (fira-code-mode-set-font) + ; code-block not tangled + (all-the-icons-install-fonts) + (fira-code-mode-set-font) #+end_src * Performance #+begin_src emacs-lisp - ;;lsp performance improvement - (setq gc-cons-threshold-original gc-cons-threshold) - (setq gc-cons-threshold (* 1024 1024 100)) - (setq read-process-output-max (* 1024 4024)) + ;;lsp performance improvement + (setq gc-cons-threshold-original gc-cons-threshold) + (setq gc-cons-threshold (* 1024 1024 100)) + (setq read-process-output-max (* 1024 4024)) #+end_src * Packaging Initialize Package sources #+begin_src emacs-lisp - (require 'package) + (require 'package) - (setq package-archives '(("melpa" . "https://melpa.org/packages/") - ("org" . "https://orgmode.org/elpa/") - ("elpa" . "https://elpa.gnu.org/packages/"))) - (package-initialize) - (unless package-archive-contents - (package-refresh-contents)) + (setq package-archives '(("melpa" . "https://melpa.org/packages/") + ("org" . "https://orgmode.org/elpa/") + ("elpa" . "https://elpa.gnu.org/packages/"))) + (package-initialize) + (unless package-archive-contents + (package-refresh-contents)) - ;; Initialize use-package on non-Linux platforms - (unless (package-installed-p 'use-package) - (package-install 'use-package)) + ;; Initialize use-package on non-Linux platforms + (unless (package-installed-p 'use-package) + (package-install 'use-package)) #+end_src #+RESULTS: Make sure to download packages if not present #+begin_src emacs-lisp - (require 'use-package) - (setq package-native-compile t) - (setq use-package-always-ensure t) + (require 'use-package) + (setq package-native-compile t) + (setq use-package-always-ensure t) #+end_src straight #+begin_src emacs-lisp - (defvar bootstrap-version) - (let ((bootstrap-file - (expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory)) - (bootstrap-version 5)) + (defvar bootstrap-version) + (let ((bootstrap-file + (expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory)) + (bootstrap-version 5)) (unless (file-exists-p bootstrap-file) - (with-current-buffer - (url-retrieve-synchronously - "https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el" - 'silent 'inhibit-cookies) - (goto-char (point-max)) - (eval-print-last-sexp))) + (with-current-buffer + (url-retrieve-synchronously + "https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el" + 'silent 'inhibit-cookies) + (goto-char (point-max)) + (eval-print-last-sexp))) (load bootstrap-file nil 'nomessage)) (straight-use-package 'use-package) @@ -69,71 +69,72 @@ remove warning by use-package * Basic Configuration ** Better Defaults #+begin_src emacs-lisp - (setq inhibit-startup-message t) - (scroll-bar-mode -1) ; Disable visible scrollbar - (tool-bar-mode -1) ; Disable the toolbar - (tooltip-mode -1) ; Disable tooltips - (set-fringe-mode 10) ; Give some breathing room + (setq inhibit-startup-message t) + (scroll-bar-mode -1) ; Disable visible scrollbar + (tool-bar-mode -1) ; Disable the toolbar + (tooltip-mode -1) ; Disable tooltips + (set-fringe-mode 10) ; Give some breathing room - (menu-bar-mode -1) ; Disable the menu bar - (winner-mode 1) ; Disable the menu bar - (setq visible-bell nil) ; Set up the visible bell - (column-number-mode) ; Display Column Number in the modline - (setq use-dialog-box nil) ; I don't like to confirm anything with a mouse! - (defalias 'yes-or-no-p 'y-or-n-p) ; I don't want to type 'yes' everytime!, 'y' is enough + (menu-bar-mode -1) ; Disable the menu bar + (winner-mode 1) ; Disable the menu bar + (setq visible-bell nil) ; Set up the visible bell + (column-number-mode) ; Display Column Number in the modline + (setq use-dialog-box nil) ; I don't like to confirm anything with a mouse! + (defalias 'yes-or-no-p 'y-or-n-p) ; I don't want to type 'yes' everytime!, 'y' is enough - (setq comp-deferred-compilation-deny-list '()) ;; turn off bytecompiler warnings - (setq native-comp-async-report-warnings-errors nil) + ;(setq native-comp-deferred-compilation t); emacs 30+ i guess + (setq comp-deferred-compilation-deny-list '()) ;; turn off bytecompiler warnings + (setq native-comp-async-report-warnings-errors nil) #+end_src Emacs Backups trashing local dir! #+begin_src emacs-lisp - (use-package no-littering) - (setq auto-save-file-name-transforms - `((".*" ,(no-littering-expand-var-file-name "auto-save/") t))) - (setq backup-directory-alist `((".*" . "~/.local/share/emacs-backups"))) - (setq make-backup-files t ; backup of a file the first time it is saved. - backup-by-copying t ; don't clobber symlinks - version-control t ; version numbers for backup files - vc-make-backup-files t ; version control for git/vcs dirs - delete-old-versions t ; delete excess backup files silently - delete-by-moving-to-trash t - kept-old-versions 6 ; oldest versions to keep when a new numbered backup is made - kept-new-versions 9 ; newest versions to keep when a new numbered backup is made - auto-save-default t ; auto-save every buffer that visits a file - auto-save-timeout 20 ; number of seconds idle time before auto-save (default: 30) - auto-save-interval 200 ; number of keystrokes between auto-saves (default: 300) - create-lockfiles nil ; don't use lockfiles (default: t) - ) + (use-package no-littering) + (setq auto-save-file-name-transforms + `((".*" ,(no-littering-expand-var-file-name "auto-save/") t))) + (setq backup-directory-alist `((".*" . "~/.local/share/emacs-backups"))) + (setq make-backup-files t ; backup of a file the first time it is saved. + backup-by-copying t ; don't clobber symlinks + version-control t ; version numbers for backup files + vc-make-backup-files t ; version control for git/vcs dirs + delete-old-versions t ; delete excess backup files silently + delete-by-moving-to-trash t + kept-old-versions 6 ; oldest versions to keep when a new numbered backup is made + kept-new-versions 9 ; newest versions to keep when a new numbered backup is made + auto-save-default t ; auto-save every buffer that visits a file + auto-save-timeout 20 ; number of seconds idle time before auto-save (default: 30) + auto-save-interval 200 ; number of keystrokes between auto-saves (default: 300) + create-lockfiles nil ; don't use lockfiles (default: t) + ) #+end_src Better Scrolling #+begin_src emacs-lisp - (setq scroll-conservatively 10) - (setq scroll-margin 3) - ;; (use-package smooth-scrolling - ;; :custom (smooth-scrolling-mode 1)) + (setq scroll-conservatively 10) + (setq scroll-margin 3) + ;; (use-package smooth-scrolling + ;; :custom (smooth-scrolling-mode 1)) #+end_src ** Fonts Setting fonts here as vars to stay sane #+begin_src emacs-lisp - (setq my/ui/monofont "FiraCode Nerd Font") - (setq my/ui/varfont "Noto Serif") - (setq my/ui/arabicfont "Noto Sans Arabic") + (setq my/ui/monofont "FiraCode Nerd Font") + (setq my/ui/varfont "Noto Serif") + (setq my/ui/arabicfont "Noto Sans Arabic") #+end_src #+begin_src emacs-lisp - (set-face-attribute 'default nil :font my/ui/monofont :height 90) - (set-face-attribute 'fixed-pitch nil :font my/ui/monofont :height 90) - (set-face-attribute 'variable-pitch nil :font my/ui/varfont :height 90) - ;; Info has a horrible mono font - (set-face-attribute 'Info-quoted nil :font my/ui/monofont :height 90) + (set-face-attribute 'default nil :font my/ui/monofont :height 90) + (set-face-attribute 'fixed-pitch nil :font my/ui/monofont :height 90) + (set-face-attribute 'variable-pitch nil :font my/ui/varfont :height 90) + ;; Info has a horrible mono font + (set-face-attribute 'Info-quoted nil :font my/ui/monofont :height 90) #+end_src emacs-client frames don't adhire to the font for some reason, need to run this hook: #+begin_src emacs-lisp - (defun my/ui/font-check () + (defun my/ui/font-check () "Do font check, then remove self from `focus-in-hook'; need to run this just once." (set-face-attribute 'default nil :font my/ui/monofont :height 90) (set-face-attribute 'fixed-pitch nil :font my/ui/monofont :height 90) @@ -143,7 +144,7 @@ run this hook: ;; Arabic (when window-system (set-fontset-font "fontset-default" '(#x600 . #x6ff) my/ui/arabicfont)) (remove-hook 'focus-in-hook #'my/ui/font-check)) - (add-hook 'focus-in-hook #'my/ui/font-check) + (add-hook 'focus-in-hook #'my/ui/font-check) #+end_src Arabic fonts :) @@ -154,33 +155,33 @@ Arabic fonts :) ** Theme Run =M-x= all-the-icons-install-fonts for the first time! #+begin_src emacs-lisp - (use-package all-the-icons) + (use-package all-the-icons) #+end_src The status line #+begin_src emacs-lisp (use-package doom-modeline - :ensure t - :init (doom-modeline-mode 1) - :config - (display-battery-mode 1) - :custom - ((doom-modeline-height 15) (doom-modeline-icon t))) + :ensure t + :init (doom-modeline-mode 1) + :config + (display-battery-mode 1) + :custom + ((doom-modeline-height 15) (doom-modeline-icon t))) #+end_src buffers with dimmed colors #+begin_src emacs-lisp - (use-package solaire-mode - :init (solaire-global-mode +1)) + (use-package solaire-mode + :init (solaire-global-mode +1)) #+end_src Actuall Theme: #+begin_src emacs-lisp - (use-package doom-themes + (use-package doom-themes :config ;; Global settings (defaults) (setq doom-themes-enable-bold t ; if nil, bold is universally disabled - doom-themes-enable-italic t) ; if nil, italics is universally disabled + doom-themes-enable-italic t) ; if nil, italics is universally disabled (load-theme 'doom-gruvbox t) ;; (load-theme 'doom-one-light t) (custom-set-faces @@ -192,7 +193,7 @@ Actuall Theme: '(org-date ((t (:inherit fixed-pitch)))) ;; '(ivy-posframe-border ((t (:background "#ffffff"))))) - ) + ) ;; Enable custom neotree theme (all-the-icons must be installed!) (doom-themes-neotree-config) @@ -205,56 +206,56 @@ Actuall Theme: Transparency! #+begin_src emacs-lisp - ;; for the first frame - (set-frame-parameter nil 'alpha-background 0.9) - ;; for other frames - (add-hook 'server-after-make-frame-hook - (lambda nil (set-frame-parameter nil 'alpha-background 0.9))) + ;; for the first frame + (set-frame-parameter nil 'alpha-background 0.9) + ;; for other frames + (add-hook 'server-after-make-frame-hook + (lambda nil (set-frame-parameter nil 'alpha-background 0.9))) #+end_src Center text in the frame, looks nice ;) #+begin_src emacs-lisp - (use-package olivetti + (use-package olivetti :diminish :hook (text-mode . olivetti-mode) :hook (prog-mode . olivetti-mode) :hook (Info-mode . olivetti-mode) :config - (setq olivetti-body-width 120)) - + (setq-default olivetti-body-width 120)) + #+end_src ** Line Numbers I don't use line numbers anymore, chad.png - + DEPRECATED Enable Globally #+begin_src emacs-lisp :tangle no - ; this block has ":tangle no" - (global-display-line-numbers-mode 0) + ; this block has ":tangle no" + (global-display-line-numbers-mode 0) #+end_src DEPRECATED Disable for the following modes #+begin_src emacs-lisp :tangle no - (defun disable-line-numbers () "Disables line number" (interactive) (display-line-numbers-mode 0)) + (defun disable-line-numbers () "Disables line number" (interactive) (display-line-numbers-mode 0)) - (dolist (mode '(org-mode-hook - term-mode-hook - treemacs-mode-hook - cargo-test-mode-hook - shell-mode-hook - eshell-mode-hook)) + (dolist (mode '(org-mode-hook + term-mode-hook + treemacs-mode-hook + cargo-test-mode-hook + shell-mode-hook + eshell-mode-hook)) (add-hook mode #'disable-line-numbers)) #+end_src ONLY IN PROG! #+begin_src emacs-lisp - ;; (add-hook 'prog-mode-hook 'display-line-numbers-mode) + ;; (add-hook 'prog-mode-hook 'display-line-numbers-mode) #+end_src - + ** Undo Self explanatory #+begin_src emacs-lisp - (use-package undo-fu) + (use-package undo-fu) #+end_src ** Org roam warning @@ -265,11 +266,11 @@ Self explanatory ** Tab Width *8* Spaces for a single tab is too much #+begin_src emacs-lisp - (setq-default tab-width 4) + (setq-default tab-width 4) #+end_src Spaces > Tabs #+begin_src emacs-lisp - (setq-default indent-tabs-mode nil) + (setq-default indent-tabs-mode nil) #+end_src #+RESULTS: @@ -278,10 +279,10 @@ Spaces > Tabs should i really be commiting this? :> ** auth sources #+begin_src emacs-lisp - (setq auth-sources '("~/.authinfo.gpg" - "secrets:local"; keepassxc db - "~/.authinfo" - "~/.netrc")) + (setq auth-sources '("~/.authinfo.gpg" + "secrets:local"; keepassxc db + "~/.authinfo" + "~/.netrc")) (require 'epa-file) (epa-file-enable) #+end_src @@ -289,7 +290,7 @@ should i really be commiting this? :> * Help =helpful-key= and =describe-function= #+begin_src emacs-lisp - (use-package helpful + (use-package helpful :commands (helpful-callable helpful-variable helpful-command helpful-key) :custom (counsel-describe-function-function #'helpful-callable) @@ -304,14 +305,14 @@ should i really be commiting this? :> * Keybinds Single Esc to Quit, instead of *three* #+begin_src emacs-lisp - (global-set-key (kbd "") 'keyboard-escape-quit) + (global-set-key (kbd "") 'keyboard-escape-quit) #+end_src ** Function keys #+begin_src emacs-lisp - (global-set-key (kbd "M-") '(lambda () (interactive) (org-agenda nil "n"))) - (global-set-key (kbd "" ) '(lambda () (interactive) (org-ql-view "Overview: Agenda-like"))) - (global-set-key (kbd "M-") 'elfeed-dashboard) + (global-set-key (kbd "M-") '(lambda () (interactive) (org-agenda nil "n"))) + (global-set-key (kbd "" ) '(lambda () (interactive) (org-ql-view "Overview: Agenda-like"))) + (global-set-key (kbd "M-") 'elfeed-dashboard) #+end_src ** General.el @@ -319,7 +320,7 @@ Eval First and Last at least block! Edit: honestly I have no clue wtf that meant, or why I wrote it, but I will keep it *** use-package #+begin_src emacs-lisp - (use-package general + (use-package general :after evil :defer t :preface @@ -327,31 +328,31 @@ Edit: honestly I have no clue wtf that meant, or why I wrote it, but I will keep *** Helper Functions #+begin_src emacs-lisp - (defun my/keybind/config () + (defun my/keybind/config () (interactive) (counsel-find-file "emacs" "~/.config/")) - (defun my/keybind/capture-inbox () + (defun my/keybind/capture-inbox () (interactive) (org-capture nil "gi")) - - (defun my/counsel-insert-file-path () + + (defun my/counsel-insert-file-path () "Insert relative file path using counsel minibuffer" (interactive) (unless (featurep 'counsel) (require 'counsel)) (ivy-read "Insert filename: " 'read-file-name-internal - :matcher #'counsel--find-file-matcher - :action - (lambda (x) - (insert (file-relative-name x))))) + :matcher #'counsel--find-file-matcher + :action + (lambda (x) + (insert (file-relative-name x))))) #+end_src *** leader-keys **** config head declartion #+begin_src emacs-lisp - :config - (general-create-definer my/leader-keys + :config + (general-create-definer my/leader-keys :keymaps 'override :states '(normal insert visual emacs) :prefix "SPC" @@ -362,200 +363,200 @@ Edit: honestly I have no clue wtf that meant, or why I wrote it, but I will keep **** Symbols, Spaces, Numbers, u, tabs #+begin_src emacs-lisp - (my/leader-keys - "." '(counsel-find-file :which-key "find file") - "SPC" '(counsel-projectile-find-file :which-key "projectile find file") - "/" '(counsel-projectile-rg :which-key "projects") - "," '(counsel-rg :which-key "rg") - "u" '(universal-argument :which-key "universal arg") - ";" '(counsel-M-x :which-key "M-x") - ":" '(eval-expression :which-key "eval expression") + (my/leader-keys + "." '(counsel-find-file :which-key "find file") + "SPC" '(counsel-projectile-find-file :which-key "projectile find file") + "/" '(counsel-projectile-rg :which-key "projects") + "," '(counsel-rg :which-key "rg") + "u" '(universal-argument :which-key "universal arg") + ";" '(counsel-M-x :which-key "M-x") + ":" '(eval-expression :which-key "eval expression") #+end_src **** Toggles (t) #+begin_src emacs-lisp - "t" '(:ignore t :which-key "toggles") + "t" '(:ignore t :which-key "toggles") #+end_src **** Help (h) #+begin_src emacs-lisp - "h" '(:ignore t :which-key "Help") + "h" '(:ignore t :which-key "Help") - "ht" '(counsel-load-theme :which-key "Choose Theme") - "hk" '(helpful-key :which-key "Describe Key") - "hf" '(counsel-describe-function :which-key "Describe Function") - "hv" '(counsel-describe-variable :which-key "Describe Variable") - "hF" '(counsel-describe-face :which-key "Describe Face") - "hi" '(info :which-key "info") - "hm" '(woman :which-key "woman") + "ht" '(counsel-load-theme :which-key "Choose Theme") + "hk" '(helpful-key :which-key "Describe Key") + "hf" '(counsel-describe-function :which-key "Describe Function") + "hv" '(counsel-describe-variable :which-key "Describe Variable") + "hF" '(counsel-describe-face :which-key "Describe Face") + "hi" '(info :which-key "info") + "hm" '(woman :which-key "woman") #+end_src **** search (s) #+begin_src emacs-lisp - "s" '(:ignore t :which-key "Search") - - "sb" '(swiper :which-key "swiper") + "s" '(:ignore t :which-key "Search") + + "sb" '(swiper :which-key "swiper") #+end_src **** Files (f) #+begin_src emacs-lisp - "f" '(:ignore t :which-key "Files") + "f" '(:ignore t :which-key "Files") - "fr" '(counsel-recentf :which-key "Recent Files") - "fp" '(my/keybind/config :which-key "Config") - "fd" '(dired :which-key "dired prompt") - "fD" '(dired-jump :which-key "dired current") + "fr" '(counsel-recentf :which-key "Recent Files") + "fp" '(my/keybind/config :which-key "Config") + "fd" '(dired :which-key "dired prompt") + "fD" '(dired-jump :which-key "dired current") #+end_src **** Roam and Org, Capture, Inbox(r/C/I) #+begin_src emacs-lisp - "r" '(:ignore t :which-key "Roam+Org") - - "ra" '(org-agenda :which-key "Agenda") - "rA" '(cfw:open-org-calendar :which-key "Calendar") - "rh" '(helm-org-ql-views :which-key "org-ql views") - - "rD" '(deft :which-key "Deft") - "rf" '(org-roam-node-find :which-key "Find Note") - "rl" '(org-roam-buffer-toggle :which-key "Toggle Sidebar") - "rr" '(org-roam-db-sync :which-key "Roam Sync") - "ri" '(org-roam-node-insert :which-key "Node Insert") - "rI" '(org-id-get-create :which-key "Org Id get/create") - "rT" '(counsel-org-tag :which-key "Org Id get/create") - - - ;; Dailies - "rd" '(:ignore t :which-key "Dailies") - "rdD" '(org-roam-dailies-goto-date :which-key "Go To Date") - "rdT" '(org-roam-dailies-goto-today :which-key "Go To Today") - "rdt" '(org-roam-dailies-capture-today :which-key "Capture Today") - "rdY" '(org-roam-dailies-goto-yesterday :which-key "Go To yesterday") - "rdy" '(org-roam-dailies-capture-yesterday :which-key "Capture yesterday") - "rdM" '(org-roam-dailies-goto-tomorrow :which-key "Go To tomorrow") - "rdm" '(org-roam-dailies-capture-tomorrow :which-key "Capture tomorrow") - - ;; Clocks - "rc" '(:ignore t :which-key "Clocks") - "rci" '(org-clock-in :which-key "Clock In") - "rcI" '(org-clock-in-last :which-key "Clock In Last") - "rco" '(org-clock-out :which-key "Clock Out") - "rcp" '(org-pomodoro :which-key "Pomodoro") - "rcR" '(org-clock-report :which-key "Clock Report") - "rcg" '(org-clock-goto :which-key "Goto Clock") - - ;; Anki - "rn" '(:ignore t :which-key "AnKi") - "rnp" '(anki-editor-push-notes :which-key "Clock In") - "rni" '(anki-editor-insert-notes :which-key "Clock In") - - - ;; Schedules and Deadlines - ;; TODO! + "r" '(:ignore t :which-key "Roam+Org") + + "ra" '(org-agenda :which-key "Agenda") + "rA" '(cfw:open-org-calendar :which-key "Calendar") + "rh" '(helm-org-ql-views :which-key "org-ql views") + + "rD" '(deft :which-key "Deft") + "rf" '(org-roam-node-find :which-key "Find Note") + "rl" '(org-roam-buffer-toggle :which-key "Toggle Sidebar") + "rr" '(org-roam-db-sync :which-key "Roam Sync") + "ri" '(org-roam-node-insert :which-key "Node Insert") + "rI" '(org-id-get-create :which-key "Org Id get/create") + "rT" '(counsel-org-tag :which-key "Org Id get/create") + + + ;; Dailies + "rd" '(:ignore t :which-key "Dailies") + "rdD" '(org-roam-dailies-goto-date :which-key "Go To Date") + "rdT" '(org-roam-dailies-goto-today :which-key "Go To Today") + "rdt" '(org-roam-dailies-capture-today :which-key "Capture Today") + "rdY" '(org-roam-dailies-goto-yesterday :which-key "Go To yesterday") + "rdy" '(org-roam-dailies-capture-yesterday :which-key "Capture yesterday") + "rdM" '(org-roam-dailies-goto-tomorrow :which-key "Go To tomorrow") + "rdm" '(org-roam-dailies-capture-tomorrow :which-key "Capture tomorrow") + + ;; Clocks + "rc" '(:ignore t :which-key "Clocks") + "rci" '(org-clock-in :which-key "Clock In") + "rcI" '(org-clock-in-last :which-key "Clock In Last") + "rco" '(org-clock-out :which-key "Clock Out") + "rcp" '(org-pomodoro :which-key "Pomodoro") + "rcR" '(org-clock-report :which-key "Clock Report") + "rcg" '(org-clock-goto :which-key "Goto Clock") + + ;; Anki + "rn" '(:ignore t :which-key "AnKi") + "rnp" '(anki-editor-push-notes :which-key "Clock In") + "rni" '(anki-editor-insert-notes :which-key "Clock In") + + + ;; Schedules and Deadlines + ;; TODO! #+end_src Capture #+begin_src emacs-lisp - "C" '(org-capture :which-key "Org-Capture") - "I" '(my/keybind/capture-inbox :which-key "Capture Inbox") + "C" '(org-capture :which-key "Org-Capture") + "I" '(my/keybind/capture-inbox :which-key "Capture Inbox") #+end_src **** Open (o) #+begin_src emacs-lisp - "o" '(:ignore t :which-key "Open") + "o" '(:ignore t :which-key "Open") - "oT" '(vterm :which-key "Vterm in current window") - ; use C-t - ;"ot" '(vterm-toggle :which-key "Vterm in other window") - "ob" '(bookmark-jump :which-key "Bookmark Jump") - "oB" '(bookmark-set :which-key "Bookmark set") - "op" '(list-processes :which-key "List Proccess") + "oT" '(vterm :which-key "Vterm in current window") + ; use C-t + ;"ot" '(vterm-toggle :which-key "Vterm in other window") + "ob" '(bookmark-jump :which-key "Bookmark Jump") + "oB" '(bookmark-set :which-key "Bookmark set") + "op" '(list-processes :which-key "List Proccess") - "om" '(mu4e :which-key "mu4e") - "ot" '(telega :which-key "Telega") - "oc" '(circe :which-key "Circe") - "os" '(easy-hugo :which-key "site") + "om" '(mu4e :which-key "mu4e") + "ot" '(telega :which-key "Telega") + "oc" '(circe :which-key "Circe") + "os" '(easy-hugo :which-key "site") - "oe" '(elfeed-dashboard :which-key "Elfeed Dashboard") + "oe" '(elfeed-dashboard :which-key "Elfeed Dashboard") #+end_src **** Insert (i) #+begin_src emacs-lisp - "i" '(:ignore t :which-key "Insert") - "ie" '(emoji-insert :which-key "Emoji") - "if" '(my/counsel-insert-file-path :which-key "Insert Relative path") - "ik" '(helm-show-kill-ring :which-key "Insert from Kill ring") + "i" '(:ignore t :which-key "Insert") + "ie" '(emoji-insert :which-key "Emoji") + "if" '(my/counsel-insert-file-path :which-key "Insert Relative path") + "ik" '(helm-show-kill-ring :which-key "Insert from Kill ring") #+end_src **** Buffers (b) #+begin_src emacs-lisp - "b" '(:ignore t :which-key "buffers") + "b" '(:ignore t :which-key "buffers") - "bs" '(save-buffer :which-key "Save Buffer") - "bk" '(kill-current-buffer :which-key "Kill Buffer") - "bl" '(evil-switch-to-windows-last-buffer :which-key "Last Buffer") - "bi" '(ibuffer :which-key "Ibuffer") - "br" '(revert-buffer :which-key "Revert Buffer") - "bb" '(helm-buffers-list :which-key "Switch to buffer") - - "bc" '(my/circe/helm-buffers :which-key "Circe Helm") - "bt" '(telega-switch-buffer :which-key "Telega buffers") + "bs" '(save-buffer :which-key "Save Buffer") + "bk" '(kill-current-buffer :which-key "Kill Buffer") + "bl" '(evil-switch-to-windows-last-buffer :which-key "Last Buffer") + "bi" '(ibuffer :which-key "Ibuffer") + "br" '(revert-buffer :which-key "Revert Buffer") + "bb" '(helm-buffers-list :which-key "Switch to buffer") + + "bc" '(my/circe/helm-buffers :which-key "Circe Helm") + "bt" '(telega-switch-buffer :which-key "Telega buffers") #+end_src **** Windows (w) #+begin_src emacs-lisp - "w" '(:ignore t :which-key "Windows") - - "wj" '(evil-window-down :which-key "Window Down") - "wk" '(evil-window-up :which-key "Window Up") - "wl" '(evil-window-right :which-key "Window Left") - "wh" '(evil-window-left :which-key "Window Down") - "wJ" '(evil-window-move-very-bottom :which-key "Move Window Down") - "wK" '(evil-window-move-very-top :which-key "Move Window Up") - "wL" '(evil-window-move-far-right :which-key "Move Window Left") - "wH" '(evil-window-move-far-left :which-key "Move Window Down") - - "ws" '(evil-window-split :which-key "Window Split") - "wv" '(evil-window-vsplit :which-key "Window Vsplit") - "wd" '(evil-window-delete :which-key "Window delete") - "wu" '(winner-undo :which-key "Window Undo") - "wo" '(other-window :which-key "Window Other") - "wr" '(winner-redo :which-key "Window Redo") - "wt" '(treemacs :which-key "Treemacs") + "w" '(:ignore t :which-key "Windows") + + "wj" '(evil-window-down :which-key "Window Down") + "wk" '(evil-window-up :which-key "Window Up") + "wl" '(evil-window-right :which-key "Window Left") + "wh" '(evil-window-left :which-key "Window Down") + "wJ" '(evil-window-move-very-bottom :which-key "Move Window Down") + "wK" '(evil-window-move-very-top :which-key "Move Window Up") + "wL" '(evil-window-move-far-right :which-key "Move Window Left") + "wH" '(evil-window-move-far-left :which-key "Move Window Down") + + "ws" '(evil-window-split :which-key "Window Split") + "wv" '(evil-window-vsplit :which-key "Window Vsplit") + "wd" '(evil-window-delete :which-key "Window delete") + "wu" '(winner-undo :which-key "Window Undo") + "wo" '(other-window :which-key "Window Other") + "wr" '(winner-redo :which-key "Window Redo") + "wt" '(treemacs :which-key "Treemacs") #+end_src **** Code (c) #+begin_src emacs-lisp - "c" '(:ignore t :which-key "code") + "c" '(:ignore t :which-key "code") - "cE" '(eval-defun :which-key "Eval Function at Point") - "ce" '(eval-last-sexp :which-key "Eval Function") - "cb" '(eval-buffer :which-key "Eval Buffer") - "ca" '(lsp-execute-code-action :which-key "Code Action") - "cl" '(lsp-avy-lens :which-key "Code Action") - "ci" '(lsp-ui-imenu :which-key "lsp imenu") - "cr" '(lsp-rename :which-key "rename") - ;"cs" '(lsp-find-refernces :which-key "find refernces") - "cd" '(lsp-find-definition :which-key "goto defintion") - "cD" '(lsp-ui-peek-find-definitions :which-key "goto defintion") - "cs" '(lsp-ui-peek-find-refernces :which-key "find refernces") - "cc" '(recompile :which-key "find refernces") - "cC" '(compile :which-key "find refernces") + "cE" '(eval-defun :which-key "Eval Function at Point") + "ce" '(eval-last-sexp :which-key "Eval Function") + "cb" '(eval-buffer :which-key "Eval Buffer") + "ca" '(lsp-execute-code-action :which-key "Code Action") + "cl" '(lsp-avy-lens :which-key "Code Action") + "ci" '(lsp-ui-imenu :which-key "lsp imenu") + "cr" '(lsp-rename :which-key "rename") + ;"cs" '(lsp-find-refernces :which-key "find refernces") + "cd" '(lsp-find-definition :which-key "goto defintion") + "cD" '(lsp-ui-peek-find-definitions :which-key "goto defintion") + "cs" '(lsp-ui-peek-find-refernces :which-key "find refernces") + "cc" '(recompile :which-key "find refernces") + "cC" '(compile :which-key "find refernces") #+end_src **** Git (g) #+begin_src emacs-lisp - "g" '(:ignore t :which-key "Git") - "gg" '(magit-status :which-key "Magit") + "g" '(:ignore t :which-key "Git") + "gg" '(magit-status :which-key "Magit") #+end_src **** Projectile (p) #+begin_src emacs-lisp - "p" '(projectile-command-map t :which-key "Projectile") + "p" '(projectile-command-map t :which-key "Projectile") #+end_src **** Quit (q) #+begin_src emacs-lisp - "q" '(:ignore t :which-key "Quit and Stuff") - "qf" '(delete-frame :which-key "Close Frame") + "q" '(:ignore t :which-key "Quit and Stuff") + "qf" '(delete-frame :which-key "Close Frame") #+end_src *** Closing Brackets @@ -566,20 +567,20 @@ Capture ** Evil *** Basic Evil #+begin_src emacs-lisp - (use-package evil + (use-package evil :init (setq evil-want-integration t - evil-want-keybinding nil - evil-want-C-u-scroll t - evil-want-C-w-delete t - evil-want-C-i-jump t - evil-want-Y-yank-to-eol t - evil-normal-state-cursor 'box - evil-emacs-state-cursor '(box +evil-emacs-cursor-fn); TODO: fix - evil-insert-state-cursor 'bar - evil-visual-state-cursor 'hollow - evil-undo-system 'undo-redo) - + evil-want-keybinding nil + evil-want-C-u-scroll t + evil-want-C-w-delete t + evil-want-C-i-jump t + evil-want-Y-yank-to-eol t + evil-normal-state-cursor 'box + evil-emacs-state-cursor '(box +evil-emacs-cursor-fn); TODO: fix + evil-insert-state-cursor 'bar + evil-visual-state-cursor 'hollow + evil-undo-system 'undo-redo) + :config (evil-mode 1) @@ -599,7 +600,6 @@ Capture (define-key evil-insert-state-map "\C-b" 'evil-backward-char) (define-key evil-visual-state-map "\C-b" 'evil-backward-char) - (define-key evil-insert-state-map "\C-d" 'evil-delete-char) (define-key evil-normal-state-map "\C-i" 'evil-jump-forward) @@ -633,43 +633,43 @@ Capture #+end_src (Not Working) Emacs State Cursor Color #+begin_src emacs-lisp - (defun +evil-default-cursor-fn (interactive) + (defun +evil-default-cursor-fn (interactive) (evil-set-cursor-color (get 'cursor 'evil-normal-color))) - (defun +evil-emacs-cursor-fn () (interactive) + (defun +evil-emacs-cursor-fn () (interactive) (evil-set-cursor-color (get 'cursor 'evil-emacs-color))) #+end_src *** Evil Collection #+begin_src emacs-lisp - (use-package evil-collection + (use-package evil-collection :after evil ; :custom - ; (evil-collection-outline-bind-tab-p t) + ; (evil-collection-outline-bind-tab-p t) :config (evil-collection-init)) #+end_src *** Evil Escape #+begin_src emacs-lisp - ;; ; https://emacs.stackexchange.com/questions/19961/using-jk-to-exit-insert-mode-with-key-chord-or-anything-else - ;; (defun my-jk () - ;; (interactive) - ;; (let* ((initial-key ?j) - ;; (final-key ?k) - ;; (timeout 0.5) - ;; (event (read-event nil nil timeout))) - ;; (if event - ;; ;; timeout met - ;; (if (and (characterp event) (= event final-key)) - ;; (evil-normal-state) - ;; (insert initial-key) - ;; (push event unread-command-events)) - ;; ;; timeout exceeded - ;; (insert initial-key)))) + ;; ; https://emacs.stackexchange.com/questions/19961/using-jk-to-exit-insert-mode-with-key-chord-or-anything-else + ;; (defun my-jk () + ;; (interactive) + ;; (let* ((initial-key ?j) + ;; (final-key ?k) + ;; (timeout 0.5) + ;; (event (read-event nil nil timeout))) + ;; (if event + ;; ;; timeout met + ;; (if (and (characterp event) (= event final-key)) + ;; (evil-normal-state) + ;; (insert initial-key) + ;; (push event unread-command-events)) + ;; ;; timeout exceeded + ;; (insert initial-key)))) - ;; (define-key evil-insert-state-map (kbd "j") 'my-jk) + ;; (define-key evil-insert-state-map (kbd "j") 'my-jk) - (use-package key-chord + (use-package key-chord :after evil :custom (key-chord-two-keys-delay 0.05) @@ -679,133 +679,132 @@ Capture (key-chord-define evil-insert-state-map "jk" 'evil-normal-state) (key-chord-define evil-replace-state-map "jk" 'evil-normal-state)) - - ;; (use-package evil-escape - ;; :after evil - ;; :init - ;; (setq 'evil-escape-excluded-major-modes '(magit-status-mode)) - ;; (evil-escape-mode) - ;; :config - ;; (setq evil-escape-key-sequence "jk") - ;; (setq evil-escape-delay 0.2) - ;; (setq evil-escape-unordered-key-sequence t)) + ;; (use-package evil-escape + ;; :after evil + ;; :init + ;; (setq 'evil-escape-excluded-major-modes '(magit-status-mode)) + ;; (evil-escape-mode) + ;; :config + ;; (setq evil-escape-key-sequence "jk") + ;; (setq evil-escape-delay 0.2) + ;; (setq evil-escape-unordered-key-sequence t)) #+end_src *** Evil args [[https://github.com/wcsmith/evil-args][wcsmith/evil-args: Motions and text objects for delimited arguments in Evil.]] #+begin_src emacs-lisp - (use-package evil-args + (use-package evil-args :config ;; bind evil-args text objects (define-key evil-inner-text-objects-map "a" 'evil-inner-arg) (define-key evil-outer-text-objects-map "a" 'evil-outer-arg) - + ;; bind evil-forward/backward-args (define-key evil-normal-state-map "L" 'evil-forward-arg) (define-key evil-normal-state-map "H" 'evil-backward-arg) (define-key evil-motion-state-map "L" 'evil-forward-arg) (define-key evil-motion-state-map "H" 'evil-backward-arg) - + ;; bind evil-jump-out-args ;; (define-key evil-normal-state-map "K" 'evil-jump-out-args)) - ) + ) #+end_src *** Evil Easy Motion [[https://github.com/PythonNut/evil-easymotion][PythonNut/evil-easymotion: A port of vim easymotion to Emacs' evil-mode]] #+begin_src emacs-lisp - (use-package evil-easymotion + (use-package evil-easymotion :config (evilem-default-keybindings "SPC")) - + #+end_src *** evil-org #+begin_src emacs-lisp - (use-package evil-org - :hook (org-mode . evil-org-mode)) + (use-package evil-org + :hook (org-mode . evil-org-mode)) #+end_src *** Evil snipe [[https://github.com/hlissner/evil-snipe][hlissner/evil-snipe: 2-char searching ala vim-sneak & vim-seek, for evil-mode]] #+begin_src emacs-lisp - (use-package evil-snipe - :config - (setq evil-snipe-repeat-scope 'whole-visible) - (evil-snipe-mode +1)) + (use-package evil-snipe + :config + (setq evil-snipe-repeat-scope 'whole-visible) + (evil-snipe-mode +1)) #+end_src *** Evil numbers #+begin_src emacs-lisp - (use-package evil-numbers - :config + (use-package evil-numbers + :config (evil-define-key '(normal visual) 'global (kbd "C-c +") 'evil-numbers/inc-at-pt) (evil-define-key '(normal visual) 'global (kbd "C-c -") 'evil-numbers/dec-at-pt) (evil-define-key '(normal visual) 'global (kbd "C-c C-+") 'evil-numbers/inc-at-pt-incremental) (evil-define-key '(normal visual) 'global (kbd "C-c C--") 'evil-numbers/dec-at-pt-incremental) - ) + ) #+end_src * Completions ** ivy Better Completions #+begin_src emacs-lisp - (use-package ivy + (use-package ivy :defer t :diminish :bind (("C-s" . swiper); TODO: move to Keybinds - :map ivy-minibuffer-map - ("TAB" . ivy-alt-done) - ("C-l" . ivy-alt-done) - ("C-j" . ivy-next-line) - ("C-k" . ivy-previous-line) - :map ivy-switch-buffer-map - ("C-k" . ivy-previous-line) - ("C-l" . ivy-done) - ("C-d" . ivy-switch-buffer-kill) - :map ivy-reverse-i-search-map - ("C-k" . ivy-previous-line) - ("C-d" . ivy-reverse-i-search-kill)) + :map ivy-minibuffer-map + ("TAB" . ivy-alt-done) + ("C-l" . ivy-alt-done) + ("C-j" . ivy-next-line) + ("C-k" . ivy-previous-line) + :map ivy-switch-buffer-map + ("C-k" . ivy-previous-line) + ("C-l" . ivy-done) + ("C-d" . ivy-switch-buffer-kill) + :map ivy-reverse-i-search-map + ("C-k" . ivy-previous-line) + ("C-d" . ivy-reverse-i-search-kill)) :config (ivy-mode 1)) #+end_src Ivy Rich for having =M-x= description and keybinds #+begin_src emacs-lisp - (use-package ivy-rich + (use-package ivy-rich :after counsel :init (ivy-rich-mode 1)) #+end_src Ivy floating #+begin_src emacs-lisp :tangle no - (use-package ivy-posframe + (use-package ivy-posframe :after ivy :diminish :custom-face (ivy-posframe-border ((t (:background "#ffffff")))) :config (setq ivy-posframe-display-functions-alist '((t . ivy-posframe-display-at-frame-top-center)) - ivy-posframe-height-alist '((t . 20)) - ivy-posframe-parameters '((internal-border-width . 10))) + ivy-posframe-height-alist '((t . 20)) + ivy-posframe-parameters '((internal-border-width . 10))) (setq ivy-posframe-width 120) (setq ivy-posframe-parameters - '((left-fringe . 8) - (right-fringe . 8))) - + '((left-fringe . 8) + (right-fringe . 8))) + (ivy-posframe-mode +1)) - + #+end_src ** Counsel #+begin_src emacs-lisp - (use-package counsel + (use-package counsel :defer t :bind (("M-x" . counsel-M-x) - ;("C-x b" . counsel-ibuffer) - ("C-x C-f" . counsel-find-file) - :map minibuffer-local-map - ("C-r" . 'counsel-minibuffer-history) - ("C-w" . 'evil-delete-backward-word)) + ;("C-x b" . counsel-ibuffer) + ("C-x C-f" . counsel-find-file) + :map minibuffer-local-map + ("C-r" . 'counsel-minibuffer-history) + ("C-w" . 'evil-delete-backward-word)) :config (setq ivy-initial-inputs-alist nil)) ;; Don't start searches with '^' #+end_src @@ -813,38 +812,38 @@ Ivy floating slow loading! defer it #+begin_src emacs-lisp (use-package which-key - :defer 10 - :diminish which-key-mode - :config - (which-key-mode) - (setq which-key-idle-delay 1 - which-key-max-display-columns 5)) + :defer 10 + :diminish which-key-mode + :config + (which-key-mode) + (setq which-key-idle-delay 1 + which-key-max-display-columns 5)) #+end_src ** Company Mode #+begin_src emacs-lisp (use-package company - :ensure - :defer 5 - :diminish company-mode - :custom - (company-tooltip-minimum-width 40) ;reduce flicker due to changing width - (global-company-mode t) - (company-idle-delay 0.3) ;; how long to wait until popup - (company-minimum-prefix-length 1) ;; The minimum prefix length for idle completion. - (company-selection-wrap-around t) - ;; (company-begin-commands nil) ;; uncomment to disable popup - :bind - (:map company-active-map - ;; ("C-n". company-select-next) - ("C-w". evil-delete-backward-word) - ("" . company-complete-common-or-cycle) - ("RET" . company-complete-selection) - ;; ("C-p". company-select-previous) - ("M-<". company-select-first) - ("M->". company-select-last))) + :ensure + :defer 5 + :diminish company-mode + :custom + (company-tooltip-minimum-width 40) ;reduce flicker due to changing width + (global-company-mode t) + (company-idle-delay 0.3) ;; how long to wait until popup + (company-minimum-prefix-length 1) ;; The minimum prefix length for idle completion. + (company-selection-wrap-around t) + ;; (company-begin-commands nil) ;; uncomment to disable popup + :bind + (:map company-active-map + ;; ("C-n". company-select-next) + ("C-w". evil-delete-backward-word) + ("" . company-complete-common-or-cycle) + ("RET" . company-complete-selection) + ;; ("C-p". company-select-previous) + ("M-<". company-select-first) + ("M->". company-select-last))) - (use-package company-box + (use-package company-box :after company :hook (company-mode . company-box-mode)) #+end_src @@ -853,74 +852,74 @@ slow loading! defer it #+begin_src emacs-lisp (defun my-backends () (set (make-local-variable 'company-backends) - '((company-capf ;; I think this must come first? - :with - company-yasnippet - company-files - company-dabbrev-code)))) + '((company-capf ;; I think this must come first? + :with + company-yasnippet + company-files + company-dabbrev-code)))) #+end_src ** Prescient better sorting for ivy, company.. #+begin_src emacs-lisp - (use-package prescient + (use-package prescient :defer t :diminish :config (prescient-persist-mode 1)) - (use-package ivy-prescient + (use-package ivy-prescient :after counsel :init (ivy-prescient-mode 1)) - (use-package company-prescient + (use-package company-prescient :after company :config - (company-prescient-mode 1) - (prescient-persist-mode) - ) - ;; (use-package selectrum-prescient) + (company-prescient-mode 1) + (prescient-persist-mode) + ) + ;; (use-package selectrum-prescient) #+end_src ** Yasnippet #+begin_src emacs-lisp - (use-package yasnippet + (use-package yasnippet :defer 9 :config (yas-global-mode)) - (use-package yasnippet-snippets + (use-package yasnippet-snippets :after yasnippet) #+end_src ** Helm #+begin_src emacs-lisp - (use-package helm - :defer t - :config (helm-autoresize-mode 1)) + (use-package helm + :defer t + :config (helm-autoresize-mode 1)) #+end_src * Org-Mode ** Set directories #+begin_src emacs-lisp - (setq org-directory "~/Documents/gtd/" - org-roam-directory "~/Documents/roam/" - ;; org-s-file (car (org-roam-id-find "34f6b040-ea49-421c-ade6-3834a9c86e0f")) - ;; org-books-file (concat org-roam-directory "book_list.org") - org-agenda-files (list org-directory ); org-s-file) - rmh-elfeed-org-files (list "~/Documents/private.el/elfeed.org") - elfeed-dashboard-file "~/Documents/private.el/elfeed-dashboard.org" - org-preview-latex-image-directory "~/.cache/ltx/ltximg" - org-my-anki-file (concat org-roam-directory "anki.org") - org-refile-targets '((org-agenda-files . (:level . 1)))) + (setq org-directory "~/Documents/gtd/" + org-roam-directory "~/Documents/roam/" + ;; org-s-file (car (org-roam-id-find "34f6b040-ea49-421c-ade6-3834a9c86e0f")) + ;; org-books-file (concat org-roam-directory "book_list.org") + org-agenda-files (list org-directory ); org-s-file) + rmh-elfeed-org-files (list "~/Documents/private.el/elfeed.org") + elfeed-dashboard-file "~/Documents/private.el/elfeed-dashboard.org" + org-preview-latex-image-directory "~/.cache/ltx/ltximg" + org-my-anki-file (concat org-roam-directory "anki.org") + org-refile-targets '((org-agenda-files . (:level . 1)))) #+end_src ** use-package Modes To Start #+begin_src emacs-lisp - (defun my/org-mode/org-mode-setup () - (interactive) + (defun my/org-mode/org-mode-setup () + (interactive) (flyspell-mode 1) (org-indent-mode) (variable-pitch-mode 0) @@ -928,109 +927,109 @@ Modes To Start #+end_src use-package #+begin_src emacs-lisp - (use-package org - :defer t - :hook (org-mode . my/org-mode/org-mode-setup) - (org-mode . my/org-mode/load-prettify-symbols); symbols - (org-mode . auto-fill-mode) - :config - (require 'org-tempo) - (require 'org-habit) + (use-package org + :defer t + :hook (org-mode . my/org-mode/org-mode-setup) + (org-mode . my/org-mode/load-prettify-symbols); symbols + (org-mode . auto-fill-mode) + :config + (require 'org-tempo) + (require 'org-habit) (add-to-list 'org-file-apps '("\\.xlsx\\'" . default)) - (setq geiser-default-implementation 'guile) - (setq org-ellipsis " ⤵") - (setq org-agenda-start-with-log-mode t) - (setq org-highlight-latex-and-related '(latex)) - (setq org-log-done 'time) - (setq org-log-into-drawer t) - (dolist (face '((org-document-title . 2.0) - (org-level-1 . 1.5) - (org-level-2 . 1.0) - (org-level-3 . 1.0) - (org-level-4 . 1.0) - (org-level-5 . 1.0) - (org-level-6 . 1.0) - (org-level-7 . 1.0) - (org-level-8 . 1.0))) - ;; (set-face-attribute (car face) nil :font my/ui/varfont :weight 'regular :height (cdr face))) - (set-face-attribute (car face) nil :font my/ui/monofont :weight 'regular :height (cdr face))) - ;) + (setq geiser-default-implementation 'guile) + (setq org-ellipsis " ⤵") + (setq org-agenda-start-with-log-mode t) + (setq org-highlight-latex-and-related '(latex)) + (setq org-log-done 'time) + (setq org-log-into-drawer t) + (dolist (face '((org-document-title . 2.0) + (org-level-1 . 1.5) + (org-level-2 . 1.0) + (org-level-3 . 1.0) + (org-level-4 . 1.0) + (org-level-5 . 1.0) + (org-level-6 . 1.0) + (org-level-7 . 1.0) + (org-level-8 . 1.0))) + ;; (set-face-attribute (car face) nil :font my/ui/varfont :weight 'regular :height (cdr face))) + (set-face-attribute (car face) nil :font my/ui/monofont :weight 'regular :height (cdr face))) + ;) - (setq org-todo-keyword-faces `(("NOW" (:foreground "white" :background "#444527")) - ("NEXT" (:foreground "bright-white" :background "#444527")))) + (setq org-todo-keyword-faces `(("NOW" (:foreground "white" :background "#444527")) + ("NEXT" (:foreground "bright-white" :background "#444527")))) - (setq org-format-latex-options (plist-put org-format-latex-options :scale 1.5)) - ;; Ensure that anything that should be fixed-pitch in Org files appears that way - (set-face-attribute 'org-block nil :foreground nil :inherit 'fixed-pitch) - (set-face-attribute 'org-code nil :inherit '(shadow fixed-pitch)) - (set-face-attribute 'org-table nil :inherit '(shadow fixed-pitch)) - (set-face-attribute 'org-verbatim nil :inherit '(shadow fixed-pitch)) - (set-face-attribute 'org-special-keyword nil :inherit '(font-lock-comment-face fixed-pitch)) - (set-face-attribute 'org-meta-line nil :inherit '(font-lock-comment-face fixed-pitch)) - (set-face-attribute 'org-todo nil :background "#444527" ) - (set-face-attribute 'org-done nil :strike-through t) - (set-face-attribute 'org-headline-done nil :strike-through t) - (set-face-attribute 'org-checkbox nil :inherit 'fixed-pitch)) + (setq org-format-latex-options (plist-put org-format-latex-options :scale 1.5)) + ;; Ensure that anything that should be fixed-pitch in Org files appears that way + (set-face-attribute 'org-block nil :foreground nil :inherit 'fixed-pitch) + (set-face-attribute 'org-code nil :inherit '(shadow fixed-pitch)) + (set-face-attribute 'org-table nil :inherit '(shadow fixed-pitch)) + (set-face-attribute 'org-verbatim nil :inherit '(shadow fixed-pitch)) + (set-face-attribute 'org-special-keyword nil :inherit '(font-lock-comment-face fixed-pitch)) + (set-face-attribute 'org-meta-line nil :inherit '(font-lock-comment-face fixed-pitch)) + (set-face-attribute 'org-todo nil :background "#444527" ) + (set-face-attribute 'org-done nil :strike-through t) + (set-face-attribute 'org-headline-done nil :strike-through t) + (set-face-attribute 'org-checkbox nil :inherit 'fixed-pitch)) #+end_src Capture Templates #+begin_src emacs-lisp (use-package doct - :ensure t - ;;recommended: defer until calling doct - :commands (doct)) + :ensure t + ;;recommended: defer until calling doct + :commands (doct)) #+end_src ** Open with external app #+begin_src emacs-lisp - ;; Excel with xdg-open - ;;(add-to-list 'org-file-apps '("\\.xlsx\\'" . default)) - ;; moved to org use package + ;; Excel with xdg-open + ;;(add-to-list 'org-file-apps '("\\.xlsx\\'" . default)) + ;; moved to org use package #+end_src ** Appearance *** Symbols #+begin_src emacs-lisp - (defun my/org-mode/load-prettify-symbols () + (defun my/org-mode/load-prettify-symbols () (interactive) (setq prettify-symbols-alist - (mapcan (lambda (x) (list x (cons (upcase (car x)) (cdr x)))) - '(("#+begin_src" . ?) - ("#+end_src" . ?) - ("#+begin_example" . ?) - ("#+end_example" . ?) - ("#+header:" . ?) - ("#+name:" . ?﮸) - ("#+title:" . "") - ("#+results:" . ?) - ("#+call:" . ?) - (":properties:" . ?) - (":logbook:" . ?)))) + (mapcan (lambda (x) (list x (cons (upcase (car x)) (cdr x)))) + '(("#+begin_src" . ?) + ("#+end_src" . ?) + ("#+begin_example" . ?) + ("#+end_example" . ?) + ("#+header:" . ?) + ("#+name:" . ?﮸) + ("#+title:" . "") + ("#+results:" . ?) + ("#+call:" . ?) + (":properties:" . ?) + (":logbook:" . ?)))) (prettify-symbols-mode 1)) #+end_src *** COMMENT Visual Fill (center) -I know use olivetti mode, this code block is ignored! +I now use olivetti mode, this code block is ignored! #+begin_src emacs-lisp :tangle no - (defun my/org-mode/org-mode-visual-fill () - (interactive) + (defun my/org-mode/org-mode-visual-fill () + (interactive) (setq visual-fill-column-width 110 - visual-fill-column-center-text t - fill-column 90) + visual-fill-column-center-text t + fill-column 90) (visual-fill-column-mode 1)) #+end_src #+begin_src emacs-lisp :tangle no - (use-package visual-fill-column; center text + (use-package visual-fill-column; center text :hook (org-mode . my/org-mode/org-mode-visual-fill)) #+end_src *** org-bullets #+begin_src emacs-lisp (use-package org-bullets - :after org - :hook (org-mode . org-bullets-mode) - :custom - (org-bullets-bullet-list '("◉" "○" "●" "○" "●" "○" "●"))) + :after org + :hook (org-mode . org-bullets-mode) + :custom + (org-bullets-bullet-list '("◉" "○" "●" "○" "●" "○" "●"))) #+end_src *** Latex @@ -1043,291 +1042,304 @@ scale inline ** Babel Don't confirm, I know what I am doing! #+begin_src emacs-lisp - (setq org-confirm-babel-evaluate nil) + (setq org-confirm-babel-evaluate nil) #+end_src *** Language List #+begin_src emacs-lisp - (org-babel-do-load-languages - 'org-babel-load-languages - '((emacs-lisp . t) - (python . t) - ;(restclient . t) - (sql . t) - ;(mermaid . t) - (octave . t) - (scheme . t) - (shell . t))) + (org-babel-do-load-languages + 'org-babel-load-languages + '((emacs-lisp . t) + (python . t) + ;(restclient . t) + (sql . t) + ;(mermaid . t) + (octave . t) + (scheme . t) + (shell . t))) #+end_src *** Structure Templates Allow fast code insertion #+begin_src emacs-lisp - ;; This is needed as of Org 9.2 + ;; This is needed as of Org 9.2 - (add-to-list 'org-structure-template-alist '("sh" . "src shell")) - (add-to-list 'org-structure-template-alist '("el" . "src emacs-lisp")) - (add-to-list 'org-structure-template-alist '("re" . "src restclient")) - (add-to-list 'org-structure-template-alist '("sq" . "src sql")) - (add-to-list 'org-structure-template-alist '("sql" . "src sql")) - (add-to-list 'org-structure-template-alist '("oc" . "src octave")) - (add-to-list 'org-structure-template-alist '("py" . "src python")) - (add-to-list 'org-structure-template-alist '("scm" . "src scheme")) + (add-to-list 'org-structure-template-alist '("sh" . "src shell")) + (add-to-list 'org-structure-template-alist '("el" . "src emacs-lisp")) + (add-to-list 'org-structure-template-alist '("re" . "src restclient")) + (add-to-list 'org-structure-template-alist '("sq" . "src sql")) + (add-to-list 'org-structure-template-alist '("sql" . "src sql")) + (add-to-list 'org-structure-template-alist '("oc" . "src octave")) + (add-to-list 'org-structure-template-alist '("py" . "src python")) + (add-to-list 'org-structure-template-alist '("scm" . "src scheme")) #+end_src #+RESULTS: *** Mermaid graphs #+begin_src emacs-lisp :tangle no - ; :tangle no - (use-package ob-mermaid - :after org) + ; :tangle no + (use-package ob-mermaid + :after org) #+end_src ** Capture *** Templates #+begin_src emacs-lisp - (setq org-capture-templates - (doct `(("Consume: Read/watch" :keys "c" - :file ,(concat org-directory "inbox.org") - :prepend t - :template ("* %{todo-state} %^{Description}" - ":PROPERTIES:" - ":Created: %U" - ":END:" - "%?") - :children (("Read" :keys "r" - :headline "Read" - :todo-state "TODO") - ("Watch" :keys "w" - :headline "Watch" - :todo-state "TODO"))) - ("Ideas" :keys "i" - :file ,(concat org-directory "inbox.org") - :prepend t - :template ("* %{todo-state} %^{Description}" - ":PROPERTIES:" - ":Created: %U" - ":END:" - "%?") - :children (("Project" :keys "p" - :olp ("Ideas" "Project") - :todo-state "") - ("Blogs" :keys "b" - :olp ("Blog") - :todo-state "") - ("placeholder" :keys "w" - :headline "Watch" - :todo-state "TODO"))) - ("GTD" :keys "g" - :file ,(concat org-directory "inbox.org") - :prepend t - :template ("* %{todo-state} %^{Description}" - ":PROPERTIES:" - ":Created: %U" - ":END:" - "%?") - :children (("Inbox" :keys "i" - :headline "Inbox" - :todo-state "") - ("placeholder" :keys "w" - :headline "Watch" - :todo-state "TODO")))))) + (setq org-capture-templates + (doct `(("Consume: Read/watch" :keys "c" + :file ,(concat org-directory "inbox.org") + :prepend t + :template ("* %{todo-state} %^{Description}" + ":PROPERTIES:" + ":Created: %U" + ":END:" + "%?") + :children (("Read" :keys "r" + :headline "Read" + :todo-state "TODO") + ("Watch" :keys "w" + :headline "Watch" + :todo-state "TODO"))) + ("Ideas" :keys "i" + :file ,(concat org-directory "inbox.org") + :prepend t + :template ("* %{todo-state} %^{Description}" + ":PROPERTIES:" + ":Created: %U" + ":END:" + "%?") + :children (("Project" :keys "p" + :olp ("Ideas" "Project") + :todo-state "") + ("Blogs" :keys "b" + :olp ("Blog") + :todo-state "") + ("placeholder" :keys "w" + :headline "Watch" + :todo-state "TODO"))) + ("GTD" :keys "g" + :file ,(concat org-directory "inbox.org") + :prepend t + :template ("* %{todo-state} %^{Description}" + ":PROPERTIES:" + ":Created: %U" + ":END:" + "%?") + :children (("Inbox" :keys "i" + :headline "Inbox" + :todo-state "") + ("placeholder" :keys "w" + :headline "Watch" + :todo-state "TODO")))))) #+end_src *** Utils launch with =emacsclient -e '(make-orgcapture-frame)'= From: https://yiufung.net/post/anki-org/ #+begin_src emacs-lisp - (defun make-orgcapture-frame () - "Create a new frame and run org-capture." - (interactive) - ;(make-frame '((name . "org-capture") (window-system . x))); window-system breaks for some reason :( - (make-frame '((name . "org-capture"))) - (select-frame-by-name "org-capture") - (counsel-org-capture) - (delete-other-windows)) + (defun make-orgcapture-frame () + "Create a new frame and run org-capture." + (interactive) + ;(make-frame '((name . "org-capture") (window-system . x))); window-system breaks for some reason :( + (make-frame '((name . "org-capture"))) + (select-frame-by-name "org-capture") + (counsel-org-capture) + (delete-other-windows)) #+end_src ** Agenda *** Customizations #+begin_src emacs-lisp ;;laggy :( - (setq org-agenda-show-outline-path nil) + (setq org-agenda-show-outline-path nil + org-deadline-warning-days 30) #+end_src *** T/ODOs #+begin_src emacs-lisp - (setq org-todo-keywords '((sequence "TODO(t!)" "NOW(o)" "NEXT(n)" "|" "DONE(d!)") - (sequence "|" "CANCELED(c!)"))) + (setq org-todo-keywords '((sequence "TODO(t!)" "NOW(o)" "NEXT(n)" "|" "DONE(d!)") + (sequence "|" "CANCELED(c!)"))) #+end_src *** start on sunday! #+begin_src emacs-lisp - (setq org-agenda-start-on-weekday 0 ;0 is sunday - org-agenda-weekend-days '(5 6)) + (setq org-agenda-start-on-weekday 0 ;0 is sunday + org-agenda-weekend-days '(5 6)) #+end_src +*** Weeks per semester +#+begin_src emacs-lisp + (defun org-week-to-class-week (week) + (- week 34)) + + (advice-add 'org-days-to-iso-week :filter-return + #'org-week-to-class-week) + +#+end_src *** Go EVIL! #+BEGIN_SRC emacs-lisp - (eval-after-load 'org-agenda - '(progn - (evil-set-initial-state 'org-agenda-mode 'normal) - (evil-define-key 'normal org-agenda-mode-map - (kbd "") 'org-agenda-goto - ;;;; (kbd "\t") 'org-agenda-goto + (eval-after-load 'org-agenda + '(progn + (evil-set-initial-state 'org-agenda-mode 'normal) + (evil-define-key 'normal org-agenda-mode-map + (kbd "") 'org-agenda-goto + ;;;; (kbd "\t") 'org-agenda-goto - "q" 'org-agenda-quit - "S" 'org-save-all-org-buffers + "q" 'org-agenda-quit + "S" 'org-save-all-org-buffers - ;;;; Clocking - "c" nil - "ci" 'org-agenda-clock-in - "co" 'org-agenda-clock-out - "cx" 'org-agenda-clock-cancel - "cR" 'org-agenda-clockreport-mode + ;;;; Clocking + "c" nil + "ci" 'org-agenda-clock-in + "co" 'org-agenda-clock-out + "cx" 'org-agenda-clock-cancel + "cR" 'org-agenda-clockreport-mode - ;;;; Properties - "s" 'org-agenda-schedule - "d" 'org-agenda-deadline - "p" 'org-agenda-priority - "t" 'org-agenda-todo - "T" 'counsel-org-tag - ":" 'org-agenda-set-tags - "e" 'org-agenda-set-effort + ;;;; Properties + "s" 'org-agenda-schedule + "d" 'org-agenda-deadline + "p" 'org-agenda-priority + "+" 'org-agenda-priority-up + "-" 'org-agenda-priority-down + "t" 'org-agenda-todo + "T" 'counsel-org-tag + ":" 'org-agenda-set-tags + "e" 'org-agenda-set-effort - ;;;; Movement - "j" 'org-agenda-next-line - "k" 'org-agenda-previous-line - "f" 'org-agenda-later - "b" 'org-agenda-earlier - "J" 'org-agenda-next-date-line - "K" 'org-agenda-previous-date-line - "." 'org-agenda-goto-today + ;;;; Movement + "j" 'org-agenda-next-line + "k" 'org-agenda-previous-line + "f" 'org-agenda-later + "b" 'org-agenda-earlier + "J" 'org-agenda-next-date-line + "K" 'org-agenda-previous-date-line + "." 'org-agenda-goto-today - ;;;; View toggles - "vt" 'org-agenda-toggle-time-grid - "vw" 'org-agenda-week-view - "vd" 'org-agenda-day-view - "vl" 'org-agenda-log-mode - "vr" 'org-agenda-redo - "r" 'org-agenda-redo;; often used - "F" 'org-agenda-follow-mode + ;;;; View toggles + "vt" 'org-agenda-toggle-time-grid + "vw" 'org-agenda-week-view + "vd" 'org-agenda-day-view + "vl" 'org-agenda-log-mode + "vr" 'org-agenda-redo + "r" 'org-agenda-redo;; often used + "F" 'org-agenda-follow-mode - ;;;; Other - "C" 'org-capture - "R" 'my/org-agenda/process-inbox-item - "A" 'org-agenda-archive - "g/" 'org-agenda-filter-by-tag - "gr" 'org-ql-view-refresh - "gh" 'helm-org-ql-views - ;;;; cool but inactive - ;; "gj" 'org-agenda-goto-date - ;; "gJ" 'org-agenda-clock-goto - ;; "gm" 'org-agenda-bulk-mark - ;; "go" 'org-agenda-open-link - ;; "+" 'org-agenda-priority-up - ;; "-" 'org-agenda-priority-down - ;; "y" 'org-agenda-todo-yesterday - ;; "n" 'org-agenda-add-note - ;; ";" 'org-timer-set-timer - ;; "I" 'helm-org-task-file-headings - ;; "i" 'org-agenda-clock-in-avy - ;; "O" 'org-agenda-clock-out-avy - ;; "u" 'org-agenda-bulk-unmark - ;; "x" 'org-agenda-exit - ;; "va" 'org-agenda-archives-mode - ;;"vc" 'org-agenda-show-clocking-issues - ;; "o" 'delete-other-windows - ;; "gh" 'org-agenda-holiday - ;; "gv" 'org-agenda-view-mode-dispatch - "n" nil ; evil-search-next - ;; "{" 'org-agenda-manipulate-query-add-re - ;; "}" 'org-agenda-manipulate-query-subtract-re - ;; "0" 'evil-digit-argument-or-evil-beginning-of-line - ;; "<" 'org-agenda-filter-by-category - ;; ">" 'org-agenda-date-prompt - ;; "H" 'org-agenda-holidays - ;; "L" 'org-agenda-recenter - ;; "Z" 'org-agenda-sunrise-sunset - ;; "T" 'org-agenda-show-tags - ;; "X" 'org-agenda-clock-cancel - ;; "[" 'org-agenda-manipulate-query-add - ;; "g\\" 'org-agenda-filter-by-tag-refine - ;; "]" 'org-agenda-manipulate-query-subtract - ))) - ;; TODO check this + ;;;; Other + "C" 'org-capture + "R" 'my/org-agenda/process-inbox-item + "A" 'org-agenda-archive + "g/" 'org-agenda-filter-by-tag + "gr" 'org-ql-view-refresh + "gh" 'helm-org-ql-views + ;;;; cool but inactive + ;; "gj" 'org-agenda-goto-date + ;; "gJ" 'org-agenda-clock-goto + "gm" 'org-agenda-bulk-mark + "go" 'org-agenda-open-link + ;; "y" 'org-agenda-todo-yesterday + ;; "n" 'org-agenda-add-note + ;; ";" 'org-timer-set-timer + ;; "I" 'helm-org-task-file-headings + ;; "i" 'org-agenda-clock-in-avy + ;; "O" 'org-agenda-clock-out-avy + ;; "u" 'org-agenda-bulk-unmark + ;; "x" 'org-agenda-exit + ;; "va" 'org-agenda-archives-mode + ;;"vc" 'org-agenda-show-clocking-issues + ;; "o" 'delete-other-windows + ;; "gh" 'org-agenda-holiday + ;; "gv" 'org-agenda-view-mode-dispatch + "n" nil ; evil-search-next + ;; "{" 'org-agenda-manipulate-query-add-re + ;; "}" 'org-agenda-manipulate-query-subtract-re + ;; "0" 'evil-digit-argument-or-evil-beginning-of-line + ;; "<" 'org-agenda-filter-by-category + ;; ">" 'org-agenda-date-prompt + ;; "H" 'org-agenda-holidays + ;; "L" 'org-agenda-recenter + ;; "Z" 'org-agenda-sunrise-sunset + ;; "T" 'org-agenda-show-tags + ;; "X" 'org-agenda-clock-cancel + ;; "[" 'org-agenda-manipulate-query-add + ;; "g\\" 'org-agenda-filter-by-tag-refine + ;; "]" 'org-agenda-manipulate-query-subtract + ))) + ;; TODO check this #+END_SRC *** habits #+begin_src emacs-lisp - (setq org-habit-graph-column 80 ; prevent overwriting title - org-habit-show-habits-only-for-today 't - org-habit-show-all-today nil) ; show even if DONE - ;; (with-eval-after-load 'org-habit - ;; (defun org-habit-streak-count () - ;; (goto-char (point-min)) - ;; (while (not (eobp)) - ;; ;;on habit line? - ;; (when (get-text-property (point) 'org-habit-p) - ;; (let ((streak 0) - ;; (counter (+ org-habit-graph-column (- org-habit-preceding-days org-habit-following-days))) - ;; ) - ;; (move-to-column counter) - ;; ;;until end of line - ;; (while (= (char-after (point)) org-habit-completed-glyph) - ;; (setq streak (+ streak 1)) - ;; (setq counter (- counter 1)) - ;; (backward-char 1)) - ;; (end-of-line) - ;; (insert (number-to-string streak)))) - ;; (forward-line 1))) + (setq org-habit-graph-column 80 ; prevent overwriting title + org-habit-show-habits-only-for-today 't + org-habit-show-all-today nil) ; show even if DONE + ;; (with-eval-after-load 'org-habit + ;; (defun org-habit-streak-count () + ;; (goto-char (point-min)) + ;; (while (not (eobp)) + ;; ;;on habit line? + ;; (when (get-text-property (point) 'org-habit-p) + ;; (let ((streak 0) + ;; (counter (+ org-habit-graph-column (- org-habit-preceding-days org-habit-following-days))) + ;; ) + ;; (move-to-column counter) + ;; ;;until end of line + ;; (while (= (char-after (point)) org-habit-completed-glyph) + ;; (setq streak (+ streak 1)) + ;; (setq counter (- counter 1)) + ;; (backward-char 1)) + ;; (end-of-line) + ;; (insert (number-to-string streak)))) + ;; (forward-line 1))) - ;; (add-hook 'org-agenda-finalize-hook 'org-habit-streak-count)) + ;; (add-hook 'org-agenda-finalize-hook 'org-habit-streak-count)) #+end_src *** org SUPER agenda #+begin_src emacs-lisp - (use-package org-super-agenda - :after org-agenda - :config - (setq org-agenda-span 'day); a week is too much - (setq org-super-agenda-groups - '((:log t :order 99); logs at bottom - (:name "S" - :order 97 - :tag ("S")) - (:name "Habits" - :order 98 - :habit t) - (:name "Today" ; today is what - :time-grid t ; Items that appear on the time grid - :scheduled today) - (:name "Now" ; today is what - :todo "NOW") - (:name "Overdue" - :deadline past - :scheduled past) - (:name "Deadlines" - :deadline t) - (:name "To Refile" - :tag ("INBOX")))) + (use-package org-super-agenda + :after org-agenda + :config + (setq org-agenda-span 'day); a week is too much + (setq org-super-agenda-groups + '((:log t :order 99); logs at bottom + (:name "S" + :order 97 + :tag ("S")) + (:name "Life" + :order 97 + :tag ("L")) + (:name "Habits" + :order 98 + :habit t) + (:name "Overdue" + :deadline past + :scheduled past) + (:name "Today" ; today is what + :time-grid t ; Items that appear on the time grid + :scheduled today) + (:name "Now" ; today is what + :todo "NOW") + (:name "Deadlines" + :deadline t) + (:name "To Refile" + :tag ("INBOX")))) - (org-super-agenda-mode 1) + (org-super-agenda-mode 1) - :hook (org-agenda-mode . origami-mode) - (org-agenda-mode . org-super-agenda-mode); need this sadly - (org-agenda-mode . olivetti-mode) - ;(org-agenda-mode . olivetti-mode) - ;(evil-define-key '(normal visual) 'org-super-agenda-header-map "j" 'org-agenda-next-line) - :bind (:map org-super-agenda-header-map - ([tab] . origami-toggle-node) - ;; evil doesn't work on headers, bruh - ("j" . org-agenda-next-line) - ("k" . org-agenda-previous-line) - ("h" . evil-backward-char) - ("l" . evil-forward-char))) + :hook (org-agenda-mode . origami-mode) + (org-agenda-mode . org-super-agenda-mode); need this sadly + (org-agenda-mode . olivetti-mode) + ;(org-agenda-mode . olivetti-mode) + ;(evil-define-key '(normal visual) 'org-super-agenda-header-map "j" 'org-agenda-next-line) + :bind (:map org-super-agenda-header-map + ([tab] . origami-toggle-node) + ;; evil doesn't work on headers, bruh + ("j" . org-agenda-next-line) + ("k" . org-agenda-previous-line) + ("h" . evil-backward-char) + ("l" . evil-forward-char))) #+end_src *** COMMENT org-ql @@ -1336,182 +1348,181 @@ From: https://yiufung.net/post/anki-org/ #+end_src #+begin_src emacs-lisp - ; TODO: tasks not in inbox, and have no schedule/effort/etc - (use-package org-ql - :config - (setq org-ql-views (list - (cons "Agenda:Today" - (list :buffers-files #'org-agenda-files - :query '(and (not (done)) - (or (deadline auto) - (scheduled :to today) - (todo "NOW") - (ts-active :on today))) - :sort '(priority date todo) - :super-groups 'org-super-agenda-groups - :title "Overview: Today")) - (cons "To Refile" - (list :buffers-files #'org-agenda-files - :query '(or - (parent (tags "INBOX")) - (done)) - :super-groups '((:name "Done" :todo "DONE") - (:name "Canceled" :todo "CANCELED") - (:name "Inbox" :anything)) - :title "Inbox")) - (cons "Plans" - (list :buffers-files #'org-agenda-files - :query '(and - (parent (tags "PLAN")) - (not (done))) - :super-groups '((:auto-outline-path)) - :sort '(priority date todo) - :title "Plans")) - (cons "Consoom and Create" - (list :buffers-files #'org-agenda-files - :query '(parent (tags "READ" "WATCH" "TO_BLOG")) - :super-groups '((:tag "READ") - (:tag "WATCH") - (:tag "TO_BLOG")) - :sort '(todo) - :title "Goals")) - (cons "Orphans" - (list :buffers-files #'org-agenda-files - :query '(and ;(not (todo)) - (not (done)) - (not (effort)) - (not (tags "NOT_ORPHAN" "INBOX")) - (not (scheduled)) - (not (deadline)) - (parent)))) - (cons "Quick Picks" - (list :buffers-files #'org-agenda-files - :query '(and (not (done)) - (effort <= 10)) - :sort '(todo) - :super-groups 'org-super-agenda-groups - :title "Quick Picks"))))) - + ; TODO: tasks not in inbox, and have no schedule/effort/etc + (use-package org-ql + :config + (setq org-ql-views (list + (cons "Agenda:Today" + (list :buffers-files #'org-agenda-files + :query '(and (not (done)) + (or (deadline auto) + (scheduled :to today) + (todo "NOW") + (ts-active :on today))) + :sort '(priority date todo) + :super-groups 'org-super-agenda-groups + :title "Overview: Today")) + (cons "To Refile" + (list :buffers-files #'org-agenda-files + :query '(or + (parent (tags "INBOX")) + (done)) + :super-groups '((:name "Done" :todo "DONE") + (:name "Canceled" :todo "CANCELED") + (:name "Inbox" :anything)) + :title "Inbox")) + (cons "Plans" + (list :buffers-files #'org-agenda-files + :query '(and + (parent (tags "PLAN")) + (not (done))) + :super-groups '((:auto-outline-path)) + :sort '(priority date todo) + :title "Plans")) + (cons "Consoom and Create" + (list :buffers-files #'org-agenda-files + :query '(parent (tags "READ" "WATCH" "TO_BLOG")) + :super-groups '((:tag "READ") + (:tag "WATCH") + (:tag "TO_BLOG")) + :sort '(todo) + :title "Goals")) + (cons "Orphans" + (list :buffers-files #'org-agenda-files + :query '(and ;(not (todo)) + (not (done)) + (not (effort)) + (not (tags "NOT_ORPHAN" "INBOX")) + (not (scheduled)) + (not (deadline)) + (parent)))) + (cons "Quick Picks" + (list :buffers-files #'org-agenda-files + :query '(and (not (done)) + (effort <= 10)) + :sort '(todo) + :super-groups 'org-super-agenda-groups + :title "Quick Picks"))))) #+end_src *** COMMENT org-timeblock #+begin_src emacs-lisp - (use-package org-timeblock - :straight (org-timeblock :type git - :host github - :repo "ichernyshovvv/org-timeblock")) + (use-package org-timeblock + :straight (org-timeblock :type git + :host github + :repo "ichernyshovvv/org-timeblock")) #+end_src -*** org-hyperscheduler +*** COMMENT org-hyperscheduler #+begin_src emacs-lisp - (use-package org-hyperscheduler - :straight - ( :repo "dmitrym0/org-hyperscheduler" - :host github - :type git - :files ("*")) - :custom - (org-hyperscheduler-readonly-mode nil)) + (use-package org-hyperscheduler + :straight + ( :repo "dmitrym0/org-hyperscheduler" + :host github + :type git + :files ("*")) + :custom + (org-hyperscheduler-readonly-mode nil)) #+end_src *** Helper functions Stolen from: [[https://blog.jethro.dev/posts/processing_inbox/][Org-mode Workflow Part 2: Processing the Inbox · Jethro Kuan]] #+begin_src emacs-lisp - (defun my/org-agenda/process-inbox-item () + (defun my/org-agenda/process-inbox-item () "Process a single item in the org-agenda." (interactive) (org-with-wide-buffer - (org-agenda-set-tags) - ;(org-agenda-priority) - (org-agenda-set-effort) - (org-agenda-refile nil nil t))) + (org-agenda-set-tags) + ;(org-agenda-priority) + (org-agenda-set-effort) + (org-agenda-refile nil nil t))) #+end_src *** Calfw calendar #+begin_src emacs-lisp - (use-package calfw :after org) - (use-package calfw-org - :after calfw - :config + (use-package calfw :after org) + (use-package calfw-org + :after calfw + :config ; looks nice (setq cfw:fchar-junction ?╬ - cfw:fchar-vertical-line ?║ - cfw:fchar-horizontal-line ?═ - cfw:fchar-left-junction ?╠ - cfw:fchar-right-junction ?╣ - cfw:fchar-top-junction ?╦ - cfw:fchar-top-left-corner ?╔ - cfw:fchar-top-right-corner ?╗) - (evil-set-initial-state 'cfw:details-mode 'emacs)) + cfw:fchar-vertical-line ?║ + cfw:fchar-horizontal-line ?═ + cfw:fchar-left-junction ?╠ + cfw:fchar-right-junction ?╣ + cfw:fchar-top-junction ?╦ + cfw:fchar-top-left-corner ?╔ + cfw:fchar-top-right-corner ?╗) + (evil-set-initial-state 'cfw:details-mode 'emacs)) #+end_src ** org-pomodoro #+begin_src emacs-lisp - (use-package org-pomodoro - :defer t - :custom - (org-pomodoro-length 25) - (org-pomodoro-keep-killed-pomodoro-time t) - (org-pomodoro-manual-break t)) + (use-package org-pomodoro + :defer t + :custom + (org-pomodoro-length 25) + (org-pomodoro-keep-killed-pomodoro-time t) + (org-pomodoro-manual-break t)) #+end_src ** Org analyzer #+begin_src emacs-lisp - (use-package org-analyzer) + (use-package org-analyzer) #+end_src ** org-roam *** use-package #+begin_src emacs-lisp - (use-package org-roam + (use-package org-roam :defer t :custom (org-roam-completion-everywhere t) (org-roam-db-gc-threshold most-positive-fixnum) ;; preformance (org-roam-capture-ref-templates '(("r" "ref" plain "%?" :if-new - (file+head "%<%Y%m%d%H%M%S>-${slug}.org" "#+title: ${title}") - :unnarrowed t))) + (file+head "%<%Y%m%d%H%M%S>-${slug}.org" "#+title: ${title}") + :unnarrowed t))) :config ;; side window ;(require 'org-roam-protocol) (org-roam-db-autosync-mode) (add-to-list 'display-buffer-alist - '("\\*org-roam\\*" - (display-buffer-in-side-window) - (side . right) - (slot . 0) - (window-width . 0.33) - (window-parameters . ((no-other-window . t) - (no-delete-other-windows . t)))))) + '("\\*org-roam\\*" + (display-buffer-in-side-window) + (side . right) + (slot . 0) + (window-width . 0.33) + (window-parameters . ((no-other-window . t) + (no-delete-other-windows . t)))))) #+end_src *** org roam server #+begin_src emacs-lisp - (use-package websocket - :after org-roam) - - (use-package simple-httpd - :after org-roam) - - (use-package org-roam-ui - :straight (org-roam-ui - :type git - :host github - :repo "org-roam/org-roam-ui" - :files ("*.el" "out")) - :after org-roam ;; or :after org - :hook (org-roam . org-roam-ui-mode) - :config) - + (use-package websocket + :after org-roam) + + (use-package simple-httpd + :after org-roam) + + (use-package org-roam-ui + :straight (org-roam-ui + :type git + :host github + :repo "org-roam/org-roam-ui" + :files ("*.el" "out")) + :after org-roam ;; or :after org + :hook (org-roam . org-roam-ui-mode) + :config) + #+end_src *** Deft #+begin_src emacs-lisp - (use-package deft + (use-package deft :after org :bind :custom @@ -1521,40 +1532,40 @@ Stolen from: [[https://blog.jethro.dev/posts/processing_inbox/][Org-mode Workflo (deft-default-extension "org") (deft-directory org-roam-directory)) (setq deft-recursive t) - (setq deft-strip-summary-regexp ":PROPERTIES:\n\\(.+\n\\)+:END:\n") - (setq deft-use-filename-as-title 't) + (setq deft-strip-summary-regexp ":PROPERTIES:\n\\(.+\n\\)+:END:\n") + (setq deft-use-filename-as-title 't) #+end_src ** org-download and clip-link #+begin_src emacs-lisp (use-package org-download - :after org) + :after org) (use-package org-cliplink - :after org) + :after org) #+end_src ** COMMENT org-book #+begin_src emacs-lisp - (use-package org-books - :after org ) + (use-package org-books + :after org ) #+end_src ** COMMENT Anki Stopped using this, I just use Anki like a normal person #+begin_src emacs-lisp - (use-package anki-editor + (use-package anki-editor :after org :bind (:map org-mode-map - ("" . anki-editor-cloze-region-auto-incr)) + ("" . anki-editor-cloze-region-auto-incr)) :init (setq-default anki-editor-use-math-jax t) :config - - (setq anki-editor-create-decks nil ;; Allow anki-editor to create a new deck if it doesn't exist - anki-editor-org-tags-as-anki-tags t) - - ) + + (setq anki-editor-create-decks nil ;; Allow anki-editor to create a new deck if it doesn't exist + anki-editor-org-tags-as-anki-tags t) + + ) #+end_src * Development @@ -1562,39 +1573,39 @@ Stopped using this, I just use Anki like a normal person *** Brackets setup #+begin_src emacs-lisp - (use-package rainbow-delimiters + (use-package rainbow-delimiters :hook (prog-mode . rainbow-delimiters-mode) - (prog-mode . show-paren-mode) - ;(prog-mode . electric-pair-local-mode) - ) + (prog-mode . show-paren-mode) + ;(prog-mode . electric-pair-local-mode) + ) #+end_src #+begin_src emacs-lisp - ;; (use-package paredit :defer t) + ;; (use-package paredit :defer t) #+end_src #+begin_src emacs-lisp - (use-package parinfer-rust-mode ; - :hook - (emacs-lisp-mode . parinfer-rust-mode) - (scheme-mode . parinfer-rust-mode) - (clojure-mode . parinfer-rust-mode) - ;tabs break parinfer rust mode - (parinfer-rust-mode . (lambda () (setq indent-tabs-mode nil))); - :init - (setq parinfer-rust-auto-download t - ; this variable is only available on my fork - parinfer-rust-disable-troublesome-modes t)) + (use-package parinfer-rust-mode ; + :hook + (emacs-lisp-mode . parinfer-rust-mode) + (scheme-mode . parinfer-rust-mode) + (clojure-mode . parinfer-rust-mode) + ;tabs break parinfer rust mode + (parinfer-rust-mode . (lambda () (setq indent-tabs-mode nil))); + :init + (setq parinfer-rust-auto-download t + ; this variable is only available on my fork + parinfer-rust-disable-troublesome-modes t)) #+end_src *** Compilation output When running =M-x compile= the output is colored! #+begin_src emacs-lisp - (add-hook 'compilation-filter-hook 'ansi-color-compilation-filter) + (add-hook 'compilation-filter-hook 'ansi-color-compilation-filter) #+end_src *** Projectile #+begin_src emacs-lisp - (use-package projectile + (use-package projectile :defer t :diminish projectile-mode :config (projectile-mode) @@ -1602,39 +1613,40 @@ When running =M-x compile= the output is colored! :init ;; NOTE: Set this to the folder where you keep your Git repos! (when (file-directory-p "~/code") - (setq projectile-project-search-path '("~/code"))) + (setq projectile-project-search-path '("~/code"))) (setq projectile-switch-project-action #'projectile-dired)) #+end_src Counsel Projectile #+begin_src emacs-lisp - (use-package counsel-projectile + (use-package counsel-projectile :defer 9 :config (counsel-projectile-mode)) #+end_src *** Recentf #+begin_src emacs-lisp - (use-package recentf + (use-package recentf :defer 10 :config (recentf-mode 1) ; https://github.com/emacscollective/no-littering#suggested-settings - (with-eval-after-load 'no-littering + (with-eval-after-load 'no-littering (add-to-list 'recentf-exclude no-littering-var-directory) (add-to-list 'recentf-exclude no-littering-etc-directory))) #+end_src *** lsp performance +This is done in Performance section #+begin_src emacs-lisp :tangle no - (setq gc-cons-threshold 100000000) ;; 100 mb - (setq read-process-output-max (* 1024 4024)) ;; 4mb + (setq gc-cons-threshold 100000000) ;; 100 mb + (setq read-process-output-max (* 1024 4024)) ;; 4mb #+end_src *** lsp-mode #+begin_src emacs-lisp - (use-package lsp-mode + (use-package lsp-mode :commands (lsp lsp-deferred) - ;; :hook - ;; (lsp-mode . my/lsp/lsp-mode-setup) + ;; :hook + ;; (lsp-mode . my/lsp/lsp-mode-setup) :custom (lsp-headerline-breadcrumb-segments '(path-up-to-project file)) (lsp-rust-analyzer-cargo-watch-command "clippy") @@ -1657,46 +1669,46 @@ Counsel Projectile (lsp-headerline-breadcrumb-mode -1) (flycheck-mode 1) :bind - (:map lsp-mode-map - ;; ("" . company-indent-or-complete-common); commented cuz tabs for yasnippet! - ) - ) + (:map lsp-mode-map + ;; ("" . company-indent-or-complete-common); commented cuz tabs for yasnippet! + ) + ) #+end_src Lsp UI #+begin_src emacs-lisp - (use-package lsp-ui - :commands lsp-ui-mode - :custom - (lsp-ui-peek-always-show t) - (lsp-ui-doc-mode t) - (lsp-ui-sideline-show-hover nil) - ;; (lsp-ui-doc-enable nil) - :bind - (:map lsp-ui-mode-map - ([remap evil-lookup] . lsp-ui-doc-glance) - ([remap xref-find-references] . lsp-ui-peek-find-references) - ("C-c z" . lsp-ui-doc-focus-frame) - :map lsp-ui-doc-frame-mode-map - ("C-g" . lsp-ui-doc-unfocus-frame) - ("C-c z" . lsp-ui-doc-unfocus-frame) - )) + (use-package lsp-ui + :commands lsp-ui-mode + :custom + (lsp-ui-peek-always-show t) + (lsp-ui-doc-mode t) + (lsp-ui-sideline-show-hover nil) + ;; (lsp-ui-doc-enable nil) + :bind + (:map lsp-ui-mode-map + ([remap evil-lookup] . lsp-ui-doc-glance) + ([remap xref-find-references] . lsp-ui-peek-find-references) + ("C-c z" . lsp-ui-doc-focus-frame) + :map lsp-ui-doc-frame-mode-map + ("C-g" . lsp-ui-doc-unfocus-frame) + ("C-c z" . lsp-ui-doc-unfocus-frame) + )) #+end_src #+RESULTS: *** lsp treemacs #+begin_src emacs-lisp - ;; (use-package lsp-treemacs - ;; :after lsp) + ;; (use-package lsp-treemacs + ;; :after lsp) #+end_src *** Flycheck #+begin_src emacs-lisp (use-package flycheck :custom-face (flycheck-warning ((t (:underline (:color "#fabd2f" :style line :position line))))) - (flycheck-error ((t (:underline (:color "#fb4934" :style line :position line))))) - (flycheck-info ((t (:underline (:color "#83a598" :style line :position line)))))) + (flycheck-error ((t (:underline (:color "#fb4934" :style line :position line))))) + (flycheck-info ((t (:underline (:color "#83a598" :style line :position line)))))) #+end_src *** Hide Show @@ -1705,96 +1717,95 @@ Lsp UI :hook (prog-mode . origami-mode)) #+end_src -*** Formatting +*** COMMENT Formatting #+begin_src emacs-lisp - (use-package format-all + (use-package format-all ;; :commands (format-all-mode) :defer :config - (setq my/format-all-formatters '(("Verilog" verible))) + (setq my/format-all-formatters '(("Verilog" verible))) :hook (prog-mode . format-all-mode) - (format-all-mode . (lambda () (setq format-all-formatters my/format-all-formatters))) - (format-all-mode . format-all-ensure-formatter)) + (format-all-mode . (lambda () (setq format-all-formatters my/format-all-formatters))) + (format-all-mode . format-all-ensure-formatter)) #+end_src *** Debug Use the Debug Adapter Protocol for running tests and debugging #+begin_src emacs-lisp (use-package dap-mode - :hook - (lsp-mode . dap-mode) - (lsp-mode . dap-ui-mode)) + :hook + (lsp-mode . dap-mode) + (lsp-mode . dap-ui-mode)) #+end_src *** Highlihght Indenation Mode #+begin_src emacs-lisp (use-package highlight-indent-guides - :hook (prog-mode . highlight-indent-guides-mode) - :custom (highlight-indent-guides-method 'character) - (highlight-indent-guides-responsive 'top)) + :hook (prog-mode . highlight-indent-guides-mode) + :custom (highlight-indent-guides-method 'character) + (highlight-indent-guides-responsive 'top)) #+end_src ** Git #+begin_src emacs-lisp - (setq vc-handled-backends '(Git)) + (setq vc-handled-backends '(Git)) #+end_src *** Magit #+begin_src emacs-lisp (use-package magit - :commands (magit) - :custom - (magit-display-buffer-function #'magit-display-buffer-same-window-except-diff-v1)) + :commands (magit) + :custom + (magit-display-buffer-function #'magit-display-buffer-same-window-except-diff-v1)) #+end_src Magit TODOs! #+begin_src emacs-lisp - (use-package magit-todos - :after magit - :config (magit-todos-mode 1)) + (use-package magit-todos + :after magit + :config (magit-todos-mode 1)) #+end_src *** TODO Forge #+begin_src emacs-lisp - ;(use-package forge) + ;(use-package forge) #+end_src *** Git gutter #+begin_src emacs-lisp - (use-package git-gutter + (use-package git-gutter :hook (prog-mode . git-gutter-mode) :config (setq git-gutter:update-interval 0.02)) - - (use-package git-gutter-fringe - :config - (define-fringe-bitmap 'git-gutter-fr:added [224] nil nil '(center repeated)) - (define-fringe-bitmap 'git-gutter-fr:modified [224] nil nil '(center repeated)) - (define-fringe-bitmap 'git-gutter-fr:deleted [128 192 224 240] nil nil 'bottom) - :ensure t) - + + (use-package git-gutter-fringe + :config + (define-fringe-bitmap 'git-gutter-fr:added [224] nil nil '(center repeated)) + (define-fringe-bitmap 'git-gutter-fr:modified [224] nil nil '(center repeated)) + (define-fringe-bitmap 'git-gutter-fr:deleted [128 192 224 240] nil nil 'bottom) + :ensure t) #+end_src ** Treemacs use-package #+begin_src emacs-lisp - (use-package treemacs + (use-package treemacs :commands (treemacs) :init (setq treemacs-follow-after-init t - treemacs-is-never-other-window t - treemacs-sorting 'alphabetic-case-insensitive-asc)) + treemacs-is-never-other-window t + treemacs-sorting 'alphabetic-case-insensitive-asc)) #+end_src fix evil keybinds #+begin_src emacs-lisp - (use-package treemacs-evil - ;:when (package-installed-p 'evil-collection) - ;:defer t + (use-package treemacs-evil + ;:when (package-installed-p 'evil-collection) + ;:defer t :after treemacs :init :config - (general-def evil-treemacs-state-map + (general-def evil-treemacs-state-map [return] #'treemacs-RET-action [tab] #'treemacs-TAB-action "TAB" #'treemacs-TAB-action @@ -1805,63 +1816,63 @@ fix evil keybinds Get treemacs-lsp #+begin_src emacs-lisp - (use-package lsp-treemacs - :after (treemacs lsp)) - (use-package treemacs-magit - :after treemacs magit) - (use-package treemacs-persp - :after treemacs - :config (treemacs-set-scope-type 'Perspectives)) + (use-package lsp-treemacs + :after (treemacs lsp)) + (use-package treemacs-magit + :after treemacs magit) + (use-package treemacs-persp + :after treemacs + :config (treemacs-set-scope-type 'Perspectives)) #+end_src ** Language *** COMMENT Arduino #+begin_src emacs-lisp - (use-package arduino-mode - :config + (use-package arduino-mode + :config (lsp-register-client - (make-lsp-client - :new-connection (lsp-stdio-connection '("arduino-language-server" "-clangd" "clangd" "-cli" "arduino-cli" "-cli-config" "/home/lambda/.arduino15/arduino-cli.yaml" "-fqbn" "arduino:avr:uno")) - :activation-fn (lsp-activate-on "arduino") - :server-id 'arduino-language-server)) - :defer t) + (make-lsp-client + :new-connection (lsp-stdio-connection '("arduino-language-server" "-clangd" "clangd" "-cli" "arduino-cli" "-cli-config" "/home/lambda/.arduino15/arduino-cli.yaml" "-fqbn" "arduino:avr:uno")) + :activation-fn (lsp-activate-on "arduino") + :server-id 'arduino-language-server)) + :defer t) #+end_src *** Clojure #+begin_src emacs-lisp - (use-package cider - :defer t - :config (require 'flycheck-clj-kondo) - :hook (clojure-mode . zprint-format-on-save-mode) - (clojure-mode . flycheck-mode) - ; (clojure-mode . electric-pair-local-mode) - :bind (:map cider-mode-map - ([remap lsp-find-definition] . cider-find-var) - ([remap eval-defun] . cider-eval-list-at-point) - ([remap eval-last-sexp] . cider-eval-last-sexp))) + (use-package cider + :defer t + :config (require 'flycheck-clj-kondo) + :hook (clojure-mode . zprint-format-on-save-mode) + (clojure-mode . flycheck-mode) + ; (clojure-mode . electric-pair-local-mode) + :bind (:map cider-mode-map + ([remap lsp-find-definition] . cider-find-var) + ([remap eval-defun] . cider-eval-list-at-point) + ([remap eval-last-sexp] . cider-eval-last-sexp))) #+end_src Auto format #+begin_src emacs-lisp - (use-package zprint-format - :after cider) + (use-package zprint-format + :after cider) #+end_src #+begin_src emacs-lisp - (use-package flycheck-clj-kondo - :after cider) + (use-package flycheck-clj-kondo + :after cider) #+end_src *** COMMENT Rust #+begin_src emacs-lisp - (use-package rustic + (use-package rustic :defer t :ensure :bind (:map rustic-mode-map - ("C-c C-c l" . lsp-ui-flycheck-list) - ("C-c C-c s" . lsp-rust-analyzer-status) - ("" . rustic-cargo-test) - ("C-" . rustic-cargo-run)) + ("C-c C-c l" . lsp-ui-flycheck-list) + ("C-c C-c s" . lsp-rust-analyzer-status) + ("" . rustic-cargo-test) + ("C-" . rustic-cargo-run)) :config ;; uncomment for less flashiness ;; (setq lsp-eldoc-hook nil) @@ -1875,77 +1886,80 @@ Auto format :custom (rustic-rustfmt-config-alist '((edition . "2021")))) - (defun my/dev/rustic-mode-hook () + (defun my/dev/rustic-mode-hook () ;; so that run C-c C-c C-r works without having to confirm, but don't try to ;; save rust buffers that are not file visiting. Once ;; https://github.com/brotzeit/rustic/issues/253 has been resolved this should ;; no longer be necessary. (when buffer-file-name - (setq-local buffer-save-without-query t))) + (setq-local buffer-save-without-query t))) #+end_src *** emacs-lisp #+begin_src emacs-lisp - ;; (add-hook 'emacs-lisp-mode-hook 'company-mode) - (add-hook 'emacs-lisp-mode-hook 'flycheck-mode) + ;; (add-hook 'emacs-lisp-mode-hook 'company-mode) + (add-hook 'emacs-lisp-mode-hook 'flycheck-mode) #+end_src *** COMMENT V #+begin_src emacs-lisp - (use-package v-mode + (use-package v-mode :defer t :preface - (defun my/lsp/v () + (defun my/lsp/v () (interactive) (lsp) (flycheck-mode 1) (company-mode 1)) - :init + :init (delete '("\\.[ds]?va?h?\\'" . verilog-mode) auto-mode-alist) ;; :straight (v-mode ;; :type git ;; :host github ;; :repo "damon-kwok/v-mode" ;; :files ("tokens" "v-mode.el")) - (setq auto-mode-alist - (cons '("\\(\\.v\\|\\.vv\\|\\.vsh\\)$" . v-mode) auto-mode-alist)) + (setq auto-mode-alist + (cons '("\\(\\.v\\|\\.vv\\|\\.vsh\\)$" . v-mode) auto-mode-alist)) :hook (v-mode . my/lsp/v) :config (flycheck-define-checker v-checker - "A v syntax checker using the v fmt." - :command ("v" "fmt" "-verify" (eval (buffer-file-name))) - :error-patterns - ((error line-start (file-name) ":" line ":" column ": error: " (message) line-end)) - :modes v-mode) + "A v syntax checker using the v fmt." + :command ("v" "fmt" "-verify" (eval (buffer-file-name))) + :error-patterns + ((error line-start (file-name) ":" line ":" column ": error: " (message) line-end)) + :modes v-mode) (add-to-list 'flycheck-checkers 'v-checker) :bind-keymap ("M-z" . v-menu) ("" . v-menu) ("C-c C-f" . v-format-buffer) :mode ("\\.v\\.vsh\\'" . 'v-mode)) - + #+end_src *** Haskell #+begin_src emacs-lisp - (use-package haskell-mode :defer t) + (use-package haskell-mode + :defer t + :config (require 'lsp-haskell)) #+end_src #+begin_src emacs-lisp (use-package lsp-haskell - :preface + :preface ;; lambda symbol - (defun my/font/pretty-lambdas-haskell () - (font-lock-add-keywords - nil `((,(concat "\\(" (regexp-quote "\\") "\\)") - (0 (progn (compose-region (match-beginning 1) (match-end 1) - ,(make-char 'greek-iso8859-7 107)) - nil)))))) + (defun my/font/pretty-lambdas-haskell () + (font-lock-add-keywords + nil `((,(concat "\\(" (regexp-quote "\\") "\\)") + (0 (progn (compose-region (match-beginning 1) (match-end 1) + ,(make-char 'greek-iso8859-7 107)) + nil)))))) :hook (haskell-mode . lsp) - ;(haskell-literate-mode-hook lsp) - (prog-mode . electric-pair-local-mode) + ;(haskell-literate-mode-hook lsp) + (prog-mode . electric-pair-local-mode) (haskell-mode . my/font/pretty-lambdas-haskell) + (haskell-mode . flymake-mode) :config (haskell-indentation-mode -1) (add-hook 'before-save-hook 'lsp-format-buffer) @@ -1954,35 +1968,35 @@ Auto format *** COMMENT yaml #+begin_src emacs-lisp - (use-package yaml-mode + (use-package yaml-mode :hook (yaml-mode . lsp)) #+end_src *** Web #+begin_src emacs-lisp - (use-package typescript-mode + (use-package typescript-mode :defer t :hook (typescript-mode . electric-pair-mode) :hook (typescript-mode . setup-tide-mode) :hook (typescript-mode . prettier-mode) :hook (typescript-mode . lsp) - :config (add-to-list 'auto-mode-alist '("\\.tsx\\'" . typescript-mode))) + :config (add-to-list 'auto-mode-alist '("\\.tsx\\'" . typescript-mode))) - (use-package tide + (use-package tide :defer t :preface (defun setup-tide-mode () - (interactive) - (tide-setup) - (flycheck-mode +1) - (setq flycheck-check-syntax-automatically '(save mode-enabled)) - (eldoc-mode +1) - (tide-hl-identifier-mode +1) - ;; company is an optional dependency. You have to - ;; install it separately via package-install - ;; `M-x package-install [ret] company` - (company-mode +1)) + (interactive) + (tide-setup) + (flycheck-mode +1) + (setq flycheck-check-syntax-automatically '(save mode-enabled)) + (eldoc-mode +1) + (tide-hl-identifier-mode +1) + ;; company is an optional dependency. You have to + ;; install it separately via package-install + ;; `M-x package-install [ret] company` + (company-mode +1)) :config ;; aligns annotation to the right hand side @@ -1995,46 +2009,46 @@ Auto format svelte #+begin_src emacs-lisp - (use-package svelte-mode - :hook (svelte-mode . lsp) - (svelte-mode . (lambda () - (add-hook 'before-save-hook 'lsp-format-buffer nil t)))) + (use-package svelte-mode + :hook (svelte-mode . lsp) + (svelte-mode . (lambda () + (add-hook 'before-save-hook 'lsp-format-buffer nil t)))) #+end_src prettier #+begin_src emacs-lisp (use-package prettier :defer t - ) + ) #+end_src lsp hooks setups #+begin_src emacs-lisp - (add-hook 'html-mode-hook 'lsp) - (add-hook 'js-mode-hook 'lsp) - (add-hook 'js-jsx-mode-hook 'lsp) + (add-hook 'html-mode-hook 'lsp) + (add-hook 'js-mode-hook 'lsp) + (add-hook 'js-jsx-mode-hook 'lsp) #+end_src *** COMMENT Lua #+begin_src emacs-lisp - (use-package lua-mode - :hook (lua-mode . lsp)) + (use-package lua-mode + :hook (lua-mode . lsp)) #+end_src *** Markdown Better Diff in header sizes #+begin_src emacs-lisp - (eval-after-load 'markdown-mode - '(custom-set-faces - '(markdown-header-face-1 ((t (:inherit markdown-header-face :height 1.7)))) - '(markdown-header-face-2 ((t (:inherit markdown-header-face :height 1.4)))) - '(markdown-header-face-3 ((t (:inherit markdown-header-face :height 1.3)))) - '(markdown-header-face-4 ((t (:inherit markdown-header-face :height 1.2)))) - '(markdown-header-face-5 ((t (:inherit markdown-header-face :height 1.1)))) - '(markdown-header-face-6 ((t (:inherit markdown-header-face :height 1.0)))) - )) - ;; (add-hook 'markdown-mode-hook 'my/org-mode/org-mode-visual-fill) - ;; (add-hook 'markdown-mode-hook 'outline-minor-mode) + (eval-after-load 'markdown-mode + '(custom-set-faces + '(markdown-header-face-1 ((t (:inherit markdown-header-face :height 1.7)))) + '(markdown-header-face-2 ((t (:inherit markdown-header-face :height 1.4)))) + '(markdown-header-face-3 ((t (:inherit markdown-header-face :height 1.3)))) + '(markdown-header-face-4 ((t (:inherit markdown-header-face :height 1.2)))) + '(markdown-header-face-5 ((t (:inherit markdown-header-face :height 1.1)))) + '(markdown-header-face-6 ((t (:inherit markdown-header-face :height 1.0)))) + )) + ;; (add-hook 'markdown-mode-hook 'my/org-mode/org-mode-visual-fill) + ;; (add-hook 'markdown-mode-hook 'outline-minor-mode) #+end_src *** COMMENT Vue @@ -2046,41 +2060,41 @@ Better Diff in header sizes *** COMMENT Scheme (guile) #+begin_src emacs-lisp - (use-package geiser + (use-package geiser :defer ;; :bind ([remap eval-last-sexp] . geiser-eval-last-sexp)) - ) + ) - (use-package geiser-guile) + (use-package geiser-guile) #+end_src *** Scala Scala mode for highlighting, indents and motion commands #+begin_src emacs-lisp (use-package scala-mode - :hook + :hook (scala-mode . flycheck-mode) (scala-mode . lsp) (scala-mode . electric-pair-local-mode) (scala-mode . (lambda () - (add-hook 'before-save-hook 'lsp-format-buffer nil t))) - :interpreter + (add-hook 'before-save-hook 'lsp-format-buffer nil t))) + :interpreter ("scala" . scala-mode)) #+end_src Sbt for sbt commands... #+begin_src emacs-lisp (use-package sbt-mode - :commands sbt-start sbt-command - :config - ;; WORKAROUND: https://github.com/ensime/emacs-sbt-mode/issues/31 - ;; allows using SPACE when in the minibuffer - (substitute-key-definition - 'minibuffer-complete-word - 'self-insert-command - minibuffer-local-completion-map) - ;; sbt-supershell kills sbt-mode: https://github.com/hvesalai/emacs-sbt-mode/issues/152 - (setq sbt:program-options '("-Dsbt.supershell=false"))) + :commands sbt-start sbt-command + :config + ;; WORKAROUND: https://github.com/ensime/emacs-sbt-mode/issues/31 + ;; allows using SPACE when in the minibuffer + (substitute-key-definition + 'minibuffer-complete-word + 'self-insert-command + minibuffer-local-completion-map) + ;; sbt-supershell kills sbt-mode: https://github.com/hvesalai/emacs-sbt-mode/issues/152 + (setq sbt:program-options '("-Dsbt.supershell=false"))) #+end_src #+begin_src emacs-lisp @@ -2090,35 +2104,35 @@ Sbt for sbt commands... *** C and cpp #+begin_src emacs-lisp - ;; (use-package ccls - ;; :hook ((c-mode c++-mode) . (lambda () (require 'ccls) (lsp))) - ;; ((c-mode c++-mode) . (lambda () (add-hook 'before-save-hook 'lsp-format-buffer nil t))) - ;; ((c-mode c++-mode) . electric-pair-local-mode) - ;; ((c-mode c++-mode) . yas-minor-mode)) + ;; (use-package ccls + ;; :hook ((c-mode c++-mode) . (lambda () (require 'ccls) (lsp))) + ;; ((c-mode c++-mode) . (lambda () (add-hook 'before-save-hook 'lsp-format-buffer nil t))) + ;; ((c-mode c++-mode) . electric-pair-local-mode) + ;; ((c-mode c++-mode) . yas-minor-mode)) - (use-package cc-mode + (use-package cc-mode :defer t :hook ((c++-mode cc-mode c-mode) . lsp) - ((c++-mode cc-mode c-mode) . lsp) - ((c++-mode cc-mode c-mode) . electric-pair-local-mode) - ((c++-mode cc-mode c-mode) . yas-minor-mode) - ((c++-mode cc-mode c-mode) . (lambda () - (add-hook 'before-save-hook 'lsp-format-buffer nil t)))) + ((c++-mode cc-mode c-mode) . lsp) + ((c++-mode cc-mode c-mode) . electric-pair-local-mode) + ((c++-mode cc-mode c-mode) . yas-minor-mode) + ((c++-mode cc-mode c-mode) . (lambda () + (add-hook 'before-save-hook 'lsp-format-buffer nil t)))) #+end_src *** COMMENT Ruby #+begin_src emacs-lisp - (use-package ruby-mode + (use-package ruby-mode :hook (ruby-mode . lsp) (ruby-mode . electric-pair-mode) (ruby-mode . (lambda () - (add-hook 'before-save-hook 'lsp-format-buffer nil t)))) + (add-hook 'before-save-hook 'lsp-format-buffer nil t)))) #+end_src *** COMMENT python #+begin_src emacs-lisp - (use-package elpy + (use-package elpy :ensure t :defer t :bind ([remap lsp-find-definition] . elpy-goto-definition) @@ -2130,45 +2144,43 @@ Sbt for sbt commands... *** LaTeX AucTex -#+begin_src emacs-lisp - ;; latexmk - (use-package magic-latex-buffer +#+begin_src emacs-lisp :tangle no + ;; latexmk + (use-package magic-latex-buffer :custom (magic-latex-buffer 1) :defer t) - (use-package auctex-latexmk - :defer t) - ;; company - (use-package company-math - :after company) - (use-package company-auctex - :after company) - (use-package company-reftex - :after company) + (use-package auctex-latexmk + :defer t) + ;; company + (use-package company-math + :after company) + (use-package company-auctex + :after company) + (use-package company-reftex + :after company) + ;; use cdlatex + (use-package cdlatex + :defer t) - ;; use cdlatex - (use-package cdlatex - :defer t) + ;; https://gist.github.com/saevarb/367d3266b3f302ecc896 + ;; https://piotr.is/2010/emacs-as-the-ultimate-latex-editor/ - ;; https://gist.github.com/saevarb/367d3266b3f302ecc896 - ;; https://piotr.is/2010/emacs-as-the-ultimate-latex-editor/ - - (use-package latex + (use-package latex :straight auctex :defer t :custom - (olivetti-body-width 120) (cdlatex-simplify-sub-super-scripts nil) (reftex-default-bibliography - '("~/Documents/refs.bib")) + '("~/Documents/refs.bib")) (bibtex-dialect 'biblatex) :mode ("\\.tex\\'" . latex-mode) - ;; also see evil-define-key in :config + ;; also see evil-define-key in :config :bind (:map LaTeX-mode-map - ("TAB" . cdlatex-tab) - ("'" . cdlatex-math-modify) - ("C-c C-e" . cdlatex-environment)) + ("TAB" . cdlatex-tab) + ("'" . cdlatex-math-modify) + ("C-c C-e" . cdlatex-environment)) :hook (LaTeX-mode . flyspell-mode) @@ -2180,21 +2192,21 @@ AucTex (LaTeX-mode . try/latex-mode-setup) (LaTeX-mode . turn-on-cdlatex) (LaTeX-mode . origami-mode) - ;; (LaTeX-mode . TeX-fold-mode) + ;; (LaTeX-mode . TeX-fold-mode) (LaTeX-mode . lsp) - ;; (LaTeX-mode . olivetti-mode);; already set as a text-mode-hook - ;; (LaTeX-mode . TeX-PDF-mode) ;; what does it do? - ;; (LaTeX-mode . company-mode) ;; already enabled globaly - ;; (LaTeX-mode . xenops-mode) ;; svgs too lagy :( - ;; (LaTeX-mode . flycheck-mode);; already enabled with lsp - ;; (LaTeX-mode . LaTeX-math-mode) + ;; (LaTeX-mode . olivetti-mode);; already set as a text-mode-hook + ;; (LaTeX-mode . TeX-PDF-mode) ;; what does it do? + ;; (LaTeX-mode . company-mode) ;; already enabled globaly + ;; (LaTeX-mode . xenops-mode) ;; svgs too lagy :( + ;; (LaTeX-mode . flycheck-mode);; already enabled with lsp + ;; (LaTeX-mode . LaTeX-math-mode) :config ;; pressing "$" while selecting text will cycle between \(\) and \[\] environment ;; where does \[\] come from? I have no clue! ;; I only defined \(\) lol - (setq TeX-electric-math (quote ("\\(" . "\\)"))) - (evil-define-key 'visual 'LaTeX-mode-map + (setq TeX-electric-math (quote ("\\(" . "\\)"))) + (evil-define-key 'visual 'LaTeX-mode-map "$" 'TeX-insert-dollar "'" 'cdlatex-math-modify) @@ -2213,13 +2225,13 @@ AucTex ;; ;; pdftools ;; ;; https://emacs.stackexchange.com/questions/21755/use-pdfview-as-default-auctex-pdf-viewer#21764 (setq TeX-view-program-selection '((output-pdf "Zathura")) - ;; TeX-view-program-list '(("PDF Tools" TeX-pdf-tools-sync-view)) - TeX-source-correlate-start-server t) ;; not sure if last line is neccessary - ;; (add-to-list 'TeX-view-program-selection '(output-pdf "Zathura")) + ;; TeX-view-program-list '(("PDF Tools" TeX-pdf-tools-sync-view)) + TeX-source-correlate-start-server t) ;; not sure if last line is neccessary + ;; (add-to-list 'TeX-view-program-selection '(output-pdf "Zathura")) - ;; clean intermdiate tex crap - (add-to-list 'LaTeX-clean-intermediate-suffixes '"-figure[0-9]*\\.\\(pdf\\|md5\\|log\\|dpth\\|dep\\|run\\.xml\\)") - (add-to-list 'LaTeX-clean-intermediate-suffixes '".auxlock") + ;; clean intermdiate tex crap + (add-to-list 'LaTeX-clean-intermediate-suffixes '"-figure[0-9]*\\.\\(pdf\\|md5\\|log\\|dpth\\|dep\\|run\\.xml\\)") + (add-to-list 'LaTeX-clean-intermediate-suffixes '".auxlock") ; (eval-after-load 'latex ; `(dolist (face '((font-latex-sectioning-0-face . 3.0) ; \part @@ -2239,105 +2251,104 @@ AucTex (auctex-latexmk-setup) (setq auctex-latexmk-inherit-TeX-PDF-mode t) - ) + ) #+end_src Custom functions -#+begin_src emacs-lisp +#+begin_src emacs-lisp :tangle no (defun try/latex-mode-setup () - (require 'company-reftex) - (turn-on-reftex) - (require 'company-auctex) - (require 'company-math) + (require 'company-reftex) + (turn-on-reftex) + (require 'company-auctex) + (require 'company-math) (setq-local company-backends - + (append '((company-reftex-labels company-reftex-citations) - (company-math-symbols-unicode company-math-symbols-latex company-latex-commands) - (company-auctex-macros company-auctex-symbols company-auctex-environments) - company-ispell) - company-backends))) + (company-math-symbols-unicode company-math-symbols-latex company-latex-commands) + (company-auctex-macros company-auctex-symbols company-auctex-environments) + company-ispell) + company-backends))) #+end_src Insert from clip [[https://hershsingh.net/blog/emacs-latex-screenshot/#:~:text=Clipboard%20to%20TeX,-Finally%2C%20I%20have&text=Once%20I%20have%20captured%20the,file%20img%2F.][Quickly insert hand-drawn figures in a LaTeX document in Emacs]] -#+begin_src emacs-lisp - (defvar latex/insert-image-format "\\begin{center}\\includegraphics[width=\\linewidth]{%s}\\end{center}") - (defvar latex/insert-figure-format - " \\begin{figure}[h] - \\centering - \\includegraphics[width=\\linewidth]{%s} - \\caption{\\label{fig:TODO} TODO} +#+begin_src emacs-lisp :tangle no + (defvar latex/insert-image-format "\\begin{center}\\includegraphics[width=\\linewidth]{%s}\\end{center}") + (defvar latex/insert-figure-format + " \\begin{figure}[h] + \\centering + \\includegraphics[width=\\linewidth]{%s} + \\caption{\\label{fig:TODO} TODO} \\end{figure} \\FloatBarrier") - (defun latex/insert-image-from-clipboard () + (defun latex/insert-image-from-clipboard () (interactive) (let* - ;; Ask for a filename - ((image-name (read-string "image-name: ")) - ;; This is getting uply... - (image-file-location (concat "\"" (expand-file-name (concat (TeX-master-directory) "img/" image-name ".png" )) "\""))) + ;; Ask for a filename + ((image-name (read-string "image-name: ")) + ;; This is getting uply... + (image-file-location (concat "\"" (expand-file-name (concat (TeX-master-directory) "img/" image-name ".png" )) "\""))) - ;; Make the "img" directory if it does not exist - (make-directory (concat (TeX-master-directory) "img") t) + ;; Make the "img" directory if it does not exist + (make-directory (concat (TeX-master-directory) "img") t) - ;; Copy the image in clipboard to "img/" directory - (shell-command (concat "xclip -selection clipboard -t image/png -o > " image-file-location)) + ;; Copy the image in clipboard to "img/" directory + (shell-command (concat "xclip -selection clipboard -t image/png -o > " image-file-location)) - ;; Insert the latex snippet to include the figure - (insert (format latex/insert-image-format (concat "img/" (file-name-nondirectory image-file-location) ))))) + ;; Insert the latex snippet to include the figure + (insert (format latex/insert-image-format (concat "img/" (file-name-nondirectory image-file-location) ))))) (defun latex/insert-figure-from-clipboard () (interactive) (let* - ;; Ask for a filename - ((image-name (read-string "image-name: ")) - ;; This is getting uply... - (image-file-location (concat "\"" (expand-file-name (concat (TeX-master-directory) "img/" image-name ".png" )) "\""))) + ;; Ask for a filename + ((image-name (read-string "image-name: ")) + ;; This is getting uply... + (image-file-location (concat "\"" (expand-file-name (concat (TeX-master-directory) "img/" image-name ".png" )) "\""))) - ;; Make the "img" directory if it does not exist - (make-directory (concat (TeX-master-directory) "img") t) + ;; Make the "img" directory if it does not exist + (make-directory (concat (TeX-master-directory) "img") t) - ;; Copy the image in clipboard to "img/" directory - (message (concat "xclip -selection clipboard -t image/png -o > " image-file-location)) - (shell-command (concat "xclip -selection clipboard -t image/png -o > " image-file-location)) - - ;; Insert the latex snippet to include the figure - (insert (format latex/insert-figure-format (concat "img/" (file-name-nondirectory (concat image-name ".png"))))))) + ;; Copy the image in clipboard to "img/" directory + (message (concat "xclip -selection clipboard -t image/png -o > " image-file-location)) + (shell-command (concat "xclip -selection clipboard -t image/png -o > " image-file-location)) + ;; Insert the latex snippet to include the figure + (insert (format latex/insert-figure-format (concat "img/" (file-name-nondirectory (concat image-name ".png"))))))) #+end_src Folding #+begin_src emacs-lisp :tangle no - (use-package outshine ; + (use-package outshine ; :defer t :config - (setq LaTeX-section-list '( - ("part" 0) - ("chapter" 1) - ("section" 2) - ("subsection" 3) - ("subsubsection" 4) - ("paragraph" 5) - ("subparagraph" 6) - ("begin" 7))) - - - (add-hook 'LaTeX-mode-hook #'(lambda () - (outshine-mode 1) - (setq outline-level #'LaTeX-outline-level) - (setq outline-regexp (LaTeX-outline-regexp t)) - (setq outline-heading-alist - (mapcar (lambda (x) - (cons (concat "\\" (nth 0 x)) (nth 1 x))) - LaTeX-section-list))))) + (setq LaTeX-section-list '( + ("part" 0) + ("chapter" 1) + ("section" 2) + ("subsection" 3) + ("subsubsection" 4) + ("paragraph" 5) + ("subparagraph" 6) + ("begin" 7))) + + + (add-hook 'LaTeX-mode-hook #'(lambda () + (outshine-mode 1) + (setq outline-level #'LaTeX-outline-level) + (setq outline-regexp (LaTeX-outline-regexp t)) + (setq outline-heading-alist + (mapcar (lambda (x) + (cons (concat "\\" (nth 0 x)) (nth 1 x))) + LaTeX-section-list))))) - (general-define-key + (general-define-key :states '(normal visual) :keymaps 'LaTeX-mode-map "TAB" '(outshine-cycle :which-key "outshine-cycle")) @@ -2346,55 +2357,186 @@ Folding #+end_src ivy bibtex -#+begin_src emacs-lisp - (use-package ivy-bibtex +#+begin_src emacs-lisp :tangle no + (use-package ivy-bibtex :defer t :custom (bibtex-completion-bibliography - '("~/Documents/refs.bib")) + '("~/Documents/refs.bib")) (bibtex-completion-library-path '("~/papers")) (bibtex-completion-cite-prompt-for-optional-arguments nil) (bibtex-completion-cite-default-as-initial-input t) - ) - + ) + #+end_src -*** Verilog #+begin_src emacs-lisp - (setq verilog-linter "verilator --lint-only") - (setq verilog-auto-newline nil - verilog-auto-arg-sort t - verilog-case-fold nil) - ; (setq verilog-indent-level 1) - (add-hook 'verilog-mode-hook 'electric-pair-mode) - (add-hook 'verilog-mode-hook 'lsp) - (add-hook 'verilog-mode-hook 'flycheck-mode) - ;; (add-hook 'verilog-mode-hook (lambda () - ;; (add-hook 'before-save-hook 'verilog-indent-buffer nil t))) - - (with-eval-after-load 'lsp-mode - (add-to-list 'lsp-language-id-configuration '(verilog-mode . "verilog")) - (lsp-register-client - (make-lsp-client :new-connection (lsp-stdio-connection "verible-verilog-ls") - :major-modes '(verilog-mode) - :server-id 'verible-ls))) - + (use-package lsp-latex + :hook ((tex-mode . lsp) + (latex-mode . lsp))) #+end_src +*** COMMENT Ledger +Unused, switched to =hledger= +#+begin_src emacs-lisp + (use-package ledger-mode + ;; :mode ("\\.dat\\'" "\\.ledger\\'") + :mode ("\\.ledger\\'") + :bind (:map ledger-mode-map + ("C-x C-s" . my/ledger-save)) + :custom (ledger-clear-whole-transactions t) + :hook ((ledger-mode . flycheck-mode) + (ledger-mode . flyspell-mode)) + :config + ;(add-hook 'ledger-mode-hook (lambda () (add-hook 'before-save-hook 'ledger-mode-clean-buffer))) + ) + + (use-package flycheck-ledger :after ledger-mode) +#+end_src +*** hledger +#+begin_src emacs-lisp + (use-package hledger-mode + :mode ("\\.journal\\'" "\\.hledger\\'") + ;:commands hledger-enable-reporting + :preface + (defun hledger/next-entry () + "Move to next entry and pulse." + (interactive) + (hledger-next-or-new-entry) + (hledger-pulse-momentary-current-entry)) + + (defface hledger-warning-face + '((((background dark)) + :background "Red" :foreground "White") + (((background light)) + :background "Red" :foreground "White") + (t :inverse-video t)) + "Face for warning" + :group 'hledger) + + (defun hledger/prev-entry () + "Move to last entry and pulse." + (interactive) + (hledger-backward-entry) + (hledger-pulse-momentary-current-entry)) + + :bind (("C-c j" . hledger-run-command) + :map hledger-mode-map + ("C-c e" . hledger-jentry) + ("M-p" . hledger/prev-entry) + ("M-n" . hledger/next-entry)) + :init + (setq hledger-jfile (expand-file-name "~/Documents/ledger/data_2024.hledger") + hledger-currency-string "SAR" + ;hledger-email-secrets-file (expand-file-name "secrets.el" emacs-assets-directory) + ) + ;; Expanded account balances in the overall monthly report are + ;; mostly noise for me and do not convey any meaningful information. + (setq hledger-show-expanded-report nil) + + (when (boundp 'my-hledger-service-fetch-url) + (setq hledger-service-fetch-url + my-hledger-service-fetch-url)) + + :config + (require 'hledger-input) + (add-hook 'hledger-view-mode-hook #'hl-line-mode) + ;(add-hook 'hledger-view-mode-hook #'center-text-for-reading) + + (add-hook 'hledger-view-mode-hook + (lambda () + (run-with-timer 1 + nil + (lambda () + (when (equal hledger-last-run-command + "balancesheet") + ;; highlight frequently changing accounts + (highlight-regexp "^.*\\(savings\\|cash\\).*$") + (highlight-regexp "^.*credit-card.*$" + 'hledger-warning-face)))))) + + (add-hook 'hledger-mode-hook + (lambda () + (make-local-variable 'company-backends) + (add-to-list 'company-backends 'hledger-company)))) +#+end_src + +#+begin_src emacs-lisp +(use-package flycheck-hledger + :after (flycheck hledger-mode) + :demand t) + +#+end_src +*** COMMENT Verilog +#+begin_src emacs-lisp + + (setq verilog-linter "verilator --lint-only") + (setq verilog-auto-newline nil + verilog-auto-arg-sort t + verilog-case-fold nil) + ; (setq verilog-indent-level 1) + (add-hook 'verilog-mode-hook 'electric-pair-mode) + (add-hook 'verilog-mode-hook 'lsp) + (add-hook 'verilog-mode-hook 'flycheck-mode) + (add-hook 'verilog-mode-hook (lambda () + (add-hook 'before-save-hook 'verilog-indent-buffer nil t))) + + (with-eval-after-load 'lsp-mode + (add-to-list 'lsp-language-id-configuration '(verilog-mode . "verilog")) + (lsp-register-client + (make-lsp-client :new-connection (lsp-stdio-connection "verible-verilog-ls") + :major-modes '(verilog-mode) + :server-id 'verible-ls))) + +#+end_src +*** SystemVerilog +#+begin_src emacs-lisp + (use-package verilog-ext + :hook ((verilog-mode . verilog-ext-mode) + (verilog-ext-mode . electric-pair-local-mode) + (verilog-ext-mode . lsp-mode)) + :init + ;; Can also be set through `M-x RET customize-group RET verilog-ext': + ;; Comment out/remove the ones you do not need + (setq verilog-ext-feature-list + '(font-lock + xref + capf + hierarchy + eglot + lsp + ;lsp-bridge + ;lspce + flycheck + beautify + navigation + template + formatter + compilation + imenu + which-func + hideshow + typedefs + time-stamp + block-end-comments + ports)) + :config + (verilog-ext-mode-setup)) +#+end_src *** VHDL #+begin_src emacs-lisp - (setq lsp-vhdl-server 'vhdl-ls) - (add-hook 'vhdl-mode-hook 'vhdl-electric-mode) - (add-hook 'vhdl-mode-hook 'flycheck-mode) - (add-hook 'vhdl-mode-hook (lambda () - (add-hook 'before-save-hook 'vhdl-beautify-buffer nil t))) + (setq lsp-vhdl-server 'vhdl-ls) + (add-hook 'vhdl-mode-hook 'vhdl-electric-mode) + (add-hook 'vhdl-mode-hook 'flycheck-mode) + (add-hook 'vhdl-mode-hook (lambda () + (add-hook 'before-save-hook 'vhdl-beautify-buffer nil t))) #+end_src *** Bash #+begin_src emacs-lisp - (use-package flymake-shellcheck + (use-package flymake-shellcheck :commands flymake-shellcheck-load :init (add-hook 'sh-mode-hook 'flymake-shellcheck-load)) @@ -2403,55 +2545,54 @@ ivy bibtex *** Nix(OS) #+begin_src emacs-lisp - (use-package nix-mode - :hook (nix-mode . (lambda () - ;(add-hook 'before-save-hook 'nix-mode-format nil t)))); doesn't require nixfmt - (add-hook 'before-save-hook 'nix-format-buffer nil t)))) + (use-package nix-mode + :hook (nix-mode . (lambda () + ;(add-hook 'before-save-hook 'nix-mode-format nil t)))); doesn't require nixfmt + (add-hook 'before-save-hook 'nix-format-buffer nil t)))) #+end_src ** Tramp #+begin_src emacs-lisp - ; moved to Git - ; https://emacs.stackexchange.com/questions/16489/tramp-is-unbearably-slow-osx-ssh - ; (setq vc-handled-backends '(Git)) + ; moved to Git + ; https://emacs.stackexchange.com/questions/16489/tramp-is-unbearably-slow-osx-ssh + ; (setq vc-handled-backends '(Git)) (setq tramp-backup-directory-alist backup-directory-alist) - (setq vc-ignore-dir-regexp - (format "\\(%s\\)\\|\\(%s\\)" - vc-ignore-dir-regexp - tramp-file-name-regexp)) - (setq vc-handled-backends '(Git)) - ;https://libredd.it/r/emacs/comments/320cvb/projectile_slows_tramp_mode_to_a_crawl_is_there_a/ + (setq vc-ignore-dir-regexp + (format "\\(%s\\)\\|\\(%s\\)" + vc-ignore-dir-regexp + tramp-file-name-regexp)) + (setq vc-handled-backends '(Git)) + ;https://libredd.it/r/emacs/comments/320cvb/projectile_slows_tramp_mode_to_a_crawl_is_there_a/ (add-hook 'find-file-hook - (lambda () - (when (file-remote-p default-directory) - (setq-local projectile-mode-line "Projectile" - vc-handled-backends '())))) - - + (lambda () + (when (file-remote-p default-directory) + (setq-local projectile-mode-line "Projectile" + vc-handled-backends '())))) + #+end_src * Misc ** Restart Emacs #+begin_src emacs-lisp - (use-package restart-emacs) + (use-package restart-emacs) #+end_src ** Vterm #+begin_src emacs-lisp - (use-package vterm - :commands vterm - :bind (:map vterm-mode-map - ("C-t" . vterm-toggle)) - :config - ;;Toggle vterm - (evil-define-key '(normal visual insert) 'vterm-mode-map (kbd "C-t") 'vterm-toggle) + (use-package vterm + :commands vterm + :bind (:map vterm-mode-map + ("C-t" . vterm-toggle)) + :config + ;;Toggle vterm + (evil-define-key '(normal visual insert) 'vterm-mode-map (kbd "C-t") 'vterm-toggle) - :custom - ; claimed to be faster: https://teddit.net/r/emacs/comments/tpey9g/making_vterm_snappy_by_setting_vtermtimerdelay_to/ - (vterm-timer-delay nil) - :ensure t) + :custom + ; claimed to be faster: https://teddit.net/r/emacs/comments/tpey9g/making_vterm_snappy_by_setting_vtermtimerdelay_to/ + (vterm-timer-delay nil) + :ensure t) #+end_src #+begin_src emacs-lisp @@ -2460,106 +2601,106 @@ ivy bibtex ** Server #+begin_src emacs-lisp - (unless (server-running-p) (server-start)) - (add-hook 'server-after-make-frame-hook '(lambda () (set-cursor-color "#FFFFFF"))) + (unless (server-running-p) (server-start)) + (add-hook 'server-after-make-frame-hook '(lambda () (set-cursor-color "#FFFFFF"))) #+end_src ** COMMENT ranger #+begin_src emacs-lisp - (use-package ranger - :defer t - :config (ranger-override-dired-mode t)) + (use-package ranger + :defer t + :config (ranger-override-dired-mode t)) #+end_src ** Ligatures #+begin_src emacs-lisp - - (let ((ligatures `((?- . ,(regexp-opt '("-|" "-~" "---" "-<<" "-<" "--" "->" "->>" "-->"))) - (?/ . ,(regexp-opt '("/**" "/*" "///" "/=" "/==" "/>" "//"))) - ;; (?* . ,(regexp-opt '("*>" "***" "*/"))) - (?* . ,(regexp-opt '("*>" "*/"))) - (?< . ,(regexp-opt '("<-" "<<-" "<=>" "<=" "<|" "<||" "<|||::=" "<|>" "<:" "<>" "<-<" - "<<<" "<==" "<<=" "<=<" "<==>" "<-|" "<<" "<~>" "<=|" "<~~" "<~" - "<$>" "<$" "<+>" "<+" "" "" "<->" ""))) + (?/ . ,(regexp-opt '("/**" "/*" "///" "/=" "/==" "/>" "//"))) + ;; (?* . ,(regexp-opt '("*>" "***" "*/"))) + (?* . ,(regexp-opt '("*>" "*/"))) + (?< . ,(regexp-opt '("<-" "<<-" "<=>" "<=" "<|" "<||" "<|||::=" "<|>" "<:" "<>" "<-<" + "<<<" "<==" "<<=" "<=<" "<==>" "<-|" "<<" "<~>" "<=|" "<~~" "<~" + "<$>" "<$" "<+>" "<+" "" "" "<->" "