blob: 635388fc1ec85c8942d81607c42461aaa40833c5 [file] [log] [blame]
Skyler Greya2dca222022-09-02 00:02:49 +01001{
2 pkgs,
3 home,
4 username,
Skyler Grey934f1422022-09-04 11:50:04 +01005 fzf-tab,
Skyler Greya2dca222022-09-02 00:02:49 +01006 ...
7}: {
8 home = {
9 programs.zsh = {
10 enable = true;
Skyler Grey934f1422022-09-04 11:50:04 +010011 plugins = [
12 {
13 name = "fzf-tab";
14 src = fzf-tab;
15 }
16 ];
Skyler Greya2dca222022-09-02 00:02:49 +010017 oh-my-zsh = {
18 enable = true;
19 plugins = ["git"];
20 theme = "crunch";
21 };
22 history = {
23 size = 10000;
24 path = "${home.xdg.dataHome}/zsh/history";
25 expireDuplicatesFirst = true;
26 extended = true;
27 };
28 initExtra = ''
Skyler Grey9f68e082022-10-31 00:16:15 +000029 unset __HM_SESS_VARS_SOURCED
30 . "$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh"
31
Skyler Greya2dca222022-09-02 00:02:49 +010032 bindkey -v
33 bindkey "\'\'$\{key[Up]}" up-line-or-search
34
Skyler Greya2dca222022-09-02 00:02:49 +010035 ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=243';
36 ZSH_HIGHLIGHT_STYLES[comment]='fg=248';
37
38
39 if [[ $SHLVL != "1" ]]; then
40 export RPS1=$'%{\033[38;5;248m%}(%{$fg[red]%}L$SHLVL%{\033[38;5;248m%})%{\033[39m\033[49m%} '
41 fi
42
43 function tempd {
44 cd "$(mktemp -d)"
45 }
46
47 # disable sort when completing `git checkout`
48 zstyle ':completion:*:git-checkout:*' sort false
49 # set descriptions format to enable group support
50 zstyle ':completion:*:descriptions' format '[%d]'
51 # set list-colors to enable filename colorizing
52 zstyle ':completion:*' list-colors ''${(s.:.)LS_COLORS}
53 # preview directory's content with exa when completing cd
54 zstyle ':fzf-tab:complete:cd:*' fzf-preview 'exa -1 -l --color=always $realpath'
55 # switch group using `,` and `.`
56 zstyle ':fzf-tab:*' switch-group ',' '.'
Skyler Grey934f1422022-09-04 11:50:04 +010057 enable-fzf-tab
Skyler Greya2dca222022-09-02 00:02:49 +010058
59 alias compinit="true"
Skyler Grey65e23692022-09-09 23:14:03 +010060
Skyler Grey9f68e082022-10-31 00:16:15 +000061 ulimit -n 131072
62
Skyler Grey65e23692022-09-09 23:14:03 +010063 source "${./zsh/completions/bun.zsh}"
Skyler Greyb3504ab2022-10-31 00:09:02 +000064 source "${./zsh/completions/charm.zsh}"
Skyler Greya2dca222022-09-02 00:02:49 +010065 '';
66 enableSyntaxHighlighting = true;
67 enableAutosuggestions = true;
68 autocd = true;
69 dotDir = ".config/zsh";
70 };
71
Skyler Grey934f1422022-09-04 11:50:04 +010072 home = {
73 shellAliases = {
74 ":q" = "exit";
Skyler Grey04122e82022-10-30 23:13:01 +000075 "q" = "exit";
Skyler Grey934f1422022-09-04 11:50:04 +010076 };
77 packages = [pkgs.fzf];
Skyler Greya2dca222022-09-02 00:02:49 +010078 };
79 };
80 config.environment.persistence."/nix/persist".users.${username}.directories = [".local/share/zsh"];
81}