nixos-config/home/zsh/default.nix

97 lines
2.5 KiB
Nix
Raw Normal View History

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-21 15:16:09 -05:00
#disable control+s to pause terminal
unsetopt FLOW_CONTROL
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-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-23 02:30:20 -05:00
programs.fzf.enableZshIntegration = true;
programs.zoxide.enableZshIntegration = true;
programs.eza.enableZshIntegration = true;
2024-12-23 11:39:48 -05:00
programs.nix-index.enableZshIntegration = true;
2024-12-13 23:27:33 -05:00
}