sell out to powerlevel10k, update upgrade_system to support oh-my-zsh themes, add a missing command zsh plugin, and add sweet logic for vscode terminal with the tag wrapper for ag

This commit is contained in:
Tony Blyler 2021-07-12 12:25:43 -04:00
parent 2ee9018e7a
commit 6e2f9dbe7a
4 changed files with 1653 additions and 9 deletions

1623
home/.p10k.zsh Normal file

File diff suppressed because it is too large Load diff

View file

@ -1,3 +1,10 @@
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi
if [ -f "${HOME}/.zshrc.d/init" ]; then
source "${HOME}/.zshrc.d/init"
fi
@ -28,7 +35,7 @@ fi
# oh-my-zsh {
export ZSH="${HOME}/.oh-my-zsh"
ZSH_THEME="candy"
ZSH_THEME="powerlevel10k/powerlevel10k"
HYPHEN_INSENSITIVE="true"
UPDATE_ZSH_DAYS=7
DISABLE_UPDATE_PROMPT="true"
@ -39,6 +46,8 @@ plugins=(
battery
brew
catimg
colorize
command-not-found
common-aliases
copydir
copyfile
@ -93,6 +102,7 @@ setopt \
export LANG='en_US.UTF-8'
export TERM='xterm-256color'
export EDITOR='vim'
# if nvim is installed, effectively replace vim
if command -v nvim &> /dev/null; then
export EDITOR='nvim'
@ -101,6 +111,13 @@ if command -v nvim &> /dev/null; then
alias vimdiff="nvim -d"
alias view="nvim -R"
fi
# if we're in vs code's terminal, set the editor to vs code
if [ "${TERM_PROGRAM:-nope}" = "vscode" ]; then
export EDITOR='code'
export TAG_CMD_FMT_STRING="code --goto {{.Filename}}:{{.LineNumber}}:{{.ColumnNumber}}"
fi
export VISUAL="${EDITOR}"
# use reflink cp if supported (yay CoW)
@ -189,3 +206,6 @@ for SCRIPT in "${HOME}/.zshrc.d"/**/(.|?)*(.zsh|.sh); do
source "${SCRIPT}"
done
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh

View file

@ -38,15 +38,9 @@ upgrade_system() {
fi
(
cd "${ZSH}/custom/plugins"
for FILE in *; do
if ! [ -d "${FILE}" ]; then
continue
fi
for DIR in "$ZSH"/custom/{themes,plugins}/*/; do
(
cd "${FILE}"
cd "${DIR}"
[ -d .git ] || exit 0
git pull
)

View file

@ -40,6 +40,13 @@ install_ohmyzsh() {
fi
/bin/bash -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
local -r P10K_THEME_PATH="${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k"
if [ -d "$P10K_THEME_PATH" ]; then
return
fi
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git "$P10K_THEME_PATH"
}
install_custom_ohmyzsh_plugins() {