Skyler Turner | 0ab3b7f | 2022-03-04 23:24:10 +0000 | [diff] [blame] | 1 | { config, ... }: { |
Skyler Turner | 62330c1 | 2022-03-04 22:10:16 +0000 | [diff] [blame] | 2 | programs.zsh = { |
| 3 | enable = true; |
| 4 | oh-my-zsh = { |
| 5 | enable = true; |
| 6 | plugins = [ "git" ]; |
| 7 | theme = "crunch"; |
| 8 | }; |
| 9 | history = { |
| 10 | size = 10000; |
| 11 | path = "${config.xdg.dataHome}/zsh/history"; |
| 12 | expireDuplicatesFirst = true; |
| 13 | extended = true; |
| 14 | }; |
| 15 | initExtra = '' |
| 16 | bindkey "\'\'$\{key[Up]}" up-line-or-search |
| 17 | |
| 18 | command_not_found_handler () |
| 19 | { |
| 20 | local p='/nix/store/ycclzpk99snlrk8sg9n4j8pm1927gavw-command-not-found/bin/command-not-found'; |
| 21 | if [ -x "$p" ] && [ -f '/nix/var/nix/profiles/per-user/root/channels/nixos/programs.sqlite' ]; then |
| 22 | "$p" "$@" 2>&1 | sed -r 's/nix-shell -p (\S+)/nix shell nixpkgs#\1/g' 1>&2; |
| 23 | if [ $? = 126 ]; then |
| 24 | "$@"; |
| 25 | else |
| 26 | return 127; |
| 27 | fi; |
| 28 | else |
| 29 | echo "$1: command not found" 1>&2; |
| 30 | return 127; |
| 31 | fi |
| 32 | } |
Skyler Grey | e2f4ab9 | 2022-05-20 12:09:15 +0100 | [diff] [blame] | 33 | |
| 34 | ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=243'; |
Skyler Grey | 87c0f2c | 2022-05-24 13:22:19 +0100 | [diff] [blame] | 35 | ZSH_HIGHLIGHT_STYLES[comment]='fg=248'; |
Skyler Grey | e45bfb8 | 2022-07-20 17:13:27 +0100 | [diff] [blame] | 36 | |
| 37 | if [[ $SHLVL != "1" ]]; then |
| 38 | export prompt="($SHLVL) $prompt" |
| 39 | fi |
Skyler Turner | 62330c1 | 2022-03-04 22:10:16 +0000 | [diff] [blame] | 40 | ''; |
| 41 | enableSyntaxHighlighting = true; |
| 42 | enableAutosuggestions = true; |
| 43 | autocd = true; |
| 44 | dotDir = ".local/share/zsh"; |
| 45 | }; |
Skyler Grey | e2f4ab9 | 2022-05-20 12:09:15 +0100 | [diff] [blame] | 46 | } |