From 9139a1b136fa2b5adfcac0ac09a4f61aa1ee1ff4 Mon Sep 17 00:00:00 2001 From: Thomas Ulmer Date: Wed, 4 Feb 2026 14:24:16 -0800 Subject: full reorg --- .gitignore | 44 +- .gitmodules | 14 +- Xdefaults | 111 - alacritty/alacritty.toml | 49 - bash_aliases | 25 - bash_profile | 32 - bashrc | 68 - brightness/brightnessdown | 3 - brightness/brightnessmax | 4 - brightness/brightnessup | 3 - config/Xdefaults | 111 + config/alacritty/alacritty | 1 + config/alacritty/alacritty.toml | 49 + config/bash_aliases | 25 + config/bash_profile | 32 + config/bashrc | 68 + config/emacs/.emacs.desktop.lock | 1 + config/emacs/emacs | 1 + config/emacs/eshell/alias | 6 + config/emacs/eshell/profile | 1 + config/emacs/history | 22 + config/emacs/init.el | 1135 ++ config/emacs/site-lisp/chinese.el | 18 + config/emacs/site-lisp/fbterm.el | 13 + config/emacs/site-lisp/maze.el | 64 + config/emacs/site-lisp/my-eglot.el | 7 + config/emacs/site-lisp/my-exwm.el | 184 + config/emacs/site-lisp/my-mail.el | 52 + config/emacs/site-lisp/my-modal.el | 212 + config/emacs/site-lisp/single-header.el | 257 + config/emacs/site-lisp/tex-conf.el | 47 + config/emacs/site-lisp/tmu-custom-theme.el | 67 + config/emacs/splashLaputa.png | Bin 0 -> 376185 bytes config/emacs/templates/c.eld | 5 + config/emacs/viper | 1 + config/fbterm/fbterm-emacs.sh | 4 + config/fbterm/fbtermrc | 60 + config/firefox/chrome/userChrome.css | 4 + config/firefox/user.js | 11 + config/foot/foot.ini | 187 + config/glide/glide.d.ts | 13955 +++++++++++++++++++ config/glide/glide.ts | 59 + config/glirc/config | 18 + config/qutebrowser/autoconfig.yml | 24 + config/qutebrowser/bookmarks/urls | 0 config/qutebrowser/quickmarks | 0 config/qutebrowser/qutebrowser | 1 + config/sway/config | 298 + config/sway/otherwindow | 81 + config/sway/switch.py | 101 + config/sway/switch.sh | 11 + config/sway/toEmacs.sh | 12 + config/vimb/_style.css | 55 + config/vimb/config | 20 + config/vimb/scripts.js | 8 + config/vimb/vimb/_style.css | 55 + config/vimb/vimb/config | 20 + config/waybar/config | 163 + config/waybar/mediaplayer.py | 128 + config/waybar/style.css | 259 + config/xinitrc | 16 + config/xmobarrc | 106 + config/xmonad/xmonad.cabal | 14 + config/xmonad/xmonad.hs | 243 + dwm/dwm-6.6.tar.gz | Bin 26379 -> 0 bytes dwm/dwm-6.6/LICENSE | 38 - dwm/dwm-6.6/Makefile | 45 - dwm/dwm-6.6/README | 48 - dwm/dwm-6.6/config.def.h | 136 - dwm/dwm-6.6/config.mk | 39 - dwm/dwm-6.6/drw.c | 448 - dwm/dwm-6.6/drw.h | 58 - dwm/dwm-6.6/dwm.1 | 176 - dwm/dwm-6.6/dwm.c | 2277 --- dwm/dwm-6.6/dwm.png | Bin 373 -> 0 bytes dwm/dwm-6.6/movestack.c | 49 - dwm/dwm-6.6/transient.c | 42 - dwm/dwm-6.6/util.c | 37 - dwm/dwm-6.6/util.h | 9 - dwm/setup.sh | 9 - emacs/eshell/alias | 6 - emacs/eshell/profile | 1 - emacs/init.el | 1135 -- emacs/site-lisp/chinese.el | 18 - emacs/site-lisp/fbterm.el | 13 - emacs/site-lisp/maze.el | 64 - emacs/site-lisp/my-eglot.el | 7 - emacs/site-lisp/my-exwm.el | 184 - emacs/site-lisp/my-mail.el | 52 - emacs/site-lisp/my-modal.el | 211 - emacs/site-lisp/single-header.el | 257 - emacs/site-lisp/tex-conf.el | 47 - emacs/site-lisp/tmu-custom-theme.el | 67 - emacs/splashLaputa.png | Bin 376185 -> 0 bytes emacs/templates/c.eld | 5 - fbterm/fbterm-emacs.sh | 4 - fbterm/fbtermrc | 60 - firefox/chrome/userChrome.css | 4 - firefox/user.js | 11 - foot/foot.ini | 187 - glide/glide.ts | 59 - misc/lk.sh | 28 - niceties/capslock/caps2esc | 7 - niceties/capslock/caps2esc-tools | 1 - niceties/capslock/caps2escd | 5 - niceties/capslock/interception-tools | 1 - niceties/capslock/udevmon.yaml | 6 - niceties/setup.sh | 25 - niceties/unclutter-xfixes | 1 - qutebrowser/autoconfig.yml | 24 - qutebrowser/bookmarks/urls | 0 qutebrowser/quickmarks | 0 scripts/brightness/brightnessdown | 3 + scripts/brightness/brightnessmax | 4 + scripts/brightness/brightnessup | 3 + scripts/misc/lk.sh | 28 + scripts/volume/volumedown | 3 + scripts/volume/volumemute | 3 + scripts/volume/volumeup | 3 + setup.sh | 62 +- slstatus/setup.sh | 9 - slstatus/slstatus-1.1.tar.gz | Bin 18407 -> 0 bytes slstatus/slstatus-1.1/LICENSE | 46 - slstatus/slstatus-1.1/Makefile | 69 - slstatus/slstatus-1.1/README | 65 - slstatus/slstatus-1.1/arg.h | 33 - slstatus/slstatus-1.1/components/battery.c | 247 - slstatus/slstatus-1.1/components/cat.c | 32 - slstatus/slstatus-1.1/components/cpu.c | 157 - slstatus/slstatus-1.1/components/datetime.c | 20 - slstatus/slstatus-1.1/components/disk.c | 59 - slstatus/slstatus-1.1/components/entropy.c | 29 - slstatus/slstatus-1.1/components/hostname.c | 17 - slstatus/slstatus-1.1/components/ip.c | 87 - slstatus/slstatus-1.1/components/kernel_release.c | 19 - .../slstatus-1.1/components/keyboard_indicators.c | 50 - slstatus/slstatus-1.1/components/keymap.c | 86 - slstatus/slstatus-1.1/components/load_avg.c | 19 - slstatus/slstatus-1.1/components/netspeeds.c | 129 - slstatus/slstatus-1.1/components/num_files.c | 32 - slstatus/slstatus-1.1/components/ram.c | 212 - slstatus/slstatus-1.1/components/run_command.c | 31 - slstatus/slstatus-1.1/components/swap.c | 274 - slstatus/slstatus-1.1/components/temperature.c | 73 - slstatus/slstatus-1.1/components/uptime.c | 34 - slstatus/slstatus-1.1/components/user.c | 33 - slstatus/slstatus-1.1/components/volume.c | 219 - slstatus/slstatus-1.1/components/wifi.c | 413 - slstatus/slstatus-1.1/config.def.h | 74 - slstatus/slstatus-1.1/config.mk | 22 - slstatus/slstatus-1.1/slstatus.1 | 47 - slstatus/slstatus-1.1/slstatus.c | 135 - slstatus/slstatus-1.1/slstatus.h | 85 - slstatus/slstatus-1.1/util.c | 141 - slstatus/slstatus-1.1/util.h | 16 - st/setup.sh | 9 - st/st-0.9.3.tar.gz | Bin 49528 -> 0 bytes st/st-0.9.3/FAQ | 253 - st/st-0.9.3/LEGACY | 17 - st/st-0.9.3/LICENSE | 34 - st/st-0.9.3/Makefile | 51 - st/st-0.9.3/README | 34 - st/st-0.9.3/TODO | 28 - st/st-0.9.3/arg.h | 50 - st/st-0.9.3/config.def.h | 503 - st/st-0.9.3/config.mk | 36 - st/st-0.9.3/st.1 | 177 - st/st-0.9.3/st.c | 3414 ----- st/st-0.9.3/st.h | 136 - st/st-0.9.3/st.info | 244 - st/st-0.9.3/win.h | 44 - st/st-0.9.3/x.c | 2532 ---- sway/config | 298 - sway/otherwindow | 81 - sway/switch.py | 101 - sway/switch.sh | 11 - sway/toEmacs.sh | 12 - symlinks.csv | 34 +- vimb/_style.css | 55 - vimb/config | 20 - vimb/scripts.js | 8 - vimb/vimb/_style.css | 55 - vimb/vimb/config | 20 - volume/volumedown | 3 - volume/volumemute | 3 - volume/volumeup | 3 - waybar/config | 163 - waybar/mediaplayer.py | 128 - waybar/style.css | 259 - xinitrc | 16 - xmobarrc | 106 - xmonad/build | 3 - xmonad/xmonad.cabal | 14 - xmonad/xmonad.hs | 243 - 194 files changed, 18415 insertions(+), 18452 deletions(-) delete mode 100644 Xdefaults delete mode 100644 alacritty/alacritty.toml delete mode 100644 bash_aliases delete mode 100644 bash_profile delete mode 100644 bashrc delete mode 100755 brightness/brightnessdown delete mode 100755 brightness/brightnessmax delete mode 100755 brightness/brightnessup create mode 100644 config/Xdefaults create mode 120000 config/alacritty/alacritty create mode 100644 config/alacritty/alacritty.toml create mode 100644 config/bash_aliases create mode 100644 config/bash_profile create mode 100644 config/bashrc create mode 100644 config/emacs/.emacs.desktop.lock create mode 120000 config/emacs/emacs create mode 100644 config/emacs/eshell/alias create mode 100644 config/emacs/eshell/profile create mode 100644 config/emacs/history create mode 100644 config/emacs/init.el create mode 100644 config/emacs/site-lisp/chinese.el create mode 100644 config/emacs/site-lisp/fbterm.el create mode 100644 config/emacs/site-lisp/maze.el create mode 100644 config/emacs/site-lisp/my-eglot.el create mode 100644 config/emacs/site-lisp/my-exwm.el create mode 100644 config/emacs/site-lisp/my-mail.el create mode 100644 config/emacs/site-lisp/my-modal.el create mode 100755 config/emacs/site-lisp/single-header.el create mode 100644 config/emacs/site-lisp/tex-conf.el create mode 100755 config/emacs/site-lisp/tmu-custom-theme.el create mode 100644 config/emacs/splashLaputa.png create mode 100644 config/emacs/templates/c.eld create mode 100644 config/emacs/viper create mode 100755 config/fbterm/fbterm-emacs.sh create mode 100644 config/fbterm/fbtermrc create mode 100644 config/firefox/chrome/userChrome.css create mode 100644 config/firefox/user.js create mode 100644 config/foot/foot.ini create mode 100644 config/glide/glide.d.ts create mode 100644 config/glide/glide.ts create mode 100644 config/glirc/config create mode 100644 config/qutebrowser/autoconfig.yml create mode 100644 config/qutebrowser/bookmarks/urls create mode 100644 config/qutebrowser/quickmarks create mode 120000 config/qutebrowser/qutebrowser create mode 100644 config/sway/config create mode 100755 config/sway/otherwindow create mode 100755 config/sway/switch.py create mode 100755 config/sway/switch.sh create mode 100755 config/sway/toEmacs.sh create mode 100644 config/vimb/_style.css create mode 100644 config/vimb/config create mode 100644 config/vimb/scripts.js create mode 100644 config/vimb/vimb/_style.css create mode 100644 config/vimb/vimb/config create mode 100644 config/waybar/config create mode 100755 config/waybar/mediaplayer.py create mode 100644 config/waybar/style.css create mode 100644 config/xinitrc create mode 100644 config/xmobarrc create mode 100644 config/xmonad/xmonad.cabal create mode 100644 config/xmonad/xmonad.hs delete mode 100644 dwm/dwm-6.6.tar.gz delete mode 100644 dwm/dwm-6.6/LICENSE delete mode 100644 dwm/dwm-6.6/Makefile delete mode 100644 dwm/dwm-6.6/README delete mode 100644 dwm/dwm-6.6/config.def.h delete mode 100644 dwm/dwm-6.6/config.mk delete mode 100644 dwm/dwm-6.6/drw.c delete mode 100644 dwm/dwm-6.6/drw.h delete mode 100644 dwm/dwm-6.6/dwm.1 delete mode 100644 dwm/dwm-6.6/dwm.c delete mode 100644 dwm/dwm-6.6/dwm.png delete mode 100644 dwm/dwm-6.6/movestack.c delete mode 100644 dwm/dwm-6.6/transient.c delete mode 100644 dwm/dwm-6.6/util.c delete mode 100644 dwm/dwm-6.6/util.h delete mode 100755 dwm/setup.sh delete mode 100644 emacs/eshell/alias delete mode 100644 emacs/eshell/profile delete mode 100644 emacs/init.el delete mode 100644 emacs/site-lisp/chinese.el delete mode 100644 emacs/site-lisp/fbterm.el delete mode 100644 emacs/site-lisp/maze.el delete mode 100644 emacs/site-lisp/my-eglot.el delete mode 100644 emacs/site-lisp/my-exwm.el delete mode 100644 emacs/site-lisp/my-mail.el delete mode 100644 emacs/site-lisp/my-modal.el delete mode 100755 emacs/site-lisp/single-header.el delete mode 100644 emacs/site-lisp/tex-conf.el delete mode 100755 emacs/site-lisp/tmu-custom-theme.el delete mode 100644 emacs/splashLaputa.png delete mode 100644 emacs/templates/c.eld delete mode 100755 fbterm/fbterm-emacs.sh delete mode 100644 fbterm/fbtermrc delete mode 100644 firefox/chrome/userChrome.css delete mode 100644 firefox/user.js delete mode 100644 foot/foot.ini delete mode 100644 glide/glide.ts delete mode 100755 misc/lk.sh delete mode 100755 niceties/capslock/caps2esc delete mode 160000 niceties/capslock/caps2esc-tools delete mode 100755 niceties/capslock/caps2escd delete mode 160000 niceties/capslock/interception-tools delete mode 100644 niceties/capslock/udevmon.yaml delete mode 100755 niceties/setup.sh delete mode 160000 niceties/unclutter-xfixes delete mode 100644 qutebrowser/autoconfig.yml delete mode 100644 qutebrowser/bookmarks/urls delete mode 100644 qutebrowser/quickmarks create mode 100755 scripts/brightness/brightnessdown create mode 100755 scripts/brightness/brightnessmax create mode 100755 scripts/brightness/brightnessup create mode 100755 scripts/misc/lk.sh create mode 100755 scripts/volume/volumedown create mode 100755 scripts/volume/volumemute create mode 100755 scripts/volume/volumeup delete mode 100755 slstatus/setup.sh delete mode 100644 slstatus/slstatus-1.1.tar.gz delete mode 100644 slstatus/slstatus-1.1/LICENSE delete mode 100644 slstatus/slstatus-1.1/Makefile delete mode 100644 slstatus/slstatus-1.1/README delete mode 100644 slstatus/slstatus-1.1/arg.h delete mode 100644 slstatus/slstatus-1.1/components/battery.c delete mode 100644 slstatus/slstatus-1.1/components/cat.c delete mode 100644 slstatus/slstatus-1.1/components/cpu.c delete mode 100644 slstatus/slstatus-1.1/components/datetime.c delete mode 100644 slstatus/slstatus-1.1/components/disk.c delete mode 100644 slstatus/slstatus-1.1/components/entropy.c delete mode 100644 slstatus/slstatus-1.1/components/hostname.c delete mode 100644 slstatus/slstatus-1.1/components/ip.c delete mode 100644 slstatus/slstatus-1.1/components/kernel_release.c delete mode 100644 slstatus/slstatus-1.1/components/keyboard_indicators.c delete mode 100644 slstatus/slstatus-1.1/components/keymap.c delete mode 100644 slstatus/slstatus-1.1/components/load_avg.c delete mode 100644 slstatus/slstatus-1.1/components/netspeeds.c delete mode 100644 slstatus/slstatus-1.1/components/num_files.c delete mode 100644 slstatus/slstatus-1.1/components/ram.c delete mode 100644 slstatus/slstatus-1.1/components/run_command.c delete mode 100644 slstatus/slstatus-1.1/components/swap.c delete mode 100644 slstatus/slstatus-1.1/components/temperature.c delete mode 100644 slstatus/slstatus-1.1/components/uptime.c delete mode 100644 slstatus/slstatus-1.1/components/user.c delete mode 100644 slstatus/slstatus-1.1/components/volume.c delete mode 100644 slstatus/slstatus-1.1/components/wifi.c delete mode 100644 slstatus/slstatus-1.1/config.def.h delete mode 100644 slstatus/slstatus-1.1/config.mk delete mode 100644 slstatus/slstatus-1.1/slstatus.1 delete mode 100644 slstatus/slstatus-1.1/slstatus.c delete mode 100644 slstatus/slstatus-1.1/slstatus.h delete mode 100644 slstatus/slstatus-1.1/util.c delete mode 100644 slstatus/slstatus-1.1/util.h delete mode 100755 st/setup.sh delete mode 100644 st/st-0.9.3.tar.gz delete mode 100644 st/st-0.9.3/FAQ delete mode 100644 st/st-0.9.3/LEGACY delete mode 100644 st/st-0.9.3/LICENSE delete mode 100644 st/st-0.9.3/Makefile delete mode 100644 st/st-0.9.3/README delete mode 100644 st/st-0.9.3/TODO delete mode 100644 st/st-0.9.3/arg.h delete mode 100644 st/st-0.9.3/config.def.h delete mode 100644 st/st-0.9.3/config.mk delete mode 100644 st/st-0.9.3/st.1 delete mode 100644 st/st-0.9.3/st.c delete mode 100644 st/st-0.9.3/st.h delete mode 100644 st/st-0.9.3/st.info delete mode 100644 st/st-0.9.3/win.h delete mode 100644 st/st-0.9.3/x.c delete mode 100644 sway/config delete mode 100755 sway/otherwindow delete mode 100755 sway/switch.py delete mode 100755 sway/switch.sh delete mode 100755 sway/toEmacs.sh delete mode 100644 vimb/_style.css delete mode 100644 vimb/config delete mode 100644 vimb/scripts.js delete mode 100644 vimb/vimb/_style.css delete mode 100644 vimb/vimb/config delete mode 100755 volume/volumedown delete mode 100755 volume/volumemute delete mode 100755 volume/volumeup delete mode 100644 waybar/config delete mode 100755 waybar/mediaplayer.py delete mode 100644 waybar/style.css delete mode 100644 xinitrc delete mode 100644 xmobarrc delete mode 100755 xmonad/build delete mode 100644 xmonad/xmonad.cabal delete mode 100644 xmonad/xmonad.hs diff --git a/.gitignore b/.gitignore index c711dcd..cd678db 100644 --- a/.gitignore +++ b/.gitignore @@ -2,32 +2,18 @@ *.o TAGS -xmonad/build-x86_64-linux/ -xmonad/dist-newstyle/ -xmonad/xmonad-x86_64-linux -xmonad/xmonad.errors - -emacs/.cache/ -emacs/.lsp-session-v1 -emacs/tramp -emacs/tree-sitter/ -emacs/transient/ -emacs/recentf -emacs/recentf.eld -emacs/projects.eld -emacs/elpa -emacs/eln-cache -emacs/auto-save-list -emacs/bookmarks.eld -emacs/url/ -emacs/eshell/history -emacs/eshell/lastdir - -slstatus/*/config.h -slstatus/*/slstatus - -st/*/config.h -st/*/st - -dwm/*/config.h -dwm/*/dwm +config/emacs/.cache/ +config/emacs/.lsp-session-v1 +config/emacs/tramp +config/emacs/tree-sitter/ +config/emacs/transient/ +config/emacs/recentf +config/emacs/recentf.eld +config/emacs/projects.eld +config/emacs/elpa +config/emacs/eln-cache +config/emacs/auto-save-list +config/emacs/bookmarks.eld +config/emacs/url/ +config/emacs/eshell/history +config/emacs/eshell/lastdir diff --git a/.gitmodules b/.gitmodules index 81c3985..fc9aa05 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,12 +1,18 @@ [submodule "emacs-source"] - path = emacs-source + path = tree/src/emacs/emacs-source url = git://git.savannah.gnu.org/emacs.git [submodule "capslock/interception-tools"] - path = niceties/capslock/interception-tools + path = tree/src/capslock/interception-tools url = https://gitlab.com/interception/linux/tools [submodule "capslock/caps2esc"] - path = niceties/capslock/caps2esc-tools + path = tree/src/capslock/caps2esc-tools url = https://gitlab.com/interception/linux/plugins/caps2esc [submodule "niceties/unclutter-xfixes"] - path = niceties/unclutter-xfixes + path = tree/src/unclutter-xfixes url = https://github.com/Airblader/unclutter-xfixes +[submodule "tree/src/tcc/tcc"] + path = tree/src/tcc/tcc + url = https://repo.or.cz/tinycc.git +[submodule "tree/src/microhs/microhs"] + path = tree/src/microhs/microhs + url = https://github.com/augustss/MicroHs diff --git a/Xdefaults b/Xdefaults deleted file mode 100644 index 8ba8341..0000000 --- a/Xdefaults +++ /dev/null @@ -1,111 +0,0 @@ -! Selenized dark color palette for xterm. -xterm*background: rgb:10/3c/48 -xterm*foreground: rgb:ad/bc/bc -! normal colors: "black", red, green, yellow, blue, magenta, cyan, "white" -xterm*color0: rgb:18/49/56 -xterm*color1: rgb:fa/57/50 -xterm*color2: rgb:75/b9/38 -xterm*color3: rgb:db/b3/2d -xterm*color4: rgb:46/95/f7 -xterm*color5: rgb:f2/75/be -xterm*color6: rgb:41/c7/b9 -xterm*color7: rgb:72/89/8f -! bright/bold versions of colors (in the same order) -xterm*color8: rgb:2d/5b/69 -xterm*color9: rgb:ff/66/5c -xterm*color10: rgb:84/c7/47 -xterm*color11: rgb:eb/c1/3d -xterm*color12: rgb:58/a3/ff -xterm*color13: rgb:ff/84/cd -xterm*color14: rgb:53/d6/c7 -xterm*color15: rgb:ca/d8/d9 - - - - - -!------------------------------------------------------------------------------- -! Xft settings -!------------------------------------------------------------------------------- -Xft.dpi: 96 -Xft.antialias: false -Xft.rgba: rgb -Xft.hinting: true -Xft.hintstyle: hintslight -!------------------------------------------------------------------------------- -! URxvt settings -! Colours lifted from Solarized (http://ethanschoonover.com/solarized) -! More info at: -! http://pod.tst.eu/http://cvs.schmorp.de/rxvt-unicode/doc/rxvt.1.pod -!------------------------------------------------------------------------------- -URxvt.depth: 32 -URxvt.geometry: 90x30 -URxvt.transparent: false -URxvt.fading: 0 -! URxvt.urgentOnBell: true -! URxvt.visualBell: true -URxvt.loginShell: true -URxvt.saveLines: 5000 -URxvt.internalBorder: 3 -URxvt.lineSpace: 0 -! Fonts -URxvt.allow_bold: false -/* URxvt.font: -*-terminus-medium-r-normal-*-12-120-72-72-c-60-iso8859-1 */ -URxvt*font: xft:Monospace:pixelsize=14 -URxvt*boldFont: xft:Monospace:pixelsize=14 -! Fix font space -URxvt*letterSpace: -1 -! Scrollbar -URxvt.scrollStyle: rxvt -URxvt.scrollBar: false -! Perl extensions -! URxvt.perl-ext-common: default,matcher -! URxvt.matcher.button: 1 -! URxvt.urlLauncher: firefox -! Cursor -URxvt.cursorBlink: true -URxvt.cursorColor: #657b83 -URxvt.cursorUnderline: false -! Pointer -URxvt.pointerBlank: true -!!Source http://github.com/altercation/solarized - -*background: #002b36 -*foreground: #657b83 -!!*fading: 40 -*fadeColor: #002b36 -*cursorColor: #93a1a1 -*pointerColorBackground: #586e75 -*pointerColorForeground: #93a1a1 - -!! black dark/light -*color0: #073642 -*color8: #002b36 - -!! red dark/light -*color1: #dc322f -*color9: #cb4b16 - -!! green dark/light -*color2: #859900 -*color10: #586e75 - -!! yellow dark/light -*color3: #b58900 -*color11: #657b83 - -!! blue dark/light -*color4: #268bd2 -*color12: #839496 - -!! magenta dark/light -*color5: #d33682 -*color13: #6c71c4 - -!! cyan dark/light -*color6: #2aa198 -*color14: #93a1a1 - -!! white dark/light -*color7: #eee8d5 -*color15: #fdf6e3 diff --git a/alacritty/alacritty.toml b/alacritty/alacritty.toml deleted file mode 100644 index 72e4f07..0000000 --- a/alacritty/alacritty.toml +++ /dev/null @@ -1,49 +0,0 @@ -# Default colors -[colors.primary] -background = '#111111' -foreground = '#EEEEEE' - -# Cursor colors -[colors.cursor] -text = '#EBEBEB' -cursor = '#1f97ea' - -# Normal colors -[colors.normal] -black = '#0d0d0d' -red = '#FF301B' -green = '#0ec248' -yellow = '#FFC620' -blue = '#3966ad' -magenta = '#8763B8' -cyan = '#21DEEF' -white = '#EBEBEB' - -# Bright colors -[colors.bright] -black = '#6D7070' -red = '#FF4352' -green = '#B8E466' -yellow = '#FFD750' -blue = '#1BA6FA' -magenta = '#A578EA' -cyan = '#73FBF1' -white = '#FEFEF8' - -[window] -opacity = 1 - -# Vi mode -[[keyboard.bindings]] -key = "Space" -mods = "Control|Alt" -action = "ToggleViMode" - -[colors.vi_mode_cursor] -cursor = '#FF0000' -text = '#111111' - -[colors.selection] -text = '#111111' -background = '#931b1b' - diff --git a/bash_aliases b/bash_aliases deleted file mode 100644 index e6d95a0..0000000 --- a/bash_aliases +++ /dev/null @@ -1,25 +0,0 @@ -#aliases for bash -alias cb="xclip -selection clipboard" -alias bctl="bluetoothctl" -alias make="make -j4" -alias less="less -i" - -alias e="emacs" -alias a="emacsclient -n" -alias femacs="fbterm -- fbterm-emacs.sh" -alias demacs="emacs --daemon" - -alias ta="tmux attach" - -alias gs="git status" -alias gc="git checkout" -alias gl="git log --graph --oneline --all" -alias glt="git log --graph --all --oneline --simplify-by-decoration" - -alias pd="pushd" -alias ppd="popd" -alias up="cd .." - -alias ll="ls -la" -alias ls="ls --color=auto" -alias grep='grep --color=auto' diff --git a/bash_profile b/bash_profile deleted file mode 100644 index 88f4ed4..0000000 --- a/bash_profile +++ /dev/null @@ -1,32 +0,0 @@ -# This file is sourced by bash for login shells. The following line -# runs your .bashrc and is recommended by the bash info pages. - -# Ensure XDG_RUNTIME_DIR is set -if test -z "$XDG_RUNTIME_DIR"; then - export XDG_RUNTIME_DIR=$(mktemp -d /tmp/$(id -u)-runtime-dir.XXX) -fi - -if [[ -f ~/.bashrc ]] ; then - . ~/.bashrc -fi - -if [ -d ~/.ghcup/bin ]; then - export PATH=~/.ghcup/bin:$PATH -fi - -if [ -d ~/.cabal/bin ]; then - export PATH=~/.cabal/bin:$PATH -fi - -if [ -d ~/.cargo/bin ]; then - export PATH=~/.cargo/bin:$PATH -fi - -if [ -d ~/.mcabal/bin ]; then - export PATH=~/.mcabal/bin:$PATH -fi - -if [ -d ~/.local/bin ]; then - export PATH=~/.local/bin:$PATH -fi - diff --git a/bashrc b/bashrc deleted file mode 100644 index b148117..0000000 --- a/bashrc +++ /dev/null @@ -1,68 +0,0 @@ -# If not running interactively, don't do anything -case $- in - *i*) ;; - *) return;; -esac - -# don't put duplicate lines or lines starting with space in the history. -# See bash(1) for more options -HISTCONTROL=ignoreboth - -# append to the history file, don't overwrite it -shopt -s histappend - -# for setting history length see HISTSIZE and HISTFILESIZE in bash(1) -HISTSIZE=1000 -HISTFILESIZE=2000 - -# check the window size after each command and, if necessary, -# update the values of LINES and COLUMNS. -shopt -s checkwinsize - -# If set, the pattern "**" used in a pathname expansion context will -# match all files and zero or more directories and subdirectories. -shopt -s globstar - -# set a fancy prompt (non-color, unless we know we "want" color) -case "$TERM" in - xterm-color|*-256color) color_prompt=yes;; -esac - -if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then - # We have color support; assume it's compliant with Ecma-48 - # (ISO/IEC-6429). (Lack of such support is extremely rare, and such - # a case would tend to support setf rather than setaf.) - color_prompt=yes -else - color_prompt= -fi - -if [ "$color_prompt" = yes ]; then - PS1='\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ' -else - PS1='\u@\h:\w\$ ' -fi -unset color_prompt - -# If this is an xterm set the title to user@host:dir -case "$TERM" in - xterm*|rxvt*|st*|alacritty*) - PS1="\[\e]0;\u@\h: \w\a\]$PS1" - ;; - *) - ;; -esac - -[ -n "$EAT_SHELL_INTEGRATION_DIR" ] && \ - source "$EAT_SHELL_INTEGRATION_DIR/bash" - -export ALTERNATE_EDITOR=emacs -export EDITOR="emacsclient -c" -export VISUAL="emacsclient -c" -export MORE="FRX" -export LESS="FRX" -export PAGER=$(which less || which more || echo "cat") - -if [ -f ~/.bash_aliases ]; then - . ~/.bash_aliases -fi diff --git a/brightness/brightnessdown b/brightness/brightnessdown deleted file mode 100755 index e48bd82..0000000 --- a/brightness/brightnessdown +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -echo $((($(cat /sys/class/backlight/intel_backlight/brightness) -1) / 2)) | sudo tee /sys/class/backlight/intel_backlight/brightness diff --git a/brightness/brightnessmax b/brightness/brightnessmax deleted file mode 100755 index d186f28..0000000 --- a/brightness/brightnessmax +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -cat /sys/class/backlight/intel_backlight/max_brightness | sudo tee /sys/class/backlight/intel_backlight/brightness - diff --git a/brightness/brightnessup b/brightness/brightnessup deleted file mode 100755 index f1e3a40..0000000 --- a/brightness/brightnessup +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -echo $((($(cat /sys/class/backlight/intel_backlight/brightness) * 2) + 1)) | sudo tee /sys/class/backlight/intel_backlight/brightness diff --git a/config/Xdefaults b/config/Xdefaults new file mode 100644 index 0000000..8ba8341 --- /dev/null +++ b/config/Xdefaults @@ -0,0 +1,111 @@ +! Selenized dark color palette for xterm. +xterm*background: rgb:10/3c/48 +xterm*foreground: rgb:ad/bc/bc +! normal colors: "black", red, green, yellow, blue, magenta, cyan, "white" +xterm*color0: rgb:18/49/56 +xterm*color1: rgb:fa/57/50 +xterm*color2: rgb:75/b9/38 +xterm*color3: rgb:db/b3/2d +xterm*color4: rgb:46/95/f7 +xterm*color5: rgb:f2/75/be +xterm*color6: rgb:41/c7/b9 +xterm*color7: rgb:72/89/8f +! bright/bold versions of colors (in the same order) +xterm*color8: rgb:2d/5b/69 +xterm*color9: rgb:ff/66/5c +xterm*color10: rgb:84/c7/47 +xterm*color11: rgb:eb/c1/3d +xterm*color12: rgb:58/a3/ff +xterm*color13: rgb:ff/84/cd +xterm*color14: rgb:53/d6/c7 +xterm*color15: rgb:ca/d8/d9 + + + + + +!------------------------------------------------------------------------------- +! Xft settings +!------------------------------------------------------------------------------- +Xft.dpi: 96 +Xft.antialias: false +Xft.rgba: rgb +Xft.hinting: true +Xft.hintstyle: hintslight +!------------------------------------------------------------------------------- +! URxvt settings +! Colours lifted from Solarized (http://ethanschoonover.com/solarized) +! More info at: +! http://pod.tst.eu/http://cvs.schmorp.de/rxvt-unicode/doc/rxvt.1.pod +!------------------------------------------------------------------------------- +URxvt.depth: 32 +URxvt.geometry: 90x30 +URxvt.transparent: false +URxvt.fading: 0 +! URxvt.urgentOnBell: true +! URxvt.visualBell: true +URxvt.loginShell: true +URxvt.saveLines: 5000 +URxvt.internalBorder: 3 +URxvt.lineSpace: 0 +! Fonts +URxvt.allow_bold: false +/* URxvt.font: -*-terminus-medium-r-normal-*-12-120-72-72-c-60-iso8859-1 */ +URxvt*font: xft:Monospace:pixelsize=14 +URxvt*boldFont: xft:Monospace:pixelsize=14 +! Fix font space +URxvt*letterSpace: -1 +! Scrollbar +URxvt.scrollStyle: rxvt +URxvt.scrollBar: false +! Perl extensions +! URxvt.perl-ext-common: default,matcher +! URxvt.matcher.button: 1 +! URxvt.urlLauncher: firefox +! Cursor +URxvt.cursorBlink: true +URxvt.cursorColor: #657b83 +URxvt.cursorUnderline: false +! Pointer +URxvt.pointerBlank: true +!!Source http://github.com/altercation/solarized + +*background: #002b36 +*foreground: #657b83 +!!*fading: 40 +*fadeColor: #002b36 +*cursorColor: #93a1a1 +*pointerColorBackground: #586e75 +*pointerColorForeground: #93a1a1 + +!! black dark/light +*color0: #073642 +*color8: #002b36 + +!! red dark/light +*color1: #dc322f +*color9: #cb4b16 + +!! green dark/light +*color2: #859900 +*color10: #586e75 + +!! yellow dark/light +*color3: #b58900 +*color11: #657b83 + +!! blue dark/light +*color4: #268bd2 +*color12: #839496 + +!! magenta dark/light +*color5: #d33682 +*color13: #6c71c4 + +!! cyan dark/light +*color6: #2aa198 +*color14: #93a1a1 + +!! white dark/light +*color7: #eee8d5 +*color15: #fdf6e3 diff --git a/config/alacritty/alacritty b/config/alacritty/alacritty new file mode 120000 index 0000000..c15d976 --- /dev/null +++ b/config/alacritty/alacritty @@ -0,0 +1 @@ +/home/tmu/dotfiles/config/alacritty \ No newline at end of file diff --git a/config/alacritty/alacritty.toml b/config/alacritty/alacritty.toml new file mode 100644 index 0000000..72e4f07 --- /dev/null +++ b/config/alacritty/alacritty.toml @@ -0,0 +1,49 @@ +# Default colors +[colors.primary] +background = '#111111' +foreground = '#EEEEEE' + +# Cursor colors +[colors.cursor] +text = '#EBEBEB' +cursor = '#1f97ea' + +# Normal colors +[colors.normal] +black = '#0d0d0d' +red = '#FF301B' +green = '#0ec248' +yellow = '#FFC620' +blue = '#3966ad' +magenta = '#8763B8' +cyan = '#21DEEF' +white = '#EBEBEB' + +# Bright colors +[colors.bright] +black = '#6D7070' +red = '#FF4352' +green = '#B8E466' +yellow = '#FFD750' +blue = '#1BA6FA' +magenta = '#A578EA' +cyan = '#73FBF1' +white = '#FEFEF8' + +[window] +opacity = 1 + +# Vi mode +[[keyboard.bindings]] +key = "Space" +mods = "Control|Alt" +action = "ToggleViMode" + +[colors.vi_mode_cursor] +cursor = '#FF0000' +text = '#111111' + +[colors.selection] +text = '#111111' +background = '#931b1b' + diff --git a/config/bash_aliases b/config/bash_aliases new file mode 100644 index 0000000..e6d95a0 --- /dev/null +++ b/config/bash_aliases @@ -0,0 +1,25 @@ +#aliases for bash +alias cb="xclip -selection clipboard" +alias bctl="bluetoothctl" +alias make="make -j4" +alias less="less -i" + +alias e="emacs" +alias a="emacsclient -n" +alias femacs="fbterm -- fbterm-emacs.sh" +alias demacs="emacs --daemon" + +alias ta="tmux attach" + +alias gs="git status" +alias gc="git checkout" +alias gl="git log --graph --oneline --all" +alias glt="git log --graph --all --oneline --simplify-by-decoration" + +alias pd="pushd" +alias ppd="popd" +alias up="cd .." + +alias ll="ls -la" +alias ls="ls --color=auto" +alias grep='grep --color=auto' diff --git a/config/bash_profile b/config/bash_profile new file mode 100644 index 0000000..88f4ed4 --- /dev/null +++ b/config/bash_profile @@ -0,0 +1,32 @@ +# This file is sourced by bash for login shells. The following line +# runs your .bashrc and is recommended by the bash info pages. + +# Ensure XDG_RUNTIME_DIR is set +if test -z "$XDG_RUNTIME_DIR"; then + export XDG_RUNTIME_DIR=$(mktemp -d /tmp/$(id -u)-runtime-dir.XXX) +fi + +if [[ -f ~/.bashrc ]] ; then + . ~/.bashrc +fi + +if [ -d ~/.ghcup/bin ]; then + export PATH=~/.ghcup/bin:$PATH +fi + +if [ -d ~/.cabal/bin ]; then + export PATH=~/.cabal/bin:$PATH +fi + +if [ -d ~/.cargo/bin ]; then + export PATH=~/.cargo/bin:$PATH +fi + +if [ -d ~/.mcabal/bin ]; then + export PATH=~/.mcabal/bin:$PATH +fi + +if [ -d ~/.local/bin ]; then + export PATH=~/.local/bin:$PATH +fi + diff --git a/config/bashrc b/config/bashrc new file mode 100644 index 0000000..b148117 --- /dev/null +++ b/config/bashrc @@ -0,0 +1,68 @@ +# If not running interactively, don't do anything +case $- in + *i*) ;; + *) return;; +esac + +# don't put duplicate lines or lines starting with space in the history. +# See bash(1) for more options +HISTCONTROL=ignoreboth + +# append to the history file, don't overwrite it +shopt -s histappend + +# for setting history length see HISTSIZE and HISTFILESIZE in bash(1) +HISTSIZE=1000 +HISTFILESIZE=2000 + +# check the window size after each command and, if necessary, +# update the values of LINES and COLUMNS. +shopt -s checkwinsize + +# If set, the pattern "**" used in a pathname expansion context will +# match all files and zero or more directories and subdirectories. +shopt -s globstar + +# set a fancy prompt (non-color, unless we know we "want" color) +case "$TERM" in + xterm-color|*-256color) color_prompt=yes;; +esac + +if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then + # We have color support; assume it's compliant with Ecma-48 + # (ISO/IEC-6429). (Lack of such support is extremely rare, and such + # a case would tend to support setf rather than setaf.) + color_prompt=yes +else + color_prompt= +fi + +if [ "$color_prompt" = yes ]; then + PS1='\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ' +else + PS1='\u@\h:\w\$ ' +fi +unset color_prompt + +# If this is an xterm set the title to user@host:dir +case "$TERM" in + xterm*|rxvt*|st*|alacritty*) + PS1="\[\e]0;\u@\h: \w\a\]$PS1" + ;; + *) + ;; +esac + +[ -n "$EAT_SHELL_INTEGRATION_DIR" ] && \ + source "$EAT_SHELL_INTEGRATION_DIR/bash" + +export ALTERNATE_EDITOR=emacs +export EDITOR="emacsclient -c" +export VISUAL="emacsclient -c" +export MORE="FRX" +export LESS="FRX" +export PAGER=$(which less || which more || echo "cat") + +if [ -f ~/.bash_aliases ]; then + . ~/.bash_aliases +fi diff --git a/config/emacs/.emacs.desktop.lock b/config/emacs/.emacs.desktop.lock new file mode 100644 index 0000000..f1904f0 --- /dev/null +++ b/config/emacs/.emacs.desktop.lock @@ -0,0 +1 @@ +7862 \ No newline at end of file diff --git a/config/emacs/emacs b/config/emacs/emacs new file mode 120000 index 0000000..2514d29 --- /dev/null +++ b/config/emacs/emacs @@ -0,0 +1 @@ +/home/tmu/dotfiles/config/emacs \ No newline at end of file diff --git a/config/emacs/eshell/alias b/config/emacs/eshell/alias new file mode 100644 index 0000000..6dcd5cf --- /dev/null +++ b/config/emacs/eshell/alias @@ -0,0 +1,6 @@ +alias ll ls -la $* +alias gs git status $* +alias gc git checkout $* +alias gl git log --graph --all --oneline $* +alias glt git log --graph --all --oneline --simplify-by-decoration $* +alias ff find-file $1 diff --git a/config/emacs/eshell/profile b/config/emacs/eshell/profile new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/config/emacs/eshell/profile @@ -0,0 +1 @@ + diff --git a/config/emacs/history b/config/emacs/history new file mode 100644 index 0000000..e7d5648 --- /dev/null +++ b/config/emacs/history @@ -0,0 +1,22 @@ +;; -*- mode: emacs-lisp; lexical-binding: t; coding: utf-8-emacs-unix -*- +;; Minibuffer history file, automatically generated by ‘savehist’. + +(setq savehist-minibuffer-history-variables '(shell-command-history read-number-history regexp-history substitute--history viper-ex-history viper-search-history query-replace-history minibuffer-history bookmark-history Man-topic-history read-expression-history grep-regexp-history yes-or-no-p-history extended-command-history file-name-history buffer-name-history)) +(setq shell-command-history '("pwd")) +(setq regexp-history '("advice")) +(setq substitute--history '("VIPER")) +(setq viper-ex-history '("25,43s/d/D" "25,36p" "pr" "rp" "1" ",$p" "2" "0," ",$p" "s/old/new" ",$s/viper/VIPER" ",$/s/viper/VIPER" ",$ p" "b" "!fortune" "s/viper/VIPER" "s/viper Viper" "s/viper/Viper" "<,>s/viper/VIPER")) +(setq viper-search-history '(#("syntax-preference 'emacs) + (setq-default viper-ex-style-motion nil) + (setq-default viper-auto-indent t) + (setq-default viper-" 0 29 (fontified t) 29 41 (face font-lock-keyword-face fontified t) 41 72 (fontified t) 72 84 (face font-lock-keyword-face fontified t) 84 109 (fontified t) 109 121 (face font-lock-keyword-face fontified t) 121 128 (fontified t)) "viper" "")) +(setq query-replace-history '("#define \\1 0" #("^ *\\([A-Z_]*\\b\\).*" 3 4 (syntax-table #1=(3)) 14 15 (syntax-table #1#)))) +(setq minibuffer-history '("viper" "call-interactively" "default-directory" "save-excursion" "elisp" "with-local-quit" "call-interactively" "add-function" "viper-ex" "add-function" "funcall-interactively" "add-function" "viper-ex" "add-function" "advice-add" "defadvice" "advice-add" "advice--called-interactively-skip" "call-interactively" "funcall-interactively" "viper-ex" "funcall" "call-interactively" "with-local-quit" "elisp" "condition-case" "ignore-errors" "ignore-error" "elisp" "catch" "advice-add" "display-line-numbers-mode" "display-line-numbers" "advice-add" "ex-substitute" "viper-ex" "viper-mode" "viper-always" "viper" "substitute-0.5.0" "viper-substitute" "tmu-custom")) +(setq bookmark-history '("init.el")) +(setq Man-topic-history '("exec" "dbus-launch")) +(setq read-expression-history '("(project-root (project-current))" "(require 'substitute)" "(setq before-save-hook nil)")) +(setq grep-regexp-history '("XDG_RUNTIME")) +(setq yes-or-no-p-history '("yes" "no" "yes")) +(setq extended-command-history '("my/shell-at-root" "free-keys" "toggle-debug-on-quit" "viper-ex" "toggle-viper-mode" "viper-mode" "display-line-numbers-mode" "package-delete" "substitute-target-to-beginning-of-buffer" "list-packages" "toggle-viper-mode" "emacs-lock-mode" "emacs-build-description" "my/start-erc" "load-file" "describe-char" "list-colors-display" "describe-theme" "package-upgrade-all" "package-refresh-contents" "c-mode" "man" "desktop-remove" "desktop-read" "desktop-save" "bash-ts-mode" "package-autoremove")) +(setq file-name-history '("~/Desktop/musl/src/math/arm/fma.c" "~/.emacs.d/init.el" "~/.local/share/emacs/31.0.50/lisp/emacs-lisp/advice.el.gz" "~/.emacs.d/init.el" "~/.emacs.d/elpa/substitute-0.5.0/substitute-autoloads.el" "~/.local/share/emacs/31.0.50/lisp/emulation/viper-ex.el.gz" "~/.emacs.d/init.el" "/su:root@localhost:/opt/slskd/.local/share/slskd/slskd.yml" "~/.emacs.d/" "/su:root@localhost:/opt/slskd/.local/share/slskd/old.yml" "~/dotfiles/bash_profile" "~/.xinitrc")) +(setq buffer-name-history '("*Completions*" "*vc-diff*" "*info*" " *viper-info*" "*Async Shell Command*" "init.el" "*Async Shell Command*" "fma.c" "*Async Shell Command*" "init.el" "simple.el.gz" "init.el" " *viper-info*" "init.el" "*info*" "*Help*" "viper.el.gz" "init.el" "*Help*" "init.el" "display-line-numbers.el.gz" "*Occur*" "init.el" "*Help*" "init.el" "*Help*" "substitute-0.5.0" "substitute-autoloads.el" "substitute.el" "init.el" "info" "*Packages*" "*Help*" "*Ibuffer*" "#haskell" "Libera.Chat" "#haskell" "old.yml" "Libera.Chat" "*Help*" "slskd.yml" "init.el" "tmu-custom-theme.el" "example" "*vc-dir*" "bash_profile" "*xref*" "*Messages*" "ValveSteamLicense")) diff --git a/config/emacs/init.el b/config/emacs/init.el new file mode 100644 index 0000000..27eef38 --- /dev/null +++ b/config/emacs/init.el @@ -0,0 +1,1135 @@ +;;; init.el --- tmu init file -*- lexical-binding: t; -*- + +;;; Commentary: +;;; This file is organized with +;;; +;;; Stuff that needs to be at the start (package init, some fast +;;; startup stuff, etc) +;;; then my custom functions and variables +;;; then builtin customization +;;; then external packages +;;; then other files that contain config I don't need all the time +;;; then things Emacs sets programtically. + +;;; Code: + +;;; Init header: + +(progn ; performance stuff: + ;; delay initial gc until after loading init if possible + (setq gc-cons-threshold most-positive-fixnum) + (add-hook 'emacs-startup-hook + (lambda () + (setq gc-cons-threshold (expt 2 23))))) + +(require 'package) +(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/")) +(push "~/.emacs.d/site-lisp/" load-path) +(package-initialize) +(require 'use-package-ensure) +(setq use-package-always-ensure t) + +(use-package benchmark-init + :config + (add-hook 'after-init-hook 'benchmark-init/deactivate)) + +;;; Custom definitions, with prefix "my/" + +(defvar surround-keys '("(" "{" "[" "$" "\"" "'")) +(defun my/wrap-pair () + "Ensure the region is active and then \"insert-pair\"." + (interactive) + (activate-mark) + (insert-pair)) +(eval + `(define-keymap + :full nil + :name "Surround" + :prefix 'surround-prefix + ,@(mapcan + (lambda (key) (list key ''my/wrap-pair)) + surround-keys + ))) + +(defun my/toggle-frame-transparency () + "Toggle transparency." + (interactive) + (let ((alpha-transparency 90)) + (if (eq alpha-transparency (frame-parameter nil 'alpha-background)) + (set-frame-parameter nil 'alpha-background 100) + (set-frame-parameter nil 'alpha-background alpha-transparency)))) + +(defvar my/prog-cleanup-excluded-modes + '(makefile-gmake-mode makefile-mode makefile-imake-mode + makefile-makepp-mode makefile-bsdmake-mode + makefile-automake-mode + python-mode + fundamental-mode) + "Major modes for which \"my/clean-prog-file\" should not be run before save.") + +(defvar my/prog-cleanup-want-tabs-modes + '(makefile-gmake-mode makefile-mode makefile-imake-mode + makefile-makepp-mode makefile-bsdmake-mode makefile-automake-mode) + "Major modes that need tabs instead of spaces. +\"my/clean-prog-file\" should convert spaces to tabs instead of tabs to spaces.") + +(defvar my/prog-cleanup-indent-max-lines 500 + "Skip reindenting the buffer if it is longer than this many lines. +Nil for no limit.") + +(defun my/clean-prog-file (&optional buffer) + "Perform whitespace cleanup and some normalization on `buffer'. +Defaults to the current BUFFER. Converts tabs to spaces unless the +major mode is in `my/prog-cleanup-want-tabs-modes', otherwise do the +reverse. Delete trailing whitespace." + (unless buffer (setq buffer (current-buffer))) + (with-current-buffer buffer + (cond + ((and (functionp 'clang-format-buffer) + ; safety valve for undef'd + (derived-mode-p '(c-mode c++-mode))) + (clang-format-buffer)) + (t + (when (and my/prog-cleanup-indent-max-lines + (< (car (buffer-line-statistics buffer)) + my/prog-cleanup-indent-max-lines)) + (indent-region (point-min) (point-max))))) + (if (member major-mode my/prog-cleanup-want-tabs-modes) + (tabify (point-min) (point-max)) + (untabify (point-min) (point-max))) + (delete-trailing-whitespace))) + +(defun my/prog-buffer-setup () + "Do setup in for code buffers." + (superword-mode 1) + (modify-syntax-entry ?_ "w") + (hs-minor-mode 1) + (display-fill-column-indicator-mode 1) + (smerge-mode 1) + ;; (when (derived-mode-p '(c-mode c++-mode)) + ;; (c-guess)) + (add-hook 'before-save-hook + (lambda () + (unless (member major-mode my/prog-cleanup-excluded-modes) + (my/clean-prog-file))))) +(add-hook 'prog-mode-hook 'my/prog-buffer-setup) + +(defun my/wrap-region-paren () + "Wraps the region in parens. Similar to pressing ( with the region active." + (interactive) + (let ((beg (region-beginning)) + (end (region-end))) + (save-excursion + (goto-char beg) + (insert "(") + (goto-char (+ end 1)) + (insert ")")))) + +(defun my/zap-whitespace () + "Zaps (deletes) the whitespace around the point in both directions." + (interactive) + (push-mark) + (skip-chars-backward " \t\n") + (push-mark) + (skip-chars-forward " \t\n") + (delete-region (mark) (point)) + (pop-mark) + (goto-char (mark)) + (pop-mark)) + +(defun my/wrap-sexp (&optional arg) + "Wraps the following sexp in a pair of parens. +Places point inside the new pair, pushing the mark before the new pair. +With prefix ARG do ARG number sexps if given, including backwards." + (interactive "p") + (message "%s" arg) + (if arg + (progn + (push-mark) + (insert-pair arg ?\( ?\))) + (insert-pair 1 ?\( ?\)))) + +(defun my/toggle-window-other-reachability () + "Toggle whether this window can be selected by `other-window'." + (interactive) + (let* ((win (get-buffer-window (current-buffer))) + (current (window-parameter win 'no-other-window))) + (set-window-parameter win 'no-other-window (not current)) + (force-mode-line-update))) +;; small hack to make other window reachability visible like window dedication +(advice-add 'mode-line-window-control :around + (lambda (f) (concat (funcall f) + (if (window-parameter nil 'no-other-window) "o" ""))) + '(:name "other-window-indicator")) + +;; TODO find a bind for this +(defun my/open-window-by-buffer (buffer) + "Move focus to an extant window by the buffer it contains. +If no such window exists, switch to BUFFER in the current window." + (interactive "bBuffer: ") + (let ((win (get-buffer-window buffer t))) + (if win + (select-window win) + (switch-to-buffer buffer)))) + +(defun my/shorten-path (path) + "Shorten string PATH. Initialize all but the last path component." + (let* ((components (split-string path "/")) + (last-component (-last (lambda (s) (not (string-empty-p s))) components)) + (shortened-components + (mapcar (lambda (comp) + (if (or (string-equal comp last-component) (string-empty-p comp)) + comp + (substring comp 0 1))) + components))) + (mapconcat 'identity shortened-components "/"))) + +(defun my/swap-other-window-buffer () + "Exchange buffer contents with the next window. +Tries to switch the buffer contents of the current window and the next +in the cyclic ordering. Doesn't consider windows that are dedicated." + (interactive) + (let* ((cw (get-mru-window nil nil nil t)) + (cb (window-buffer cw)) + (ow (next-window)) + (ob (window-buffer ow))) + (unless (window-dedicated-p cw) + (while (window-dedicated-p ow) + (setq ow (next-window ow) + ob (window-buffer ow))) + (unless (eq cw ow) + (progn + (with-selected-window ow + (switch-to-buffer cb)) + (with-selected-window cw + (switch-to-buffer ob))))))) + +(defun my/activate-mark () + "Activate the region a la `C-SPC C-SPC', but don't move the point. +Useful in combination with `query-replace' for acting on the region." + (interactive) + (if (region-active-p) + (deactivate-mark) + (activate-mark))) + +(defun my/c-x-n-to-m-n (&optional keymap) + "Copy bindings from C-x [n] to M-[n] in KEYMAP, defaulting to the global +keymap." + (unless keymap (setq keymap global-map)) + (mapc (lambda (n) + (let* ((from (concat "C-x " (format "%d" n))) + (to (concat "M-" (format "%d" n))) + (bind (keymap-lookup keymap from))) + (keymap-set keymap to bind))) + '(0 1 2 3 4 5 6 7 8 9))) +(my/c-x-n-to-m-n) + +(defun my/keymap-keys (map) + "Return a list of all key sequences in a keymap MAP recursively." + (mapcan (lambda (c) + (let ((ks (car c)) + (km (cdr c)) + (acc nil)) + (map-keymap (lambda (key bind) + (let ((kss (vconcat ks (vector key)))) + (when (commandp bind) + (push kss acc)))) + km) + acc)) + (accessible-keymaps map))) + +(defun my/eshell (&optional arg) + "Create a new eshell or switch to an existing one. +With ARG, make a new shell. If the current buffer is an eshell, switch +back to the previous selected buffer." + (interactive "P") + (if (eq major-mode 'eshell-mode) + (switch-to-prev-buffer) + (eshell arg))) + +(defun my/eshell-clear-or-center (&optional clear) + "Either clear the screen or recenter display depending on point location." + (interactive "P") + (cond + (clear (eshell/clear clear)) + ((>= (point) eshell-last-output-end) ;; at the input line + (eshell/clear clear)) + (t ;; in scroll back somewhere + (recenter-top-bottom)))) + +(defun my/vc-on-root (&optional arg) + "Open a vc dir buffer at the project root. +With ARG, open a Dired buffer instead." + (interactive "P") + (let ((dir (project-root (project-current t)))) + (if arg + (dired dir) + (vc-dir dir)))) + +(defun my/shell-at-root () + "Execute an async shell commmand at the root of the current project." + (interactive) + (let ((prior-cwd default-directory) + (want-quit inhibit-quit)) + (setq inhibit-quit t) + (with-local-quit + (setq default-directory (project-root (project-current))) + (call-interactively 'async-shell-command)) + (setq default-directory prior-cwd + inhibit-quit want-quit))) + +(defun my/kill-buffer (&optional arg) + "Kill the current buffer. With ARG kill the window as well." + (interactive "P") + (if arg + (kill-buffer-and-window) + (kill-buffer))) + +(defvar my/layout-pair (cons nil nil) + "Cons pair of window configurations.") +(add-hook 'after-init-hook + (lambda () + (setq my/layout-pair (cons (current-window-configuration) + (current-window-configuration))))) +(defun my/layout-swap (&optional arg) + "Swap between the two saved window configurations. +With ARG, don't save the current layout." + (interactive "p") + (let ((left (car my/layout-pair)) + (right (cdr my/layout-pair)) + (cwc (current-window-configuration))) + (cond + ((>= arg 16) (setq my/layout-pair (cons cwc cwc))) + ((eq (selected-frame) (window-configuration-frame right)) + (unless (>= arg 4) (setq left cwc)) + (set-window-configuration right t t) + (setq my/layout-pair (cons right left))) + (t (message "Quick layout swap only works with same frame!"))))) + +(defun my/display-lines-advice (func &rest r) + "Around advice that temporarily shows line numbers." + (let ((want-quit inhibit-quit)) + (setq inhibit-quit t) + (display-line-numbers-mode 1) + (force-window-update) + (with-local-quit + (call-interactively func)) + (display-line-numbers-mode -1) + (force-window-update) + (setq inhibit-quit want-quit))) + +(progn ; my global keybinds + (define-minor-mode my/keys-mode + "Minor mode collecting global keybinds" + :global t + :keymap (make-sparse-keymap)) + + ;; The keymaps in `emulation-mode-map-alists' take precedence over + ;; `minor-mode-map-alist' + (add-to-list 'emulation-mode-map-alists + '((my/keys-mode . my/keys-keymap))) + + (keymap-set my/keys-mode-map "C-x -" 'my/swap-other-window-buffer) + (keymap-set my/keys-mode-map "C-x w o" 'my/toggle-window-other-reachability) + (keymap-set my/keys-mode-map "M-w" 'copy-region-as-kill) ; make copying not flash cursor + (keymap-set my/keys-mode-map "M-(" 'my/wrap-region-paren) + (keymap-set my/keys-mode-map "M-z" 'my/zap-whitespace) + (keymap-set my/keys-mode-map "C-M-z" 'my/wrap-sexp) + (keymap-set my/keys-mode-map "M-o" 'other-window) + (keymap-set my/keys-mode-map "M-RET" 'my/eshell) + (keymap-set my/keys-mode-map "M-C" 'calc) + (keymap-set my/keys-mode-map "M-K" 'my/kill-buffer) + (keymap-set my/keys-mode-map "M-D" 'my/vc-on-root) + (keymap-set my/keys-mode-map "M-J" 'scroll-lock-mode) + (keymap-set my/keys-mode-map "M-Q" 'auto-fill-mode) + (keymap-set my/keys-mode-map "M-A" 'beginning-of-line-text) + (keymap-set my/keys-mode-map "M-R" 'my/layout-swap) + (keymap-set my/keys-mode-map "M-W" 'switch-to-buffer) + (keymap-set my/keys-mode-map "M-N" 'man) + (keymap-set my/keys-mode-map "M-*" 'my/shell-at-root) + (keymap-set my/keys-mode-map "C-c R" 'raise-sexp) + (keymap-set my/keys-mode-map "C-c r" 'delete-pair) + (keymap-set my/keys-mode-map "M-S" 'surround-prefix) + (keymap-set my/keys-mode-map "M-\"" 'my/activate-mark) + + (my/keys-mode 1)) + +(progn ; mode for log files + (define-derived-mode + generic-log-mode + fundamental-mode + "Log" + "Major mode for following log files." + (setq-local auto-revert-verbose nil) + (auto-revert-tail-mode 1)) + (add-to-list 'auto-mode-alist + '("\\.log\\'" . generic-log-mode))) + +;;; Builtin config: + +(use-package server ; allow emacsclient + :demand t + :config + (unless (server-running-p) (server-start))) + +(use-package proced ; process editor + :commands (proced) + :config + (setq-default proced-auto-update-flag t) + (setq-default proced-auto-update-interval 1)) + +(use-package dabbrev ; dynamic abbreviations + :demand t + :config + (add-to-list 'dabbrev-ignored-buffer-modes 'exwm-mode) + (add-to-list 'dabbrev-ignored-buffer-modes 'pdf-view-mode) + (add-to-list 'dabbrev-ignored-buffer-modes 'tags-table-mode) + (add-to-list 'dabbrev-ignored-buffer-modes 'doc-view-mode)) + +(progn ; dired directory editor + (require 'dired) + (defun dired-do-find-marked-files () + (interactive) + (seq-do 'find-file (dired-get-marked-files))) + (define-key dired-mode-map (kbd "C-o") 'dired-display-file) + (define-key dired-mode-map (kbd "F") 'dired-do-find-marked-files)) + +(use-package ibuffer ; give a nice list of buffers with extra info + :commands (ibuffer) + :custom + (ibuffer-formats + '((mark modified read-only " " + (name 50 50 :left :elide) ; was originally 18 + " " + (size 9 -1 :right) + " " + (mode 16 16 :left :elide) + " " filename-and-process) + (mark " " + (name 16 -1) + " " filename))) + :bind + ("C-x C-b" . ibuffer)) + +(progn ; isearch search in buffer + ;; swap basic and regex binds + (keymap-set global-map "C-s" 'isearch-forward-regexp) + (keymap-set global-map "C-r" 'isearch-backward-regexp) + (keymap-set global-map "C-M-s" 'isearch-forward) + (keymap-set global-map "C-M-r" 'isearch-backward)) + +(use-package eshell ; emacs shell + :demand t + :config + (use-package esh-help) + (require 'em-hist) + (require 'em-term) + (setup-esh-help-eldoc) + :bind (:map eshell-mode-map + ("C-l" . my/eshell-clear-or-center)) ; todo make smarter with centering + :hook (eshell-mode . eldoc-mode)) + +(use-package ediff ; emacs interactive diff + :custom + (ediff-window-setup-function 'ediff-setup-windows-plain)) + +(progn ; comint, doesn't play with use-package + (require 'comint) + (setq-default comint-scroll-to-bottom-on-input t) + (setq-default comint-scroll-to-bottom-on-output t) + (add-to-list 'comint-output-filter-functions #'comint-truncate-buffer) + (add-to-list 'comint-output-filter-functions #'ansi-color-process-output)) + +(use-package tramp ; remote access for files + :demand t + :custom + (tramp-allow-unsafe-temporary-files t)) + +(use-package asm-mode ; asm comments and tags generation + :demand t + :custom + (asm-comment-char ?#) ; prefer # over ; for asm comments + :init + (defun add-asm-label-tag-generation-hook () + (add-hook 'after-save-hook + (lambda () + (shell-command + "find . -iregex '.*\\.[sS]' -exec etags -l none -r '/\\([a-zA-Z0-9\\-_]+\\):/\1/' {} +")) + 0 t)) + :hook + (asm-mode . 'add-asm-label-tag-generation-hook)) + +(use-package compile ; compliation buffers and easy bind + :custom + (compilation-always-kill t) + (compilation-scroll-output t) + :bind (:map my/keys-mode-map ("M-M" . 'recompile)) + :config + ;; Allow compilation buffer to be dedicated across frames + (add-to-list 'display-buffer-alist '("\\*compilation\\*" nil (reusable-frames . t))) + (add-hook 'compilation-filter-hook #'ansi-color-compilation-filter)) + +(use-package man ; view manuals in emacs + :custom + (Man-switches "-a")) + +(use-package imenu ; jump to items in the current buffer + :bind + ("M-i" . imenu) + :custom + (imenu-auto-rescan t) + (imenu-flatten t)) + +(use-package xref ; jump to syntactic elements in project + ;; (add-hook 'xref-backend-functions 'gxref-xref-backend) + :bind ("M-I" . xref-find-definitions)) + +(use-package time ; time if I want it in the modeline etc + :custom + (display-time-day-and-date t) + (display-time-24hr-format t)) + +(use-package battery ; battery in modeline etc + ) + +(progn ; indent code when pasting + (require 'dash) + (defvar yank-indent-modes '(prog-mode LaTeX-mode TeX-mode) + "Modes in which to indent regions that are yanked (or yank-popped).") + + (defun yank-indent-func (&optional arg) + (let* ((parents (derived-mode-all-parents major-mode)) + (helper (lambda (acc v) (or acc (member v yank-indent-modes)))) + (included (-reduce helper parents))) + (when (and (not arg) included) + (indent-region (region-beginning) (region-end))))) + + (advice-add 'yank :after 'yank-indent-func) + (advice-add 'yank-pop :after 'yank-indent-func)) + +(progn ; better commenting binds + (global-set-key (kbd "C-x C-;") 'comment-or-uncomment-region) + (global-set-key (kbd "C-x ;") 'comment-line) + (global-set-key (kbd "C-x :") 'comment-or-uncomment-region) + ;; ^ duped for terminal w/o C-; + ) + +(progn ; default modeline config additions + (let ((dir '("" (:eval (let ((str (concat (format " [%s] " (my/shorten-path default-directory))))) + (add-face-text-property + 0 (length str) + '(:weight bold :foreground "green2") + t str) + str))))) + (add-to-list 'mode-line-misc-info dir))) + +(progn ; comfy scratch buffer + (require 'iimage) + (setq inhibit-startup-screen t) + (setq initial-scratch-message + (concat (propertize ";; " 'invisible t) + " +;; scratch for lisp evaluation and unsaved text + +")) + (add-hook 'emacs-startup-hook + (lambda () + (with-current-buffer "*scratch*" + (emacs-lock-mode 'kill) + (iimage-mode 1))))) + +(progn ; confirm fewer things + (setq kill-buffer-query-functions + (delq 'process-kill-buffer-query-function kill-buffer-query-functions)) + (setq confirm-kill-processes nil) + (setq async-shell-command-buffer 'new-buffer) + (setq vc-follow-symlinks t)) + +;; misc vars +(setq delete-pair-blink-delay 0 + enable-recursive-minibuffers t + frame-resize-pixelwise t) +(electric-pair-mode 1) +(vc-auto-revert-mode 1) + +;;; External packages: + +(use-package orderless ; ordering (minibuffer) completions + :demand t + :custom + (orderless-skip-highlighting t) + (completion-styles '(orderless basic partial-completion emacs22)) + (completion-category-defaults nil) + (completion-category-overrides nil) + (completion-ignore-case t) + (read-file-name-completion-ignore-case t) + (read-buffer-completion-ignore-case t) + (orderless-smart-case nil) + (orderless-matching-styles + '(orderless-prefixes orderless-literal orderless-regexp))) + +(use-package vertico ; better minibuffer complete + :demand t + :custom + (vertico-cycle t) + :config + (vertico-mode 1) + (vertico-flat-mode) + :bind (:map minibuffer-local-map + ("M-v" . 'vertico-flat-mode))) + +;; (use-package posframe ; child frames inside normal frames +;; ) +;; (use-package vertico-posframe ; use posframes to display minibuffer +;; :after vertico +;; :demand t +;; :custom +;; (vertico-posframe-poshandler +;; #'posframe-poshandler-frame-bottom-center) +;; (vertico-posframe-size-function +;; (lambda (buffer) +;; (let ((w (frame-width))) +;; (list +;; :height (buffer-local-value 'vertico-posframe-height buffer) +;; :min-height (or (buffer-local-value 'vertico-posframe-min-height buffer) +;; (let ((height (+ vertico-count 1))) +;; (min height (or (buffer-local-value 'vertico-posframe-height buffer) height)))) +;; :width w +;; :min-width w)))) +;; :config +;; (vertico-posframe-mode 1)) + +(use-package marginalia ; more info in minibuffer menus + :demand t + :custom + (marginalia-max-relative-age 0) + (marginalia-align 'right) + :bind (:map minibuffer-local-map + ("M-A" . 'marginalia-cycle)) + :config + (marginalia-mode)) + +(use-package embark ; more actions from minibuffer + :demand t + :bind + (("C-." . embark-act) + ("C-," . embark-dwim) + ("C-h B" . embark-bindings)) + :config + ;; Hide the mode line of the Embark live/completions buffers + (add-to-list 'display-buffer-alist + '("\\`\\*Embark Collect \\(Live\\|Completions\\)\\*" + nil + (window-parameters (mode-line-format . none))))) + +(use-package corfu ; in buffer completion + :demand t + :custom + (corfu-cycle t) + (corfu-quit-no-match t) + :bind (("M-/" . completion-at-point)) + :init + (defun my/corfu-commit-single () + "Complete without asking if there is only one candidate." + (when (and (corfu--popup-visible-p) + (= (length corfu--candidates) 1)) + (corfu-accept))) + :hook (corfu-post-command . my/corfu-commit-single) + :config + (global-corfu-mode 1)) + +(use-package tempel ; templates + :demand t + :custom + (tempel-path "~/.emacs.d/templates/*.eld") + :bind (("M-+" . tempel-complete)) + :config + (keymap-set tempel-map " " #'tempel-next) + (keymap-set tempel-map " " #'tempel-previous)) + +(use-package tempel-collection ; other people's templates + :after tempel + :demand t) + +(use-package cape ; extend completion frameworks + :demand t + :bind ("C-c p" . cape-prefix-map) + :config + (advice-add 'pcomplete-completions-at-point :around 'cape-wrap-silent) + ;; (advice-add 'pcomplete-completions-at-point :around 'cape-wrap-purify) + (defvar my/completion-at-point-functions-always-include + (list 'tags-completion-at-point-function 'cape-dabbrev 'cape-dict 'tempel-complete)) + ;; local settings should include t to also include global settings + (setq completion-at-point-functions my/completion-at-point-functions-always-include)) + +(use-package ibuffer-vc ; group buffers by vcs directory + :after ibuffer + :demand t + :hook + (ibuffer . + (lambda () + (ibuffer-vc-set-filter-groups-by-vc-root) + (unless (eq ibuffer-sorting-mode 'alphabetic) + (ibuffer-do-sort-by-alphabetic))))) + +(use-package free-keys ; display a list of unbound keys + ) + +(use-package which-key ; show list of next keys after prefix & delay + :demand t + :config + (which-key-mode 1)) + +(use-package winum ; binds for switching to windows by number + :demand t + :config + (winum-mode 1)) + +;; (use-package savehist ; preserve minibuffer history across sessions +;; :demand t +;; :init +;; (savehist-mode)) + +;; (use-package consult ; more encompassing buffer switch and searching +;; :demand t +;; :custom +;; (consult-preview-excluded-buffers t) +;; (consult-narrow-key ",") +;; :bind +;; ("C-x b" . consult-buffer) +;; ("M-W" . consult-buffer) +;; ("C-S-y" . consult-yank-from-kill-ring) +;; ("M-g M-g" . consult-goto-line) +;; ("C-S-s" . consult-line-multi) +;; ("M-s g" . consult-grep) +;; ("M-s G" . grep) +;; ("M-s f" . consult-find) +;; ;; move some standard binds +;; ("M-s s" . consult-line)) +;; (use-package embark-consult +;; :after embark consult) + +(use-package hl-todo ; highlight certain keywords + :hook + (prog-mode . hl-todo-mode)) + +(use-package visible-mark ; make the mark visible + :demand t + :custom-face + (visible-mark-active + ((t . (:foreground "black" + :background "deep pink" + :box (:line-width (-1 . -1) + :color "deep pink" + :style nil))))) + :custom + (visible-mark-max 1) + :config + (global-visible-mark-mode 1)) + +(use-package avy ; goto location by char pair and jump list + :bind (("C-'" . avy-goto-char-2) + ("M-G" . avy-goto-char-2)) + :custom + (avy-all-windows nil) + (avy-all-windows-alt 'all-frames)) + +(use-package balanced-windows ; auto rebalance windows + :bind ("C-x w b" . balanced-windows-mode)) + +(use-package eat ; terminal emu + make eshell behave better + :demand t + :custom + (eat-enable-auto-line-mode t) + :config + (eat-eshell-mode) + (eat-eshell-visual-command-mode) + (let* ((desired-global-binds (my/keymap-keys my/keys-mode-map)) + (desired-prefixes (mapcar (lambda (ks) + (let ((k1 (elt ks 0)) + (meta-mask ?\M-\0)) + (if (numberp k1) + (if (equal ?\e k1) + (vector k1 (elt ks 1)) + (let ((k-no-m (logand k1 (lognot meta-mask))) + (k-has-m (not (zerop (logand k1 meta-mask))))) + (if k-has-m + (vector ?\e k-no-m) + (vector k1)))) + (vector k1)))) + desired-global-binds))) + (mapc (lambda (ks) + (add-to-list 'eat-semi-char-non-bound-keys ks) + (add-to-list 'eat-eshell-semi-char-non-bound-keys ks)) + desired-prefixes) + (eat-update-semi-char-mode-map) + (eat-eshell-update-semi-char-mode-map))) + +(use-package bash-completion ; allow bash completion in eshell mostly + :demand t + :config + (add-hook 'shell-dynamic-complete-functions + 'bash-completion-dynamic-complete) + :hook + (eshell-mode . (lambda () + (add-hook 'completion-at-point-functions + 'bash-completion-capf-nonexclusive nil t)))) + +(use-package pinentry ; allow some passwords to be entered with emacs + ) + +(use-package password-store ; gnu pass integration + :demand t) +(use-package auth-source-pass ; allow pass to act as auth within emacs + :init (auth-source-pass-enable)) +(use-package pass ; nice interface for gnu pass + :demand t + :after password-store auth-source-pass + :custom + (pass-suppress-confirmations t) + (epg-pinentry-mode 'loopback) + :config + (add-to-list 'display-buffer-alist + '("\\*Password-Store\\*" + display-buffer-in-side-window + (side . right)))) + +(use-package pyvenv ; respect python environments + ) + +;; (use-package sideline ; put warnings on the side of the same line +;; :init +;; (use-package sideline-flycheck) +;; (use-package sideline-flymake) +;; :custom +;; (sideline-backends-right '(sideline-flycheck sideline-flymake))) + +;; (use-package flycheck +;; :config +;; ;; flymake stuff to be less annoying +;; ;; (face-spec-set 'flycheck-note '((t :underline nil))) +;; ;; (face-spec-set 'flycheck-info '((t :underline nil))) +;; ;; (face-spec-set 'flycheck-warning '((t :underline nil))) +;; ;; (face-spec-set 'flycheck-error '((t :underline nil))) +;; :hook +;; (prog-mode . flycheck-mode)) + +(progn ; collected folding binds, hs + fold this + (define-prefix-command 'my/fold-map) + (global-set-key (kbd "M-F") 'my/fold-map) + (define-keymap :full nil + :parent nil + :suppress nil + :keymap nil + :name "my/fold-map" + :prefix 'my/fold-map) + (progn ; hideshow folding + (keymap-set my/fold-map "t" 'hs-toggle-hiding) + (keymap-set my/fold-map "l" 'hs-hide-level) + (keymap-set my/fold-map "C-t" 'hs-hide-all) + (keymap-set my/fold-map "C-a" 'hs-show-all)) + + (use-package fold-this ; fold arbitrary region + :init + (defun my/fold-this-fold-forward (&optional arg) + "Fold forward ARG number of sexps, defaulting to one." + (interactive "p") + (push-mark) + (forward-sexp arg) + (fold-this (mark) (point)) + (pop-mark)) + + (defun my/fold-this-fold-backward (&optional arg) + "Fold backward ARG number of sexps, defaulting to one." + (interactive "p") + (push-mark) + (backward-sexp arg) + (fold-this (point) (mark)) + (pop-mark)) + + :bind (:map my/fold-map + ("c" . fold-this) + ("e" . fold-this-unfold-at-point) + ("f" . my/fold-this-fold-forward) + ("b" . my/fold-this-fold-backward)))) + +(use-package clang-format ; let clang do c formatting + ) + +(use-package rust-mode ; rust lang syntax + ) + +(use-package haskell-mode ; haskell + cabal integrations + :custom + (haskell-tags-on-save t) + (haskell-process-type 'cabal-repl) + (haskell-process-auto-import-loaded-modules t) + :hook (haskell-mode . interactive-haskell-mode)) + +(use-package opam-switch-mode ; make emacs mode respect switch + :config + (when (and (file-exists-p "~/.opam") (executable-find "opam")) + (opam-switch-set-switch "default"))) +(use-package tuareg ; ocaml mode + :after opam-switch-mode) +(use-package ocp-indent ; indentation for ocaml + :after tuareg + :hook (tuareg-mode . ocp-setup-indent)) +(use-package merlin ; ocaml completion + :after tuareg + :hook (tuareg-mode . merlin-mode) + :custom (merlin-command 'opam)) + +(use-package racket-mode ; basic racket integration + ) + +(use-package sdcv ; dictionary, requires sdcv install + :demand t + :config + (define-prefix-command 'dict-map) + (define-keymap :full nil + :parent nil + :suppress nil + :keymap nil + :name "dict-map" + :prefix 'dict-map + (kbd "w") 'sdcv-search-input + (kbd "c") (lambda () (interactive) + (activate-input-method 'pyim) + (sdcv-search-input (read-from-minibuffer "Chinese Word: " + nil nil nil + nil nil t)) + (activate-input-method nil))) + :bind (:map text-mode-map + ("M-l" . 'dict-map))) + +(use-package erc ; irc client + :init + (defun my/start-erc () + "Start erc and autojoin various channels" + (interactive) + (erc :server "irc.libera.chat" :port 6667)) + :custom + (erc-modules '(services autojoin button completion fill imenu irccontrols list match menu + move-to-prompt netsplit networks readonly ring stamp track)) + (erc-nick "tccq") + (erc-use-auth-source-for-nickserv-password t) + (erc-autojoin-channels-alist '(("libera.chat" + "#emacs" "#haskell" "#duskos" "#ocaml"))) + + (erc-hide-list '("JOIN" "PART" "QUIT")) + (erc-current-nick-highlight-type 'nick) + (erc-keywords nil) + (erc-track-exclude-types '("JOIN" "PART" "QUIT" "NICK" "MODE")) + (erc-track-use-faces t) + (erc-track-faces-priority-list '(erc-current-nick-face erc-keyword-face)) + (erc-track-priority-faces-only 'all)) + +(use-package minions ; show less on the modeline + :demand t + :config + (minions-mode 1) + :custom + (minions-prominent-modes '(my/temp-nonmodal-mode persp-mode auto-fill-mode eldoc-mode eglot-mode lsp-mode))) + +(use-package ispell ; spellchecker + :demand t + :custom + (ispell-personal-dictionary "/home/tmu/.aspell.en.pws") + :config + (defun ispell-mode (&optional arg) + "Make some old packages work with modern ispell." + (interactive) + (ispell-minor-mode arg)) + (advice-add 'ispell-mode :before 'debug) + (setq-default text-mode-hook (cons 'ispell-minor-mode (remove 'ispell-mode text-mode-hook)))) + +(load-file "/home/tmu/.emacs.d/site-lisp/my-modal.el") + +;;; Optional files for occasional loading: + +;; if you want exwm, include from ~/.emacs.d/site-lisp/my-exwm.el +;; if you want mail, include from ~/.emacs.d/site-lisp/my-mail.el +;; if you want eglot, include from ~/.emacs.d/site-lisp/my-eglot.el + +;;; Theming: + +(require 'tmu-custom-theme) +(push "~/.emacs.d/site-lisp/" custom-theme-load-path) +(load-theme 'tmu-custom t) + +;;; Things emacs sets programatically: +;; ---------------------------------------------------------------------- + +(put 'dired-find-alternate-file 'disabled nil) +(put 'upcase-region 'disabled nil) +(put 'downcase-region 'disabled nil) +(put 'list-timers 'disabled nil) +(put 'narrow-to-region 'disabled nil) +(put 'set-goal-column 'disabled nil) + +(custom-set-variables + ;; custom-set-variables was added by Custom. + ;; If you edit it by hand, you could mess it up, so be careful. + ;; Your init file should contain only one such instance. + ;; If there is more than one, they won't work right. + '(comment-style 'extra-line) + '(connection-local-criteria-alist + '(((:application eshell :protocol "ssh" :user "tmu" :machine + "cnoserver") + autogenerated-connection-local-profile/\(:application\ eshell\ :protocol\ \"ssh\"\ :user\ \"tmu\"\ :machine\ \"cnoserver\"\)) + ((:application vc-git :protocol "ssh" :user "tmu" :machine + "cnoserver") + autogenerated-connection-local-profile/\(:application\ vc-git\ :protocol\ \"ssh\"\ :user\ \"tmu\"\ :machine\ \"cnoserver\"\)) + ((:application vc-git) vc-git-connection-default-profile) + ((:application tramp :protocol "kubernetes") + tramp-kubernetes-connection-local-default-profile) + ((:application tramp :protocol "flatpak") + tramp-container-connection-local-default-flatpak-profile + tramp-flatpak-connection-local-default-profile) + ((:application tramp) + tramp-connection-local-default-system-profile + tramp-connection-local-default-shell-profile) + ((:application eshell) eshell-connection-default-profile))) + '(connection-local-profile-alist + '((autogenerated-connection-local-profile/\(:application\ eshell\ :protocol\ \"ssh\"\ :user\ \"tmu\"\ :machine\ \"cnoserver\"\) + (eshell-path-env-list "/bin" "/usr/bin" "/sbin" "/usr/sbin" + "/usr/local/bin" "/usr/local/sbin")) + (autogenerated-connection-local-profile/\(:application\ vc-git\ :protocol\ \"ssh\"\ :user\ \"tmu\"\ :machine\ \"cnoserver\"\) + (vc-git--program-version . "2.48.1")) + (vc-git-connection-default-profile (vc-git--program-version)) + (tramp-flatpak-connection-local-default-profile + (tramp-remote-path "/app/bin" tramp-default-remote-path "/bin" + "/usr/bin" "/sbin" "/usr/sbin" + "/usr/local/bin" "/usr/local/sbin" + "/local/bin" "/local/freeware/bin" + "/local/gnu/bin" "/usr/freeware/bin" + "/usr/pkg/bin" "/usr/contrib/bin" "/opt/bin" + "/opt/sbin" "/opt/local/bin")) + (tramp-kubernetes-connection-local-default-profile + (tramp-config-check . tramp-kubernetes--current-context-data) + (tramp-extra-expand-args 97 + (tramp-kubernetes--container + (car tramp-current-connection)) + 104 + (tramp-kubernetes--pod + (car tramp-current-connection)) + 120 + (tramp-kubernetes--context-namespace + (car tramp-current-connection)))) + (tramp-container-connection-local-default-flatpak-profile + (tramp-remote-path "/app/bin" tramp-default-remote-path "/bin" + "/usr/bin" "/sbin" "/usr/sbin" + "/usr/local/bin" "/usr/local/sbin" + "/local/bin" "/local/freeware/bin" + "/local/gnu/bin" "/usr/freeware/bin" + "/usr/pkg/bin" "/usr/contrib/bin" "/opt/bin" + "/opt/sbin" "/opt/local/bin")) + (tramp-connection-local-darwin-ps-profile + (tramp-process-attributes-ps-args "-acxww" "-o" + "pid,uid,user,gid,comm=abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" + "-o" "state=abcde" "-o" + "ppid,pgid,sess,tty,tpgid,minflt,majflt,time,pri,nice,vsz,rss,etime,pcpu,pmem,args") + (tramp-process-attributes-ps-format (pid . number) + (euid . number) + (user . string) + (egid . number) (comm . 52) + (state . 5) (ppid . number) + (pgrp . number) + (sess . number) + (ttname . string) + (tpgid . number) + (minflt . number) + (majflt . number) + (time . tramp-ps-time) + (pri . number) + (nice . number) + (vsize . number) + (rss . number) + (etime . tramp-ps-time) + (pcpu . number) + (pmem . number) (args))) + (tramp-connection-local-busybox-ps-profile + (tramp-process-attributes-ps-args "-o" + "pid,user,group,comm=abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" + "-o" "stat=abcde" "-o" + "ppid,pgid,tty,time,nice,etime,args") + (tramp-process-attributes-ps-format (pid . number) + (user . string) + (group . string) (comm . 52) + (state . 5) (ppid . number) + (pgrp . number) + (ttname . string) + (time . tramp-ps-time) + (nice . number) + (etime . tramp-ps-time) + (args))) + (tramp-connection-local-bsd-ps-profile + (tramp-process-attributes-ps-args "-acxww" "-o" + "pid,euid,user,egid,egroup,comm=abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" + "-o" + "state,ppid,pgid,sid,tty,tpgid,minflt,majflt,time,pri,nice,vsz,rss,etimes,pcpu,pmem,args") + (tramp-process-attributes-ps-format (pid . number) + (euid . number) + (user . string) + (egid . number) + (group . string) (comm . 52) + (state . string) + (ppid . number) + (pgrp . number) + (sess . number) + (ttname . string) + (tpgid . number) + (minflt . number) + (majflt . number) + (time . tramp-ps-time) + (pri . number) + (nice . number) + (vsize . number) + (rss . number) + (etime . number) + (pcpu . number) + (pmem . number) (args))) + (tramp-connection-local-default-shell-profile + (shell-file-name . "/bin/sh") (shell-command-switch . "-c")) + (tramp-connection-local-default-system-profile + (path-separator . ":") (null-device . "/dev/null")) + (eshell-connection-default-profile (eshell-path-env-list)))) + '(custom-safe-themes + '("aee99e2118e960b53016623dc2345d88227d1236d28c6c34858e1d55575cf7c3" + "6f5e3fd2b4245ffe660da69ea5c13ab392337e94776dfb23cc1d8d0f80e3baa2" + "1b8c2fd98bf6777d8b95f8cf98fdaede88feee3419ec3e5008f94b56618ac6ca" + "0cc5046b7981609166c28b64f6185fa5f73bcb00d21e037f304794c6aaa1f340" + "9f2e4e8b2ddbfdd392eedbc123649d94654278dee5a53b899557224416413d35" + "6dafb31ade9ff07229faaf05c41c2ae475c44731362b792f65f3930b1a2c9cfd" + "dc77e008092a5a4aa6b6ed8e4826bebf8f2fb930a8de073bf7f458efd884cca8" + "d1ff3e66028f9c527298580d2a64f9e3280f07f9e94d4dada72b67ef15069441" + "3d4e3644e237a95683daa73e397c4c0d1ae06bbaaf8040104232591a28bc1315" + "12a07bc38295e4b06a8965db261f51ea7ea61fbf91b3ef41298bbb549d1d9403" + default)) + '(ede-project-directories + '("/home/tmu/Desktop/eway/sway" "/home/tmu/Desktop/eway/cage" + "/home/tmu/Desktop/eway/wlroots" "/home/tmu/Desktop/eway/comp" + "/home/tmu/Desktop/eway")) + '(eglot-events-buffer-config '(:size 0 :format full)) + '(fortune-dir "/usr/share/fortune/") + '(gdb-non-stop-setting nil) + '(helm-minibuffer-history-key "M-p") + '(menu-bar-mode nil) + '(package-selected-packages nil) + '(pyim-assistant-scheme 'cangjie) + '(safe-local-variable-values '((LEXICAL-binding . t))) + '(scroll-bar-mode nil) + '(tags-revert-without-query t) + '(tool-bar-mode nil) + '(transient-mark-mode nil) + '(whitespace-style + '(face trailing tabs lines-tail missing-newline-at-eof indentation + space-after-tab space-before-tab tab-mark) t)) + +(custom-set-faces + ;; custom-set-faces was added by Custom. + ;; If you edit it by hand, you could mess it up, so be careful. + ;; Your init file should contain only one such instance. + ;; If there is more than one, they won't work right. + ) diff --git a/config/emacs/site-lisp/chinese.el b/config/emacs/site-lisp/chinese.el new file mode 100644 index 0000000..4b01594 --- /dev/null +++ b/config/emacs/site-lisp/chinese.el @@ -0,0 +1,18 @@ +;; chinese input stuff +;; (require 'unicode-fonts) +;; (unicode-fonts-setup) +(require 'pyim) +(require 'pyim-basedict) +(pyim-basedict-enable) +;; (require 'pyim-wbdict) +(setq default-input-method "pyim") +(setq pyim-default-scheme 'quanpin) +;; (pyim-wbdict-v98-morphe-enable) +;; (dolist (charset '(kana han symbol cjk-misc bopomofo)) +;; (set-fontset-font (frame-parameter nil 'font) +;; charset +;; (font-spec :family "FangSong" :size 15))) +;; (setq rime-translate-keybindings +;; '("C-f" "C-b" "C-n" "C-p" "C-g" "" "" "" "" "" "" "")) +;; (setq rime-share-data-dir "~/.local/share/fcitx5/rime") +;; (setq rime-show-candidate 'popup) diff --git a/config/emacs/site-lisp/fbterm.el b/config/emacs/site-lisp/fbterm.el new file mode 100644 index 0000000..b8b3ba4 --- /dev/null +++ b/config/emacs/site-lisp/fbterm.el @@ -0,0 +1,13 @@ +;; config specifically for running emacs as the base process of fbterm + + +(require 'ednc) +(require 'single-header) + +;;; Code: + +(unless ednc-mode (ednc-mode 1)) +(unless single-header-mode (single-header-mode 1)) + +(provide 'fbterm) +;;; fbterm.el ends here diff --git a/config/emacs/site-lisp/maze.el b/config/emacs/site-lisp/maze.el new file mode 100644 index 0000000..784049f --- /dev/null +++ b/config/emacs/site-lisp/maze.el @@ -0,0 +1,64 @@ +;; [adj] movement and editing for lisp + +(provide 'maze-lisp) + +(defun maze--cur-end () + (push-mark) + (thing-at-point--end-of-sexp) + (let ((cur (point))) + (goto-char (mark)) + (pop-mark) + cur)) + +(defun maze--hl (beg end &optional buffer) + (let ((overlay (make-overlay beg end (or buffer (current-buffer))))) + (overlay-put overlay 'face 'highlight) + (setq maze-overlay overlay) + overlay)) + +(defun maze--unhl () + (if maze-overlay + (delete-overlay maze-overlay))) + +(defun maze--update-hl (beg end) + (if maze-overlay + (move-overlay maze-overlay beg end) + (maze--hl beg end))) + +(defun maze-forward (n) + (interactive "p") + (goto-char (or (scan-sexps (point) 2) (buffer-end 1))) + (thing-at-point--beginning-of-sexp) + (maze--update-hl (point) (maze--cur-end))) + +(defun maze-backward (n) + (interactive "p") + (let ((n (or n 1))) + (backward-sexp n)) + (maze--update-hl (point) (maze--cur-end))) + +(defun maze-inward (n) + (interactive "p") + (down-list n) + (maze--update-hl (point) (maze--cur-end))) + +(defun maze-outward (n) + (interactive "p") + (backward-up-list n) + (maze--update-hl (point) (maze--cur-end))) + +(defvar-keymap maze-mode-map + (kbd "j") 'maze-forward + (kbd "k") 'maze-backward + (kbd "l") 'maze-inward + (kbd "h") 'maze-outward) + + +(define-minor-mode maze-mode + "doc" + :keymap maze-mode-map + :init-value nil + :after-hook (progn + (setq-local parse-sexp-ignore-comments t) + (setq-local maze-overlay nil) + (font-lock-mode 1))) diff --git a/config/emacs/site-lisp/my-eglot.el b/config/emacs/site-lisp/my-eglot.el new file mode 100644 index 0000000..f4a00a3 --- /dev/null +++ b/config/emacs/site-lisp/my-eglot.el @@ -0,0 +1,7 @@ +(use-package eglot + :demand t) +(use-package eglot-tempel + :after eglot tempel + :config + (eglot-tempel-mode 1)) + diff --git a/config/emacs/site-lisp/my-exwm.el b/config/emacs/site-lisp/my-exwm.el new file mode 100644 index 0000000..be71f52 --- /dev/null +++ b/config/emacs/site-lisp/my-exwm.el @@ -0,0 +1,184 @@ +(use-package exwm ; emacs x window manager + :demand nil + :config + (require 'exwm-randr) + (require 'exwm-xim) + (require 'exwm-systemtray) + (require 'exwm-manage) + (add-to-list 'exwm-manage-configurations '((equal exwm-class-name "Slack") managed t)) + (use-package exwm-modeline) + ;;(exwm-xim-mode 1) + + (defun my/exwm-auto-workspace-montior () + "Autopopulate exwm-randr-workspace-monitor-plist and attempt to +have a workspace on each monitor. Try to keep up with xrandr +changes." + (let ((buf (generate-new-buffer "*xrandr-output*")) + (out-plist nil)) + (call-process-shell-command "xrandr --listmonitors -q" nil buf nil) + (with-current-buffer buf + (keep-lines "[^[:word:]]connected" (point-min) (point-max) nil) + ;; (goto-char (point-min)) + ;; (while (re-search-forward "^\\([a-zA-Z\\-0-9]+\\) .*$" nil t nil) + ;; (replace-match "\\1")) + ;; (goto-char (point-min)) + (let ((num-monitors (count-lines (point-min) (point-max))) + (i 0)) + (setq exwm-workspace-number num-monitors) + (goto-char (point-min)) + (while (< i num-monitors) + (move-beginning-of-line 1) + (push-mark) + (search-forward-regexp " ") + (backward-char) + (push (buffer-substring (mark) (point)) out-plist) + (if (> i 0) + (let ((prev (caddr out-plist)) + (cur (car out-plist))) + (call-process-shell-command + (format "xrandr --output %s --auto --right-of %s" cur prev) + nil nil nil)) + (call-process-shell-command + (format "xrandr --output %s --auto" (car out-plist)) nil nil nil)) + (push i out-plist) + (setq i (+ i 1)) + (pop-mark) + (forward-line)))) + (kill-buffer buf) + (setq exwm-randr-workspace-monitor-plist out-plist)) + (while (> exwm-workspace-number (length exwm-workspace--list)) + (exwm-workspace-add))) + (add-hook 'exwm-randr-screen-change-hook #'my/exwm-auto-workspace-montior) + + (defun my/exwm-set-buffer-name () + (if exwm-title + (let* ((shortened-title (replace-regexp-in-string + " - Mozilla Firefox" + "" + exwm-title)) + (class-and-title (concat + exwm-class-name + "<" + shortened-title + ">"))) + (setq-local exwm-title class-and-title) + (exwm-workspace-rename-buffer exwm-title)))) + + (defun my/exwm-other-workspace (arg) + "Focus other monitor's workspace." + (interactive "p") + ;; based on other-frame + (let ((filter-f (function (lambda (f) + (and (exwm-workspace--active-p f) + (not (eq (selected-frame) f)))))) + (sframe (selected-frame)) + (frame (selected-frame))) + (while (> arg 0) + (setq frame (next-frame frame)) + (while (and (not (eq frame sframe)) + (not (eq (frame-visible-p frame) t)) + (funcall filter-f frame)) + (setq frame (next-frame frame))) + (setq arg (1- arg))) + (while (< arg 0) + (setq frame (previous-frame frame)) + (while (and (not (eq frame sframe)) + (not (eq (frame-visible-p frame) t)) + (filter-f frame)) + (setq frame (previous-frame frame))) + (setq arg (1+ arg))) + (exwm-workspace-switch frame))) + + (defun my/dmenu (command) + (interactive (list (read-shell-command "$ "))) + (start-process-shell-command command nil command)) + + (defun my/browser () + (interactive) + (start-process-shell-command "glide" nil "glide")) + + (defun my/brightnessdown () (interactive) (start-process "" nil "brightnessdown")) + (defun my/brightnessup () (interactive) (start-process "" nil "brightnessup")) + (defun my/mute () (interactive) (start-process "" nil "pactl" "set-sink-mute" "@DEFAULT_SINK@" "toggle")) + (defun my/voldown () (interactive) (start-process "" nil "pactl" "set-sink-volume" "@DEFAULT_SINK@" "-5%")) + (defun my/volup () (interactive) (start-process "" nil "pactl" "set-sink-volume" "@DEFAULT_SINK@" "+5%")) + + (push ?\C-\\ exwm-input-prefix-keys) ;;C-\ to switch input method + (push ?\C-u exwm-input-prefix-keys) ;; send C-u to all windows too + (push ?\M-L exwm-input-prefix-keys) + (progn + ;; (exwm-enable) + ;; (exwm-randr-mode) + ;; (ednc-mode 1) + ;; (exwm-systemtray-mode) + ;; (add-hook 'after-init-hook #'exwm-randr-refresh) + ) + :hook + (exwm-update-class . my/exwm-set-buffer-name) + (exwm-update-title . my/exwm-set-buffer-name) + ;; (after-init . exwm-randr-refresh) + ;; (after-init . display-time-mode) + ;; (after-init . ednc-mode) + ;; (after-init . display-battery-mode) + :custom + (exwm-replace nil) + (exwm-title-length 50) + (exwm-workspace-show-all-buffers t) + (exwm-layout-show-all-buffers t) + + (exwm-modeline-randr t) + (exwm-modeline-short nil) + (exwm-modeline-urgent t) + + (exwm-manage-force-tiling t) + + (exwm-input-global-keys + `( + ([?\M-r] . exwm-reset) + ;; Bind "s-w" to window switcher + ([?\M-W] . consult-buffer) + ([?\M-o] . other-window) + ([?\M-O] . my/exwm-other-workspace) + + ([?\M-D] . my/dmenu) + ([?\M-E] . my/browser) + (,(kbd "M-C-m") . my/eshell) + ([?\M-K] . kill-current-buffer) + + ,@(mapcar (lambda (n) + (let* ((from (concat "C-x " (format "%d" n))) + (to (concat "M-" (format "%d" n))) + (bind (keymap-lookup global-map from))) + (cons (kbd to) bind))) + (number-sequence 0 9)) + + ([XF86MonBrightnessDown] . my/brightnessdown) + ([XF86MonBrightnessUp] . my/brightnessup) + ([XF86AudioMute] . my/mute) + ([XF86AudioLowerVolume] . my/voldown) + ([XF86AudioRaiseVolume] . my/volup))) + (exwm-input-simulation-keys + '(;; movement + ([?\C-b] . [left]) + ([?\M-b] . [C-left]) + ([?\C-f] . [right]) + ([?\M-f] . [C-right]) + ([?\C-p] . [up]) + ([?\C-n] . [down]) + ([?\C-a] . [home]) + ([?\C-e] . [end]) + ([?\M-v] . [prior]) + ([?\C-v] . [next]) + ;; edit, copy, paste + ([?\C-d] . [delete]) + ([?\C-k] . [S-end delete]) + ([M-backspace] . [C-backspace]) + ([?\M-w] . [?\C-c]) + ([?\C-y] . [?\C-v]) + ([?\C-s] . [?\C-f]))) + (exwm-input-move-event 'M-down-mouse-1) + (exwm-input-resize-event 'M-down-mouse-3) + :bind (:map exwm-mode-map + ("C-q" . 'exwm-input-send-next-key) + ("M-!" . 'shell-command))) + diff --git a/config/emacs/site-lisp/my-mail.el b/config/emacs/site-lisp/my-mail.el new file mode 100644 index 0000000..bcda232 --- /dev/null +++ b/config/emacs/site-lisp/my-mail.el @@ -0,0 +1,52 @@ +(use-package mu4e + :ensure nil + :demand nil + :init + ;; assumed Maildir layout + ;; ~/Maildir/Account0/{Inbox,Sent,Trash} + ;; ~/Maildir/Account1/{Inbox,Sent,Trash} + ;; where Account0 is context name + (defun my/make-mu4e-context (context-name full-name mail-address signature) + "Return a mu4e context named CONTEXT-NAME with :match-func matching + folder name CONTEXT-NAME in Maildir. The context's `user-mail-address', + `user-full-name' and `mu4e-compose-signature' is set to MAIL-ADDRESS + FULL-NAME and SIGNATURE respectively. + Special folders are set to context specific folders." + (let ((dir-name (concat "/" context-name))) + (make-mu4e-context + :name context-name + ;; we match based on the maildir of the message + ;; this matches maildir /Arkham and its sub-directories + :match-func + `(lambda (msg) + (when msg + (string-match-p + ,(concat "^" dir-name) + (mu4e-message-field msg :maildir)))) + :vars + `((user-mail-address . ,mail-address) + (user-full-name . ,full-name) + (mu4e-sent-folder . ,(concat dir-name "/sent")) + (mu4e-drafts-folder . ,(concat dir-name "/drafts")) + (mu4e-trash-folder . ,(concat dir-name "/trash")) + (mu4e-refile-folder . ,(concat dir-name "/archive")) + (mu4e-compose-signature . ,signature))))) + :custom + (mu4e-change-filenames-when-moving t) + (mu4e-get-mail-command "mbsync --all") + :config + ;;Fixing duplicate UID errors when using mbsync and mu4e + (setq mu4e-contexts + `(,(my/make-mu4e-context + "thomasmulmer02" "Thomas Ulmer" + "thomasmulmer02@gmail.com" "Thanks, +Thomas Ulmer"))) + + (require 'smtpmail) + (setq message-send-mail-function 'smtpmail-send-it) + (setq smtpmail-default-smtp-server "smtp.gmail.com" + smtpmail-smtp-server "smtp.gmail.com" + smtpmail-smtp-service 587 + starttls-use-gnutls t + smtpmail-starttls-credentials '(("smtp.gmail.com" 587 nil nil)) + smtp-auth-credentials (expand-file-name "~/.authinfo.gpg"))) diff --git a/config/emacs/site-lisp/my-modal.el b/config/emacs/site-lisp/my-modal.el new file mode 100644 index 0000000..1803609 --- /dev/null +++ b/config/emacs/site-lisp/my-modal.el @@ -0,0 +1,212 @@ +;;; bespoke vish modal -*- lexical-binding: t; -*- + +(require 's) + + +(defun do-nothing () (interactive)) + +(defun yank-looks-like-lines () + (s-contains? " +" (current-kill 0 t))) + +(defun paste-after-maybe-lines () + (interactive) + (if (yank-looks-like-lines) + (progn + (move-end-of-line nil) + (newline) + (yank)) + (forward-char-unless-eol) + (yank))) + +(defun paste-before-maybe-lines () + (interactive) + (if (yank-looks-like-lines) + (progn + (move-beginning-of-line nil) + (yank)) + (yank))) + +(defun forward-char-unless-eol (&optional arg) + (interactive "P") + (when (< (point) (point-at-eol)) (forward-char arg))) + +(defun mark-end-of-line (&optional arg) + (interactive "P") + (push-mark) + (move-end-of-line arg) + (exchange-point-and-mark)) + +(defun mark-beginning-of-line (&optional arg) + (interactive "P") + (push-mark) + (move-beginning-of-line arg) + (exchange-point-and-mark)) + +;; what I really want is a meta operator to invert the arg count, +;; but between how ryo calls functions and expects symbols in binds, +;; this is the best I can do. +(defun mark-word-backward (&optional arg allow-extend) + (interactive "P\np") + (cond + ((null arg) + (setq arg -1)) + ((numberp arg) + (setq arg (* -1 arg)))) + (mark-word arg allow-extend)) + +(defun mark-sexp-backward (&optional arg allow-extend) + (interactive "P\np") + (cond + ((null arg) + (setq arg -1)) + ((numberp arg) + (setq arg (* -1 arg)))) + (mark-sexp arg allow-extend)) + +(defun mark-defun-backward (&optional arg interactive) + (interactive "p\nd") + (cond + ((null arg) + (setq arg -1)) + ((numberp arg) + (setq arg (* -1 arg)))) + (mark-defun arg interactive)) + +(defun mark-paragraph-backward (&optional arg allow-extend) + (interactive "P\np") + (cond + ((null arg) + (setq arg -1)) + ((numberp arg) + (setq arg (* -1 arg)))) + (mark-paragraph arg allow-extend)) + +(defconst my/ryo-digits '(("1" "C-1" :norepeat t) + ("2" "C-2" :norepeat t) + ("3" "C-3" :norepeat t) + ("4" "C-4" :norepeat t) + ("5" "C-5" :norepeat t) + ("6" "C-6" :norepeat t) + ("7" "C-7" :norepeat t) + ("8" "C-8" :norepeat t) + ("9" "C-9" :norepeat t))) + +(defconst my/ryo-moves '(("h" backward-char) + ("j" next-line) + ("k" previous-line) + ("l" forward-char) + + ("e" forward-word) + ("b" backward-word) + ("E" forward-sexp) + ("B" backward-sexp) + + ("0" "C-a") + ("$" "C-e") + + ("[" beginning-of-defun) + ("]" end-of-defun) + ("{" backward-paragraph) + ("}" forward-paragraph) + )) + +(defconst my/ryo-marking-moves '(("h" backward-char :first (push-mark-command)) + ("j" next-line :first (push-mark-command)) + ("k" previous-line :first (push-mark-command)) + ("l" forward-char :first (push-mark-command)) + + ("b" mark-word-backward) + ("e" mark-word) + ("B" mark-sexp-backward) + ("E" mark-sexp) + + ("[" mark-defun-backward) + ("]" mark-defun) + + ("0" mark-beginning-of-line) + ("$" mark-end-of-line) + + ("{" mark-paragraph-backward) + ("}" mark-paragraph) + )) + +(defconst my/ryo-no-ops '( + "" + "`" "-" "+" + "q" "w" "r" "t" "\\" + "s" "f" ";" "'" + "z" "n" "m" "," "." + + "~" "!" "@" "#" "%" "^" "&" "*" "(" ")" "_" "+" + "Q" "W" "R" "T" "Y" "U" "|" + "S" "D" "F" "H" "J" "K" "L" ":" "\"" + "Z" "X" "C" "V" "N" "M" "<" ">" + )) + + + +(use-package ryo-modal + :demand t + :bind (:map my/keys-mode-map + ("C-c C-" . ryo-modal-mode)) + :config + (define-minor-mode my/temp-nonmodal-mode + "Minor mode for a temporary exit that should return to ryo-modal-mode." + :keymap (define-keymap + "" + 'my/temp-nonmodal-mode) + :lighter " " + (ryo-modal-mode (if my/temp-nonmodal-mode -1 1))) + + (let* () + (eval + `(ryo-modal-keys + ,@my/ryo-moves + ,@my/ryo-digits + ,@(mapcar (lambda (key) (list key 'do-nothing)) my/ryo-no-ops) + ("g" (("g" beginning-of-buffer))) + ("G" end-of-buffer) + + ("i" my/temp-nonmodal-mode) + ("I" back-to-indentation :then '(my/temp-nonmodal-mode)) + ("a" forward-char-unless-eol :then '(my/temp-nonmodal-mode)) + ("A" move-end-of-line :then '(my/temp-nonmodal-mode)) + ("o" move-end-of-line :then '(newline-and-indent my/temp-nonmodal-mode)) + ("O" move-beginning-of-line + :then '(open-line indent-according-to-mode my/temp-nonmodal-mode)) + + ("x" delete-char) + ("d" (("d" kill-whole-line) + ("m" kill-region))) + ("d" ,my/ryo-marking-moves :then '(kill-region)) + + ("c" (("c" kill-whole-line)) + :then '(open-line my/temp-nonmodal-mode)) + ("c" (("m" kill-region)) + :then '(my/temp-nonmodal-mode)) + ("C" kill-line :then '(my/temp-nonmodal-mode)) + ("c" ,my/ryo-marking-moves :then '(kill-region my/temp-nonmodal-mode)) + + ("y" (("m" copy-region-as-kill))) + ("y" (("y" copy-region-as-kill)) + :first '(push-mark move-beginning-of-line push-mark move-end-of-line forward-char) + :then '(pop-mark pop-to-mark-command)) + + ("P" paste-before-maybe-lines) + ("p" paste-after-maybe-lines) + + ("/" isearch-forward-regexp) + ("?" isearch-backward-regexp) + + ("u" undo) + + ("SPC" set-mark-command) + ("v" set-mark-command) + ))) + (setq ryo-modal-cursor-color "aquamarine") + (defun ryo-modal-unless-minibuffer () + (unless (minibufferp) + (ryo-modal-mode 1))) + ;; (add-hook 'after-change-major-mode-hook 'ryo-modal-unless-minibuffer) + ) diff --git a/config/emacs/site-lisp/single-header.el b/config/emacs/site-lisp/single-header.el new file mode 100755 index 0000000..dc65335 --- /dev/null +++ b/config/emacs/site-lisp/single-header.el @@ -0,0 +1,257 @@ +;; single-header --- Display a topline inside each frame with global info -*- lexical-binding: t; -*- + +;; Author: Thomas Ulmer +;; Package-Requires: ((ednc) (battery) (s) (dash)) +;; Package-Version 1.0 + +(require 'battery) +(require 's) +(require 'dash) + +(use-package ednc ; make emacs a dbus notify reciever + ) + +;;; Commentary: +;;; + +;;; Code: + +;; testing +;; (require 'notifications) +;; (notifications-notify :title "2st test" :body "hello, world" :app-name "EDNC" +;; :actions '("default" "default")) + +(defgroup single-header + '((single-header-face custom-face) + (single-header-update-increment custom-variable)) + "Custom variables for the single header package." + :prefix "single-header" + :group 'emacs) +(defface single-header-face + '((default . (:background "#000000" :family "Source Code Pro"))) + "Base face for the header line." + :group 'single-header) +(defcustom single-header-update-increment + 3 + "Number of seconds before updating the header again." + :type 'natnum + :group 'single-header) +(defvar single-header--active-notifs nil) +(defvar single-header--timer nil) + +(defmacro single-header--time-lock (force frame name &rest body) + "" + (let* ((last-t-str (concat name "--last-time")) + (last-t (or (intern-soft last-t-str) (make-symbol last-t-str)))) + ;; cache contains the symol of the cache variable + ;; last-t contains the symbol of the last time it was evaluated + `(if force + (progn + (set-frame-parameter ,frame (quote ,last-t) (time-convert (current-time) 'integer)) + ,@body) + (let ((cur-time (time-convert (current-time) 'integer)) + (next-time (time-add (or (frame-parameter ,frame (quote ,last-t)) 0) + single-header-update-increment))) + (when (time-less-p next-time cur-time) + (progn + (set-frame-parameter ,frame (quote ,last-t) cur-time) + ,@body)))))) + +(defun single-header--with-face (str &rest face-plist) + "Convenience wrapper for `add-face-text-property'." + (add-face-text-property 0 (length str) face-plist t str) + str) + +(defun single-header--register-notif-change (old new) + "Function to hook `ednc-notification-presentation-functions'." + (when new + (push new single-header--active-notifs)) + (when (and old + (member old single-header--active-notifs)) + (setq single-header--active-notifs + (remove old single-header--active-notifs))) + (when (or new old) + (single-header-update t))) + +(defun single-header--make-notif-string () + "Produce a string representation of the active notifications." + (mapconcat (lambda (e) + (format "[%s | %s | %s] " + (s-truncate 8 (ednc-notification-app-name e)) + (s-truncate 8 (ednc-notification-summary e)) + (s-truncate 20 (ednc-notification-body e))) + ) + (ednc-notifications) + "")) + +(defun single-header-dismiss (num) + "Dismiss the most recent notification from the header line. With a prefix +arg, dismiss all the notifications." + (interactive "p") + (cond ((and (natnump num) (>= num 4)) + (mapc 'ednc-dismiss-notification (ednc-notifications))) + (t + (let ((notifs (ednc-notifications))) + (when notifs + (ednc-dismiss-notification (car notifs)))))) + (single-header-update t)) + +(defun single-header--make-header-info-string () + "Generates the mode line string that contains all the info to the right." + (let ((str (concat + (single-header--with-face (battery-format "[%b%p%%] " (and battery-status-function (funcall battery-status-function))) + :weight 'bold) + (single-header--with-face (let* ((mi (memory-info)) + (tm (float (car mi))) + (fm (float (cadr mi))) + (ts (float (caddr mi))) + (fs (float (cadddr mi)))) + (format "{%.2f %.2f} " (- 1 (/ fm tm)) (- 1 (/ fs ts)))) + :foreground "#00ced1") + (single-header--with-face (format "<%03.2f> " (car (load-average 1))) + :foreground "#da70d6") + (format-time-string "%a, %b %+4Y-%0m-%0d ") + (single-header--with-face (format-time-string "%R") + :weight 'bold) + ))) + (single-header--with-face str 'single-header-face))) + +(defun single-header--init-buffer (buf) + (with-current-buffer buf + (insert "header test") + (jit-lock-mode nil) + (font-lock-mode -1) + (buffer-disable-undo) + (setq-local mode-line-format nil) + (setq-local header-line-format nil) + (setq-local cursor-type nil) + (setq-local cursor-in-non-selected-windows nil) + (setq-local overflow-newline-into-fringe nil) + (setq-local word-wrap nil) + (setq-local show-trailing-whitespace nil))) + +(defun single-header--init-window (win) + (with-selected-window win + (set-window-dedicated-p win t) + (set-window-parameter win 'no-other-window t) + (set-window-parameter win 'no-delete-other-windows t) + (set-window-margins win 0 0) + (set-window-fringes win 0 0) + (set-window-scroll-bars win 0 nil 0 nil) + (setq-local window-min-height 1) + (setq-local window-safe-min-height 1) + (let + (window-size-fixed) + (fit-window-to-buffer win 1)) + (setq-local window-size-fixed t) + (when + (fboundp 'window-preserve-size) + (window-preserve-size win nil t)))) + +(defun single-header--init-frame (&optional frame) + (setq frame (or frame (selected-frame))) + (with-selected-frame frame + (let* ((buf (generate-new-buffer "*header*")) + (win (display-buffer-in-side-window buf '((side . top) + (slot . -100))))) + (single-header--init-buffer buf) + (single-header--init-window win) + (set-frame-parameter frame 'single-header-buf buf) + (set-frame-parameter frame 'single-header-win win)))) + +(defun single-header-update (&optional force) + "" + (mapc (lambda (f) (single-header-update-frame f force)) + (visible-frame-list))) + +(defun single-header-format (frame win buf) + "Evaluated in the header buffer when empty to fill the buffer." + (let* ((win-width (window-max-chars-per-line win 'single-header-face)) + (info (single-header--make-header-info-string)) + (info-width (string-width info)) + (notifs (s-truncate (- win-width info-width 2) + (single-header--make-notif-string))) + (notifs-width (string-width notifs)) + (filled (min win-width (+ info-width notifs-width))) + (padding-width (- win-width filled)) + (padding (make-string padding-width ? ))) + (setq notifs (single-header--with-face notifs 'single-header-face)) + (setq padding (single-header--with-face padding 'single-header-face)) + (setq info (single-header--with-face info 'single-header-face)) + (concat notifs padding info))) + +(defun single-header-update-frame (frame &optional force) + "" + (with-selected-frame frame + (let ((buf (frame-parameter frame 'single-header-buf)) + (win (frame-parameter frame 'single-header-win))) + (when (and buf win) + (with-current-buffer buf + (single-header--time-lock + force frame "header-lock" + (let ((str (single-header-format frame win buf))) + (erase-buffer) + (insert str)))))))) + +(defun single-header-make () + "Create the header and show it." + (let ((registered + (or (equal 'single-header--register-notif-change + ednc-notification-presentation-functions) + (and (listp ednc-notification-presentation-functions) + (-contains? ednc-notification-presentation-functions + 'single-header--register-notif-change))))) + (unless registered + (if (listp ednc-notification-presentation-functions) + (push 'single-header--register-notif-change + ednc-notification-presentation-functions) + (list 'single-header--register-notif-change + ednc-notification-presentation-functions)))) + (mapc (lambda (f) + (when (frame-live-p f) + (single-header--init-frame f))) + (frame-list)) + ;; TODO frame creation hook + (add-hook 'after-make-frame-functions #'single-header--init-frame) + (when single-header--timer + (cancel-timer single-header--timer)) + (setq single-header--timer + (run-with-timer 0 single-header-update-increment 'single-header-update))) + +(defun single-header-delete () + "Remove an existing header buffer." + (let ((reg-list (and (listp ednc-notification-presentation-functions) + (-contains? ednc-notification-presentation-functions + 'single-header--register-notif-change))) + (reg-equal (or (equal 'single-header--register-notif-change + ednc-notification-presentation-functions)))) + (when reg-list + (delete 'single-header--register-notif-change + ednc-notification-presentation-functions)) + (when reg-equal + (setq ednc-notification-presentation-functions + 'ednc--update-log-buffer))) + (cancel-timer single-header--timer) + (setq single-header--timer nil) + (remove-hook 'after-make-frame-functions 'single-header--init-frame) + (mapc (lambda (f) + (delete-window (frame-parameter f 'single-header-win)) + (kill-buffer (frame-parameter f 'single-header-buf)) + (set-frame-parameter f 'single-header-buf nil) + (set-frame-parameter f 'single-header-win nil)) + (frame-list))) + +(define-minor-mode single-header-mode + "Global minor mode to enable a single info line at the top of each frame." + :group 'single-header + :global t + :init-value nil + :keymap `((,(kbd "M-L d") . single-header-dismiss) + (,(kbd "M-L t") . single-header-mode)) + :interactive t + (if (not single-header-mode) + (single-header-delete) + (single-header-make))) + +(provide 'single-header) +;;; single-header.el ends here diff --git a/config/emacs/site-lisp/tex-conf.el b/config/emacs/site-lisp/tex-conf.el new file mode 100644 index 0000000..4592ce5 --- /dev/null +++ b/config/emacs/site-lisp/tex-conf.el @@ -0,0 +1,47 @@ +;; latex stuff +(require 'tex-mode) +(define-key latex-mode-map (kbd "C-c m") (lambda () (interactive) + (push-mark) + (insert "\\[\n\n\\]") + (indent-region (mark) (point)) + (pop-mark) + (previous-line) + (indent-for-tab-command) + )) + +;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; ;;;;;;;;;;;;;;;; LaTeX ;;;;;;;;;;;;;;;;; +;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;; ##### Don't forget to configure +;; ##### Okular to use emacs in +;; ##### "Configuration/Configure Okular/Editor" +;; ##### => Editor => Emacsclient. (you should see +;; ##### emacsclient -a emacs --no-wait +%l %f +;; ##### in the field "Command". + +(add-hook 'LaTeX-mode-hook 'turn-on-reftex) +(setq reftex-plug-into-AUCTeX t) + +;; ##### Always ask for the master file +;; ##### when creating a new TeX file. +(setq-default TeX-master nil) + +;; ##### Enable synctex correlation. From Okular just press +;; ##### Shift + Left click to go to the good line. +(setq TeX-source-correlate-mode t + TeX-source-correlate-start-server t) + +;; ### Set Okular as the default PDF viewer. +(eval-after-load "tex" + '(setcar (cdr (assoc 'output-pdf TeX-view-program-selection)) "Okular")) + +(add-hook 'tex-mode-hook (lambda () + (setq spell-fu-faces-exclude + '(tex-math + font-lock-builtin-face + font-lock-keyword-face + font-lock-function-name-face + font-lock-variable-name-face + font-latex-sedate-face)) + (outline-minor-mode 1))) diff --git a/config/emacs/site-lisp/tmu-custom-theme.el b/config/emacs/site-lisp/tmu-custom-theme.el new file mode 100755 index 0000000..965d7c8 --- /dev/null +++ b/config/emacs/site-lisp/tmu-custom-theme.el @@ -0,0 +1,67 @@ +;; -*- lexical-binding: t; -*- +(provide 'tmu-custom-theme) + +(deftheme tmu-custom + "Created 2023-01-06.") + +(custom-theme-set-faces + 'tmu-custom + '(cursor ((((background light)) (:background "black")) (((background dark)) (:background "white")))) + '(fixed-pitch ((t (:family "Monospace")))) + '(variable-pitch ((((type w32)) (:foundry "outline" :family "Arial")) (t (:family "Sans Serif")))) + '(escape-glyph ((((background dark)) (:foreground "cyan")) (((type pc)) (:foreground "magenta")) (t (:foreground "brown")))) + '(homoglyph ((((background dark)) (:foreground "cyan")) (((type pc)) (:foreground "magenta")) (t (:foreground "brown")))) + '(minibuffer-prompt ((t (:weight bold :box (:line-width (1 . -1) :color "red" :style released-button) :foreground "white smoke" :background "royal blue")))) + '(highlight ((t (:background "gray30")))) + '(region ((t (:extend t :background "SeaGreen4")))) + '(shadow ((((class color grayscale) (min-colors 88) (background light)) (:foreground "grey50")) (((class color grayscale) (min-colors 88) (background dark)) (:foreground "grey70")) (((class color) (min-colors 8) (background light)) (:foreground "green")) (((class color) (min-colors 8) (background dark)) (:foreground "yellow")))) + '(secondary-selection ((t (:extend t :foreground "#f6f3e8" :background "#333366")))) + '(trailing-whitespace ((((class color) (background light)) (:background "red1")) (((class color) (background dark)) (:background "red1")) (t (:inverse-video t)))) + '(font-lock-bracket-face ((t (:inherit (font-lock-punctuation-face))))) + '(font-lock-builtin-face ((t (:foreground "chartreuse2")))) + '(font-lock-comment-delimiter-face ((default (:inherit (font-lock-comment-face))))) + '(font-lock-comment-face ((t (:foreground "orchid2")))) + '(font-lock-constant-face ((t (:foreground "maroon1")))) + '(font-lock-delimiter-face ((t (:inherit (font-lock-punctuation-face))))) + '(font-lock-doc-face ((t (:foreground "indian red")))) + '(font-lock-doc-markup-face ((t (:inherit (font-lock-constant-face))))) + '(font-lock-escape-face ((t (:inherit (font-lock-regexp-grouping-backslash))))) + '(font-lock-function-name-face ((t (:foreground "spring green")))) + '(font-lock-keyword-face ((t (:weight bold :foreground "light sea green")))) + '(font-lock-negation-char-face ((t nil))) + '(font-lock-number-face ((t nil))) + '(font-lock-misc-punctuation-face ((t (:inherit (font-lock-punctuation-face))))) + '(font-lock-operator-face ((t nil))) + '(font-lock-preprocessor-face ((t (:foreground "cornflower blue")))) + '(font-lock-property-face ((t (:inherit (font-lock-variable-name-face))))) + '(font-lock-punctuation-face ((t nil))) + '(font-lock-regexp-grouping-backslash ((t (:inherit (bold))))) + '(font-lock-regexp-grouping-construct ((t (:inherit (bold))))) + '(font-lock-string-face ((t (:foreground "Skyblue1")))) + '(font-lock-type-face ((t (:foreground "medium purple")))) + '(font-lock-variable-name-face ((t (:foreground "PaleGreen2")))) + '(font-lock-warning-face ((t (:weight bold :foreground "hot pink")))) + '(button ((t (:inherit (link))))) + '(link ((((class color) (min-colors 88) (background light)) (:underline t)) (((class color) (background light)) (:underline t)) (((class color) (min-colors 88) (background dark)) (:underline t)) (((class color) (background dark)) (:underline t)))) + '(link-visited ((default (:inherit (link))) (((class color) (background light)) (:foreground "magenta4")) (((class color) (background dark)) (:foreground "violet")))) + '(fringe ((((class color) (background light)) (:background "grey95")) (((class color) (background dark)) (:background "grey10")) (t (:background "gray")))) + '(header-line ((t (:inherit mode-line)))) + '(tooltip ((((class color)) (:inherit (variable-pitch) :foreground "black" :background "lightyellow")) (t (:inherit (variable-pitch))))) + '(mode-line ((t (:background "black" :family "DejaVu Sans")))) + '(mode-line-buffer-id ((t (:weight bold)))) + '(mode-line-emphasis ((t (:weight bold)))) + '(mode-line-highlight ((((supports :box t) (class color) (min-colors 88)) (:box (:line-width (2 . 2) :color "grey40" :style released-button))) (t (:inherit (highlight))))) + '(mode-line-inactive ((t (:inherit mode-line :foreground "dark gray")))) + '(isearch ((((class color) (min-colors 88) (background light)) (:foreground "lightskyblue1" :background "magenta3")) (((class color) (min-colors 88) (background dark)) (:foreground "brown4" :background "palevioletred2")) (((class color) (min-colors 16)) (:foreground "cyan1" :background "magenta4")) (((class color) (min-colors 8)) (:foreground "cyan1" :background "magenta4")) (t (:inverse-video t)))) + '(isearch-fail ((((class color) (min-colors 88) (background light)) (:background "RosyBrown1")) (((class color) (min-colors 88) (background dark)) (:background "red4")) (((class color) (min-colors 16)) (:background "red")) (((class color) (min-colors 8)) (:background "red")) (((class color grayscale)) (:foreground "grey")) (t (:inverse-video t)))) + '(lazy-highlight ((((class color) (min-colors 88) (background light)) (:distant-foreground "black" :background "paleturquoise")) (((class color) (min-colors 88) (background dark)) (:distant-foreground "white" :background "paleturquoise4")) (((class color) (min-colors 16)) (:distant-foreground "white" :background "turquoise3")) (((class color) (min-colors 8)) (:distant-foreground "white" :background "turquoise3")) (t (:underline t)))) + '(match ((((class color) (min-colors 88) (background light)) (:background "khaki1")) (((class color) (min-colors 88) (background dark)) (:background "RoyalBlue3")) (((class color) (min-colors 8) (background light)) (:foreground "black" :background "yellow")) (((class color) (min-colors 8) (background dark)) (:foreground "white" :background "blue")) (((type tty) (class mono)) (:inverse-video t)) (t (:background "gray")))) + '(next-error ((t (:inherit (region))))) + '(query-replace ((t (:inherit (isearch))))) + '(default ((t (:family "Source Code Pro" :foundry "ADBO" :width normal :height 98 :weight regular :slant normal :underline nil :overline nil :extend nil :strike-through nil :box nil :inverse-video nil :foreground "white smoke" :background "gray10" :stipple nil :inherit nil)))) + '(frog-menu-posframe-background-face ((t (:background "RoyalBlue4")))) + '(minibuffer-prompt ((t (:background "gray10" :foreground "cyan" :box nil :weight bold)))) + '(pyim-page ((t (:inherit default :background "#333333" :foreground "#dcdccc")))) + '(vterm-color-blue ((t (:inherit ansi-color-bright-green))))) + +(provide-theme 'tmu-custom) diff --git a/config/emacs/splashLaputa.png b/config/emacs/splashLaputa.png new file mode 100644 index 0000000..4b5de18 Binary files /dev/null and b/config/emacs/splashLaputa.png differ diff --git a/config/emacs/templates/c.eld b/config/emacs/templates/c.eld new file mode 100644 index 0000000..fdb899f --- /dev/null +++ b/config/emacs/templates/c.eld @@ -0,0 +1,5 @@ + +c-mode + +(for > "for (" p "; " p "; " p ") {" n> (p "body;") n> "}") +(fori > "for (int i = 0; i < " p "; ++i) {" n> (p "body;") n> "}") diff --git a/config/emacs/viper b/config/emacs/viper new file mode 100644 index 0000000..feadc7d --- /dev/null +++ b/config/emacs/viper @@ -0,0 +1 @@ +(setq viper-inhibit-startup-message 't) diff --git a/config/fbterm/fbterm-emacs.sh b/config/fbterm/fbterm-emacs.sh new file mode 100755 index 0000000..91616b3 --- /dev/null +++ b/config/fbterm/fbterm-emacs.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +export TERM=fbterm +dbus-run-session -- emacs -l "~/.emacs.d/site-lisp/fbterm.el" diff --git a/config/fbterm/fbtermrc b/config/fbterm/fbtermrc new file mode 100644 index 0000000..777071f --- /dev/null +++ b/config/fbterm/fbtermrc @@ -0,0 +1,60 @@ +# Configuration for FbTerm + +# Lines starting with '#' are ignored. +# Note that end-of-line comments are NOT supported, comments must be on a line of their own. + +# font family names/pixelsize used by fbterm, multiple font family names must be seperated by ',' +# and using a fixed width font as the first is strongly recommended +font-names=Adwaita Mono,Terminus +font-size=14 + +# force font width (and/or height), usually for non-fixed width fonts +# legal value format: n (fw_new = n), +n (fw_new = fw_old + n), -n (fw_new = fw_old - n) +#font-width=8 +#font-height=18 + +# default color of foreground/background text +# available colors: 0 = black, 1 = red, 2 = green, 3 = brown, 4 = blue, 5 = magenta, 6 = cyan, 7 = white +color-foreground=7 +color-background=0 +color-0=000000 +color-1=AA0000 +color-2=00AA00 +color-3=AA5500 +color-4=0000AA +color-5=AA00AA +color-6=00AAAA +color-7=AAAAAA +color-8=555555 +color-9=FF5555 +color-10=55FF55 +color-11=FFFF55 +color-12=5555FF +color-13=FF55FF +color-14=55FFFF +color-15=FFFFFF + +# max scroll-back history lines of every window, value must be [0 - 65535], 0 means disable it +history-lines=1000 + +# up to 5 additional text encodings, multiple encodings must be seperated by ',' +# run 'iconv --list' to get available encodings. +text-encodings=UTF-8,LATIN1 + +# cursor shape: 0 = underline, 1 = block +# cursor flash interval in milliseconds, 0 means disable flashing +cursor-shape=1 +cursor-interval=500 + +# additional ascii chars considered as part of a word while auto-selecting text, except ' ', 0-9, a-z, A-Z +word-chars=._- + +# change the clockwise orientation angle of screen display +# available values: 0 = 0 degree, 1 = 90 degrees, 2 = 180 degrees, 3 = 270 degrees +screen-rotate=0 + +# specify the favorite input method program to run +input-method= + +# treat ambiguous width characters as wide +ambiguous-wide=no diff --git a/config/firefox/chrome/userChrome.css b/config/firefox/chrome/userChrome.css new file mode 100644 index 0000000..510b37d --- /dev/null +++ b/config/firefox/chrome/userChrome.css @@ -0,0 +1,4 @@ +/* Hide tab bar. */ +#tabbrowser-tabs, #tabbrowser-tabs arrowscrollbox { min-height: 0 !important; } +#tabbrowser-tabs tab { height: var(--tab-min-height); } +#tabbrowser-tabs tab:first-of-type:last-of-type { display: none !important; } diff --git a/config/firefox/user.js b/config/firefox/user.js new file mode 100644 index 0000000..9045107 --- /dev/null +++ b/config/firefox/user.js @@ -0,0 +1,11 @@ +// Allow chrome/userChrome.css +user_pref("toolkit.legacyUserProfileCustomizations.stylesheets", true); + +// Force all links to open in the same window. +user_pref("browser.link.open_newwindow", 1); + +// Disable horrible tab switcher. +user_pref("browser.ctrlTab.recentlyUsedOrder", false); + +// Disable horrible new tab page. +user_pref("browser.newtabpage.enabled", false); diff --git a/config/foot/foot.ini b/config/foot/foot.ini new file mode 100644 index 0000000..e07855c --- /dev/null +++ b/config/foot/foot.ini @@ -0,0 +1,187 @@ +# -*- conf -*- + +# shell=$SHELL (if set, otherwise user's default shell from /etc/passwd) +# term=foot (or xterm-256color if built with -Dterminfo=disabled) +# login-shell=no + +# app-id=foot +# title=foot +# locked-title=no + +font=Terminus:size=12 +# font-bold= +# font-italic= +# font-bold-italic= +# line-height= +# letter-spacing=0 +# horizontal-letter-offset=0 +# vertical-letter-offset=0 +# underline-offset= +# box-drawings-uses-font-glyphs=no +dpi-aware=no + +# initial-window-size-pixels=700x500 # Or, +# initial-window-size-chars= +# initial-window-mode=windowed +# pad=2x2 # optionally append 'center' +# resize-delay-ms=100 + +# notify=notify-send -a ${app-id} -i ${app-id} ${title} ${body} + +# bold-text-in-bright=no +# word-delimiters=,│`|:"'()[]{}<> +# selection-target=primary +# workers= + +[bell] +# urgent=no +# notify=no +# command= +# command-focused=no + +[scrollback] +# lines=1000 +# multiplier=3.0 +# indicator-position=relative +# indicator-format= + +[url] +# launch=xdg-open ${url} +# label-letters=sadfjklewcmpgh +# osc8-underline=url-mode +# protocols=http, https, ftp, ftps, file, gemini, gopher +# uri-characters=abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_.,~:;/?#@!$&%*+="'()[] + +[cursor] +# style=block +# color= +# blink=no +# beam-thickness=1.5 +# underline-thickness= + +[mouse] +# hide-when-typing=no +# alternate-scroll-mode=yes + + +[colors] +alpha=0.90 +foreground=dfdfdf +background=080808 + +## Normal/regular colors (color palette 0-7) +regular0=222222 # black +regular1=cc9393 # red +regular2=7f9f7f # green +regular3=d0bf8f # yellow +regular4=6ca0a3 # blue +regular5=dc8cc3 # magenta +regular6=93e0e3 # cyan +regular7=dcdccc # white + +## Bright colors (color palette 8-15) +bright0=666666 # bright black +bright1=dca3a3 # bright red +bright2=bfebbf # bright green +bright3=f0dfaf # bright yellow +bright4=8cd0d3 # bright blue +bright5=fcace3 # bright magenta +bright6=b3ffff # bright cyan +bright7=ffffff # bright white + +## dimmed colors (see foot.ini(5) man page) +# dim0= +# ... +# dim7= + +## The remaining 256-color palette +# 16 = <256-color palette #16> +# ... +# 255 = <256-color palette #255> + +## Misc colors +# selection-foreground= +# selection-background= +# jump-labels= +# urls= +# scrollback-indicator= + +[csd] +# preferred=server +# size=26 +# font= +# color= +# hide-when-typing=no +# border-width=0 +# border-color= +# button-width=26 +# button-color= +# button-minimize-color= +# button-maximize-color= +# button-close-color= + +[key-bindings] +# scrollback-up-page=Shift+Page_Up +# scrollback-up-half-page=none +# scrollback-up-line=none +# scrollback-down-page=Shift+Page_Down +# scrollback-down-half-page=none +# scrollback-down-line=none +# clipboard-copy=Control+Shift+c XF86Copy +# clipboard-paste=Control+Shift+v XF86Paste +# primary-paste=Shift+Insert +# search-start=Control+Shift+r +# font-increase=Control+plus Control+equal Control+KP_Add +# font-decrease=Control+minus Control+KP_Subtract +# font-reset=Control+0 Control+KP_0 +# spawn-terminal=Control+Shift+n +# minimize=none +# maximize=none +# fullscreen=none +# pipe-visible=[sh -c "xurls | fuzzel | xargs -r firefox"] none +# pipe-scrollback=[sh -c "xurls | fuzzel | xargs -r firefox"] none +# pipe-selected=[xargs -r firefox] none +# show-urls-launch=Control+Shift+u +# show-urls-copy=none +# show-urls-persistent=none +# noop=none + +[search-bindings] +# cancel=Control+g Control+c Escape +# commit=Return +# find-prev=Control+r +# find-next=Control+s +# cursor-left=Left Control+b +# cursor-left-word=Control+Left Mod1+b +# cursor-right=Right Control+f +# cursor-right-word=Control+Right Mod1+f +# cursor-home=Home Control+a +# cursor-end=End Control+e +# delete-prev=BackSpace +# delete-prev-word=Mod1+BackSpace Control+BackSpace +# delete-next=Delete +# delete-next-word=Mod1+d Control+Delete +# extend-to-word-boundary=Control+w +# extend-to-next-whitespace=Control+Shift+w +# clipboard-paste=Control+v Control+Shift+v Control+y XF86Paste +# primary-paste=Shift+Insert + +[url-bindings] +# cancel=Control+g Control+c Control+d Escape +# toggle-url-visible=t + +[text-bindings] +# \x03=Mod4+c # Map Super+c -> Ctrl+c + +[mouse-bindings] +# selection-override-modifiers=Shift +# primary-paste=BTN_MIDDLE +# select-begin=BTN_LEFT +# select-begin-block=Control+BTN_LEFT +# select-extend=BTN_RIGHT +# select-extend-character-wise=Control+BTN_RIGHT +# select-word=BTN_LEFT-2 +# select-word-whitespace=Control+BTN_LEFT-2 +# select-row=BTN_LEFT-3 + +# vim: ft=dosini diff --git a/config/glide/glide.d.ts b/config/glide/glide.d.ts new file mode 100644 index 0000000..db2d26f --- /dev/null +++ b/config/glide/glide.d.ts @@ -0,0 +1,13955 @@ +/* ====================================================== + Glide version: 0.1.52a + ====================================================== */ + +declare const GLIDE_EXCOMMANDS: [ + { + readonly name: "back"; + readonly description: "Go back one page in history"; + readonly content: false; + readonly repeatable: true; + }, + { + readonly name: "forward"; + readonly description: "Go forward one page in history"; + readonly content: false; + readonly repeatable: true; + }, + { + readonly name: "reload"; + readonly description: "Reload the current page"; + readonly content: false; + readonly repeatable: true; + }, + { + readonly name: "reload_hard"; + readonly description: "Reload the current page, bypassing the cache"; + readonly content: false; + readonly repeatable: true; + }, + { + readonly name: "quit"; + readonly description: "Close all windows"; + readonly content: false; + readonly repeatable: false; + }, + { + readonly name: "clear"; + readonly description: "Clear all notifications"; + readonly content: false; + readonly repeatable: false; + }, + { + readonly name: "set"; + readonly description: "Set an option"; + readonly args_schema: { + readonly name: { + readonly type: "string"; + readonly position: 0; + readonly required: true; + }; + readonly value: { + readonly type: "string"; + readonly position: 1; + readonly required: true; + }; + }; + readonly content: false; + readonly repeatable: false; + }, + { + readonly name: "profile_dir"; + readonly description: "Show the current profile directory"; + readonly content: false; + readonly repeatable: false; + }, + { + readonly name: "config_edit"; + readonly description: "Open the config file in the default editor"; + readonly content: false; + readonly repeatable: false; + }, + { + readonly name: "config_path"; + readonly description: "Show the config file path"; + readonly content: false; + readonly repeatable: false; + }, + { + readonly name: "config_reload"; + readonly description: "Reload the config file"; + readonly content: false; + readonly repeatable: false; + }, + { + readonly name: "config_init"; + readonly description: "Initialise a config dir with all the necessary setup"; + readonly args_schema: { + readonly location: { + readonly type: { + readonly enum: readonly [ + "home", + "profile", + "cwd" + ]; + }; + readonly required: false; + readonly position: 0; + }; + }; + readonly content: false; + readonly repeatable: false; + }, + { + readonly name: "css_edit"; + readonly description: "Open the userChrome.css file in the default editor"; + readonly content: false; + readonly repeatable: false; + }, + { + readonly name: "repeat"; + readonly description: "Repeat the last invoked command. In general only applies to \"mutative\" commands"; + readonly content: false; + readonly repeatable: false; + }, + { + readonly name: "map"; + readonly description: "Show all mappings"; + readonly content: false; + readonly repeatable: false; + }, + { + readonly name: "unmap"; + readonly description: "Remove a mapping from normal mode"; + readonly args_schema: { + readonly lhs: { + readonly type: "string"; + readonly required: true; + readonly position: 0; + }; + }; + readonly content: false; + readonly repeatable: false; + }, + { + readonly name: "nunmap"; + readonly description: "Remove a mapping from normal mode"; + readonly args_schema: { + readonly lhs: { + readonly type: "string"; + readonly required: true; + readonly position: 0; + }; + }; + readonly content: false; + readonly repeatable: false; + }, + { + readonly name: "iunmap"; + readonly description: "Remove a mapping from insert mode"; + readonly args_schema: { + readonly lhs: { + readonly type: "string"; + readonly required: true; + readonly position: 0; + }; + }; + readonly content: false; + readonly repeatable: false; + }, + { + readonly name: "tab"; + readonly description: "Switch to the given tab index"; + readonly args_schema: { + readonly tab_index: { + readonly type: "integer"; + readonly required: true; + readonly position: 0; + }; + }; + readonly content: false; + readonly repeatable: false; + }, + { + readonly name: "tab_new"; + readonly description: "Create a new tab with the given URL or the default new tab page if not provided"; + readonly args_schema: { + readonly url: { + readonly type: "string"; + readonly required: false; + readonly position: 0; + }; + }; + readonly content: false; + readonly repeatable: false; + }, + { + readonly name: "tab_close"; + readonly description: "Close the current tab"; + readonly content: false; + readonly repeatable: true; + }, + { + readonly name: "tab_next"; + readonly description: "Switch to the next tab, wrapping around if applicable"; + readonly content: false; + readonly repeatable: true; + }, + { + readonly name: "tab_prev"; + readonly description: "Switch to the previous tab, wrapping around if applicable"; + readonly content: false; + readonly repeatable: true; + }, + { + readonly name: "commandline_show"; + readonly description: "Show the commandline UI"; + readonly content: false; + readonly args_schema: {}; + readonly repeatable: false; + }, + { + readonly name: "commandline_toggle"; + readonly description: "Toggle the commandline UI"; + readonly content: false; + readonly args_schema: {}; + readonly repeatable: false; + }, + { + readonly name: "commandline_focus_next"; + readonly description: "Focus the next completion in the commandline"; + readonly content: false; + readonly args_schema: {}; + readonly repeatable: false; + }, + { + readonly name: "commandline_focus_back"; + readonly description: "Focus the previous completion in the commandline"; + readonly content: false; + readonly args_schema: {}; + readonly repeatable: false; + }, + { + readonly name: "commandline_delete"; + readonly description: "Delete the focused commandline completion"; + readonly content: false; + readonly args_schema: {}; + readonly repeatable: false; + }, + { + readonly name: "commandline_accept"; + readonly description: "Accept the focused commandline completion"; + readonly content: false; + readonly args_schema: {}; + readonly repeatable: false; + }, + { + readonly name: "url_yank"; + readonly description: "Yank the URL of the current tab to the clipboard"; + readonly content: false; + readonly repeatable: false; + }, + { + readonly name: "echo"; + readonly description: "Log the given arguments to the console"; + readonly content: false; + readonly args_schema: {}; + readonly repeatable: false; + }, + { + readonly name: "mode_change"; + readonly description: "Change the current mode"; + readonly content: false; + readonly repeatable: false; + readonly args_schema: { + readonly mode: { + readonly type: { + readonly enum: GlideMode[]; + }; + readonly required: true; + readonly position: 0; + }; + readonly "--automove": { + readonly type: { + readonly enum: readonly [ + "left", + "endline" + ]; + }; + readonly required: false; + }; + readonly "--operator": { + readonly type: { + readonly enum: readonly [ + "d", + "c", + "r" + ]; + }; + readonly required: false; + readonly description: "Only applicable for operator-pending mode"; + }; + }; + }, + { + readonly name: "caret_move"; + readonly description: "Move the text caret"; + readonly content: false; + readonly repeatable: false; + readonly args_schema: { + readonly direction: { + readonly type: { + readonly enum: readonly [ + "left", + "right", + "up", + "down" + ]; + }; + readonly required: true; + readonly position: 0; + }; + }; + }, + { + readonly name: "visual_selection_copy"; + readonly description: "Copy the currently selected text to the clipboard & change to normal mode"; + readonly content: false; + readonly repeatable: false; + }, + { + readonly name: "help"; + readonly description: "Open the docs"; + readonly content: false; + readonly repeatable: false; + }, + { + readonly name: "tutor"; + readonly description: "Open the Glide tutorial"; + readonly content: false; + readonly repeatable: false; + }, + { + readonly name: "repl"; + readonly description: "Start the config REPL"; + readonly content: false; + readonly repeatable: false; + }, + { + readonly name: "keys"; + readonly description: "Synthesize the given key sequence as if they were actually pressed"; + readonly args_schema: { + readonly keyseq: { + readonly type: "string"; + readonly required: true; + readonly position: 0; + }; + }; + readonly content: false; + readonly repeatable: false; + }, + { + readonly name: "r"; + readonly description: "Replace the current character"; + readonly content: false; + readonly repeatable: false; + readonly args_schema: { + readonly character: { + readonly type: "string"; + readonly required: false; + readonly position: 0; + }; + }; + }, + { + readonly name: "scroll_top"; + readonly description: "Scroll to the top of the window"; + readonly content: true; + readonly repeatable: false; + }, + { + readonly name: "scroll_page_down"; + readonly description: "Scroll down by 1 page (the size of the viewport)"; + readonly content: true; + readonly repeatable: false; + }, + { + readonly name: "scroll_page_up"; + readonly description: "Scroll up by 1 page (the size of the viewport)"; + readonly content: true; + readonly repeatable: false; + }, + { + readonly name: "scroll_bottom"; + readonly description: "Scroll to the bottom of the window"; + readonly content: true; + readonly repeatable: false; + }, + { + readonly name: "blur"; + readonly description: "Blur the active element"; + readonly content: true; + readonly repeatable: false; + }, + { + readonly name: "focusinput"; + readonly description: "Focus an input element based on the given filter"; + readonly content: true; + readonly repeatable: false; + readonly args_schema: { + readonly filter: { + readonly type: { + readonly enum: readonly [ + "last" + ]; + }; + readonly required: true; + readonly position: 0; + }; + }; + }, + { + readonly name: "hint"; + readonly description: "Show hint labels for jumping to clickable elements"; + readonly content: false; + readonly repeatable: false; + readonly args_schema: { + readonly "-s": { + readonly type: "string"; + readonly required: false; + readonly description: "*Only* show hints for all elements matching this CSS selector"; + }; + readonly "--include": { + readonly type: "string"; + readonly required: false; + readonly description: "*Also* show hints for all elements matching this CSS selector"; + }; + readonly "-e": { + readonly type: "boolean"; + readonly required: false; + readonly description: "*Only* show hints for all elements that are editable"; + }; + readonly "--auto": { + readonly type: "boolean"; + readonly required: false; + readonly description: "If only one hint is generated, automatically activate it."; + }; + readonly "--action": { + readonly type: { + readonly enum: readonly [ + "click", + "newtab-click" + ]; + }; + readonly required: false; + }; + readonly "--location": { + readonly type: { + readonly enum: readonly [ + "content", + "browser-ui" + ]; + }; + readonly required: false; + }; + }; + }, + { + readonly name: "hints_remove"; + readonly description: "Remove all hint labels and exit hint mode"; + readonly content: false; + readonly repeatable: false; + }, + { + readonly name: "execute_motion"; + readonly description: "Used from op-pending mode to execute a motion."; + readonly content: true; + readonly repeatable: false; + }, + { + readonly name: "motion"; + readonly description: "Execute a given motion (internal)"; + readonly content: true; + readonly repeatable: false; + readonly args_schema: { + readonly keyseq: { + readonly type: { + readonly enum: readonly [ + "w", + "W", + "e", + "b", + "B", + "0", + "$", + "{", + "}", + "s", + "v", + "vh", + "vl", + "vd", + "vc", + "x", + "X", + "o" + ]; + }; + readonly required: true; + readonly position: 0; + }; + }; + }, + { + readonly name: "undo"; + readonly description: "Undo the most recent edit"; + readonly content: false; + readonly repeatable: false; + }, + { + readonly name: "redo"; + readonly description: "Redo the most recent undo"; + readonly content: false; + readonly repeatable: false; + } +]; +export type GlideExcmdName = (typeof GLIDE_EXCOMMANDS)[number]["name"]; +export type GlideCommandString = GlideExcmdName | `${GlideExcmdName} ${string}`; +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at http://mozilla.org/MPL/2.0/. +declare global { + var glide: { + ctx: { + /** + * The currently active mode. + */ + mode: GlideMode; + /** + * The URL of the currently focused tab. + */ + url: URL; + /** + * The operating system Glide is running on. + */ + os: "linux" | "win" | "macosx" | "ios" | "android" | "other"; + /** + * Whether or not the currently focused element is editable. + * + * This includes but is not limited to `html: