Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use powerlevel10k instant prompt with zim+ #11

Merged
merged 1 commit into from
Dec 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 --use degit
2 changes: 2 additions & 0 deletions configs/zim+/skel/.zlogin
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Initialize Zim
source ${ZIM_HOME}/login_init.zsh -q &!
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