Skyler Grey | 252927a | 2022-10-18 22:18:15 +0100 | [diff] [blame] | 1 | { pkgs |
| 2 | , home |
| 3 | , username |
| 4 | , fzf-tab |
| 5 | , ... |
Skyler Grey | a2dca22 | 2022-09-02 00:02:49 +0100 | [diff] [blame] | 6 | }: { |
| 7 | home = { |
| 8 | programs.zsh = { |
| 9 | enable = true; |
Skyler Grey | 934f142 | 2022-09-04 11:50:04 +0100 | [diff] [blame] | 10 | plugins = [ |
| 11 | { |
| 12 | name = "fzf-tab"; |
| 13 | src = fzf-tab; |
| 14 | } |
| 15 | ]; |
Skyler Grey | a2dca22 | 2022-09-02 00:02:49 +0100 | [diff] [blame] | 16 | oh-my-zsh = { |
| 17 | enable = true; |
Skyler Grey | 252927a | 2022-10-18 22:18:15 +0100 | [diff] [blame] | 18 | plugins = [ "git" ]; |
Skyler Grey | a2dca22 | 2022-09-02 00:02:49 +0100 | [diff] [blame] | 19 | 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 Grey | 9f68e08 | 2022-10-31 00:16:15 +0000 | [diff] [blame] | 28 | unset __HM_SESS_VARS_SOURCED |
| 29 | . "$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh" |
| 30 | |
Skyler Grey | a2dca22 | 2022-09-02 00:02:49 +0100 | [diff] [blame] | 31 | bindkey -v |
| 32 | bindkey "\'\'$\{key[Up]}" up-line-or-search |
| 33 | |
Skyler Grey | a2dca22 | 2022-09-02 00:02:49 +0100 | [diff] [blame] | 34 | ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=243'; |
Skyler Grey | f8f0653 | 2022-11-04 10:58:38 +0000 | [diff] [blame] | 35 | typeset -gA ZSH_HIGHLIGHT_STYLES |
Skyler Grey | a2dca22 | 2022-09-02 00:02:49 +0100 | [diff] [blame] | 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 Grey | 934f142 | 2022-09-04 11:50:04 +0100 | [diff] [blame] | 57 | enable-fzf-tab |
Skyler Grey | a2dca22 | 2022-09-02 00:02:49 +0100 | [diff] [blame] | 58 | |
| 59 | alias compinit="true" |
Skyler Grey | 65e2369 | 2022-09-09 23:14:03 +0100 | [diff] [blame] | 60 | |
Skyler Grey | 9f68e08 | 2022-10-31 00:16:15 +0000 | [diff] [blame] | 61 | ulimit -n 131072 |
| 62 | |
Skyler Grey | 65e2369 | 2022-09-09 23:14:03 +0100 | [diff] [blame] | 63 | source "${./zsh/completions/bun.zsh}" |
Skyler Grey | b3504ab | 2022-10-31 00:09:02 +0000 | [diff] [blame] | 64 | source "${./zsh/completions/charm.zsh}" |
Skyler Grey | f957c5a | 2023-02-19 22:21:02 +0000 | [diff] [blame] | 65 | |
| 66 | setopt HIST_IGNORE_SPACE |
Skyler Grey | a2dca22 | 2022-09-02 00:02:49 +0100 | [diff] [blame] | 67 | ''; |
| 68 | enableSyntaxHighlighting = true; |
| 69 | enableAutosuggestions = true; |
| 70 | autocd = true; |
| 71 | dotDir = ".config/zsh"; |
| 72 | }; |
| 73 | |
Skyler Grey | 934f142 | 2022-09-04 11:50:04 +0100 | [diff] [blame] | 74 | home = { |
| 75 | shellAliases = { |
| 76 | ":q" = "exit"; |
Skyler Grey | 04122e8 | 2022-10-30 23:13:01 +0000 | [diff] [blame] | 77 | "q" = "exit"; |
Skyler Grey | 934f142 | 2022-09-04 11:50:04 +0100 | [diff] [blame] | 78 | }; |
Skyler Grey | 252927a | 2022-10-18 22:18:15 +0100 | [diff] [blame] | 79 | packages = [ pkgs.fzf ]; |
Skyler Grey | a2dca22 | 2022-09-02 00:02:49 +0100 | [diff] [blame] | 80 | }; |
| 81 | }; |
Skyler Grey | 252927a | 2022-10-18 22:18:15 +0100 | [diff] [blame] | 82 | config.environment.persistence."/nix/persist".users.${username}.directories = [ ".local/share/zsh" ]; |
Skyler Grey | a2dca22 | 2022-09-02 00:02:49 +0100 | [diff] [blame] | 83 | } |