Reorganize common configuration
This commit is contained in:
parent
b0435707e4
commit
84dfefcb45
18 changed files with 81 additions and 128 deletions
45
common/home-manager/zsh.nix
Normal file
45
common/home-manager/zsh.nix
Normal file
|
@ -0,0 +1,45 @@
|
|||
{ config, lib, ... }: {
|
||||
programs = {
|
||||
zsh = {
|
||||
enable = true;
|
||||
initContent = let
|
||||
earlyInit = lib.mkBefore ''
|
||||
setopt AUTO_PUSHD
|
||||
setopt SHARE_HISTORY
|
||||
setopt MENUCOMPLETE
|
||||
autoload -U history-search-end
|
||||
zle -N history-beginning-search-backward-end history-search-end
|
||||
zle -N history-beginning-search-forward-end history-search-end
|
||||
bindkey "^[OA" history-beginning-search-backward-end
|
||||
bindkey "^[OB" history-beginning-search-forward-end
|
||||
bindkey "^r" history-incremental-search-backward
|
||||
|
||||
zstyle ':completion::complete:*' use-cache on
|
||||
zstyle ':completion::complete:*' cache-path ~/.zsh/cache/$HOST
|
||||
zstyle ':completion:*' menu select=1 _complete _ignored _approximate
|
||||
zstyle ':completion:*' verbose yes
|
||||
zstyle ':completion:*:descriptions' format '%B%d%b'
|
||||
zstyle ':completion:*:messages' format '%d'
|
||||
zstyle ':completion:*:warnings' format 'No matches for: %d'
|
||||
zstyle ':completion:*:corrections' format '%B%d (errors: %e)%b'
|
||||
zstyle ':completion:*' group-name \'\'
|
||||
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}'
|
||||
'';
|
||||
postInit = lib.mkAfter ''
|
||||
if [ -x "$(command -v fastfetch)" ]; then
|
||||
fastfetch
|
||||
fi
|
||||
'';
|
||||
in lib.mkMerge [ earlyInit postInit ];
|
||||
history.path = "${config.xdg.dataHome}/zhistory";
|
||||
syntaxHighlighting.enable = true;
|
||||
};
|
||||
starship = {
|
||||
enable = true;
|
||||
settings = {
|
||||
add_newline = true;
|
||||
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue