-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathzshrc
More file actions
87 lines (69 loc) · 2.72 KB
/
zshrc
File metadata and controls
87 lines (69 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
# Path to your Oh My Zsh installation.
export ZSH="$HOME/.oh-my-zsh"
# Uncomment the following line to use hyphen-insensitive completion.
# Case-sensitive completion must be off. _ and - will be interchangeable.
HYPHEN_INSENSITIVE="true"
# Uncomment the following line to display red dots whilst waiting for completion.
# You can also set it to another string to have that shown instead of the default red dots.
# e.g. COMPLETION_WAITING_DOTS="%F{yellow}waiting...%f"
# Caution: this setting can cause issues with multiline prompts in zsh < 5.7.1 (see #5765)
COMPLETION_WAITING_DOTS="true"
# Which plugins would you like to load?
# Standard plugins can be found in $ZSH/plugins/
# Custom plugins may be added to $ZSH_CUSTOM/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(git)
source $ZSH/oh-my-zsh.sh
autoload -U select-word-style
select-word-style bash
autoload -U colors
colors
# history options
HISTFILE=~/.zsh_history
HISTSIZE=100000
SAVEHIST=100000
setopt append_history
setopt inc_append_history # append to history immediately (incrementally)
setopt hist_ignore_all_dups # keep all history lines unique (not just adjacent ones)
setopt hist_ignore_space # allow incognito commands
setopt hist_reduce_blanks
unsetopt extended_history
setopt auto_cd # cd if only directory name entered
setopt beep # beep on error in ZLE
setopt extended_glob # treat '#', '~', and '^' as part of patterns in globs
setopt notify # immediately report on background jobs
setopt print_exit_value # print exit value of programs if they errored
unsetopt case_glob # case-(in)sensitive globbing
# use vim keybindings
bindkey -v
bindkey '^R' history-incremental-search-backward
bindkey '^S' history-incremental-search-forward
zstyle :compinstall filename "$HOME/.zshrc"
autoload -Uz compinit
compinit
stty -ixon
[[ -a /etc/zsh_command_not_found ]] && source /etc/zsh_command_not_found
WORDCHARS=''
source ~/.envrc
source ~/.aliases
autoload -Uz vcs_info # version control stuff for prompt
# Prompt options
if [[ -e ~/.oh-my-posh.yml ]]; then
eval "$(oh-my-posh init zsh --config ~/.oh-my-posh.yml)"
else
precmd() { vcs_info }
zstyle ':vcs_info:*' formats '(%b)'
colored_prompt=1
machineinfo="%n@%M"
dirinfo="[%~]"
if [ $colored_prompt -eq 1 ]; then # colored prompt
machineinfo="%{$bold_color$fg[green]%}$machine_info%{$reset_color%}"
dirinfo="%{$bold_color$fg[cyan]%}$dirinfo%{$reset_color%}"
fi
vcsinfo='${vcs_info_msg_0_}'
NEWLINE=$'\n'
export PS1="$dirinfo $vcsinfo$NEWLINE$machineinfo %% "
export PS2="${PS1/\%\%/>}" #same as PS1, only an angle bracket as the final char
fi
# vi: set filetype=zsh: