]> git.cameronkatri.com Git - dotfiles.git/blob - .zshrc
f6f71df0e2b323a7503c33dec4da786490fa7c09
[dotfiles.git] / .zshrc
1 # Copyright (c) 2021 Cameron Katri
2 # All rights reserved.
3 #
4 # Redistribution and use in source and binary forms, with or without
5 # modification, are permitted provided that the following conditions
6 # are met:
7 # 1. Redistributions of source code must retain the above copyright
8 # notice, this list of conditions and the following disclaimer.
9 # 2. Redistributions in binary form must reproduce the above copyright
10 # notice, this list of conditions and the following disclaimer in the
11 # documentation and/or other materials provided with the distribution.
12 #
13 # THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14 # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16 # ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17 # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18 # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19 # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20 # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21 # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22 # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23 # SUCH DAMAGE.
24 #
25
26 export ZSH="$HOME/.oh-my-zsh"
27 ZSH_THEME="spaceship"
28 DISABLE_LS_COLORS="true"
29 plugins=(git man mosh)
30 source $ZSH/oh-my-zsh.sh
31
32 SPACESHIP_PROMPT_ORDER=(time user dir host git package node docker venv pyenv exec_time line_sep battery vi_mode jobs exit_code char)
33
34 export LANG=en_US.UTF-8
35
36 # Various editors and fix aliases with sudo
37 export EDITOR=nvim
38 bindkey '^E' edit-command-line
39 alias code='code-oss'
40 alias sudo='sudo '
41 alias icat="kitty +kitten icat"
42 alias fuzz="fzf --preview 'bat --style=numbers,changes --color=always --line-range :500 {}' --preview-window=right:66%"
43 alias sort='LC_ALL=C sort'
44 # https://reviews.freebsd.org/D30545
45 alias diff='LC_ALL=C TZ=UTC diff --color=auto'
46 alias ls='ls --color=auto -F'
47
48 # Setup LSCOLORS, LS_COLORS and completion
49 # https://reviews.freebsd.org/D30547
50 # https://git.cameronkatri.com/opendircolors
51 test -r ~/.nord_colors && eval $(opendircolors ~/.nord_colors)
52 zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}
53
54 # Use the correct key with git
55 export GIT_SSH_COMMAND='ssh -i ~/.ssh/git -o IdentitiesOnly=yes'
56
57 # Qt Theme
58 export QT_QPA_PLATFORMTHEME=gtk2
59
60 setopt AUTO_CD
61 cdpath=(. ~/Documents)
62
63 setxkbmap -option compose:rctrl
64
65 export GPG_TTY=$(tty)
66
67 export GOPATH=$HOME/Documents/go
68
69 export PATH="$HOME/.local/bin:/usr/local/libexec/ccache:$PATH"
70 export PATH="$GOPATH/bin:$PATH"
71 typeset -U path
72
73 # Completion for kitty
74 kitty + complete setup zsh | source /dev/stdin
75
76 export LESS='-FiMRx2$z-4$Dd+c$Du+g'
77
78 # https://reviews.freebsd.org/D30341
79 if ! mount -t fusefs --libxo=json | \
80 jq -e '.mount.mounted[] | select(.node == "/usr/home/cameron/Documents/smbnetfs")' >/dev/null; then
81 smbnetfs $HOME/Documents/smbnetfs
82 fi
83
84 source ~/.proenv.zsh
85
86 function x86_64-linux-gnu-env() {
87 export CC='clang --target=x86_64-linux-gnu' CFLAGS='--sysroot=/usr/compat/debian -isystem /usr/compat/debian/usr/lib/gcc/x86_64-linux-gnu/8/include/ -isystem /usr/compat/debian/usr/lib/gcc/x86_64-linux-gnu/8/include-fixed/ -g -W -Wall -Wmissing-prototypes -Wstrict-prototypes -Wwrite-strings -Wno-unused-parameter' CPPFLAGS='--sysroot=/usr/compat/debian -isystem /usr/compat/debian/usr/lib/gcc/x86_64-linux-gnu/8/include/ -isystem /usr/compat/debian/usr/lib/gcc/x86_64-linux-gnu/8/include-fixed/ -g -W -Wall -Wmissing-prototypes -Wstrict-prototypes -Wwrite-strings -Wno-unused-parameter' LDFLAGS='--sysroot=/usr/compat/debian -isystem /usr/compat/debian/usr/lib/gcc/x86_64-linux-gnu/8/include/ -isystem /usr/compat/debian/usr/lib/gcc/x86_64-linux-gnu/8/include-fixed/' LD='ld --target=x86_64-linux-gnu' AR='llvm-ar' NM='llvm-nm'
88 }
89
90 source /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
91 source /usr/local/share/zsh-autosuggestions/zsh-autosuggestions.zsh
92
93 source /usr/local/share/examples/fzf/shell/completion.zsh
94
95 PROG=tea _CLI_ZSH_AUTOCOMPLETE_HACK=1 source $HOME/.config/tea/autocomplete.zsh
96
97 # I don't regularly check my system mail so give me an alert
98 if mail -e; then
99 echo "You have mail!"
100 fi
101
102 export CVS_RSH=ssh
103
104 alias dotconfig='git --git-dir=$HOME/Documents/dotfiles --work-tree=$HOME'