Disabling powerlevel10k, moving plugins to submodules
This commit is contained in:
parent
6c804d1db5
commit
b37b56aa89
7 changed files with 91 additions and 1583 deletions
6
.gitmodules
vendored
Normal file
6
.gitmodules
vendored
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
[submodule "zsh/plugins/zsh-syntax-highlighting"]
|
||||||
|
path = zsh/plugins/zsh-syntax-highlighting
|
||||||
|
url = https://github.com/zsh-users/zsh-syntax-highlighting.git
|
||||||
|
[submodule "zsh/plugins/kube-ps1"]
|
||||||
|
path = zsh/plugins/kube-ps1
|
||||||
|
url = https://github.com/jonmosco/kube-ps1.git
|
15
install.sh
15
install.sh
|
@ -8,7 +8,7 @@ rm -rf ~/.fdignore ~/.fzf.bash ~/.fzf.zsh ~/.gitconfig ~/.gitignore ~/.history ~
|
||||||
|
|
||||||
# repo + preparations
|
# repo + preparations
|
||||||
git clone https://github.com/ftpd/dotfiles.git ~/.dotfiles
|
git clone https://github.com/ftpd/dotfiles.git ~/.dotfiles
|
||||||
mkdir -p ~/.config/_cache/zsh ~/.config/git ~/.config/local ~/.config/zsh
|
mkdir -p ~/.config/_cache/zsh ~/.config/git ~/.config/local
|
||||||
|
|
||||||
## neovim
|
## neovim
|
||||||
ln -sf ~/.dotfiles/nvim ~/.config/
|
ln -sf ~/.dotfiles/nvim ~/.config/
|
||||||
|
@ -24,13 +24,10 @@ ln -sf ~/.dotfiles/fd ~/.config/
|
||||||
ln -sf ~/.dotfiles/tmux ~/.config/
|
ln -sf ~/.dotfiles/tmux ~/.config/
|
||||||
|
|
||||||
## zsh
|
## zsh
|
||||||
echo "skip_global_compinit=1" > ~/.zshenv
|
|
||||||
echo "export XDG_CONFIG_HOME=~/.config" >> ~/.zshenv
|
|
||||||
echo "export XDG_CACHE_HOME=~/.config/_cache" >> ~/.zshenv
|
|
||||||
echo "export XDG_DATA_HOME=~/.config/_cache" >> ~/.zshenv
|
echo "export XDG_DATA_HOME=~/.config/_cache" >> ~/.zshenv
|
||||||
|
echo "export XDG_CACHE_HOME=~/.config/_cache" >> ~/.zshenv
|
||||||
|
echo "export XDG_CONFIG_HOME=~/.config" >> ~/.zshenv
|
||||||
|
echo "" >> ~/.zshenv
|
||||||
|
echo "skip_global_compinit=1" > ~/.zshenv
|
||||||
echo "export ZDOTDIR=~/.config/zsh" >> ~/.zshenv
|
echo "export ZDOTDIR=~/.config/zsh" >> ~/.zshenv
|
||||||
mkdir -p ~/.config/zsh/plugins ~/.config/zsh/themes
|
ln -sf ~/.dotfiles/zsh ~/.config/
|
||||||
git clone https://github.com/zsh-users/zsh-autosuggestions.git ~/.config/zsh/plugins/zsh-autosuggestions
|
|
||||||
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ~/.config/zsh/plugins/zsh-syntax-highlighting
|
|
||||||
git clone https://github.com/romkatv/powerlevel10k.git ~/.config/zsh/themes/powerlevel10k
|
|
||||||
ln -sf ~/.dotfiles/zsh/zshrc ~/.config/zsh/.zshrc
|
|
||||||
|
|
77
zsh/.zshrc
Normal file
77
zsh/.zshrc
Normal file
|
@ -0,0 +1,77 @@
|
||||||
|
bindkey -e
|
||||||
|
|
||||||
|
autoload -U vcs_info
|
||||||
|
autoload -U colors && colors
|
||||||
|
autoload -U promptinit && promptinit
|
||||||
|
autoload -U compinit && compinit -d $XDG_DATA_HOME/zsh/zcompdump
|
||||||
|
|
||||||
|
HISTSIZE=10000
|
||||||
|
SAVEHIST=$HISTSIZE
|
||||||
|
HISTFILE=$XDG_DATA_HOME/zsh/history
|
||||||
|
LESSHISTFILE='/dev/null'
|
||||||
|
|
||||||
|
setopt prompt_subst
|
||||||
|
setopt share_history
|
||||||
|
setopt inc_append_history
|
||||||
|
|
||||||
|
zstyle ':completion:*' menu select
|
||||||
|
zstyle ':completion:*' list-colors ''
|
||||||
|
zmodload zsh/complist
|
||||||
|
|
||||||
|
# plugins
|
||||||
|
source $ZDOTDIR/plugins/kube-ps1/kube-ps1.sh
|
||||||
|
source $ZDOTDIR/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
|
||||||
|
|
||||||
|
# virtualenv
|
||||||
|
export VIRTUAL_ENV_DISABLE_PROMPT=1
|
||||||
|
function virtualenv_info(){
|
||||||
|
[[ -n "$VIRTUAL_ENV" ]] && venv="${VIRTUAL_ENV##*/}" || venv=''
|
||||||
|
[[ -n "$venv" ]] && echo " $venv "
|
||||||
|
}
|
||||||
|
|
||||||
|
# git
|
||||||
|
zstyle ':vcs_info:*' enable git
|
||||||
|
() {
|
||||||
|
zstyle ':vcs_info:*' stagedstr '%F{green}+'
|
||||||
|
zstyle ':vcs_info:*' unstagedstr '%F{red}!'
|
||||||
|
zstyle ':vcs_info:*' formats " %b %m%u%c%{$reset_color%}"
|
||||||
|
zstyle ':vcs_info:*' check-for-changes true
|
||||||
|
zstyle ':vcs_info:git*+set-message:*' hooks git-untracked
|
||||||
|
}
|
||||||
|
+vi-git-untracked() {
|
||||||
|
if [[ $(git rev-parse --is-inside-work-tree 2> /dev/null) == 'true' ]] && \
|
||||||
|
[[ $(git ls-files --other --directory --exclude-standard | sed q | wc -l | tr -d ' ') == 1 ]] ; then
|
||||||
|
hook_com[unstaged]+='%F{red}?'
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# kubernetes
|
||||||
|
KUBE_PS1_PREFIX=''
|
||||||
|
KUBE_PS1_SUFFIX=' '
|
||||||
|
KUBE_PS1_DIVIDER='/'
|
||||||
|
KUBE_PS1_SEPARATOR=''
|
||||||
|
KUBE_PS1_NS_COLOR='blue'
|
||||||
|
KUBE_PS1_CTX_COLOR='blue'
|
||||||
|
|
||||||
|
# fzf
|
||||||
|
if [ -f $XDG_CONFIG_HOME/fzf/fzf.zsh ]; then
|
||||||
|
source $XDG_CONFIG_HOME/fzf/fzf.zsh
|
||||||
|
export FZF_DEFAULT_COMMAND='fd -H -L --ignore-file $XDG_CONFIG_HOME/local/fd'
|
||||||
|
export FZF_CTRL_T_COMMAND='fd -H -L --ignore-file $XDG_CONFIG_HOME/local/fd'
|
||||||
|
export FZF_DEFAULT_OPTS="--multi -e --ansi --layout=reverse --preview='bat --color=always --tabs=2 --style=plain --theme=Monokai\ Extended\ Bright {}'"
|
||||||
|
export FZF_CTRL_R_OPTS="-e --ansi --layout=reverse --preview=''"
|
||||||
|
_fzf_compgen_path() {
|
||||||
|
fd -H -L --ignore-file $XDG_CONFIG_HOME/local/fd . "$1"
|
||||||
|
}
|
||||||
|
_fzf_compgen_dir() {
|
||||||
|
fd -H -L --ignore-file $XDG_CONFIG_HOME/local/fd --type d . "$1"
|
||||||
|
}
|
||||||
|
fi
|
||||||
|
|
||||||
|
# prompt
|
||||||
|
precmd() { vcs_info }
|
||||||
|
PROMPT='%{$fg_bold[default]%}$(virtualenv_info)$(kube_ps1)%{$reset_color%}${vcs_info_msg_0_}
|
||||||
|
%{$fg_bold[cyan]%}%~ %F{%(?.green.red)}❯%f '
|
||||||
|
|
||||||
|
# local addons
|
||||||
|
[ -e $XDG_CONFIG_HOME/local/zsh ] && source $XDG_CONFIG_HOME/local/zsh
|
1532
zsh/p10k.zsh
1532
zsh/p10k.zsh
File diff suppressed because it is too large
Load diff
1
zsh/plugins/kube-ps1
Submodule
1
zsh/plugins/kube-ps1
Submodule
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit 15cb6c02f5c23b9244d1e5bf81f71f1ac8b96d93
|
1
zsh/plugins/zsh-syntax-highlighting
Submodule
1
zsh/plugins/zsh-syntax-highlighting
Submodule
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit 5eb494852ebb99cf5c2c2bffee6b74e6f1bf38d0
|
42
zsh/zshrc
42
zsh/zshrc
|
@ -1,42 +0,0 @@
|
||||||
bindkey -e
|
|
||||||
|
|
||||||
autoload -U promptinit && promptinit
|
|
||||||
autoload -U compinit && compinit -d $XDG_DATA_HOME/zsh/zcompdump
|
|
||||||
|
|
||||||
export HISTSIZE=10000
|
|
||||||
SAVEHIST=$HISTSIZE
|
|
||||||
HISTFILE=$XDG_DATA_HOME/zsh/history
|
|
||||||
setopt inc_append_history
|
|
||||||
setopt share_history
|
|
||||||
|
|
||||||
zstyle ':completion:*' menu select
|
|
||||||
zstyle ':completion:*' list-colors ''
|
|
||||||
zmodload zsh/complist
|
|
||||||
|
|
||||||
export LESSHISTFILE='/dev/null'
|
|
||||||
|
|
||||||
source $XDG_CONFIG_HOME/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
|
|
||||||
source $XDG_CONFIG_HOME/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh
|
|
||||||
|
|
||||||
if [ -f $XDG_CONFIG_HOME/fzf/fzf.zsh ]; then
|
|
||||||
source $XDG_CONFIG_HOME/fzf/fzf.zsh
|
|
||||||
export FZF_DEFAULT_COMMAND='fd -H -L --ignore-file $XDG_CONFIG_HOME/local/fd'
|
|
||||||
export FZF_CTRL_T_COMMAND='fd -H -L --ignore-file $XDG_CONFIG_HOME/local/fd'
|
|
||||||
export FZF_DEFAULT_OPTS="--multi -e --ansi --layout=reverse --preview='bat --color=always --tabs=2 --style=plain --theme=Monokai\ Extended\ Bright {}'"
|
|
||||||
export FZF_CTRL_R_OPTS="-e --ansi --layout=reverse --preview=''"
|
|
||||||
_fzf_compgen_path() {
|
|
||||||
fd -H -L --ignore-file $XDG_CONFIG_HOME/local/fd . "$1"
|
|
||||||
}
|
|
||||||
_fzf_compgen_dir() {
|
|
||||||
fd -H -L --ignore-file $XDG_CONFIG_HOME/local/fd --type d . "$1"
|
|
||||||
}
|
|
||||||
gs() {
|
|
||||||
git -c color.status=always status --short |
|
|
||||||
fzf --ansi --preview '(git diff --color=always -- {-1} | sed 1,4d; cat {-1})'
|
|
||||||
}
|
|
||||||
fi
|
|
||||||
|
|
||||||
source $XDG_CONFIG_HOME/zsh/themes/powerlevel10k/powerlevel10k.zsh-theme
|
|
||||||
source ~/.dotfiles/zsh/p10k.zsh
|
|
||||||
|
|
||||||
[ -e $XDG_CONFIG_HOME/local/zsh ] && source $XDG_CONFIG_HOME/local/zsh
|
|
Loading…
Add table
Add a link
Reference in a new issue