Skyler Grey | a2dca22 | 2022-09-02 00:02:49 +0100 | [diff] [blame] | 1 | { |
| 2 | pkgs, |
| 3 | home, |
| 4 | username, |
Skyler Grey | 934f142 | 2022-09-04 11:50:04 +0100 | [diff] [blame] | 5 | fzf-tab, |
Skyler Grey | a2dca22 | 2022-09-02 00:02:49 +0100 | [diff] [blame] | 6 | ... |
| 7 | }: { |
| 8 | home = { |
| 9 | programs.zsh = { |
| 10 | enable = true; |
Skyler Grey | 934f142 | 2022-09-04 11:50:04 +0100 | [diff] [blame] | 11 | plugins = [ |
| 12 | { |
| 13 | name = "fzf-tab"; |
| 14 | src = fzf-tab; |
| 15 | } |
| 16 | ]; |
Skyler Grey | a2dca22 | 2022-09-02 00:02:49 +0100 | [diff] [blame] | 17 | 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 = '' |
| 29 | bindkey -v |
| 30 | bindkey "\'\'$\{key[Up]}" up-line-or-search |
| 31 | |
Skyler Grey | a2dca22 | 2022-09-02 00:02:49 +0100 | [diff] [blame] | 32 | ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=243'; |
| 33 | ZSH_HIGHLIGHT_STYLES[comment]='fg=248'; |
| 34 | |
| 35 | |
| 36 | if [[ $SHLVL != "1" ]]; then |
| 37 | export RPS1=$'%{\033[38;5;248m%}(%{$fg[red]%}L$SHLVL%{\033[38;5;248m%})%{\033[39m\033[49m%} ' |
| 38 | fi |
| 39 | |
| 40 | function tempd { |
| 41 | cd "$(mktemp -d)" |
| 42 | } |
| 43 | |
| 44 | # disable sort when completing `git checkout` |
| 45 | zstyle ':completion:*:git-checkout:*' sort false |
| 46 | # set descriptions format to enable group support |
| 47 | zstyle ':completion:*:descriptions' format '[%d]' |
| 48 | # set list-colors to enable filename colorizing |
| 49 | zstyle ':completion:*' list-colors ''${(s.:.)LS_COLORS} |
| 50 | # preview directory's content with exa when completing cd |
| 51 | zstyle ':fzf-tab:complete:cd:*' fzf-preview 'exa -1 -l --color=always $realpath' |
| 52 | # switch group using `,` and `.` |
| 53 | zstyle ':fzf-tab:*' switch-group ',' '.' |
Skyler Grey | 934f142 | 2022-09-04 11:50:04 +0100 | [diff] [blame] | 54 | enable-fzf-tab |
Skyler Grey | a2dca22 | 2022-09-02 00:02:49 +0100 | [diff] [blame] | 55 | |
| 56 | alias compinit="true" |
Skyler Grey | 65e2369 | 2022-09-09 23:14:03 +0100 | [diff] [blame] | 57 | |
| 58 | source "${./zsh/completions/bun.zsh}" |
Skyler Grey | a2dca22 | 2022-09-02 00:02:49 +0100 | [diff] [blame] | 59 | ''; |
| 60 | enableSyntaxHighlighting = true; |
| 61 | enableAutosuggestions = true; |
| 62 | autocd = true; |
| 63 | dotDir = ".config/zsh"; |
| 64 | }; |
| 65 | |
Skyler Grey | 934f142 | 2022-09-04 11:50:04 +0100 | [diff] [blame] | 66 | home = { |
| 67 | shellAliases = { |
| 68 | ":q" = "exit"; |
| 69 | }; |
| 70 | packages = [pkgs.fzf]; |
Skyler Grey | a2dca22 | 2022-09-02 00:02:49 +0100 | [diff] [blame] | 71 | }; |
| 72 | }; |
| 73 | config.environment.persistence."/nix/persist".users.${username}.directories = [".local/share/zsh"]; |
| 74 | } |