commit bcec804f1aad2f161c4b6053c49dacba3e93eac3 Author: earnest ma Date: Thu Nov 4 23:18:36 2021 -0400 Reimport diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..394446c --- /dev/null +++ b/LICENSE @@ -0,0 +1,20 @@ +Copyright (c) 2021 earnest ma + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +Be Gay, Do Crimes +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README b/README new file mode 100644 index 0000000..46da22c --- /dev/null +++ b/README @@ -0,0 +1,21 @@ +# Dotfiles + +Hopefully this is the last time I start over! These dotfiles are managed using +Stow and I use them on my system running Fedora 34. + +## Usage + +Clone the repository and run the script to bootstrap and stow files. + +```shell +git clone https://git.sr.ht/~earnestma/dotfiles +cd dotfiles +./bootstrap.sh +``` + +Or, use `stow */ -[D]v` to set up/ remove all the links. + +## Thanks + +- https://git.sr.ht/~seirdy/dotfiles +- and various others! <3 diff --git a/aerc/.config/aerc/.gitignore b/aerc/.config/aerc/.gitignore new file mode 100644 index 0000000..d4d975d --- /dev/null +++ b/aerc/.config/aerc/.gitignore @@ -0,0 +1 @@ +accounts.conf \ No newline at end of file diff --git a/aerc/.config/aerc/aerc.conf b/aerc/.config/aerc/aerc.conf new file mode 100644 index 0000000..968e1f0 --- /dev/null +++ b/aerc/.config/aerc/aerc.conf @@ -0,0 +1,200 @@ +# +# aerc main configuration + +[ui] +# +# Describes the format for each row in a mailbox view. This field is compatible +# with mutt's printf-like syntax. +# +# Default: %D %-17.17n %Z %s +index-format=%D %-17.17n %Z %s + +# +# See time.Time#Format at https://godoc.org/time#Time.Format +# +# Default: 2006-01-02 03:04 PM (ISO 8601 + 12 hour time) +timestamp-format=2006-01-02 03:04 PM + +# +# Width of the sidebar, including the border. +# +# Default: 20 +sidebar-width=20 + +# +# Message to display when viewing an empty folder. +# +# Default: (no messages) +empty-message=(no messages) + +# Message to display when no folders exists or are all filtered +# +# Default: (no folders) +empty-dirlist=(no folders) + +# Enable mouse events in the ui, e.g. clicking and scrolling with the mousewheel +# +# Default: false +mouse-enabled=true + +# +# Ring the bell when new messages are received +# +# Default: true +new-message-bell=true + +# Marker to show before a pinned tab's name. +# +# Default: ` +pinned-tab-marker='`' + +# Describes the format string to use for the directory list +# +# Default: %n %>r +dirlist-format=%n %>r + +# List of space-separated criteria to sort the messages by, see *sort* +# command in *aerc*(1) for reference. Prefixing a criterion with "-r " +# reverses that criterion. +# +# Example: "from -r date" +# +# Default: "" +sort= + +# Moves to next message when the current message is deleted +# +# Default: true +next-message-on-delete=true + +# The directories where the stylesets are stored. It takes a colon-separated +# list of directories. +# +# default: /usr/local/share/aerc/stylesets/ +stylesets-dirs=/usr/share/aerc/stylesets/ + +# Sets the styleset to use for the aerc ui elements. +# +# Default: default +styleset-name=default + +[viewer] +# +# Specifies the pager to use when displaying emails. Note that some filters +# may add ANSI codes to add color to rendered emails, so you may want to use a +# pager which supports ANSI codes. +# +# Default: less -R +pager=less -x 2 -Fir + +# +# If an email offers several versions (multipart), you can configure which +# mimetype to prefer. For example, this can be used to prefer plaintext over +# html emails. +# +# Default: text/plain,text/html +alternatives=text/plain,text/html + +# +# Default setting to determine whether to show full headers or only parsed +# ones in message viewer. +# +# Default: false +show-headers=false + +# +# Layout of headers when viewing a message. To display multiple headers in the +# same row, separate them with a pipe, e.g. "From|To". Rows will be hidden if +# none of their specified headers are present in the message. +# +# Default: From|To,Cc|Bcc,Date,Subject +header-layout=From|To,Cc|Bcc,Date,Subject + +# Whether to always show the mimetype of an email, even when it is just a single part +# +# Default: false +always-show-mime=false + +# How long to wait after the last input before auto-completion is triggered. +# +# Default: 250ms +completion-delay=250ms + +# +# Global switch for completion popovers +# +# Default: true +completion-popovers=true + +[compose] +# +# Specifies the command to run the editor with. It will be shown in an embedded +# terminal, though it may also launch a graphical window if the environment +# supports it. Defaults to $EDITOR, or vi. +editor=nvim + +# +# Default header fields to display when composing a message. To display +# multiple headers in the same row, separate them with a pipe, e.g. "To|From". +# +# Default: To|From,Subject +header-layout=To|From,Subject,Cc|Bcc + +# +# Specifies the command to be used to tab-complete email addresses. Any +# occurrence of "%s" in the address-book-cmd will be replaced with what the +# user has typed so far. +# +# The command must output the completions to standard output, one completion +# per line. Each line must be tab-delimited, with an email address occurring as +# the first field. Only the email address field is required. The second field, +# if present, will be treated as the contact name. Additional fields are +# ignored. +address-book-cmd=khard email --parsable --search-in-source-files --remove-first-line %s + +[filters] +# +# Filters allow you to pipe an email body through a shell command to render +# certain emails differently, e.g. highlighting them with ANSI escape codes. +# +# The first filter which matches the email's mimetype will be used, so order +# them from most to least specific. +# +# You can also match on non-mimetypes, by prefixing with the header to match +# against (non-case-sensitive) and a comma, e.g. subject,text will match a +# subject which contains "text". Use header,~regex to match against a regex. +subject,~^\[PATCH=awk -f /usr/share/aerc/filters/hldiff +text/html=/usr/share/aerc/filters/html +text/*=awk -f /usr/share/aerc/filters/plaintext +#image/*=catimg -w $(tput cols) - + +[triggers] +# +# Triggers specify commands to execute when certain events occur. +# +# Example: +# new-email=exec notify-send "New email from %n" "%s" + +# +# Executed when a new email arrives in the selected folder +new-email=exec notify-send "aerc: you have a new email" + +[templates] +# Templates are used to populate email bodies automatically. +# + +# The directories where the templates are stored. It takes a colon-separated +# list of directories. +# +# default: /usr/local/share/aerc/templates/ +template-dirs=/home/earne/.config/aerc/templates:/usr/share/aerc/templates/ + +# The template to be used for quoted replies. +# +# default: quoted_reply +quoted-reply=quoted_reply + +# The template to be used for forward as body. +# +# default: forward_as_body +forwards=forward_as_body diff --git a/aerc/.config/aerc/binds.conf b/aerc/.config/aerc/binds.conf new file mode 100644 index 0000000..2a562ed --- /dev/null +++ b/aerc/.config/aerc/binds.conf @@ -0,0 +1,130 @@ +# Binds are of the form = +# To use '=' in a key sequence, substitute it with "Eq": "" +# If you wish to bind #, you can wrap the key sequence in quotes: "#" = quit + = :prev-tab + = :next-tab + = :term + +[messages] +q = :quit +Q = :exec mbsync -a + +j = :next + = :next + = :next 50% + = :next 100% + = :next -s 100% + +k = :prev + = :prev + = :prev 50% + = :prev 100% + = :prev -s 100% +g = :select 0 +G = :select -1 + +J = :next-folder +K = :prev-folder + +v = :mark -t +V = :mark -v + + = :view +D = :delete +dt = :mvTrash +dg = :mv[Gmail]/Trash +dd = :mvDeleted +A = :archive flat +a = :archive year + +#C = :compose +C = :compose -Tnew + +rr = :reply -a +rq = :reply -aq +Rr = :reply +Rq = :reply -q +rt = :reply -a -Tthanks +Rt = :reply -qa -Tquoted_thanks +rp = :reply -a -Ttop-posting +Rp = :reply -Ttop-posting + +c = :cf +$ = :term +! = :term +| = :pipe + +/ = :search +\ = :filter +n = :next-result +N = :prev-result + +[view] +q = :close +| = :pipe +D = :delete +dt = :mvTrash +dg = :mv[Gmail]/Trash +dd = :mvDeleted +S = :save +A = :archive flat +a = :archive year + +f = :forward +rr = :reply -a +rq = :reply -aq +Rr = :reply +Rq = :reply -q +rt = :reply -a -Tthanks +Rt = :reply -qa -Tquoted_thanks +rp = :reply -a -Ttop-posting +Rp = :reply -Ttop-posting + +H = :toggle-headers + = :prev-part + = :next-part +J = :next +K = :prev + +O = :open + +[compose] +# Keybindings used when the embedded terminal is not selected in the compose +# view +$ex = + = :prev-field + = :next-field + = :next-field + +[compose::editor] +# Keybindings used when the embedded terminal is selected in the compose view +$noinherit = true +$ex = + = :prev-field + = :next-field + = :prev-tab + = :next-tab + +[compose::review] +# Keybindings used when reviewing a message to be sent +y = :send +n = :abort +p = :postpone +q = :abort +e = :edit +a = :attach +# In-Reply-To header: +r = :header -f In-Reply-To +# set patch headers for sourcehut +pp = :header -f X-Sourcehut-Patchset-Update PROPOSED +pn = :header -f X-Sourcehut-Patchset-Update NEEDS_REVISION +pr = :header -f X-Sourcehut-Patchset-Update APPROVED +pa = :header -f X-Sourcehut-Patchset-Update APPLIED +px = :header -f X-Sourcehut-Patchset-Update REJECTED + +[terminal] +$noinherit = true +$ex = + + = :prev-tab + = :next-tab diff --git a/aerc/.config/aerc/templates/forward_as_body b/aerc/.config/aerc/templates/forward_as_body new file mode 100644 index 0000000..de05ab2 --- /dev/null +++ b/aerc/.config/aerc/templates/forward_as_body @@ -0,0 +1,5 @@ +X-Mailer: aerc {{version}} + +Forwarded message from {{(index .OriginalFrom 0).Name}} on {{dateFormat .OriginalDate "Mon Jan 2, 2006 at 3:04 PM"}}: +{{wrapText .OriginalText 72}} + diff --git a/aerc/.config/aerc/templates/new b/aerc/.config/aerc/templates/new new file mode 100644 index 0000000..8c162bb --- /dev/null +++ b/aerc/.config/aerc/templates/new @@ -0,0 +1,3 @@ +X-Mailer: aerc {{version}} + + diff --git a/aerc/.config/aerc/templates/patch.sh b/aerc/.config/aerc/templates/patch.sh new file mode 100755 index 0000000..4cd0f5c --- /dev/null +++ b/aerc/.config/aerc/templates/patch.sh @@ -0,0 +1,7 @@ +REMOTE_URL=$(git remote get-url --push origin) +COMMITS=$(git reflog -2 $(git for-each-ref --format='%(upstream:short)' $(git symbolic-ref -q HEAD)) --pretty=format:%h | xargs printf '%s <- %s') +CURRENT_BRANCH=$(git branch --show-current) +UPSTREAM_BRANCH=$(git for-each-ref --format='%(upstream:short)' $(git symbolic-ref -q HEAD) | sed 's#^[^/]*/##g') +echo "On $REMOTE_URL: + $COMMITS ($CURRENT_BRANCH -> $UPSTREAM_BRANCH)" + diff --git a/aerc/.config/aerc/templates/quoted_reply b/aerc/.config/aerc/templates/quoted_reply new file mode 100644 index 0000000..4b4aba9 --- /dev/null +++ b/aerc/.config/aerc/templates/quoted_reply @@ -0,0 +1,5 @@ +X-Mailer: aerc {{version}} + +Op {{ dateFormat (.OriginalDate | toLocal) "2006-01-02 om 15:04 MST" }}, schreef {{ (index .OriginalFrom 0).Name }}: +{{ wrapText .OriginalText 72 | quote }} + diff --git a/aerc/.config/aerc/templates/quoted_thanks b/aerc/.config/aerc/templates/quoted_thanks new file mode 100644 index 0000000..9a918aa --- /dev/null +++ b/aerc/.config/aerc/templates/quoted_thanks @@ -0,0 +1,8 @@ +X-Mailer: aerc {{version}} +X-Sourcehut-Patchset-Update: APPLIED + +Thanks! + +{{ exec "~/.config/aerc/templates/patch.sh" "" }} +Op {{ dateFormat (.OriginalDate | toLocal) "2006-01-02 om 15:04 MST" }}, schreef {{ (index .OriginalFrom 0).Name }}: +{{ wrapText .OriginalText 72 | quote }} diff --git a/aerc/.config/aerc/templates/thanks b/aerc/.config/aerc/templates/thanks new file mode 100644 index 0000000..1970177 --- /dev/null +++ b/aerc/.config/aerc/templates/thanks @@ -0,0 +1,6 @@ +X-Mailer: aerc {{version}} +X-Sourcehut-Patchset-Update: APPLIED + +Thanks! + +{{ exec "~/.config/aerc/templates/patch.sh" "" }} diff --git a/git/.config/git/.gitignore b/git/.config/git/.gitignore new file mode 100644 index 0000000..536aca3 --- /dev/null +++ b/git/.config/git/.gitignore @@ -0,0 +1 @@ +secret \ No newline at end of file diff --git a/git/.config/git/config b/git/.config/git/config new file mode 100644 index 0000000..a7f05b7 --- /dev/null +++ b/git/.config/git/config @@ -0,0 +1,78 @@ +[include] + path = ~/.config/git/secret + +# include something like this in the above file: +#[sendemail] +# smtpserver = mail.example.com +# smtpuser = +# smtpencryption = tls +# smtpserverport = 587 +# annotate = yes + +[user] + email = me@earne.link + name = earnest ma + signingkey = BF66E5C8A1416E2A857C774CA343F43342EB6E2A + +[core] + autocrlf = false + quotepath = false + commitGraph = true + longpaths = true + editor = nvim + hooksPath = ~/.config/git/hooks + +[diff] + tool = bat + +[init] + defaultBranch = main + +[commit] + gpgsign = true + verbose = true + +[fetch] + prune = true + +[pull] + ff = only + +[push] + default = current + +[status] + submodulesummary = true + +[help] + autocorrect = 20 + +[gc] + writeCommitGraph = true + +[color] + ui = true + +[filter "lfs"] + clean = git-lfs clean -- %f + smudge = git-lfs smudge -- %f + process = git-lfs filter-process + required = true + +[alias] + checkup = !git log -1 && (git fetch --all 2>/dev/null || true) && git status + fuckit = reset --hard + setup = !git init && git commit --allow-empty -m \"Initial commit\" + e = commit --allow-empty-message -m '' + br = branch + co = checkout + ca = commit --amend + cd = commit -eF .git/draft + ce = commit --allow-empty-message -m '' + cm = commit + di = diff + lg = log + mg = merge + pu = push + pl = pull + st = status diff --git a/git/.config/git/hooks/post-commit b/git/.config/git/hooks/post-commit new file mode 100755 index 0000000..a0dcc1d --- /dev/null +++ b/git/.config/git/hooks/post-commit @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +COMMIT_INFO=$(git log -1 HEAD --format=reference) +notify-send 'Git commit: ' "$COMMIT_INFO" -u low diff --git a/shell_common/.config/shell_common/aliases.sh b/shell_common/.config/shell_common/aliases.sh new file mode 100644 index 0000000..ffb9b1f --- /dev/null +++ b/shell_common/.config/shell_common/aliases.sh @@ -0,0 +1,28 @@ + +# From https://mastodon.xyz/@CarlCravens/105758509287927276 +alias clear='clear; tput cup $LINES 0' + +alias camoff='sudo modprobe -r uvcvideo' # sudo rmmod -f uvcvideo +alias camon='sudo modprobe uvcvideo' + +alias clip="xclip -sel clip" + +ahbh(){ + git rev-list --left-right --count \ + "$(git remote show origin | sed -n '/HEAD branch/s/.*: //p')"..."$(git branch --show-current)" +} + +alias pu='git push' +alias st='git st' + +foldersize(){ + du -sh "$@" +} + +tmm(){ + if [ -z "$1" ]; then + tmux attach-session -t 0 || tmux + else + tmux attach-session -t "$1" || tmux new-session -t "$1" || tmux + fi +} diff --git a/tmux/.config/tmux/tmux.conf b/tmux/.config/tmux/tmux.conf new file mode 100644 index 0000000..0411fb6 --- /dev/null +++ b/tmux/.config/tmux/tmux.conf @@ -0,0 +1,77 @@ +# May not be loaded on older versions of tmux + +set -g default-terminal "tmux-256color" + +# status powerline-like theme, no dependencies. +set -g status on +set -g status-bg '#232629' +set -g status-fg colour7 +set -g status-left '#[fg=colour235,bg=colour4,bold] #S #[fg=colour4,bg=colour235,nobold]' +set -g window-status-format "#[default] #I #[fg=colour240] #[default]#W " +set -g window-status-bell-style "bold" +set -g window-status-current-format "#[fg=colour235,bg=colour6]#[fg=colour235,bg=colour6,bold] #I  #[fg=colour235]#W #[fg=colour6,bg=colour235,nobold]" +set -g status-right '#{prefix_highlight}#[fg=colour6,bg=colour235]#[fg=colour235,bg=colour6] #{=21:pane_title} #[fg=colour4,bg=colour6,nobold]#[fg=colour235,bg=colour4] %H:%M ' + +set -g @prefix_highlight_output_prefix "#[fg=colour4]#[bg=colour235]#[bg=colour4]#[fg=colour235]" +set -g @prefix_highlight_output_suffix "" +set -g @prefix_highlight_prefix_prompt " " + +# No delay between hitting +set-option -s escape-time 0 + +# Mouse support +set-option -g mouse on + +# Start with 1 instead of 0 +set -g base-index 1 +set -g pane-base-index 1 + +# Panes +bind | split-window -h -c "#{pane_current_path}" +bind - split-window -v -c "#{pane_current_path}" +unbind '"' +unbind % + +bind -n M-Left select-pane -L +bind -n M-Right select-pane -R +bind -n M-Up select-pane -U +bind -n M-Down select-pane -D + +# Windows +bind c new-window -c "#{pane_current_path}" + +bind -n M-S-Right select-window -n +bind -n M-S-Left select-window -p + +# set-option -g allow-rename off # Don't autorename windows +set -g renumber-windows on + +# Show menu of URLs to open from the visible pane - needs `urlview' +bind u capture-pane \;\ + save-buffer /tmp/tmux-buffer \;\ + split-window -l 10 "urlscan /tmp/tmux-buffer" + +# Allow programs with their own scrollback to scroll properly +bind-key -n WheelUpPane \ + if-shell -Ft= "#{?pane_active,0,1}" "select-pane -t=" \; \ + if-shell -Ft= "#{pane_in_mode}" \ + "send-keys -M ; send-keys -M ; send-keys -M" \ + "if-shell -Ft= \"#{mouse_any_flag}\" \ + \"send-keys -M\" \ + \"if-shell -Ft= '#{alternate_on}' \ + 'send-keys Up Up Up' \ + 'copy-mode -e'\"" + +bind-key -n WheelDownPane \ + if-shell -Ft= "#{?pane_active,0,1}" "select-pane -t=" \; \ + if-shell -Ft= "#{pane_in_mode}" \ + "send-keys -M ; send-keys -M ; send-keys -M" \ + "if-shell -Ft= \"#{mouse_any_flag}\" \ + \"send-keys -M\" \ + \"if-shell -Ft= '#{alternate_on}' \ + 'send-keys Down Down Down'\"" + +# source `.tmux.conf` file - as suggested in `man tmux` +bind-key R run-shell ' \ + tmux source-file $XDG_CONFIG_HOME/tmux/tmux.conf > /dev/null; \ + tmux display-message "sourced tmux.conf"' diff --git a/vscodium/.config/VSCodium/product.json b/vscodium/.config/VSCodium/product.json new file mode 100644 index 0000000..38ef53f --- /dev/null +++ b/vscodium/.config/VSCodium/product.json @@ -0,0 +1,9 @@ +{ + "extensionsGallery": { + "serviceUrl": "https://marketplace.visualstudio.com/_apis/public/gallery", + "cacheUrl": "https://vscode.blob.core.windows.net/gallery/index", + "itemUrl": "https://marketplace.visualstudio.com/items", + "controlUrl": "", + "recommendationsUrl": "" + } + } diff --git a/zsh/.zprofile b/zsh/.zprofile new file mode 100644 index 0000000..3b1615e --- /dev/null +++ b/zsh/.zprofile @@ -0,0 +1,29 @@ +# If you make changes to this, it's probably a good idea to log out. + +[ -f $HOME/.nix-profile/etc/profile.d/nix.sh ] && source \ + $HOME/.nix-profile/etc/profile.d/nix.sh + +pathadd_head() { + if [ -d "$1" ] && ! echo "$PATH" | grep -q "$1" >/dev/null; then + PATH="$1${PATH:+":$PATH"}" + fi +} + +pathadd_tail() { + if [ -d "$1" ] && ! echo "$PATH" | grep -q "$1" >/dev/null; then + PATH="${PATH:+"$PATH:"}$1" + fi +} + +export EDITOR=nvim +#export PAGER=bat +export MANPAGER="sh -c 'col -bx | bat -l man -p'" + +pathadd_tail '/envs/bin' +pathadd_head "$HOME/.local/bin" +pathadd_head '/tmp/bin' + +# Preferences +export CALIBRE_USE_SYSTEM_THEME=1 + +export PATH diff --git a/zsh/.zshenv b/zsh/.zshenv new file mode 100644 index 0000000..37caaa9 --- /dev/null +++ b/zsh/.zshenv @@ -0,0 +1,9 @@ +# `.zshenv' is sourced on all invocations of the shell, unless the -f +# option is set. It should contain commands to set the command search +# path, plus other important environment variables. + +# `.zshenv' should not contain commands that produce output or assume +# the shell is attached to a tty. + +# These functions add a directory to $PATH if it exists and it isn't already +# there. diff --git a/zsh/.zshrc b/zsh/.zshrc new file mode 100644 index 0000000..ca4364e --- /dev/null +++ b/zsh/.zshrc @@ -0,0 +1,88 @@ +# `.zshrc' is sourced in interactive shells. It should contain +# commands to set up aliases, functions, options, key bindings, etc. + +# If not running interactively, don't do anything +[[ $- != *i* ]] && return + +autoload -U colors && colors +autoload -Uz promptinit && promptinit +autoload -U compinit && compinit + +# Init plugin handling +[ -f $HOME/.local/share/miniplug.zsh ] && curl \ + -sL --create-dirs \ + https://git.sr.ht/~yerinalexey/miniplug/blob/master/miniplug.zsh \ + -o $HOME/.local/share/miniplug.zsh +source "$HOME/.local/share/miniplug.zsh" + +# Use emacs keybindings even if our EDITOR is set to vi +bindkey -e + +bindkey "^[[1;5C" forward-word +bindkey "^[[1;5D" backward-word +bindkey -s '^L' '^Uclear^M' # clear using alias + +autoload edit-command-line; zle -N edit-command-line +bindkey '^k' edit-command-line + +# History +HISTORY_IGNORE="(ls|cd|pwd|exit|sudo reboot|history|cd -|cd ..)" +HISTFILE="$HOME/.zsh_history" +HISTSIZE=99999 +SAVEHIST=90000 +setopt extended_history # record timestamp of command in HISTFILE +setopt hist_expire_dups_first # delete duplicates first when HISTFILE size exceeds HISTSIZE +setopt hist_ignore_dups # Don't add duplicate entries +setopt hist_ignore_space # ignore commands that start with space +setopt hist_verify # show command with history expansion to user before running it +setopt inc_append_history # add commands to HISTFILE in order of execution +setopt share_history # share command history data +setopt hist_find_no_dups # don't display duplicates in reverse search +setopt hist_reduce_blanks # remove superfluous blanks + +setopt interactivecomments # Comments in the interactive shell +setopt auto_continue # Send CONT signal automatically when disowning jobs +# pushd +setopt pushd_ignore_dups +export DIRSTACKSIZE=20 +setopt auto_pushd + +# Load aliases +source "$HOME/.config/shell_common/aliases.sh" + +# zsh-specific aliases +# clear zsh history: Adapted from Novimatrem: https://gitlab.com/Novimatrem/clear-bash-history +alias czh="echo 'Fully clearing history, then exiting...' && cat /dev/null > $XDG_CACHE_HOME/zshhistory && history -p && exit" + +# Completion +_comp_options+=(globdots) # include hidden files + +# reload the zsh session. From OMZ:plugins/zsh_reload +zreload() { + local cache="$ZSH_CACHE_DIR" + autoload -U compinit zrecompile + compinit -i -d "$cache/zcomp-$HOST" + + for f in ${ZDOTDIR:-~}/.zshrc "$cache/zcomp-$HOST"; do + zrecompile -p $f && command rm -f $f.zwc.old + done + + # Use $SHELL if available; remove leading dash if login shell + [[ -n "$SHELL" ]] && exec ${SHELL#-} || exec zsh +} + +# PLUGINS! +# `miniplug update` + +miniplug plugin 'zsh-users/zsh-syntax-highlighting' +miniplug plugin 'hlissner/zsh-autopair' + +miniplug theme 'tjquillan/pastel' + +miniplug load + +# auto cd must be set later +setopt AUTO_CD + +# Hooks +eval "$(direnv hook zsh)"