Compare commits

...

112 Commits
zim ... master

Author SHA1 Message Date
2e92b748ae Revert back to stock zim completion matcher-list
Current config has really annoying behaviour with options that have
both shared prefix and suffix, and it seems that the original issue
was fixed at some point.
2024-11-07 14:49:11 -05:00
47c62ca189 Use Arc-Dark-solid for GTK_THEME instead 2024-09-26 12:23:49 -04:00
3d221cc5c0 Set GTK4 and QT6 themes 2024-09-26 03:00:55 -04:00
a8e50fee03 Add PRESTOW script to create ~/.config 2024-08-29 12:03:55 -04:00
8ef873b00f Add {for,back}ward-word-fine widgets and bindings 2024-08-28 11:43:39 -04:00
95d4a1dc47 Revert "Add tmux-which-key plugin"
This reverts commit adbae6f0ad.
2024-05-08 20:22:36 -04:00
adbae6f0ad Add tmux-which-key plugin 2024-05-08 14:30:35 -04:00
b03223b9ba Add ~/.cargo/bin to path 2024-04-17 19:39:38 -04:00
8b0b1dce34 Switch nag from muchsync to mujmap 2024-04-17 19:34:22 -04:00
f803311fd6 Remove old unrelated mr stuff from apt-get aliases 2023-09-08 10:42:35 -04:00
29f1b87f59 Check if gpgconf exists before trying to run it 2023-08-11 17:08:08 -04:00
30627b531b Set ssh auth socket to use gpg-agent 2023-06-22 23:15:17 -04:00
10ed0376f9 tmux: Write a history file 2023-06-20 00:06:17 -04:00
d14b4ebee9 Add wireguard aliases for homeserver 2023-05-03 22:30:30 -04:00
645710c31d Add Emacs-like delete-horizontal-space and just-one-space key binds 2023-04-11 14:03:25 -04:00
108d8ac5a3 tmux: Install/Update plugins in background 2023-04-09 03:03:28 -04:00
b6f33fc3c3 tmux: Improve initial plugin setup 2023-04-09 02:22:06 -04:00
1e941f215d tmux: Set @mighty-scroll-by-line globally 2023-04-08 00:02:59 -04:00
9dbf5d391a tmux: Add emacs and emacsclient to @mighty-scroll-by-line 2023-04-07 23:57:59 -04:00
e4d579fa52 Fix automatic install of Tmux Plugin Manager 2023-04-07 23:47:05 -04:00
e8b33d4e7d Add tmux-mighty-scroll plugin 2023-04-07 23:31:51 -04:00
a2a8ff9a0d Add Tmux Plugin Manager 2023-04-07 23:31:39 -04:00
84b343a6f0 Move tmux.conf into ~/.config/tmux/
Didn't think this was supported, but apparently has been since 3.1
2023-04-07 22:56:08 -04:00
6b1ff550dd tmux: Enable mouse support 2023-03-26 12:29:27 -04:00
530f1d9729 tmux: Add hjkl pane navigation and resizing 2023-03-18 23:34:23 -04:00
6f427f0c5b Add some basic tmux config 2023-03-18 23:07:00 -04:00
35e0cbbb15 Add duration-info module for fred-prompt 2023-03-04 23:29:10 -05:00
defffb7391 Use full commands in window titles again, but escape % 2023-01-31 15:36:04 -05:00
87c935ffe5 Use only command name in window title to avoid escaping issues
Was having issues with `%` characters in commands doing weird things.
Could alternatively strip those characters out or escape them, but that seemed harder
2023-01-28 10:34:30 -05:00
a165991e9a Fix weird behavior relating to capital letters when completing
https://github.com/zimfw/completion/issues/10
2023-01-28 10:34:17 -05:00
ebf39e2b04 Add alias for stopping wg-quick@wgcms 2022-03-02 19:18:23 -05:00
89f4cb0fef Add some more systemctl aliases 2022-02-12 23:24:19 -05:00
be1ce99f00 Remove old rdiff-backup alias 2022-02-12 23:17:17 -05:00
fedbaf42fc Add $HOME/.local/bin to path 2022-02-12 23:15:43 -05:00
5a50b6be66 Simplify adding directories to path by using $path array 2022-02-12 23:14:58 -05:00
e4f2a41e1f Remove old GnuPG setup, replaced by systemd socket activation 2022-01-11 23:38:20 -05:00
9385ab2f72 Remove .zlogin, which is unneeded as of zimfw 1.7.0 2022-01-11 23:36:05 -05:00
e0170d68c8 Use paru's clean function instead of pacman's orphan command 2021-12-19 11:31:16 -05:00
5f554d5826 Add alias for starting CMS wireguard connection 2021-10-22 15:49:24 -04:00
60f6c3e104 Add alacritty terminfo file to make other distros stop complaining 2021-04-25 15:59:11 -04:00
48f8e3c6d3 Switch AUR helper from yay to paru for pacman aliases
It's new and exciting! I will definitely not regret this change later!
2020-11-02 01:47:27 -05:00
52c1171151 Remove borg aliases, as I have switched to using borgmatic 2020-11-02 01:44:55 -05:00
c3f0f20728 Update URL for fred-prompt 2020-09-23 01:02:22 -04:00
4176453676 Switch back to zimfw/termtitle as support for other TERMs was fixed 2020-09-09 16:57:41 -04:00
9e8d3508ac Use new emacs function to start magit without creating an extra window 2020-06-01 00:21:26 -04:00
ef6f3433f2 Improve magit alias/function to always create a new frame 2020-04-07 12:27:12 -04:00
81f2bfe24d Add "zup" alias for zimfw update 2020-03-25 01:39:57 -04:00
df4f903a59 Switch to my fork of termtitle, insert the current command name 2020-02-20 12:48:11 -05:00
c74a679f49 Move history options below zim init so they are not overridden 2020-01-12 20:39:02 -05:00
fccf010a3a Fix fasd word completion (',') by loading after completion module 2020-01-12 09:35:32 -05:00
39c9c98176 Pull zim master branch 2020-01-07 14:22:04 -05:00
ec40b3d83e Set ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE as it was invisible on remote servers 2019-12-26 19:20:49 -05:00
40c79488d4 Migrate from antigen back to zim 2019-12-25 21:27:17 -05:00
98f1fd6b31 Add sudo variants for journalctl aliases 2019-11-24 15:54:17 -05:00
30fbaacc52 Add aliases for notmuch 2019-11-22 16:24:00 -05:00
4d1e081619 Add aliases for journalctl 2019-11-22 16:23:47 -05:00
5b0b23d05a Fix '.' entry in reverse-i-search 2019-10-23 01:26:59 -04:00
b75fe78ac7 Slightly improve argument format for borg aliases 2019-09-15 00:07:37 -04:00
cf54eb4c4a Add some macOS aliases 2019-07-31 15:15:44 -04:00
e61efefed7 Add alias to cd to git toplevel 2019-07-30 11:27:55 -04:00
a7434463b3 Add icon and sticky variant to notify-send 'N' alias 2019-07-30 11:27:38 -04:00
fabc0bc01b Disable SHARE_HISTORY, it's annoying
not really sure when/where that even got set
2019-06-17 22:54:15 -04:00
9cfe45a8d8 aliases: Set new global borg location on thewarehouse 2019-05-23 00:55:48 -04:00
e3362805b4 Add magit alias/function 2019-05-06 09:14:10 -04:00
581f6eeb2e Use INC_APPEND_HISTORY, which I thought I was already using
I guess something else must have been setting this, which has now
changed? idk, whatever, it works now
2019-01-15 21:38:56 -05:00
84de02484f Add $HOME/.dotfiles to path 2018-10-05 14:27:31 -04:00
8cb7895bdf Add yay config 2018-09-04 00:36:54 -04:00
cca767608a Add env variable to prevent wine from adding file associations 2018-09-04 00:32:04 -04:00
c41da91132 Switch from trizen to yay as AUR helper 2018-09-04 00:31:20 -04:00
82cad3d993 Add htop config 2018-06-22 01:10:01 -04:00
1874872e35 Add comment 2018-06-18 10:26:39 -04:00
baa1712e7b Set QT_AUTO_SCREEN_SCALE_FACTOR for high DPI scaling 2018-06-18 10:25:41 -04:00
a3b419fc05 Use git diff as 'diff' if available 2018-06-18 10:23:43 -04:00
746850b32d aliases: Change settings for borg-backup 2018-03-17 01:53:28 -04:00
38da9ca7fc Add 'mksrcinfo' alias, since that command no longer exists 2018-03-07 14:55:57 -05:00
ff0ce7fe92 Move command-specific aliases sourcing into general aliases 2018-03-07 14:55:31 -05:00
13a67689df Set EDITOR and VISUAL 2018-03-07 14:55:17 -05:00
4337defa08 Change terminal from ROXTerm to xfce4-terminal 2018-01-21 01:44:35 -05:00
1fe053f6ea Make .aliases dir use sh-mode in emacs 2018-01-19 22:14:40 -05:00
fab1a19fd6 Change from pacaur to trizen 2018-01-19 22:14:38 -05:00
0530d4ee76 Move variables and tmpdir stuff to .zshenv and source from .profile 2017-09-05 11:28:15 -04:00
bfdd3156b6 Unset NOMATCH, fixing globbing annoyances
May make things worse
2017-09-02 14:13:24 -04:00
1c56ebf170 Remove .zlogin as it wasn't really doing anything 2017-09-02 14:13:19 -04:00
c2d03eb940 Add $HOME/.bin to PATH if it exists 2017-09-02 13:53:29 -04:00
e2956ca000 Auto rehash completions on bin change
Note that this might have a large performance issue
2017-09-02 13:50:05 -04:00
b2fab31e42 Comment the names of keys for history-substring-search 2017-09-02 13:47:07 -04:00
c848352c1f Add forward kill-word with C-DEL to match backward-kill-word 2017-09-02 13:46:36 -04:00
de1bc3ce9a Rename .zshrc to .profile so that it gets evaluated before i3 starts
This means the environment variables will be available to programs
launched through i3 or rofi
2017-09-01 15:46:14 -04:00
bddefe2fb9 Temporary fix for fred theme initial clone 2017-09-01 15:29:55 -04:00
3773c8dd1f Use zim completions module instead of direct zsh-users/zsh-completions 2017-09-01 15:29:55 -04:00
b79341b427 Add a few keybindings 2017-09-01 15:29:55 -04:00
4b73e35977 Simplify tmux auto start code
that was probably actually important, and I'll regret it later
2017-09-01 15:29:55 -04:00
52ec61bfe5 Switch to antigen, probably doesn't have everything I want yet 2017-09-01 15:29:55 -04:00
4d0a0d13ab Force calibre to use system theme
Is this the right place to do this? Probably not!
2017-08-18 03:10:17 -04:00
5a2b5677ab Use better todo.sh aliases such that completions work 2017-08-06 13:52:11 -04:00
b16451200c Change todo.sh aliases 'tap' and 'taz' to call todo.sh addons 2017-08-03 01:12:22 -04:00
4163da8b38 Add borg command for home backups
also switch to lzma,9 compression
2016-08-20 23:47:11 -04:00
6c31a7c09e Update SSH_AUTH_SOCK location 2016-07-23 14:45:46 -04:00
4200499836 Update borg-backup alias 2016-07-19 02:25:25 -04:00
6980665f31 Bump zim version 2016-07-19 02:24:59 -04:00
98b4447b95 Update QT style variable 2016-07-12 18:22:30 -04:00
8a89e99ae0 Update zim 2016-03-27 22:11:35 -04:00
5c8259b1f7 aliases: switch to pacaur (from apacman) 2016-03-02 23:34:02 -05:00
29696abd78 borg: Add emacs qeulpa and elpa dirs to --exclude 2016-02-27 12:23:00 -05:00
62ec0be26f borg: Move more arguments onto their own lines
just to make things easier to read
2016-02-27 12:22:05 -05:00
c1ea2bac17 Update .zim 2016-02-15 11:25:33 -05:00
b6c5f55079 Auto-start tmux when on a remote connection 2016-02-15 11:20:51 -05:00
b11f399843 Load run-help 2016-02-15 11:20:39 -05:00
428229f8a1 Disable history sharing 2016-02-15 11:20:23 -05:00
419ad14874 Set WORDCHARS and PAGER 2016-02-15 11:19:40 -05:00
95d993e7f3 Update .zim 2016-02-15 11:19:26 -05:00
bbb236eb61 Add borg-backup alias 2016-02-13 19:53:22 -05:00
29 changed files with 330 additions and 169 deletions

View File

@ -0,0 +1,5 @@
;;; Directory Local Variables
;;; For more information see (info "(emacs) Directory Variables")
;; set sh mode for all files
((nil . ((mode . sh))))

View File

@ -1,21 +1,7 @@
## Various update aliases
### apt
alias ai="noglob sudo apt-get install"
alias aup="sudo apt-get update; sudo apt-get upgrade"
alias adup="sudo apt-get dist-upgrade"
alias aclean="sudo apt-get autoremove; sudo apt-get autoclean"
alias apt="noglob apt"
### mr
alias mup="mr -mj update"
alias cmup="mup 2>&1|sed -ur 's/mr update: \/(.*)/'\"$(tput bold)\1$(tput sgr0)\"'/g
/mr update: command failed/c'\"$(tput setf 4)mr update: command failed$(tput sgr0)\"'
s/\/?home\/adam/~/g
/Already up-to-date/d
/Tree is up to date/d
/Updating '\''\.'\'':/d
/At revision/d
/^$/d'"
### general
alias up="(aup;aclean;cmup) | tee /tmp/up.log"
alias up="sudo apt-get update; sudo apt-get upgrade"

View File

@ -0,0 +1 @@
alias bup="brew update && brew upgrade"

View File

@ -4,3 +4,7 @@ alias en="e -n"
alias et="e -t"
alias ec="e -c"
alias ecn="ec -n"
function magit() {
ecn -e '(magit-status-no-new-window "'"$(realpath ${1-.})"'")'
}

View File

@ -1,2 +1,4 @@
## git
alias git-yolo='git commit -am "`curl -s http://whatthecommit.com/index.txt`"'
alias diff='git diff --no-index'
alias gcdr='cd "$(git rev-parse --show-toplevel)"' # cd to top level

View File

@ -1,3 +1,4 @@
## makepkg
alias fmakepkg='PKGEXT='''.pkg.tar''' makepkg'
alias fmakepkg='PKGEXT='''.pkg.tar''' makepkg'
alias mksrcinfo='makepkg --printsrcinfo > .SRCINFO'

View File

@ -1,2 +1,3 @@
## notify-send
alias N='notify-send "Command finished"'
alias N='notify-send "Command finished" -i text-x-script'
alias NS='N -u critical' # sticky

View File

@ -0,0 +1,3 @@
alias n="notmuch"
alias nco="n compact"
alias nag="mujmap -C ~/mail/adamgoldsmith.name sync"

View File

@ -0,0 +1 @@
alias o="open"

View File

@ -1,19 +1,10 @@
# pacman
alias pup='apacman -Syu --noedit --purgebuild'
alias pr='sudo apacman -Rs'
alias pi='paru'
alias pup='pi -Syu'
alias pr='pi -Rs'
alias prc='pr -c'
alias pi='apacman --purgebuild'
alias pin='pi --noedit --noconfirm'
alias pin='pi --noconfirm'
alias pis='pi -S'
alias pins='pin -S'
piro() { #remove orphans
if [[ ! -n $(apacman -Qdt) ]]; then
echo "No orphans to remove."
else
apacman -Rns $(pacman -Qdtq)
fi
}
compdef apacman=pacman
alias piro='pi -c'
alias up='pup'

View File

@ -1,2 +0,0 @@
## rdiff-backup
alias backup="rdiff-backup --exclude-globbing-filelist /home/adam/Documents/backuplist.txt /home/adam/" #target

View File

@ -0,0 +1,5 @@
alias sup="softwareupdate -ia"
alias up='tmux new-session "tmux split-window \"$(whence sup)\"; \
tmux split-window \"$(whence npmgup)\"; \
$(whence bup)"'

View File

@ -1,14 +1,30 @@
#-*- mode: sh; -*-
alias sy="systemctl"
alias sydr="sy daemon-reload"
alias sye="sy enable"
alias syd="sy disable"
alias syre="sy restart"
alias systa="sy start"
alias systo="sy stop"
alias systat="sy status"
alias ssy="sudo systemctl"
alias ssydr="ssy daemon-reload"
alias ssye="ssy enable"
alias ssyd="ssy disable"
alias ssyre="ssy restart"
alias ssysta="ssy start"
alias ssysto="ssy stop"
alias ssystat="ssy status"
alias jo="journalctl"
alias joe="jo -e"
alias joeu="jo -eu"
alias jof="jo -f"
alias jofu="jo -fu"
alias sjo="sudo journalctl"
alias sjoe="sjo -e"
alias sjoeu="sjo -eu"
alias sjof="sjo -f"
alias sjofu="sjo -fu"

View File

@ -1,5 +1,11 @@
## todo.sh
alias taz='todo.sh add "(Z)"'
tap() {
pri="$1:u" #uppercase
shift
todo.sh add "($pri) $@"
}
compdef -e 'words[1]=(todo.sh add); service=todo.sh; (( CURRENT+=1 )); _todo.sh' tap
alias t='todo.sh'
alias hw='t hw'
alias hwr="hw rel"

View File

@ -0,0 +1,5 @@
for interface in cms homeserver
do
alias wg${interface}="sudo systemctl restart wg-quick@wg-${interface}"
alias wg${interface}D="sudo systemctl stop wg-quick@wg-${interface}"
done

View File

@ -4,6 +4,9 @@
alias l='ls -1a'
alias la='ll -a'
# zim updates
alias zup="zimfw update && zimfw upgrade"
## Disable Globbing (for some things)
alias nmap="noglob nmap"
@ -14,4 +17,13 @@ mcd() { mkdir -p "$1" && cd "$1"; }
alias irc='ssh ag tmux a -t irc'
#quick alias for enabling bluetooth
alias ebluetooth="sudo modprobe btusb;blueman-manager"
alias ebluetooth="sudo modprobe btusb;ssy start bluetooth;blueman-manager"
# Command Specific Aliases
for i in $HOME/.aliases/command-specific/*
do
if hash $(basename $i) 2>/dev/null # check if command exists
then
source $i
fi
done

26
.config/htop/htoprc Normal file
View File

@ -0,0 +1,26 @@
# Beware! This file is rewritten by htop when settings are changed in the interface.
# The parser is also very primitive, and not human-friendly.
fields=0 48 17 18 38 39 40 2 46 47 49 1
sort_key=46
sort_direction=1
hide_threads=0
hide_kernel_threads=1
hide_userland_threads=0
shadow_other_users=0
show_thread_names=0
show_program_path=1
highlight_base_name=0
highlight_megabytes=1
highlight_threads=1
tree_view=0
header_margin=1
detailed_cpu_time=0
cpu_count_from_zero=0
update_process_names=0
account_guest_in_cpu_meter=0
color_scheme=0
delay=15
left_meters=AllCPUs2 Memory Swap
left_meter_modes=1 1 1
right_meters=Tasks LoadAverage Uptime Battery
right_meter_modes=2 2 2 1

42
.config/tmux/tmux.conf Normal file
View File

@ -0,0 +1,42 @@
# set prefix to C-z
set -g prefix C-z
unbind C-b
bind C-z send-prefix
# enable mouse support
set -g mouse on
# open new panes in current directory
bind % split-window -h -c "#{pane_current_path}"
bind '"' split-window -v -c "#{pane_current_path}"
# vim-like pane navigation
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# resizing
bind -r C-h resize-pane -L
bind -r C-j resize-pane -D
bind -r C-k resize-pane -U
bind -r C-l resize-pane -R
bind -r M-h resize-pane -L 5
bind -r M-j resize-pane -D 5
bind -r M-k resize-pane -U 5
bind -r M-l resize-pane -R 5
set -g history-file ~/.local/state/tmux_history
# plugins
set-option -g @plugin 'tmux-plugins/tpm'
set-option -g @plugin 'noscript/tmux-mighty-scroll'
set-option -g @mighty-scroll-by-line 'man less pager fzf emacs emacsclient'
# install/update tpm
if-shell "test ! -d ~/.config/tmux/plugins/tpm" {
run-shell 'git clone https://github.com/tmux-plugins/tpm ~/.config/tmux/plugins/tpm'
}
# start tpm
run-shell '~/.config/tmux/plugins/tpm/tpm'
# install and update plugins in background
run-shell -b '($TMUX_PLUGIN_MANAGER_PATH/tpm/bin/install_plugins && $TMUX_PLUGIN_MANAGER_PATH/tpm/bin/clean_plugins && $TMUX_PLUGIN_MANAGER_PATH/tpm/bin/update_plugins all && $TMUX_PLUGIN_MANAGER_PATH/tpm/scripts/source_plugins.sh) > /dev/null'

39
.config/yay/config.json Normal file
View File

@ -0,0 +1,39 @@
{
"buildDir": "/home/adam/.cache/yay",
"editor": "",
"editorflags": "",
"makepkgbin": "makepkg",
"makepkgconf": "",
"pacmanbin": "pacman",
"pacmanconf": "/etc/pacman.conf",
"tarbin": "bsdtar",
"redownload": "no",
"rebuild": "no",
"answerclean": "",
"answerdiff": "",
"answeredit": "",
"answerupgrade": "",
"gitbin": "git",
"gpgbin": "gpg",
"gpgflags": "",
"mflags": "",
"sortby": "votes",
"gitflags": "",
"removemake": "yes",
"requestsplitn": 150,
"sortmode": 0,
"completionrefreshtime": 7,
"sudoloop": false,
"timeupdate": false,
"devel": false,
"cleanAfter": false,
"gitclone": true,
"provides": true,
"pgpfetch": true,
"upgrademenu": true,
"cleanmenu": false,
"diffmenu": false,
"editmenu": false,
"combinedupgrade": false,
"useask": false
}

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/.config/tmux/plugins/

3
.gitmodules vendored
View File

@ -1,3 +0,0 @@
[submodule ".zim"]
path = .zim
url = http://adamgoldsmith.name/cgit/zim.git

3
.profile Normal file
View File

@ -0,0 +1,3 @@
#-*- mode: sh; -*-
source $HOME/.zshenv

BIN
.terminfo/a/alacritty Normal file

Binary file not shown.

1
.zim

@ -1 +0,0 @@
Subproject commit a51d94b91d52cc25503ed6d1c0f685d0ff71c0b3

46
.zimrc
View File

@ -1,27 +1,27 @@
#-*- mode: sh; -*-
## Zim settings
# -*- mode: sh; -*-
# Select what modules you would like enabled.
# The second line of modules may depend on options set by modules in the first line.
# These dependencies are noted on the respective module's README.md.
zmodules=(directory environment git history input utility custom \
syntax-highlighting prompt git completion)
#
# Modules
#
## Prompt
# Set your desired prompt here
zprompt_theme='fred'
zmodule environment
zmodule git
zmodule input
zmodule termtitle
zmodule utility
## Utility
# Uncomment to enable command correction prompts; 'setopt CORRECT'
# See: http://zsh.sourceforge.net/Doc/Release/Options.html#Input_002fOutput
zcorrection='true'
# Prompt
zmodule git-info
zmodule duration-info
zmodule https://git.adamgoldsmith.name/adam/fred-prompt.git
## Syntax-Highlighting
# This determines what highlighters will be used with the completion module.
# Documentation of the highlighters can be found here:
# https://github.com/zsh-users/zsh-syntax-highlighting/blob/master/docs/highlighters.md
zhighlighters=(main brackets)
## SSH
# Load these ssh identities with the ssh module
zssh_ids=(id_rsa)
zmodule zsh-users/zsh-completions
# completion must be sourced after zsh-users/zsh-completions
zmodule completion
# fast must be loaded after completion
zmodule fasd
zmodule zsh-users/zsh-autosuggestions
# zsh-users/zsh-syntax-highlighting must be sourced after completion
zmodule zsh-users/zsh-syntax-highlighting
# zsh-users/zsh-history-substring-search must be sourced after zsh-users/zsh-syntax-highlighting
zmodule zsh-users/zsh-history-substring-search

47
.zlogin
View File

@ -1,47 +0,0 @@
#-*- mode: sh; -*-
# startup file read in interactive login shells
# The following code helps us by optimizing the existing framework.
# This includes zcompile, zcompdump, etc.
(
# Function to determine the need of a zcompile. If the .zwc file
# does not exist, or the base file is newer, we need to compile.
# These jobs are asynchronous, and will not impact the interactive shell
zcompare() {
if [[ -s ${1} && ( ! -s ${1}.zwc || ${1} -nt ${1}.zwc) ]]; then
zcompile ${1}
fi
}
zim_mods=${ZDOTDIR:-${HOME}}/.zim/modules
setopt EXTENDED_GLOB
# zcompile the completion cache; siginificant speedup.
zcompare ${ZDOTDIR:-${HOME}}/.zcompdump
# zcompile .zshrc
zcompare ${ZDOTDIR:-${HOME}}/.zshrc
# zcompile some light module init scripts
zcompare ${zim_mods}/git/init.zsh
zcompare ${zim_mods}/utility/init.zsh
zcompare ${zim_mods}/pacman/init.zsh
zcompare ${zim_mods}/spectrum/init.zsh
zcompare ${zim_mods}/completion/init.zsh
# zcompile all .zsh files in the custom module
for file in ${zim_mods}/custom/**/*.zsh; do
zcompare ${file}
done
# syntax-highlighting
for file in ${zim_mods}/syntax-highlighting/external/highlighters/**/*.zsh; do
zcompare ${file}
done
zcompare ${zim_mods}/syntax-highlighting/external/zsh-syntax-highlighting.zsh
# zsh-histery-substring-search
zcompare ${zim_mods}/history-substring-search/external/zsh-history-substring-search.zsh
) &!

57
.zshenv
View File

@ -1,38 +1,53 @@
#-*- mode: sh; -*-
# Define Zim location
ZIM_HOME=${ZDOTDIR:-${HOME}}/.zim
# Environment variables
export EDITOR="emacsclient -t"
export ALTERNATE_EDITOR=""
export VISUAL="emacsclient -c -n"
export PAGER=less
export TERMINAL=alacritty
export ARDUINO_DIR="/usr/share/arduino"
export ARDMK_DIR="$HOME/Programs/Arduino-Makefile"
export STEAMAPPS="$HOME/.local/share/Steam/steamapps/common"
export QT_STYLE_OVERRIDE=gtk
export ALTERNATE_EDITOR=""
export TERMINAL=roxterm
export GTK_THEME=Arc-Dark-solid
export QT_STYLE_OVERRIDE=gtk2
export QT_QPA_PLATFORMTHEME=qt6gtk2
export QT_AUTO_SCREEN_SCALE_FACTOR=true
export CALIBRE_USE_SYSTEM_THEME=true
export WINEDLLOVERRIDES=winemenubuilder.exe=d
# Don't allow duplicate values in path
typeset -U path
path=(
$HOME/.bin
$HOME/.local/bin
$HOME/.dotfiles/
$HOME/.cargo/bin
$path
)
# Set temporary files locations
if [[ ! -d "$TMPDIR" ]]; then
if [[ ! -d "$TMPDIR" ]]
then
export TMPDIR="/tmp/$LOGNAME"
mkdir -p -m 700 "$TMPDIR"
fi
TMPPREFIX="${TMPDIR%/}/zsh"
if [[ ! -d "$TMPPREFIX" ]]; then
if [[ ! -d "$TMPPREFIX" ]]
then
mkdir -p "$TMPPREFIX"
fi
# Gnupg setup
## Start the gpg-agent if not already running
if ! pgrep -x -u "${USER}" gpg-agent >/dev/null 2>&1; then
gpg-connect-agent /bye >/dev/null 2>&1
fi
## Set SSH to use gpg-agent
# Set SSH auth socket
unset SSH_AGENT_PID
if [ "${gnupg_SSH_AUTH_SOCK_by:-0}" -ne $$ ]; then
export SSH_AUTH_SOCK="${HOME}/.gnupg/S.gpg-agent.ssh"
if hash gpgconf 2>/dev/null && [[ "${gnupg_SSH_AUTH_SOCK_by:-0}" -ne $$ ]]
then
export SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)"
fi
## Set GPG TTY
GPG_TTY=$(tty)
export GPG_TTY
## Refresh gpg-agent tty in case user switches into an X session
gpg-connect-agent updatestartuptty /bye >/dev/null

113
.zshrc
View File

@ -1,34 +1,89 @@
#-*- mode: sh; -*-
# User configuration sourced by interactive shells
# Source zim
if [[ -s ${ZDOTDIR:-${HOME}}/.zim/init.zsh ]]; then
source ${ZDOTDIR:-${HOME}}/.zim/init.zsh
if [ ! -d "$HOME/.zim" ]
then
git clone https://github.com/zimfw/zimfw $HOME/.zim
source ~/.zim/zimfw.zsh install
fi
# Command Specific Aliases
for i in $HOME/.aliases/command-specific/*
do
if hash $(basename $i) 2>/dev/null
then
source $i
fi
done
# Set editor default keymap to emacs
bindkey -e
stty -ixon #disable XON/XOFF, which breaks C-s
# General Aliases
# Prompt for spelling correction of commands.
setopt CORRECT
CORRECT_IGNORE="_*" # don't suggest completion functions
# Customize spelling correction prompt.
SPROMPT='zsh: correct %F{red}%R%f to %F{green}%r%f [nyae]? '
# Remove path separator from WORDCHARS.
WORDCHARS=${WORDCHARS//[\/]}
# Set window title format
# Escape % in commands
zstyle ':zim:termtitle' format '%~:${${1:-zsh}//\\%/%%}'
# Set window title before running a command
zstyle ':zim:termtitle' hooks 'precmd' 'preexec'
# Append `../` to your input for each `.` you type after an initial `..`
zstyle ':zim:input' double-dot-expand yes
# Set what highlighters will be used.
# See https://github.com/zsh-users/zsh-syntax-highlighting/blob/master/docs/highlighters.md
ZSH_HIGHLIGHT_HIGHLIGHTERS=(main brackets)
# Set zsh-autosuggestions highlight style
ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE="fg=black,bold,underline"
# Initialize Zim modules
if [[ ${ZIM_HOME}/init.zsh -ot ${ZDOTDIR:-${HOME}}/.zimrc ]]; then
# Update static initialization script if it's outdated, before sourcing it
source ${ZIM_HOME}/zimfw.zsh init -q
fi
source ${ZIM_HOME}/init.zsh
# Source aliases
source $HOME/.aliases/general
# Various Options
CORRECT_IGNORE="_*"
stty -ixon #disable XON/XOFF, which breaks C-s
unsetopt NOMATCH # turn off "no matches found" on glob failure
# Keybindings
my-backward-kill-word () {
local WORDCHARS=${WORDCHARS/\//}
zle backward-kill-word
# Remove older command from the history if a duplicate is to be added.
setopt HIST_IGNORE_ALL_DUPS
unsetopt SHARE_HISTORY # don't share history between terminals
setopt INC_APPEND_HISTORY
# rehashes on bin change, might cause performance issues
zstyle ':completion:*' rehash true
# History Substring Search bindings (PageUp and PageDown)
bindkey '^[[5~' history-substring-search-up
bindkey '^[[6~' history-substring-search-down
# fine word navigation
backward-word-fine() WORDCHARS='' zle .backward-word
forward-word-fine() WORDCHARS='' zle .forward-word
zle -N backward-word-fine
zle -N forward-word-fine
bindkey '^[F' forward-word-fine
bindkey '^[B' backward-word-fine
ZSH_AUTOSUGGEST_PARTIAL_ACCEPT_WIDGETS+=(forward-word-fine backward-word-fine)
# equivalents of eponymous Emacs functions
# from https://unix.stackexchange.com/a/595157
delete-horizontal-space() {
emulate -L zsh
set -o extendedglob
LBUFFER=${LBUFFER%%[[:blank:]]##}
RBUFFER=${RBUFFER##[[:blank:]]##}
}
zle -N my-backward-kill-word
bindkey '^H' my-backward-kill-word
zle -N delete-horizontal-space
bindkey '\e\\' delete-horizontal-space
just-one-space() {
delete-horizontal-space
LBUFFER="$LBUFFER "
}
zle -N just-one-space
bindkey '\e ' just-one-space
# Inserts 'sudo ' at the beginning of the line.
function prepend-sudo() {
@ -40,5 +95,13 @@ function prepend-sudo() {
zle -N prepend-sudo
bindkey "^X^S" prepend-sudo
#load fasd if it exists
hash fasd 2>/dev/null && eval "$(fasd --init auto)"
# Control-Backspace and Control-Delete
bindkey '^H' backward-kill-word
bindkey '5~' kill-word
# Auto start tmux if a remote connection
if [[ -z "$TMUX" && -z "$EMACS" && -z "$VIM" && -n "$SSH_TTY" ]]
then
# Attach only to the 'auto' session
exec tmux new-session -A -s 'auto'
fi

16
PRESTOW
View File

@ -1,17 +1,3 @@
#!/bin/bash
[ -d .zim ] && firstRun=1
echo "Getting zim"
git submodule update --init --recursive
echo "Updating .dotfiles/zsh/.zim"
cd .zim
if [ $firstRun -eq 1 ]
then
git remote set-url origin "http://adamgoldsmith.name/cgit/zim.git"
git remote set-url --push origin "ag:/srv/git/zim.git"
git remote add upstream "https://github.com/Eriner/zim.git"
fi
git submodule init
git submodule update
mkdir -p ~/.config