From 90e4a570903272849f09e94cdf3f24945016f25d Mon Sep 17 00:00:00 2001 From: Amolith Date: Sun, 28 Nov 2021 19:26:31 -0500 Subject: [PATCH] Add powerlevel10k theme & reorganise --- private_dot_zshrc.tmpl | 153 ++++++++++------------------------------- 1 file changed, 37 insertions(+), 116 deletions(-) diff --git a/private_dot_zshrc.tmpl b/private_dot_zshrc.tmpl index 4e28e2fc0242c2b5ae328ae09443a4fc47b8ab77..d34c54b7b1a7127adab8caa8b5fb9ba54c0e0af3 100644 --- a/private_dot_zshrc.tmpl +++ b/private_dot_zshrc.tmpl @@ -1,93 +1,35 @@ -# Start configuration added by Zim install -# -# User configuration sourced by interactive shells -# - -# ----------------- -# Zsh configuration -# ----------------- +# 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 -# -# History -# +source ~/.config/p10k/powerlevel10k.zsh-theme # Remove older command from the history if a duplicate is to be added. setopt HIST_IGNORE_ALL_DUPS - -# -# Input/output -# - -# Set editor default keymap to emacs (`-e`) or vi (`-v`) -bindkey -e - # 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]? ' - +SPROMPT='zsh: correct %F{red}%R%f to %F{green}%r%f [nyae]? ' # Remove path separator from WORDCHARS. WORDCHARS=${WORDCHARS//[\/]} - -# ----------------- -# Zim configuration -# ----------------- - # Use degit instead of git as the default tool to install and update modules. -#zstyle ':zim:zmodule' use 'degit' - -# -------------------- -# Module configuration -# -------------------- - -# -# completion -# - -# Set a custom path for the completion dump file. -# If none is provided, the default ${ZDOTDIR:-${HOME}}/.zcompdump is used. -#zstyle ':zim:completion' dumpfile "${ZDOTDIR:-${HOME}}/.zcompdump-${ZSH_VERSION}" - -# -# git -# - +zstyle ':zim:zmodule' use 'degit' # Set a custom prefix for the generated aliases. The default prefix is 'G'. #zstyle ':zim:git' aliases-prefix 'g' - -# -# input -# - # Append `../` to your input for each `.` you type after an initial `..` zstyle ':zim:input' double-dot-expand yes - -# -# termtitle -# - # 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' format '%1~' - -# -# zsh-autosuggestions -# - +# TODO +#zstyle ':zim:termtitle' format '%1~' # Customize the style that the suggestions are shown with. -# See https://github.com/zsh-users/zsh-autosuggestions/blob/master/README.md#suggestion-highlight-style -#ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=242' - -# -# zsh-syntax-highlighting -# - # 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 @@ -96,7 +38,6 @@ ZSH_HIGHLIGHT_HIGHLIGHTERS=(main brackets) # ------------------ # Initialize modules # ------------------ - if [[ ! -e ${ZIM_HOME}/zimfw.zsh ]]; then # Download zimfw script if missing. command mkdir -p ${ZIM_HOME} @@ -116,10 +57,6 @@ source ${ZIM_HOME}/init.zsh # Post-init module configuration # ------------------------------ -# -# zsh-history-substring-search -# - # 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 @@ -147,51 +84,40 @@ export PATH="$PATH:$ANDROID_HOME/cmdline-tools/tools/bin:$ANDROID_HOME/platform- 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 -# Uncomment the following line if you want to disable marking untracked files -# under VCS as dirty. This makes repository status check for large repositories -# much, much faster. -# DISABLE_UNTRACKED_FILES_DIRTY="true" - -#plugins=( -# git -# golang -# zsh-autosuggestions -# zsh-completions -# lxd-completion-zsh -# fzf-zsh -#) - -# Other completions +# Additional completions compctl -g '~/.teamocil/*(:t:r)' teamocil -#source $ZSH/oh-my-zsh.sh +# Integrate z - jump around source /usr/share/z/z.sh -# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh. -#[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh - -#source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh - # Ranger conf export RANGER_LOAD_DEFAULT_RC=false -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 - +# Bunch of aliases alias e="$EDITOR" alias u="linx-client" alias vim="nvim" @@ -207,34 +133,29 @@ alias secluded="cd ~/repos/sites/secluded/ && hugo --cleanDestinationDir && rsyn 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 dotgit="python3 ~/dotfiles/dotgit/dotgit/__main__.py" alias roll="roll -v" alias dn="notify-send done" alias sxiv="sxiv -p" alias tt="tasktimer" -# devour windows -function zathura() { devour zathura "$1" } -function inkscape() { devour inkscape "$1" } - -# Functions +# 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" } -PATH="{{ .chezmoi.homeDir }}/perl5/bin${PATH:+:${PATH}}"; export PATH; -PERL5LIB="{{ .chezmoi.homeDir }}/perl5/lib/perl5${PERL5LIB:+:${PERL5LIB}}"; export PERL5LIB; -PERL_LOCAL_LIB_ROOT="{{ .chezmoi.homeDir }}/perl5${PERL_LOCAL_LIB_ROOT:+:${PERL_LOCAL_LIB_ROOT}}"; export PERL_LOCAL_LIB_ROOT; -PERL_MB_OPT="--install_base \"{{ .chezmoi.homeDir }}/perl5\""; export PERL_MB_OPT; -PERL_MM_OPT="INSTALL_BASE={{ .chezmoi.homeDir }}/perl5"; export PERL_MM_OPT; autoload -U +X bashcompinit && bashcompinit -complete -o nospace -C /usr/local/bin/bitcomplete bit - # 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