This repository has been archived by the owner on Jul 5, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.zshrc
101 lines (85 loc) · 2.74 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
#
# Tmux
#
if [ -z "$TMUX" ] # When zsh is started attach to current tmux session or create a new one
then
tmux attach -t TMUX || tmux new -s TMUX
fi
#
# Neovim
#
export EDITOR="nvim"
alias vim="nvim"
#
# Oh-my-zsh
#
export ZSH="$HOME/.oh-my-zsh"
SPACESHIP_PROMPT_FIRST_PREFIX_SHOW=true # Show prefix before first line in prompt
ZSH_THEME="spaceship" # Set theme
plugins=(
git # https://github.com/robbyrussell/oh-my-zsh/wiki/Plugin:git
history-substring-search # ZSH port of Fish history search. Begin typing command, use up arrow to select previous use
zsh-autosuggestions # Suggests commands based on your history
zsh-completions # More completions
zsh-syntax-highlighting # Fish shell like syntax highlighting for Zsh
colored-man-pages # Self-explanatory
)
autoload -U compinit && compinit # reload completions for zsh-completions
source $ZSH/oh-my-zsh.sh # required
# Colorize autosuggest
export ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=5'
#
# Spaceship-prompt
#
# Spaceship-prompt customization
SPACESHIP_PROMPT_ORDER=(
dir # Current directory section
user # Username section
host # Hostname section
git # Git section (git_branch + git_status)
time # Time stampts section
# hg # Mercurial section (hg_branch + hg_status)
# package # Package version
# node # Node.js section
# ruby # Ruby section
# elixir # Elixir section
# xcode # Xcode section
# swift # Swift section
# golang # Go section
# php # PHP section
# rust # Rust section
# haskell # Haskell Stack section
# julia # Julia section
# docker # Docker section
# aws # Amazon Web Services section
# venv # virtualenv section
# conda # conda virtualenv section
# pyenv # Pyenv section
# dotnet # .NET section
# ember # Ember.js section
# kubecontext # Kubectl context section
exec_time # Execution time
line_sep # Line break
battery # Battery level and status
vi_mode # Vi-mode indicator
jobs # Background jobs indicator
# exit_code # Exit code section
char # Prompt character
)
SPACESHIP_DIR_PREFIX="%{$fg[blue]%}┌─[%b "
SPACESHIP_DIR_SUFFIX="%{$fg[blue]%} ] "
SPACESHIP_CHAR_SYMBOL="%{$fg[blue]%}└─▪%b "
#
# Other
#
# This speeds up pasting w/ autosuggest
# https://github.com/zsh-users/zsh-autosuggestions/issues/238
pasteinit() {
OLD_SELF_INSERT=${${(s.:.)widgets[self-insert]}[2,3]}
zle -N self-insert url-quote-magic # I wonder if you'd need `.url-quote-magic`?
}
pastefinish() {
zle -N self-insert $OLD_SELF_INSERT
}
zstyle :bracketed-paste-magic paste-init pasteinit
zstyle :bracketed-paste-magic paste-finish pastefinish