-
Notifications
You must be signed in to change notification settings - Fork 0
/
zshrc
66 lines (51 loc) · 2.1 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
# .zshrc
source ~/.dotfiles/zsh/env.zsh
source ~/.dotfiles/zsh/path.zsh
source ~/.dotfiles/zsh/aliases.zsh
source ~/.dotfiles/zsh/completions.zsh
source ~/.dotfiles/zsh/bindings.zsh
source ~/.dotfiles/zsh/colored-man-pages.zsh
# Prompt
autoload -U promptinit; promptinit
prompt pure
# Primary prompt with additional tweaks.
typeset -g PROMPT='%(?.%F{white}.%F{red})❯%f '
# cd by typing directory name if it's not a command
setopt auto_cd
# Do not overwrite files when redirecting using ">". Note that you can still override this with ">|"
set -o noclobber
# Enable extended glob
setopt extendedglob
# Remove older duplicate entries from history
setopt hist_ignore_all_dups
# Remove superfluous blanks from history items
setopt hist_reduce_blanks
# Show command with history expansion to user before running it
setopt hist_verify
# share history between different instances of the shell
setopt share_history
# Enable Ctrl-x-e to edit command line
autoload -U edit-command-line
# VI style:
zle -N edit-command-line
bindkey -M vicmd v edit-command-line
# Terminal title
DISABLE_AUTO_TITLE="true"
function _set_terminal_title() {
local title="$(basename "$PWD")"
if [[ -n $SSH_CONNECTION ]]; then
title="$title \xE2\x80\x94 $HOSTNAME"
fi
echo -ne "\033];$title\007"
}
precmd_functions+=(_set_terminal_title)
# Save command history to disk
HISTFILE=$HOME/.zsh_history
HISTSIZE=100000
SAVEHIST=$HISTSIZE
# Enable zsh-history-substring-search: https://github.com/zsh-users/zsh-history-substring-search
[ -f /usr/local/share/zsh-history-substring-search/zsh-history-substring-search.zsh ] && source /usr/local/share/zsh-history-substring-search/zsh-history-substring-search.zsh
# Enable zsh-autossugestions: https://github.com/zsh-users/zsh-autosuggestions
[ -f /usr/local/share/zsh-autosuggestions/zsh-autosuggestions.zsh ] && source /usr/local/share/zsh-autosuggestions/zsh-autosuggestions.zsh
# Enable zsh-syntax-highlighting: https://github.com/zsh-users/zsh-syntax-highlighting
[ -f /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh ] && source /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh