-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathzshrc
More file actions
113 lines (93 loc) · 2.72 KB
/
zshrc
File metadata and controls
113 lines (93 loc) · 2.72 KB
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
109
110
111
112
113
export PAGER="less"
export EDITOR="emacsclient -c -n"
export VISUAL="emacsclient -c -n"
# Aliases
alias t="task"
alias v="vim"
alias g="git"
alias l="ls"
alias c="cd"
alias e="emacsclient -r -n"
alias en="emacsclient -c -n"
alias dc="docker-compose"
alias mux="tmuxinator"
if ~/.scripts/command_is_available trash-put; then
alias rm="trash-put"
fi
# remove command lines from the history list when the first character on the
# line is a space
setopt histignorespace
# load zgen
source "${HOME}/.zgen/zgen.zsh"
#theme
source "${HOME}/dotfiles/settings/maxtheme"
source "${HOME}/.profile"
# check if there's no init script
if ! zgen saved; then
echo "Creating a zgen save"
zgen oh-my-zsh
# plugins
zgen oh-my-zsh plugins/git
zgen oh-my-zsh plugins/sudo
zgen load zsh-users/zsh-syntax-highlighting
zgen oh-my-zsh plugins/vi-mode
zgen oh-my-zsh plugins/tmux
zgen oh-my-zsh plugins/docker
zgen oh-my-zsh plugins/docker-compose
zgen oh-my-zsh plugins/asdf
zgen oh-my-zsh plugins/yarn
zgen oh-my-zsh plugins/rvm
# completions
zgen load zsh-users/zsh-completions src
zgen load zsh-users/zsh-autosuggestions
# theme
#zgen oh-my-zsh themes/arrow
# save all to init script
zgen save
fi
# if $LANG isnt set set it to en_US.UTF-8
if [[ -z "$LANG" ]]; then
export LANG='en_US.UTF-8'
fi
# Load FZF when available
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
# PATH setting
PATH=$PATH:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/usr/local/git/bin:/usr/bin/vendor_perl:/usr/bin/core_perl
PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting
PATH=$PATH:$HOME/.scripts
PATH=$PATH:$HOME/.bin
PATH=$PATH:$HOME/.bin
PATH=$PATH:$HOME/.config/yarn/global/node_modules/.bin
#chpwd is called after changing directories
function chpwd(){
#call ls after cd
ls;
}
# direnv integration
eval "$(direnv hook zsh)"
## [Completion]
## Completion scripts setup. Remove the following line to uninstall
[[ -f /home/max/.dart-cli-completion/zsh-config.zsh ]] && . /home/max/.dart-cli-completion/zsh-config.zsh || true
## [/Completion]
## [Emacs]
# Emacs Eat integration
[ -n "$EAT_SHELL_INTEGRATION_DIR" ] && \
source "$EAT_SHELL_INTEGRATION_DIR/zsh"
vterm_printf() {
if [ -n "$TMUX" ] && ([ "${TERM%%-*}" = "tmux" ] || [ "${TERM%%-*}" = "screen" ]); then
# Tell tmux to pass the escape sequences through
printf "\ePtmux;\e\e]%s\007\e\\" "$1"
elif [ "${TERM%%-*}" = "screen" ]; then
# GNU screen (screen, screen-256color, screen-256color-bce)
printf "\eP\e]%s\007\e\\" "$1"
else
printf "\e]%s\e\\" "$1"
fi
}
# Emacs Vterm integration
vterm_prompt_end() {
vterm_printf "51;A$(whoami)@$(hostname):$(pwd)"
}
setopt PROMPT_SUBST
PROMPT=$PROMPT'%{$(vterm_prompt_end)%}'
## [/Emacs]