# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc. # Initialization code that may require console input (password prompts, [y/n] # confirmations, etc.) must go above this block; everything else may go below. if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" fi source ~/.config/p10k/powerlevel10k.zsh-theme # Remove older command from the history if a duplicate is to be added. setopt HIST_IGNORE_ALL_DUPS # Prompt for spelling correction of commands. setopt CORRECT # Customize spelling correction prompt. SPROMPT='zsh: correct %F{red}%R%f to %F{green}%r%f [nyae]? ' # Remove path separator from WORDCHARS. WORDCHARS=${WORDCHARS//[\/]} # Use degit instead of git as the default tool to install and update modules. zstyle ':zim:zmodule' use 'degit' # Set a custom prefix for the generated aliases. The default prefix is 'G'. #zstyle ':zim:git' aliases-prefix 'g' # Append `../` to your input for each `.` you type after an initial `..` zstyle ':zim:input' double-dot-expand yes # Set a custom terminal title format using prompt expansion escape sequences. # See http://zsh.sourceforge.net/Doc/Release/Prompt-Expansion.html#Simple-Prompt-Escapes # If none is provided, the default '%n@%m: %~' is used. zstyle ':zim:termtitle' hooks 'preexec' 'precmd' zstyle ':zim:termtitle:preexec' format '${${(A)=1}[1]}' zstyle ':zim:termtitle:precmd' format '%1~' # Customize the style that the suggestions are shown with. # 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) # Customize the main highlighter styles. # See https://github.com/zsh-users/zsh-syntax-highlighting/blob/master/docs/highlighters/main.md#how-to-tweak-it #typeset -A ZSH_HIGHLIGHT_STYLES #ZSH_HIGHLIGHT_STYLES[comment]='fg=242' # ------------------ # Initialize modules # ------------------ if [[ ! -e ${ZIM_HOME}/zimfw.zsh ]]; then # Download zimfw script if missing. command mkdir -p ${ZIM_HOME} if (( ${+commands[curl]} )); then command curl -fsSL -o ${ZIM_HOME}/zimfw.zsh https://github.com/zimfw/zimfw/releases/latest/download/zimfw.zsh else command wget -nv -O ${ZIM_HOME}/zimfw.zsh https://github.com/zimfw/zimfw/releases/latest/download/zimfw.zsh fi fi if [[ ! ${ZIM_HOME}/init.zsh -nt ${ZDOTDIR:-${HOME}}/.zimrc ]]; then # Install missing modules, and update ${ZIM_HOME}/init.zsh if missing or outdated. source ${ZIM_HOME}/zimfw.zsh init -q fi source ${ZIM_HOME}/init.zsh # ------------------------------ # Post-init module configuration # ------------------------------ # Bind ^[[A/^[[B manually so up/down works both before and after zle-line-init bindkey '^[[A' history-substring-search-up bindkey '^[[B' history-substring-search-down # Bind up and down keys zmodload -F zsh/terminfo +p:terminfo if [[ -n ${terminfo[kcuu1]} && -n ${terminfo[kcud1]} ]]; then bindkey ${terminfo[kcuu1]} history-substring-search-up bindkey ${terminfo[kcud1]} history-substring-search-down fi bindkey '^P' history-substring-search-up bindkey '^N' history-substring-search-down bindkey -M vicmd 'k' history-substring-search-up bindkey -M vicmd 'j' history-substring-search-down # End configuration added by Zim install # Executable paths export PATH="$PATH:$HOME/dotfiles/bin" export PATH="$PATH:$HOME/.emacs.d/bin" export PATH="$PATH:$HOME/.cargo/bin" export PATH="$PATH:$HOME/.local/bin" export ANDROID_HOME="$HOME/SDKs/Android" export PATH="$PATH:$ANDROID_HOME/cmdline-tools/tools/bin:$ANDROID_HOME/platform-tools:$ANDROID_HOME/emulator" export PATH="$PATH:$HOME/.gem/ruby/2.7.0/bin" export PATH="$PATH:$HOME/.gem/ruby/3.0.0/bin" export PATH="$PATH:$HOME/go/bin" export PATH="{{ .chezmoi.homeDir }}/perl5/bin${PATH:+:${PATH}}"; export PATH; export PERL5LIB="{{ .chezmoi.homeDir }}/perl5/lib/perl5${PERL5LIB:+:${PERL5LIB}}"; export PERL5LIB; export PERL_LOCAL_LIB_ROOT="{{ .chezmoi.homeDir }}/perl5${PERL_LOCAL_LIB_ROOT:+:${PERL_LOCAL_LIB_ROOT}}"; export PERL_LOCAL_LIB_ROOT; export PERL_MB_OPT="--install_base \"{{ .chezmoi.homeDir }}/perl5\""; export PERL_MB_OPT; export PERL_MM_OPT="INSTALL_BASE={{ .chezmoi.homeDir }}/perl5"; export PERL_MM_OPT; # Additional preferences export LANG=en_GB.UTF-8 export EDITOR='devour emacsclient -c' export VISUAL='devour emacsclient -c' export _JAVA_AWT_WM_NONREPARENTING=1 export MANPAGER="nvim +Man!" export COLUMNS=80 export MANWIDTH=80 CASE_SENSITIVE="false" # Disable dumb Python keyring integration export PYTHON_KEYRING_BACKEND=keyring.backends.null.Keyring #HYPHEN_INSENSITIVE="true" # Uncomment the following line if pasting URLs and other text is messed up. # DISABLE_MAGIC_FUNCTIONS=true # Additional completions compctl -g '~/.teamocil/*(:t:r)' teamocil # Integrate z - jump around source /usr/share/z/z.sh # Ranger conf export RANGER_LOAD_DEFAULT_RC=false # Bunch of aliases alias e="$EDITOR" alias u="linx-client" alias vim="nvim" alias tmp="cd $(mktemp -d)" alias send="rsync -avmzzP" alias tree="exa --tree" alias bat="bat -n --theme base16 --tabs 2" alias mov="ranger ~/Videos/Movies" alias tv="ranger ~/Videos/TV\ Shows" alias yt="ranger ~/Videos/YouTube" alias pass='str="$(pwgen -s 25 1)" && echo "$str" && echo -n "$str" | xclip -selection clipboard' alias secluded="cd ~/repos/sites/secluded/ && hugo --cleanDestinationDir && rsync -avmzz public/ hel1:/var/www/secluded/" alias erase="shred -vzfun 32" alias dl="youtube-dl -f bestvideo+bestaudio --write-sub --write-auto-sub --sub-lang en --sub-format srt/best --convert-subs srt --embed-subs -o '%(upload_date)s %(title)s.%(ext)s'" alias us="unsilence -t 15 -as 1.25" alias roll="roll -v" alias sxiv="sxiv -p" alias tt="tasktimer" alias c="chezmoi" alias t="todo" alias h="hledger" # Additional functions function gi() { curl -sLw n https://www.toptal.com/developers/gitignore/api/$@ ; } function noti() { curl 'https://notify.nixnet.services/message?token={{- .gotify_token -}}' -F "title=$1" -F "message=$2" -F "priority=4" } # Hide the terminal when these apps are opened from a terminal function zathura() { devour zathura "$1" } function inkscape() { devour inkscape "$1" } autoload -U +X bashcompinit && bashcompinit # Necessary for SSH & YubiKey export GPG_TTY="$TTY" export SSH_AUTH_SOCK="/run/user/1000/gnupg/S.gpg-agent.ssh" gpgconf --launch gpg-agent # To customize prompt, run `p10k configure` or edit ~/.p10k.zsh. [[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh (( ! ${+functions[p10k]} )) || p10k finalize