2024-12-25 04:58:40 +00:00
|
|
|
{ pkgs, ... }:
|
2024-12-19 02:32:58 -05:00
|
|
|
{
|
2024-12-13 23:27:33 -05:00
|
|
|
programs.zsh = {
|
|
|
|
enable = true;
|
|
|
|
autosuggestion = {
|
|
|
|
enable = true;
|
2024-12-19 02:32:58 -05:00
|
|
|
strategy = [
|
|
|
|
"history"
|
|
|
|
"completion"
|
|
|
|
];
|
2024-12-13 23:27:33 -05:00
|
|
|
};
|
2024-12-25 04:58:40 +00:00
|
|
|
enableCompletion = true;
|
2024-12-13 23:27:33 -05:00
|
|
|
syntaxHighlighting = {
|
|
|
|
enable = true;
|
2024-12-19 02:32:58 -05:00
|
|
|
highlighters = [ "brackets" ];
|
2024-12-13 23:27:33 -05:00
|
|
|
};
|
|
|
|
autocd = true;
|
|
|
|
defaultKeymap = "emacs";
|
2024-12-25 04:58:40 +00:00
|
|
|
|
2024-12-25 00:45:18 -05:00
|
|
|
initExtraFirst = ''
|
|
|
|
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
|
|
|
|
'';
|
2024-12-25 04:58:40 +00:00
|
|
|
|
2024-12-13 23:27:33 -05:00
|
|
|
history = {
|
|
|
|
ignoreDups = true;
|
|
|
|
ignoreAllDups = true;
|
|
|
|
ignoreSpace = true;
|
2024-12-25 04:58:40 +00:00
|
|
|
save = 10000;
|
|
|
|
size = 10000;
|
2024-12-13 23:27:33 -05:00
|
|
|
append = true;
|
|
|
|
};
|
2024-12-15 01:59:29 -05:00
|
|
|
historySubstringSearch = {
|
2024-12-13 23:27:33 -05:00
|
|
|
enable = true;
|
|
|
|
searchUpKey = "^p";
|
|
|
|
searchDownKey = "^n";
|
|
|
|
};
|
|
|
|
initExtra = ''
|
2024-12-25 02:32:01 -05:00
|
|
|
# disable control+s to pause terminal
|
2024-12-21 15:16:09 -05:00
|
|
|
unsetopt FLOW_CONTROL
|
2024-12-25 01:01:08 -05:00
|
|
|
# manually integrate fzf cause we need to make sure zsh-vi-mode
|
|
|
|
# won't override C-r
|
|
|
|
function zvm_after_init() {
|
|
|
|
eval "$(${pkgs.fzf}/bin/fzf --zsh)"
|
|
|
|
}
|
|
|
|
|
2024-12-25 02:32:01 -05:00
|
|
|
# fzf-tab stuff
|
|
|
|
# set description format to enable group support
|
|
|
|
zstyle ':completion:*:descriptions' format '[%d]'
|
|
|
|
# set list-colors to enable filename colorizing
|
|
|
|
zstyle ':completion:*' list-colors ''\${(s.:.)LS_COLORS}
|
|
|
|
# force zsh not to show completion menu, which allows fzf-tab to capture the unambiguous prefix
|
|
|
|
zstyle ':completion:*' menu no
|
|
|
|
# preview directory's content with eza when completing cd
|
|
|
|
zstyle ':fzf-tab:complete:cd:*' fzf-preview 'eza -1 --color=always $realpath'
|
|
|
|
# switch group using `<` and `>`
|
|
|
|
zstyle ':fzf-tab:*' switch-group '<' '>'
|
|
|
|
|
2024-12-25 00:45:18 -05:00
|
|
|
source ${./p10k.zsh}
|
2024-12-13 23:27:33 -05:00
|
|
|
'';
|
2024-12-25 00:45:18 -05:00
|
|
|
plugins = [
|
|
|
|
{
|
|
|
|
name = "vi-mode";
|
|
|
|
src = pkgs.zsh-vi-mode;
|
|
|
|
file = "share/zsh-vi-mode/zsh-vi-mode.plugin.zsh";
|
|
|
|
}
|
|
|
|
{
|
|
|
|
name = "powerlevel10k";
|
|
|
|
src = pkgs.zsh-powerlevel10k;
|
|
|
|
file = "share/zsh-powerlevel10k/powerlevel10k.zsh-theme";
|
|
|
|
}
|
2024-12-25 02:32:01 -05:00
|
|
|
{
|
|
|
|
name = "fzf-tab";
|
|
|
|
src = pkgs.zsh-fzf-tab;
|
|
|
|
file = "share/fzf-tab/fzf-tab.zsh";
|
|
|
|
}
|
2024-12-25 00:45:18 -05:00
|
|
|
];
|
2024-12-13 23:27:33 -05:00
|
|
|
shellAliases = {
|
|
|
|
"vi" = "nvim";
|
|
|
|
"vim" = "nvim";
|
|
|
|
"t" = "tmux";
|
|
|
|
"tl" = "tmux list-sessions";
|
|
|
|
"ta" = "tmux new-session -A -s";
|
|
|
|
"se" = "sudoedit";
|
|
|
|
"s" = "sudo";
|
|
|
|
"nrs" = "sudo nixos-rebuild switch --flake .";
|
|
|
|
"nrt" = "sudo nixos-rebuild test --flake .";
|
2024-12-13 23:31:56 -05:00
|
|
|
"hrs" = "home-manager switch --flake .";
|
2024-12-14 13:38:09 -05:00
|
|
|
"g" = "git";
|
|
|
|
"ga" = "git add";
|
|
|
|
"gaa" = "git add --all";
|
|
|
|
"gb" = "git branch";
|
|
|
|
"gc" = "git commit --verbose";
|
|
|
|
"gcmsg" = "git commit --message";
|
|
|
|
"gd" = "git diff";
|
|
|
|
"gdca" = "git diff --cached";
|
|
|
|
"gds" = "git diff --staged";
|
|
|
|
"gl" = "git log --stat";
|
|
|
|
"glg" = "git log --graph";
|
|
|
|
"glga" = "git log --graph --decorate --all";
|
|
|
|
"glo" = "git log --oneline --decorate";
|
|
|
|
"gp" = "git push";
|
|
|
|
"gr" = "git remote";
|
|
|
|
"gra" = "git remote add";
|
|
|
|
"grv" = "git remote --verbose";
|
|
|
|
"gs" = "git status --short";
|
|
|
|
"gss" = "git status";
|
2024-12-13 23:27:33 -05:00
|
|
|
};
|
|
|
|
sessionVariables = {
|
|
|
|
"FZF_DEFAULT_COMMAND" = "rg";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-12-25 01:01:08 -05:00
|
|
|
programs.fzf.enableZshIntegration = false;
|
2024-12-23 02:30:20 -05:00
|
|
|
programs.zoxide.enableZshIntegration = true;
|
|
|
|
programs.eza.enableZshIntegration = true;
|
2024-12-25 01:01:08 -05:00
|
|
|
programs.nix-index.enableZshIntegration = false;
|
2024-12-13 23:27:33 -05:00
|
|
|
}
|