dotfiles/components/hm/zsh.nix
RingOfStorms (Joshua Bell) eaa2e08f5d user specifics
2024-12-29 01:21:06 -06:00

41 lines
1.4 KiB
Nix

{ ... }:
{
programs.zsh = {
enable = true;
autosuggestion.enable = true;
shellAliases = { };
defaultKeymap = "emacs";
initExtra = ''
# Set editor to neovim, TODO only do this if mod.neovim is enabled
export EDITOR=nvim
export VISUAL=nvim
# Enable editing command in external editor
autoload -Uz edit-command-line
zle -N edit-command-line
# Try multiple bindings for edit-command-line
bindkey '^X^E' edit-command-line # Traditional Ctrl+X,Ctrl+E binding
bindkey '^[^M' edit-command-line # Alt+Enter
# Note: Ctrl+Enter might not be distinctly capturable in all terminals
# Make home/end and ctrl + left/right nav how I expect them to like in bash
bindkey "\e[1~" beginning-of-line
bindkey "\e[4~" end-of-line
bindkey '^[[1;5D' emacs-backward-word
bindkey '^[[1;5C' emacs-forward-word
# Auto completion/suggestions/and case insensitivity
autoload -Uz compinit && compinit
setopt correct
setopt extendedglob
setopt nocaseglob
zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' # Case insensitive tab completion
zstyle ':completion:*' list-colors "''${(s.:.)LS_COLORS}" # Colored completion (different colors for dirs/files/etc)
zstyle ':completion:*' rehash true # automatically find new executables in path
'';
};
}