blob: fffc039a1317b4e148be753da14d1dd0df5253a5 [file] [log] [blame]
Skyler Grey252927a2022-10-18 22:18:15 +01001{ pkgs
2, home
3, username
4, fzf-tab
5, ...
Skyler Greya2dca222022-09-02 00:02:49 +01006}: {
7 home = {
8 programs.zsh = {
9 enable = true;
Skyler Grey934f1422022-09-04 11:50:04 +010010 plugins = [
11 {
12 name = "fzf-tab";
13 src = fzf-tab;
14 }
15 ];
Skyler Greya2dca222022-09-02 00:02:49 +010016 oh-my-zsh = {
17 enable = true;
Skyler Grey252927a2022-10-18 22:18:15 +010018 plugins = [ "git" ];
Skyler Greya2dca222022-09-02 00:02:49 +010019 theme = "crunch";
20 };
21 history = {
22 size = 10000;
23 path = "${home.xdg.dataHome}/zsh/history";
24 expireDuplicatesFirst = true;
25 extended = true;
26 };
27 initExtra = ''
Skyler Grey9f68e082022-10-31 00:16:15 +000028 unset __HM_SESS_VARS_SOURCED
29 . "$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh"
30
Skyler Greya2dca222022-09-02 00:02:49 +010031 bindkey -v
32 bindkey "\'\'$\{key[Up]}" up-line-or-search
33
Skyler Greya2dca222022-09-02 00:02:49 +010034 ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=243';
35 ZSH_HIGHLIGHT_STYLES[comment]='fg=248';
36
37
38 if [[ $SHLVL != "1" ]]; then
39 export RPS1=$'%{\033[38;5;248m%}(%{$fg[red]%}L$SHLVL%{\033[38;5;248m%})%{\033[39m\033[49m%} '
40 fi
41
42 function tempd {
43 cd "$(mktemp -d)"
44 }
45
46 # disable sort when completing `git checkout`
47 zstyle ':completion:*:git-checkout:*' sort false
48 # set descriptions format to enable group support
49 zstyle ':completion:*:descriptions' format '[%d]'
50 # set list-colors to enable filename colorizing
51 zstyle ':completion:*' list-colors ''${(s.:.)LS_COLORS}
52 # preview directory's content with exa when completing cd
53 zstyle ':fzf-tab:complete:cd:*' fzf-preview 'exa -1 -l --color=always $realpath'
54 # switch group using `,` and `.`
55 zstyle ':fzf-tab:*' switch-group ',' '.'
Skyler Grey934f1422022-09-04 11:50:04 +010056 enable-fzf-tab
Skyler Greya2dca222022-09-02 00:02:49 +010057
58 alias compinit="true"
Skyler Grey65e23692022-09-09 23:14:03 +010059
Skyler Grey9f68e082022-10-31 00:16:15 +000060 ulimit -n 131072
61
Skyler Grey65e23692022-09-09 23:14:03 +010062 source "${./zsh/completions/bun.zsh}"
Skyler Greyb3504ab2022-10-31 00:09:02 +000063 source "${./zsh/completions/charm.zsh}"
Skyler Greya2dca222022-09-02 00:02:49 +010064 '';
65 enableSyntaxHighlighting = true;
66 enableAutosuggestions = true;
67 autocd = true;
68 dotDir = ".config/zsh";
69 };
70
Skyler Grey934f1422022-09-04 11:50:04 +010071 home = {
72 shellAliases = {
73 ":q" = "exit";
Skyler Grey04122e82022-10-30 23:13:01 +000074 "q" = "exit";
Skyler Grey934f1422022-09-04 11:50:04 +010075 };
Skyler Grey252927a2022-10-18 22:18:15 +010076 packages = [ pkgs.fzf ];
Skyler Greya2dca222022-09-02 00:02:49 +010077 };
78 };
Skyler Grey252927a2022-10-18 22:18:15 +010079 config.environment.persistence."/nix/persist".users.${username}.directories = [ ".local/share/zsh" ];
Skyler Greya2dca222022-09-02 00:02:49 +010080}