Skip to content

Commit

Permalink
Use powerlevel10k instant prompt with zim+
Browse files Browse the repository at this point in the history
Zim does play well with powerlevel10k instant prompt. It also "has one
function to install plugins and another to load them", contratry to what
the zsh-bench README.md mentions.
  • Loading branch information
ericbn committed Dec 14, 2021
1 parent 7ff1b54 commit 0701ed5
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 15 deletions.
13 changes: 0 additions & 13 deletions configs/zim+/setup
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,3 @@
emulate -L zsh -o err_return

cp -r -- ${ZSH_SCRIPT:h}/skel/*(D) ~/

git clone -q --depth=1 https://github.com/zimfw/install.git ~/install
git clone -q --depth=1 https://github.com/zimfw/zimfw.git ~/.zim

() {
local rc
for rc in zshenv zshrc zlogin; do
<~/install/src/templates/$rc >>~/.$rc
done
}

rm -rf -- ~/install
zsh ~/.zim/zimfw.zsh install >/dev/null
4 changes: 2 additions & 2 deletions configs/zim+/skel/.zimrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
zmodule completion
zmodule romkatv/powerlevel10k
zmodule zsh-users/zsh-autosuggestions
zmodule zsh-users/zsh-syntax-highlighting
zmodule zsh-users/zsh-autosuggestions
zmodule romkatv/powerlevel10k
3 changes: 3 additions & 0 deletions configs/zim+/skel/.zshenv
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
setopt no_global_rcs

# Define Zim location
ZIM_HOME=~/.zim
15 changes: 15 additions & 0 deletions configs/zim+/skel/.zshrc
Original file line number Diff line number Diff line change
@@ -1,10 +1,25 @@
# If not in tmux, start tmux.
if [[ -z ${TMUX+X}${ZSH_SCRIPT+X}${ZSH_EXECUTION_STRING+X} ]]; then
exec tmux
fi

if [[ ! -e ${ZIM_HOME}/zimfw.zsh ]]; then
# Download zimfw script if missing.
command curl -fsSL --create-dirs -o ${ZIM_HOME}/zimfw.zsh https://github.com/zimfw/zimfw/releases/latest/download/zimfw.zsh
fi
if [[ ! ${ZIM_HOME}/init.zsh -nt ${ZDOTDIR:-${HOME}}/.zimrc ]]; then
# Install missing modules, and update ${ZIM_HOME}/init.zsh if missing or outdated.
source ${ZIM_HOME}/zimfw.zsh init -q
fi

# Activate Powerlevel10k Instant Prompt.
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

ZSH_AUTOSUGGEST_MANUAL_REBIND=1

# Load plugins.
source ${ZIM_HOME}/init.zsh

source ~/.p10k.zsh

0 comments on commit 0701ed5

Please sign in to comment.