-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy path.zshrc
50 lines (40 loc) · 1.11 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
# completion
autoload -Uz compinit && compinit
# path to your oh-my-zsh installation.
export ZSH="$HOME/.oh-my-zsh"
source $ZSH/oh-my-zsh.sh
# fzf reverse search
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
# term
export EDITOR=nvim
export VISUAL=nvim
# aliases
alias vim='nvim'
alias vi='nvim'
alias v='f -e nvim'
alias bn='git checkout -B'
alias cpdir='cp -a'
alias ds='dirs -v'
alias df='df -kTh'
alias sp='source ~/.zshrc'
alias sf='l | fzf'
alias ls='ls -G'
alias l='ls -G -l -a'
# tmux
function tn() {tmux new -s "$1"}
function tls() {tmux ls}
function tk-all() {tmux ls | grep : | cut -d. -f1 | awk '{print substr($1, 0, length($1)-1)}' | xargs kill}
function tk() {tmux kill-session -t "$1"}
function td() {tmux detach}
function ta() {tmux a -t "$1"}
# prompt
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
setopt PROMPT_SUBST
PROMPT='%F{blue}%~%F{green}$(parse_git_branch) %F{reset}'
# navigation
eval "$(fasd --init auto)"
# paths
export GOPATH=$HOME/Go
export PATH=$PATH:$GOPATH/bin:$HOME/.cargo/bin:$HOME/Library/Python/3.8/bin:/usr/local/go/bin:$GOPATH/bin:$HOME/.local/bin