use native vi mode

This commit is contained in:
cy 2025-01-03 03:06:48 -05:00
parent 2a5d4500cb
commit 68f4283a0c

View file

@ -15,7 +15,7 @@
highlighters = [ "brackets" ]; highlighters = [ "brackets" ];
}; };
autocd = true; autocd = true;
defaultKeymap = "emacs"; defaultKeymap = "viins";
initExtraFirst = '' initExtraFirst = ''
if [[ -r "''\${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-''\${(%):-%n}.zsh" ]]; then if [[ -r "''\${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-''\${(%):-%n}.zsh" ]]; then
@ -45,6 +45,11 @@
eval "$(${pkgs.fzf}/bin/fzf --zsh)" eval "$(${pkgs.fzf}/bin/fzf --zsh)"
} }
# useful emacs mode bindings
bindkey -M viins "^E" end-of-line
bindkey -M viins "^A" beginning-of-line
bindkey -M viins "^B" backward-char
# fzf-tab stuff # fzf-tab stuff
# set description format to enable group support # set description format to enable group support
zstyle ':completion:*:descriptions' format '[%d]' zstyle ':completion:*:descriptions' format '[%d]'
@ -60,11 +65,6 @@
source ${./p10k.zsh} source ${./p10k.zsh}
''; '';
plugins = with pkgs; [ plugins = with pkgs; [
{
name = "vi-mode";
src = zsh-vi-mode;
file = "share/zsh-vi-mode/zsh-vi-mode.plugin.zsh";
}
{ {
name = "powerlevel10k"; name = "powerlevel10k";
src = zsh-powerlevel10k; src = zsh-powerlevel10k;
@ -109,7 +109,7 @@
}; };
}; };
programs.fzf.enableZshIntegration = false; # manually integrated see above programs.fzf.enableZshIntegration = true;
programs.zoxide.enableZshIntegration = true; programs.zoxide.enableZshIntegration = true;
programs.eza.enableZshIntegration = true; programs.eza.enableZshIntegration = true;
programs.nix-index.enableZshIntegration = false; programs.nix-index.enableZshIntegration = false;