2022-02-05 21:42:36 +02:00
|
|
|
{ pkgs, config, ... }:
|
|
|
|
let
|
|
|
|
component = name: builtins.readFile (builtins.toString ../../config/zsh/components + "/${name}.zsh");
|
|
|
|
|
|
|
|
snippets = map component [
|
|
|
|
"console-256color"
|
|
|
|
"fuzzy-tab"
|
|
|
|
"magic-space"
|
|
|
|
"navigation"
|
|
|
|
] ++ [
|
|
|
|
"source ${pkgs.fzf}/share/fzf/key-bindings.zsh"
|
|
|
|
"ZSH_HIGHLIGHT_DIRS_BLACKLIST=(/* /ipfs /ipns)"
|
2022-04-22 18:41:44 +03:00
|
|
|
''
|
|
|
|
command_not_found_handler() {
|
|
|
|
${pkgs.comma}/bin/comma "$@"
|
|
|
|
}
|
|
|
|
''
|
2022-02-05 21:42:36 +02:00
|
|
|
];
|
|
|
|
in {
|
|
|
|
environment.shellAliases = {
|
|
|
|
cat = "bat";
|
|
|
|
df = "duf";
|
|
|
|
doas = "doas ";
|
|
|
|
du = "dua";
|
|
|
|
ip = "ip -c";
|
|
|
|
ls = "lsd";
|
|
|
|
sudo = "sudo ";
|
|
|
|
tree = "lsd --tree";
|
|
|
|
uctl = "systemctl --user";
|
2022-03-31 02:39:41 +03:00
|
|
|
vim = "hx";
|
2022-02-05 21:42:36 +02:00
|
|
|
nix-repl = "nix repl '<repl>'";
|
|
|
|
# thanks gytis
|
|
|
|
manix-view = ''manix "" | grep '^# ' | sed 's/^# \(.*\) (.*/\1/;s/ (.*//;s/^# //' | fzf --ansi --preview="manix '{}' | sed 's/type: /> type: /g' | bat -l Markdown --color=always --plain"'';
|
|
|
|
};
|
|
|
|
programs = {
|
2022-04-22 18:41:44 +03:00
|
|
|
command-not-found.enable = false;
|
2022-02-05 21:42:36 +02:00
|
|
|
zsh = {
|
|
|
|
enable = true;
|
|
|
|
histFile = "$HOME/.cache/zsh_history";
|
|
|
|
histSize = 15000;
|
|
|
|
setOptions = [
|
|
|
|
"autocd"
|
|
|
|
"autopushd"
|
|
|
|
"globcomplete"
|
|
|
|
"globstarshort"
|
|
|
|
"histexpiredupsfirst"
|
|
|
|
"histfcntllock"
|
|
|
|
"histignoredups"
|
|
|
|
"histnofunctions"
|
|
|
|
"histnostore"
|
|
|
|
"histreduceblanks"
|
|
|
|
"histverify"
|
|
|
|
"interactivecomments"
|
|
|
|
"monitor"
|
|
|
|
"nobadpattern"
|
2022-04-22 21:26:13 +03:00
|
|
|
"nonomatch"
|
2022-02-05 21:42:36 +02:00
|
|
|
"promptsubst"
|
|
|
|
"sharehistory"
|
|
|
|
"zle"
|
|
|
|
];
|
|
|
|
|
|
|
|
vteIntegration = true;
|
|
|
|
|
|
|
|
promptInit = builtins.readFile ../../config/zsh/prompt.zsh;
|
|
|
|
interactiveShellInit = builtins.concatStringsSep "\n" snippets;
|
|
|
|
enableCompletion = true;
|
|
|
|
autosuggestions.enable = true;
|
|
|
|
syntaxHighlighting = {
|
|
|
|
enable = true;
|
|
|
|
highlighters = [ "main" "pattern" ];
|
|
|
|
styles = {
|
|
|
|
"precommand" = "fg=33";
|
|
|
|
"arg0" = "fg=39";
|
|
|
|
"single-hyphen-option" = "fg=229";
|
|
|
|
"double-hyphen-option" = "fg=228";
|
|
|
|
"path" = "none";
|
|
|
|
};
|
|
|
|
|
|
|
|
# these are aliases, highlight them properly regardless
|
|
|
|
patterns = {
|
|
|
|
"doas" = "fg=33";
|
|
|
|
"sudo" = "fg=33";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|