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