-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.zshrc
108 lines (88 loc) · 3.65 KB
/
.zshrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# Zsh config
export XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}"
export XDG_CACHE_HOME="${XDG_CACHE_HOME:-$HOME/.cache}"
export XDG_DATA_HOME="${XDG_DATA_HOME:-$HOME/.local/share}"
export XDG_STATE_HOME="${XDG_DATA_HOME:-$HOME/.local/state}"
export XDG_CONFIG_RC="${XDG_DATA_HOME}"
# export XDG_ZI_HOME=${XDG_DATA_HOME}/zi
# export ${ZI[HOME_DIR]}=$XDG_ZI_HOME
# if [ ! -d "$XDG_ZI_HOME/bin" ]; then
# mkdir -p "$XDG_ZI_HOME"
# git clone https://github.com/z-shell/zi.git $XDG_ZI_HOME/bin
# fi
# typeset -A ZI
# source "$XDG_ZI_HOME/bin/zi.zsh"
# autoload -Uz _zi
# (( ${+_comps} )) && _comps[zi]=_zi
# oh-my-zsh
ZSH_DIR=~/.zsh
source $ZSH_DIR/oh-my-zsh.sh
source $ZSH_DIR/lib/init.zsh
source $ZSH_DIR/cobalt2.zsh-theme
test -e "/usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" &&
source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
test -e "/usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" &&
source /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
# installed with pacman: zsh-syntax-highlighting[-git]
bindkey -v # shell vim mode (default emacs)
bindkey "^r" history-incremental-pattern-search-backward # history search
export KEYTIMEOUT=1
## Colors
autoload -U colors && colors
zstyle ':completion:*' list-colors 'di=01;34:ln=35:so=32:pi=33:ex=01;32:bd=46;34:cd=43;34:su=41;30:sg=46;30:tw=42;30:ow=43;30' # in completion
## Options
# http://bolyai.cs.elte.hu/zsh-manual/zsh_16.html
setopt MULTIOS
setopt PROMPT_SUBST
## Language
export LANG=en_US.UTF-8
# tmux needs to know the encoding: https://github.com/wernight/powerline-web-fonts/issues/8#issuecomment-353081869
export LC_CTYPE=en_US.UTF-8
if [ "$TERM" = "tmux-256color" ]; then
export DISPLAY=:0
fi
## Paths
export PATH=$HOME/.local/bin:/usr/local/bin:$HOME/.rd/bin:/bin:/usr/bin:/usr/bin/vendor_perl:/usr/sbin:/usr/bin/site_perl:$HOME/.cargo/bin
export PATH="$(du $HOME/scripts/ | cut -f2 | grep -Fve .git -e node_modules -e lib -e data | tr '\n' ':')$PATH"
export CDPATH=.:~:~/code:~/Downloads:~/org:~/org/1_design:~/org/2_project:~/org/3_areas:~/org/4_resources:~/org/4_resources/media:~/scripts:~/.config:~/code/notes:~/.local/org
## Applications
export EDITOR=vim
export PAGER=less
export LESS="-R"
export BROWSER=brave
export B=$BROWSER
export ALT_BROWSER=firefox-developer-edition
# for eslint, see: https://github.com/eslint/eslint/issues/11914#issuecomment-525498682
### Themes
export GTK_THEME=Arc
export BAT_THEME=ansi
### Application options
export FZF_DEFAULT_OPTS="--height 50% --no-mouse --ansi --color=16"
## User specific
export KEYID=B29E6A7A7DFD16FA # GPG keyid
export WEB_HOME=$HOME/code/web
export WEB_SESSION_NAME=web
export WEB_NOTES=$ORG_AREAS/blog/posts
test -f "$HOME/.config/broot/launcher/bash/br" && source $HOME/.config/broot/launcher/bash/br
zstyle ':completion:*' cache-path "$XDG_CACHE_HOME"/zsh/zcompcache
compinit -d "$XDG_CACHE_HOME"/zsh/zcompdump-"$ZSH_VERSION"
# kitty shell integration
test -e "/usr/lib/kitty/shell-integration/kitty.zsh" && source "/usr/lib/kitty/shell-integration/kitty.zsh"
# macos
if [ "$(uname)" = "Darwin" ]; then
# overwrite bsd utils with gnu ones, so I don't have to fix my scripts on every change
# $ brew install coreutils gnu-sed findutils
gnu_overwrite_paths="$(find /usr/local/opt/*/libexec/gnubin -type d | tr '\n' ':')"
if [ -n "$gnu_overwrite_paths" ]; then
export PATH="${gnu_overwrite_paths}${PATH}"
fi
fi
# Import aliases
source $ZSH_DIR/init.zsh
# fpath+=( $ZSH_DIR/functions )
# autoload -Uz tp
# start xorg on first login into the tty
# runs commands in ~/.xinitrc
if [ "$(tty)" = "/dev/tty1" ]; then
pgrep -x Xorg >/dev/null || startx -- -dpi 120
fi