Add zsh p10k instant prompt
This commit is contained in:
parent
06efdfb847
commit
d24816b15d
|
|
@ -1,9 +1,11 @@
|
||||||
{
|
{
|
||||||
config,
|
config,
|
||||||
|
lib,
|
||||||
osConfig,
|
osConfig,
|
||||||
pkgs,
|
pkgs,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
|
with lib;
|
||||||
let
|
let
|
||||||
cfg = osConfig.modules.zsh;
|
cfg = osConfig.modules.zsh;
|
||||||
xdgCfg = config.xdg;
|
xdgCfg = config.xdg;
|
||||||
|
|
@ -38,23 +40,33 @@ in
|
||||||
extended = true;
|
extended = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
initContent = ''
|
initContent =
|
||||||
# p10k
|
let
|
||||||
source "${xdgCfg.configHome}/zsh/p10k.zsh";
|
zshConfigInitEarly = mkOrder 500 ''
|
||||||
|
# p10k
|
||||||
|
# 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
|
||||||
|
source "${xdgCfg.configHome}/zsh/p10k.zsh";
|
||||||
|
'';
|
||||||
|
zshConfig = mkOrder 1000 ''
|
||||||
# vi keybindings for menu select
|
# vi keybindings for menu select
|
||||||
bindkey -M menuselect 'h' vi-backward-char
|
#bindkey -M menuselect 'h' vi-backward-char
|
||||||
bindkey -M menuselect 'k' vi-up-line-or-history
|
#bindkey -M menuselect 'k' vi-up-line-or-history
|
||||||
bindkey -M menuselect 'j' vi-down-line-or-history
|
#bindkey -M menuselect 'j' vi-down-line-or-history
|
||||||
bindkey -M menuselect 'l' vi-forward-char
|
#bindkey -M menuselect 'l' vi-forward-char
|
||||||
|
|
||||||
# Tab to accept current selection
|
# Tab to accept current selection
|
||||||
bind-key -M menuselect '^I' accept-and-infer-next-history
|
#bindkey -M menuselect '^I' accept-and-infer-next-history
|
||||||
|
|
||||||
# Control arrow keys
|
# Control arrow keys
|
||||||
bindkey '^[[1;5C' forward-word
|
bindkey '^[[1;5C' forward-word
|
||||||
bindkey '^[[1;5D' backward-word
|
bindkey '^[[1;5D' backward-word
|
||||||
'';
|
'';
|
||||||
|
in mkMerge [ zshConfigInitEarly zshConfig ];
|
||||||
|
|
||||||
shellAliases = {
|
shellAliases = {
|
||||||
".." = "cd ..";
|
".." = "cd ..";
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue