79 lines
2.3 KiB
Nix
79 lines
2.3 KiB
Nix
{pkgs, ...}: {
|
|
programs.zsh = {
|
|
enable = true;
|
|
enableAutosuggestions = true;
|
|
enableCompletion = true;
|
|
defaultKeymap = "emacs";
|
|
dotDir = ".config/zsh";
|
|
history.expireDuplicatesFirst = true;
|
|
history.path = "$ZDOTDIR/.zsh_history";
|
|
historySubstringSearch.enable = true;
|
|
shellAliases = {
|
|
ls = "${pkgs.eza}/bin/eza --icons -a --group-directories-first";
|
|
diff = "diff --color=auto";
|
|
grep = "grep --color=auto";
|
|
ip = "ip --color=auto";
|
|
mkdir = "mkdir -p";
|
|
gst = "git status";
|
|
gc = "git commit";
|
|
ga = "git add";
|
|
gpl = "git pull";
|
|
gpu = "git push";
|
|
gd = "git diff";
|
|
gch = "git checkout";
|
|
gs = "git switch";
|
|
gre = "git restore";
|
|
gr = "git remote";
|
|
gcl = "git clone";
|
|
glg = "git log --graph --abbrev-commit --decorate --format=format:'%C(bold green)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold yellow)(%ar)%C(reset)%C(auto)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)' --all";
|
|
gb = "git branch";
|
|
gm = "git merge";
|
|
gf = "git fetch";
|
|
rebuild = "~/dotfiles/nixos/rebuild.sh";
|
|
};
|
|
syntaxHighlighting.enable = true;
|
|
syntaxHighlighting.highlighters = ["main" "brackets"];
|
|
initExtra = ''
|
|
# auto completion
|
|
bindkey '^I' complete-word
|
|
bindkey '^[[Z' autosuggest-accept
|
|
# backspace
|
|
bindkey '^[[3' delete-char
|
|
# home / end go to beginning / end of line
|
|
bindkey '^[[H' beginning-of-line
|
|
bindkey '^[[F' end-of-line
|
|
# ctrl+arrow jump word
|
|
bindkey '^[[1;5D' backward-word
|
|
bindkey '^[[1;5C' forward-word
|
|
# ctrl+entf and ctrl+backspace delete word
|
|
bindkey '^[[3;5~' delete-word
|
|
bindkey '^H' backward-delete-word
|
|
'';
|
|
};
|
|
|
|
programs.starship = {
|
|
enable = true;
|
|
enableBashIntegration = true;
|
|
enableZshIntegration = true;
|
|
settings = {
|
|
add_newline = false;
|
|
command_timeout = 5000;
|
|
character = {
|
|
success_symbol = "[](bold green)";
|
|
error_symbol = "[](bold red)";
|
|
};
|
|
cmd_duration = {
|
|
min_time = 500;
|
|
show_milliseconds = true;
|
|
};
|
|
};
|
|
};
|
|
|
|
programs.zoxide = {
|
|
enable = true;
|
|
enableBashIntegration = true;
|
|
enableZshIntegration = true;
|
|
options = ["--cmd cd"];
|
|
};
|
|
}
|