-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathzshrc
executable file
·62 lines (50 loc) · 1.71 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
#!/bin/zsh
export PATH=$HOME/opt/bin:$HOME/bin:/usr/local/bin:/usr/local/sbin:$HOME/.composer/vendor/bin:$PATH
setopt correctall auto_cd
# Vim mode
bindkey -v
export EDITOR="vim"
export AUTOSSH_GATETIME=0
setopt hist_ignore_all_dups inc_append_history
HISTFILE=~/.zsh_history
HISTSIZE=4096
SAVEHIST=4096
# Prompt setup
autoload -U promptinit; promptinit
prompt pure
# Completion
autoload -U compinit; compinit
# Aiases
alias vm="~/smux jstewart.vm.ny5.etsy.com"
alias xdebugoff='sudo sed -i '\''s/.*zend_extension.*/; zend_extension="\/usr\/lib64\/php\/modules7\/xdebug\.so"/'\'' /etc/php7/php.d/xdebug.ini; sudo systemctl restart httpd'
alias xdebugon='sudo sed -i '\''s/.*zend_extension.*/zend_extension="\/usr\/lib64\/php\/modules7\/xdebug\.so"/'\'' /etc/php7/php.d/xdebug.ini; sudo systemctl restart httpd'
alias xdebugstatus='grep '\''; zend_extension="\/usr\/lib64\/php\/modules7\/xdebug\.so"'\'' /etc/php7/php.d/xdebug.ini >/dev/null && echo "xdebug is off" || echo "xdebug is on"'
# FZF Fuzzy Finder
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
# FZF Git functions
source ~/.zsh/fzf-git.zsh
# Fish-like autosuggestions
source ~/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh
bindkey '^F' forward-word
bindkey '^E' autosuggest-execute
source ~/.zsh/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
# Magic Enter
magic-enter () {
if [[ -z $BUFFER ]]; then
echo ""
if git rev-parse --is-inside-work-tree &>/dev/null; then
# untracked files take longer to return so won't show
git status -sbu
# allows file list to show
precmd
else
ls -lh
fi
zle redisplay
else
zle accept-line
fi
}
zle -N magic-enter
bindkey "^M" magic-enter
ZSH_AUTOSUGGEST_CLEAR_WIDGETS+=(magic-enter)