More prompt fancifying
This commit is contained in:
parent
f02104ecda
commit
7928ea968f
4 changed files with 59 additions and 24 deletions
|
@ -30,6 +30,7 @@ Plug 'Shougo/neosnippet.vim'
|
||||||
Plug 'Shougo/neosnippet-snippets'
|
Plug 'Shougo/neosnippet-snippets'
|
||||||
Plug 'tomtom/tcomment_vim'
|
Plug 'tomtom/tcomment_vim'
|
||||||
Plug 'tpope/vim-fugitive'
|
Plug 'tpope/vim-fugitive'
|
||||||
|
Plug 'typeintandem/nvim'
|
||||||
Plug 'tyrannicaltoucan/vim-quantum'
|
Plug 'tyrannicaltoucan/vim-quantum'
|
||||||
Plug 'vim-airline/vim-airline'
|
Plug 'vim-airline/vim-airline'
|
||||||
Plug 'vim-airline/vim-airline-themes'
|
Plug 'vim-airline/vim-airline-themes'
|
||||||
|
|
|
@ -94,10 +94,10 @@ setw -g window-status-separator ""
|
||||||
set -g status-fg "#aaaaaa"
|
set -g status-fg "#aaaaaa"
|
||||||
set -g status-bg "#222222"
|
set -g status-bg "#222222"
|
||||||
set -g status-left '#[bg=#114400,fg=#77aa22] #I #[bg=#334455,fg=#7799aa] #h #[default] '
|
set -g status-left '#[bg=#114400,fg=#77aa22] #I #[bg=#334455,fg=#7799aa] #h #[default] '
|
||||||
set -g status-right '#[bg=#222222,fg=#666666] | #{battery_percentage} #{battery_remain} | #(date +"%R") '
|
set -g status-right '#[fg=#666666]|#[bg=#222222,fg=#99cc99] #{?#(tmux show-buffer -b project),#(tmux show-buffer -b project),-} #[bg=#222222,fg=#666666]| #{battery_percentage} #{battery_remain} | #(date +"%R") '
|
||||||
|
|
||||||
if-shell 'test $HOST = dredd' set -g status-left '#[bg=#114400,fg=#77aa22] #I #[bg=#0055aa,fg=#aabbcc] #h #[default] '
|
if-shell '[[ $(hostname) = "dredd" ]]' 'set -g status-left "#[bg=#114400,fg=#77aa22] #I #[bg=#0055aa,fg=#aabbcc] #h #[default] "'
|
||||||
if-shell 'test $HOST = seed-dlundin4' set -g status-left '#[bg=#114400,fg=#77aa22] #I #[bg=#339900,fg=#000000] #h #[default] '
|
if-shell '[[ $(hostname) != "dredd" ]]' 'set -g status-left "#[bg=#114400,fg=#77aa22] #I #[bg=#339900,fg=#000000] #h #[default] "'
|
||||||
|
|
||||||
|
|
||||||
# Startup
|
# Startup
|
||||||
|
|
2
.xinitrc
2
.xinitrc
|
@ -11,5 +11,5 @@ xsetroot -solid \#202020
|
||||||
xmodmap $HOME/.Xmodmap
|
xmodmap $HOME/.Xmodmap
|
||||||
feh --bg-fill $HOME/Images/desktop.jpg || true
|
feh --bg-fill $HOME/Images/desktop.jpg || true
|
||||||
setxkbmap -option ctrl:nocaps,grp:switch,grp_led:scroll us,se
|
setxkbmap -option ctrl:nocaps,grp:switch,grp_led:scroll us,se
|
||||||
st tmux attach -t0 &
|
st &
|
||||||
exec dwm
|
exec dwm
|
||||||
|
|
70
.zshrc
70
.zshrc
|
@ -7,8 +7,43 @@
|
||||||
# Set name of the theme to load. Optionally, if you set this to "random"
|
# Set name of the theme to load. Optionally, if you set this to "random"
|
||||||
# it'll load a random theme each time that oh-my-zsh is loaded.
|
# it'll load a random theme each time that oh-my-zsh is loaded.
|
||||||
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
|
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
|
||||||
|
export PATH=$HOME/bin:$PATH:/bin:/sbin:/usr/sbin:/usr/local/sbin
|
||||||
|
|
||||||
ZSH_THEME="robbyrussell"
|
ZSH_THEME="robbyrussell"
|
||||||
|
|
||||||
|
export HISTFILE=~/.zsh_history
|
||||||
|
export SAVEHIST=9000
|
||||||
|
export LPASS_AGENT_TIMEOUT=900
|
||||||
|
|
||||||
|
typeset -A ZSH_HIGHLIGHT_STYLES
|
||||||
|
export ZSH_HIGHLIGHT_HIGHLIGHTERS=(main brackets pattern cursor)
|
||||||
|
export ZSH_HIGHLIGHT_STYLES[command]='fg=155'
|
||||||
|
export ZSH_HIGHLIGHT_STYLES[builtin]='fg=190'
|
||||||
|
|
||||||
|
setopt append_history
|
||||||
|
setopt share_history
|
||||||
|
|
||||||
|
|
||||||
|
source ~/.zplug/init.zsh
|
||||||
|
|
||||||
|
zplug "miekg/lean"
|
||||||
|
zplug "zplug/zplug", hook-build:"zplug --self-manage"
|
||||||
|
|
||||||
|
zplug "plugins/git", from:oh-my-zsh
|
||||||
|
zplug "plugins/history-substring-search", from:oh-my-zsh
|
||||||
|
zplug "zsh-users/zsh-syntax-highlighting", defer:2
|
||||||
|
|
||||||
|
zplug "~/.zsh", from:local
|
||||||
|
|
||||||
|
if ! zplug check --verbose; then
|
||||||
|
printf "Install? [y/N]: "
|
||||||
|
if read -q; then
|
||||||
|
echo; zplug install
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
zplug load
|
||||||
|
|
||||||
# Uncomment the following line to use case-sensitive completion.
|
# Uncomment the following line to use case-sensitive completion.
|
||||||
# CASE_SENSITIVE="true"
|
# CASE_SENSITIVE="true"
|
||||||
|
|
||||||
|
@ -56,8 +91,6 @@ ZSH_THEME="robbyrussell"
|
||||||
# source $ZSH/oh-my-zsh.sh
|
# source $ZSH/oh-my-zsh.sh
|
||||||
# source ~/.oh-my-zsh/plugins/zsh-titles/titles.plugin.zsh
|
# source ~/.oh-my-zsh/plugins/zsh-titles/titles.plugin.zsh
|
||||||
|
|
||||||
source "${HOME}/.zgen/zgen.zsh"
|
|
||||||
|
|
||||||
function short_pwd {
|
function short_pwd {
|
||||||
echo $PWD | sed "s:${HOME}:~:" | sed "s:/\(.\)[^/]*:/\1:g" | sed "s:/[^/]*$:/$(basename $PWD):"
|
echo $PWD | sed "s:${HOME}:~:" | sed "s:/\(.\)[^/]*:/\1:g" | sed "s:/[^/]*$:/$(basename $PWD):"
|
||||||
}
|
}
|
||||||
|
@ -74,24 +107,11 @@ function _dln_prompt_right {
|
||||||
|
|
||||||
export PROMPT_LEAN_COLOR1=78
|
export PROMPT_LEAN_COLOR1=78
|
||||||
export PROMPT_LEAN_COLOR2=67
|
export PROMPT_LEAN_COLOR2=67
|
||||||
export PROMPT_LEAN_TMUX=''
|
export PROMPT_LEAN_TMUX=" "
|
||||||
export PROMPT_LEAN_PATH_PERCENT=50
|
export PROMPT_LEAN_PATH_PERCENT=50
|
||||||
export PROMPT_LEAN_LEFT=_dln_prompt_left
|
export PROMPT_LEAN_LEFT=_dln_prompt_left
|
||||||
# export PROMPT_LEAN_RIGHT=_dln_prompt_right
|
# export PROMPT_LEAN_RIGHT=_dln_prompt_right
|
||||||
|
|
||||||
# if the init scipt doesn't exist
|
|
||||||
if ! zgen saved; then
|
|
||||||
|
|
||||||
zgen oh-my-zsh
|
|
||||||
zgen oh-my-zsh plugins/command-not-found
|
|
||||||
zgen oh-my-zsh plugins/git
|
|
||||||
zgen oh-my-zsh plugins/git-extras
|
|
||||||
zgen oh-my-zsh plugins/history-substring-search
|
|
||||||
|
|
||||||
zgen load miekg/lean
|
|
||||||
|
|
||||||
zgen save
|
|
||||||
fi
|
|
||||||
|
|
||||||
function prompt_command {
|
function prompt_command {
|
||||||
banner="$USER@$HOST"
|
banner="$USER@$HOST"
|
||||||
|
@ -138,10 +158,13 @@ function prompt_command {
|
||||||
# alias zshconfig="mate ~/.zshrc"
|
# alias zshconfig="mate ~/.zshrc"
|
||||||
# alias ohmyzsh="mate ~/.oh-my-zsh"
|
# alias ohmyzsh="mate ~/.oh-my-zsh"
|
||||||
|
|
||||||
|
alias ls='ls --color=auto --group-directories-first --human-readable --almost-all'
|
||||||
|
|
||||||
|
bindkey -e
|
||||||
bindkey "^[[A" history-substring-search-up
|
bindkey "^[[A" history-substring-search-up
|
||||||
bindkey "^[[B" history-substring-search-down
|
bindkey "^[[B" history-substring-search-down
|
||||||
bindkey -M emacs '^P' history-substring-search-up
|
bindkey -M emacs '^P' history-beginning-search-backward
|
||||||
bindkey -M emacs '^N' history-substring-search-down
|
bindkey -M emacs '^N' history-beginning-search-forward
|
||||||
|
|
||||||
cd_func () {
|
cd_func () {
|
||||||
local dir
|
local dir
|
||||||
|
@ -158,10 +181,20 @@ cd_func () {
|
||||||
}
|
}
|
||||||
alias cd=cd_func
|
alias cd=cd_func
|
||||||
|
|
||||||
|
redraw-prompt() {
|
||||||
|
local precmd
|
||||||
|
for precmd in $precmd_functions; do
|
||||||
|
$precmd
|
||||||
|
done
|
||||||
|
zle reset-prompt
|
||||||
|
}
|
||||||
|
zle -N redraw-prompt
|
||||||
|
|
||||||
_jump() {
|
_jump() {
|
||||||
dir="$(fasd -Rdl | fzf -1 -0 --no-sort +m --height 10)" && cd_func "${dir}"
|
dir="$(fasd -Rdl | fzf -1 -0 --no-sort +m --height 10)" && cd_func "${dir}"
|
||||||
zle && zle redraw-prompt
|
zle && zle redraw-prompt
|
||||||
}
|
}
|
||||||
|
|
||||||
zle -N _jump
|
zle -N _jump
|
||||||
bindkey '^g' _jump
|
bindkey '^g' _jump
|
||||||
|
|
||||||
|
@ -187,6 +220,7 @@ export FZF_COMPLETION_TRIGGER=";"
|
||||||
command -v kubectl >/dev/null 2>&1 && source <(kubectl completion zsh)
|
command -v kubectl >/dev/null 2>&1 && source <(kubectl completion zsh)
|
||||||
command -v kops >/dev/null 2>&1 && source <(kops completion zsh)
|
command -v kops >/dev/null 2>&1 && source <(kops completion zsh)
|
||||||
command -v helm >/dev/null 2>&1 && source <(helm completion zsh)
|
command -v helm >/dev/null 2>&1 && source <(helm completion zsh)
|
||||||
|
command -v direnv >/dev/null 2>&1 && source <(direnv hook zsh)
|
||||||
|
|
||||||
[ -f /usr/share/bash-completion/completions/aws ] && source /usr/share/bash-completion/completions/aws
|
[ -f /usr/share/bash-completion/completions/aws ] && source /usr/share/bash-completion/completions/aws
|
||||||
[ -f /opt/google-cloud-sdk/completion.zsh.inc ] && source /opt/google-cloud-sdk/completion.zsh.inc
|
[ -f /opt/google-cloud-sdk/completion.zsh.inc ] && source /opt/google-cloud-sdk/completion.zsh.inc
|
||||||
|
|
Loading…
Reference in a new issue