Skip to content

Commit

Permalink
feat(zsh_plugin): support some other zsh plugin
Browse files Browse the repository at this point in the history
This commit add support of the following
zsh plugins:
- prezto
- zim
- antibody
- antigen
- zplug
- zgen
- zplugin
- zinit
  • Loading branch information
diodonfrost committed Jan 17, 2021
1 parent 394139b commit 6b37ad9
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 7 deletions.
2 changes: 1 addition & 1 deletion tasks/p10k-configure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

- name: Enable powerlevel10 config file
blockinfile:
path: '~/.zshrc'
path: "{{ p10k_zshrc_config[zsh_plugin]['zsh_file'] }}"
block: |
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
insertafter: EOF
Expand Down
8 changes: 4 additions & 4 deletions tasks/p10k-install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@

- name: Add powerlevel10k to zsh plugin
lineinfile:
path: '~/.zshrc'
regexp: "^{{ p10k_zshrc_config[zsh_plugin] }}"
line: "{{ p10k_zshrc_config[zsh_plugin] }}"
path: "{{ p10k_zshrc_config[zsh_plugin]['zsh_file'] }}"
regexp: "^{{ p10k_zshrc_config[zsh_plugin]['source'] }}"
line: "{{ p10k_zshrc_config[zsh_plugin]['source'] }}"
owner: "{{ item }}"
group: "{{ item }}"
mode: '0644'
Expand All @@ -44,7 +44,7 @@

- name: Enable powerlevel10 instant prompt
blockinfile:
path: '~/.zshrc'
path: "{{ p10k_zshrc_config[zsh_plugin]['zsh_file'] }}"
block: |
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
Expand Down
32 changes: 30 additions & 2 deletions vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,33 @@ p10k_path:
ohmyzsh: '~/.oh-my-zsh/custom/themes/powerlevel10k'

p10k_zshrc_config:
zsh: 'source ~/powerlevel10k/powerlevel10k.zsh-theme'
ohmyzsh: 'ZSH_THEME="powerlevel10k/powerlevel10k"'
zsh:
source: 'source ~/powerlevel10k/powerlevel10k.zsh-theme'
zsh_file: ~/.zshrc
ohmyzsh:
source: 'ZSH_THEME="powerlevel10k/powerlevel10k"'
zsh_file: ~/.zshrc
prezto:
source: 'zstyle :prezto:module:prompt theme powerlevel10k'
zsh_file: ~/.zpreztorc
zim:
source: 'zmodule romkatv/powerlevel10k'
zsh_file: ~/.zimrc
antibody:
source: 'antibody bundle romkatv/powerlevel10k'
zsh_file: ~/.zshrc
antigen:
source: 'antigen theme romkatv/powerlevel10k'
zsh_file: ~/.zshrc
zplug:
source: 'zplug romkatv/powerlevel10k, as:theme, depth:1'
zsh_file: ~/.zshrc
zgen:
source: 'zgen load romkatv/powerlevel10k powerlevel10k'
zsh_file: ~/.zshrc
zplugin:
source: 'zplugin ice depth=1; zplugin light romkatv/powerlevel10k'
zsh_file: ~/.zshrc
zinit:
source: 'zinit ice depth=1; zinit light romkatv/powerlevel10k'
zsh_file: ~/.zshrc

0 comments on commit 6b37ad9

Please sign in to comment.