From 8ceda16d9eb3ff274aaf35df700868d3d90269db Mon Sep 17 00:00:00 2001 From: Cameron Katri Date: Sun, 13 Jun 2021 16:11:26 -0400 Subject: Initial dotfiles --- .zshrc | 107 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 107 insertions(+) create mode 100755 .zshrc (limited to '.zshrc') diff --git a/.zshrc b/.zshrc new file mode 100755 index 0000000..90fe865 --- /dev/null +++ b/.zshrc @@ -0,0 +1,107 @@ +# Copyright (c) 2021 Cameron Katri +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# + +export ZSH="$HOME/.oh-my-zsh" +ZSH_THEME="spaceship" +DISABLE_LS_COLORS="true" +plugins=(git man mosh) +source $ZSH/oh-my-zsh.sh + +SPACESHIP_PROMPT_ORDER=(time user dir host git package node docker venv pyenv exec_time line_sep battery vi_mode jobs exit_code char) + +export LANG=en_US.UTF-8 + +# Various editors and fix aliases with sudo +export EDITOR=nvim +bindkey '^E' edit-command-line +alias code='code-oss' +alias sudo='sudo ' +alias icat="kitty +kitten icat" +alias fuzz="fzf --preview 'bat --style=numbers,changes --color=always --line-range :500 {}' --preview-window=right:66%" +alias sort='LC_ALL=C sort' +# https://reviews.freebsd.org/D30545 +alias diff='LC_ALL=C TZ=UTC diff --color=auto' +alias ls='ls --color=auto -F' + +# Setup LSCOLORS, LS_COLORS and completion +# https://reviews.freebsd.org/D30547 +# https://git.cameronkatri.com/opendircolors +test -r ~/.nord_colors && eval $(opendircolors ~/.nord_colors) +zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS} + +# Use the correct key with git +export GIT_SSH_COMMAND='ssh -i ~/.ssh/git -o IdentitiesOnly=yes' + +# Qt Theme +export QT_QPA_PLATFORMTHEME=gtk2 + +setopt AUTO_CD +cdpath=(. ~/Documents) + +setxkbmap -option compose:rctrl + +export GPG_TTY=$(tty) + +export GOPATH=$HOME/Documents/go + +if [ -n "$DESKTOP_SESSION" ];then + eval $(gnome-keyring-daemon --start) + export SSH_AUTH_SOCK +fi + +export PATH="$HOME/.local/bin:/usr/local/libexec/ccache:$PATH" +export PATH="$GOPATH/bin:$PATH" +typeset -U path + +# Completion for kitty +kitty + complete setup zsh | source /dev/stdin + +#autoload -U compinit +#compinit + +export LESS='-FiMRx2$z-4$Dd+c$Du+g' +export LESSOPEN="| source-highlight-esc.sh %s" + +# https://reviews.freebsd.org/D30341 +if ! mount -t fusefs --libxo=json | \ +jq -e '.mount.mounted[] | select(.node == "/usr/home/cameron/Documents/smbnetfs")' >/dev/null; then + smbnetfs $HOME/Documents/smbnetfs +fi + +source ~/.proenv.zsh + +source /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh +source /usr/local/share/zsh-autosuggestions/zsh-autosuggestions.zsh + +source /usr/local/share/examples/fzf/shell/completion.zsh + +PROG=tea _CLI_ZSH_AUTOCOMPLETE_HACK=1 source $HOME/.config/tea/autocomplete.zsh + +# I don't regularly check my system mail so give me an alert +if mail -e; then + echo "You have mail!" +fi + +alias dotconfig='git --git-dir=$HOME/Documents/dotfiles --work-tree=$HOME' -- cgit v1.2.3-56-ge451