zsh: Ditch oh-my-zsh
This commit is contained in:
parent
1525224696
commit
079d389cee
4 changed files with 82 additions and 0 deletions
6
.gitmodules
vendored
Normal file
6
.gitmodules
vendored
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
[submodule "zsh/zsh-syntax-highlighting"]
|
||||||
|
path = zsh/zsh-syntax-highlighting
|
||||||
|
url = git@github.com:zsh-users/zsh-syntax-highlighting.git
|
||||||
|
[submodule "zsh/zsh-autosuggestions"]
|
||||||
|
path = zsh/zsh-autosuggestions
|
||||||
|
url = git@github.com:zsh-users/zsh-autosuggestions.git
|
1
zsh/zsh-autosuggestions
Submodule
1
zsh/zsh-autosuggestions
Submodule
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit ae315ded4dba10685dbbafbfa2ff3c1aefeb490d
|
1
zsh/zsh-syntax-highlighting
Submodule
1
zsh/zsh-syntax-highlighting
Submodule
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit 3a4b212c7d8263a12bef176b10737748b752a579
|
74
zshrc
Normal file
74
zshrc
Normal file
|
@ -0,0 +1,74 @@
|
||||||
|
export PATH=$HOME/go/bin:$HOME/.local/bin:$HOME/.cargo/bin:$PATH
|
||||||
|
if which ruby >/dev/null && which gem >/dev/null; then
|
||||||
|
PATH="$(ruby -r rubygems -e 'puts Gem.user_dir')/bin:$PATH"
|
||||||
|
fi
|
||||||
|
|
||||||
|
eval $(thefuck --alias)
|
||||||
|
|
||||||
|
autoload -Uz vcs_info
|
||||||
|
|
||||||
|
export EDITOR="nvim"
|
||||||
|
alias vim=nvim
|
||||||
|
alias ls='ls --color=auto'
|
||||||
|
|
||||||
|
precmd_vcs_info() {
|
||||||
|
vcs_info
|
||||||
|
}
|
||||||
|
precmd_functions+=(precmd_vcs_info)
|
||||||
|
|
||||||
|
zstyle ':vcs_info:git:*' formats '%F{245}%b %m%u%c%f '
|
||||||
|
zstyle ':vcs_info:*' enable git
|
||||||
|
setopt prompt_subst
|
||||||
|
|
||||||
|
if [ "$SSH_CONNECTION" ]; then
|
||||||
|
PROMPT_HOST="%F{yellow}[ssh] $HOST%f "
|
||||||
|
fi
|
||||||
|
export PROMPT='$PROMPT_HOST%(?..%F{red}%? )%f%20<…<%~%<<$(pretty-git-prompt) %F{117}>%f '
|
||||||
|
|
||||||
|
HISTSIZE=20000
|
||||||
|
HISTFILE=~/.zsh_history
|
||||||
|
SAVEHIST=20000
|
||||||
|
HISTDUP=erase
|
||||||
|
setopt appendhistory
|
||||||
|
setopt sharehistory
|
||||||
|
setopt incappendhistory
|
||||||
|
|
||||||
|
bindkey -v
|
||||||
|
bindkey '^R' history-incremental-search-backward
|
||||||
|
KEYTIMEOUT=1
|
||||||
|
|
||||||
|
function zle-keymap-select zle-line-init {
|
||||||
|
case $KEYMAP in
|
||||||
|
vicmd) print -n -- "\E]50;CursorShape=0\C-G";; # block cursor
|
||||||
|
viins|main) print -n -- "\E]50;CursorShape=1\C-G";; # line cursor
|
||||||
|
esac
|
||||||
|
|
||||||
|
zle reset-prompt
|
||||||
|
zle -R
|
||||||
|
}
|
||||||
|
|
||||||
|
function zle-line-finish {
|
||||||
|
print -n -- "\E]50;CursorShape=0\C-G" # block cursor
|
||||||
|
}
|
||||||
|
|
||||||
|
zle -N zle-line-init
|
||||||
|
zle -N zle-line-finish
|
||||||
|
zle -N zle-keymap-select
|
||||||
|
|
||||||
|
setopt autocd menucomplete
|
||||||
|
|
||||||
|
first-tab() {
|
||||||
|
if [[ $#BUFFER == 0 ]]; then
|
||||||
|
BUFFER="cd "
|
||||||
|
CURSOR=3
|
||||||
|
zle list-choices
|
||||||
|
else
|
||||||
|
zle expand-or-complete
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
zle -N first-tab
|
||||||
|
bindkey '^I' first-tab
|
||||||
|
zstyle ':completion:*' menu select
|
||||||
|
|
||||||
|
source ~/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh
|
||||||
|
source ~/.zsh/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
|
Loading…
Reference in a new issue