-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathzshrc
65 lines (55 loc) · 1.57 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
# rc file for zsh
# plugins
plugins=(
git
ubuntu
fzf-tab
zsh-syntax-highlighting
zsh-autosuggestions
zsh-history-substring-search
)
# pure zsh theme
ZSH_THEME=""
source $ZSH/oh-my-zsh.sh
fpath+=("$HOME/.zsh/pure")
autoload -U promptinit; promptinit
prompt pure
# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/home/ezhang/miniconda3/bin/conda' 'shell.zsh' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
eval "$__conda_setup"
else
if [ -f "/home/ezhang/miniconda3/etc/profile.d/conda.sh" ]; then
. "/home/ezhang/miniconda3/etc/profile.d/conda.sh"
else
export PATH="/home/ezhang/miniconda3/bin:$PATH"
fi
fi
unset __conda_setup
# <<< conda initialize <<<
# Make background color work in vim in tmux
alias tmux='tmux -2'
# Replace `ls` with `eza`
# https://github.com/eza-community/eza
alias ls='eza'
# Replace `cat` with `bat`
# https://github.com/sharkdp/bat
alias cat='bat --color=always --style="header,grid"'
# fzf
alias fzf='fzf --height 40% --layout=reverse --border --preview "bat --color=always --style=numbers --line-range=:100 {}"'
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
# For fzf-tab
# disable sort when completing `git checkout`
zstyle ':completion:*:git-checkout:*' sort false
# preview directory's content with exa when completing cd
zstyle ':fzf-tab:complete:cd:*' fzf-preview 'exa -1 --color=always $realpath'
# Copy file contents
function cpf() {
if [ -n "$1" ]
then
/bin/cat $1 | clipboard
else
echo "Please specify file to copy."
fi
}