aboutsummaryrefslogtreecommitdiffstats
path: root/modules/home/soispha/conf/zsh/default.nix
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2024-05-20 16:06:57 +0200
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2024-05-20 16:14:24 +0200
commit5156e1aae36a153be98b6832ab3ced7be2b2faee (patch)
tree3f050d3bc567af4c72f87e0925d21c3521436e45 /modules/home/soispha/conf/zsh/default.nix
parentrefactor(hm/conf/zsh): Remove old zsh-prompt file (diff)
downloadnixos-config-5156e1aae36a153be98b6832ab3ced7be2b2faee.zip
refactor(hm): Rename to `modules/home`
Diffstat (limited to 'modules/home/soispha/conf/zsh/default.nix')
-rw-r--r--modules/home/soispha/conf/zsh/default.nix101
1 files changed, 101 insertions, 0 deletions
diff --git a/modules/home/soispha/conf/zsh/default.nix b/modules/home/soispha/conf/zsh/default.nix
new file mode 100644
index 00000000..90eba56c
--- /dev/null
+++ b/modules/home/soispha/conf/zsh/default.nix
@@ -0,0 +1,101 @@
+{
+ config,
+ pkgs,
+ lib,
+ shell_library,
+ system,
+ ...
+}: {
+ # TODO: ADD THIS ADDON
+ # next one only works if your alias is only a command, e.g. if you `alias='cat some_file.txt &2> /dev/null'`, running `cat some_file.txt` won't trigger it.
+ # TODO: find something better for this use case
+ # zsh-you-should-use # ZSH plugin that reminds you to use existing aliases for commands you just typed
+ home.sessionPath = [];
+ programs.zsh = {
+ enable = true;
+ autosuggestion.enable = true;
+ enableCompletion = true;
+ syntaxHighlighting.enable = true;
+
+ autocd = true;
+
+ dotDir = ".config/zsh";
+
+ history = {
+ extended = true;
+ ignoreDups = false;
+ expireDuplicatesFirst = false;
+ ignoreSpace = false; # TODO: I might change that
+
+ path = "${config.xdg.dataHome}/zsh/history";
+ save = 9000000; # number of lines to save
+ size = 9000000; # number of lines to keep
+ share = false; # share between sessions
+ };
+ historySubstringSearch = {
+ enable = true;
+ searchDownKey = "^[[B"; # DOWN Arrow key
+ searchUpKey = "^[[A"; # UP Arrow key
+ };
+
+ loginExtra =
+ ""
+ + lib.concatStringsSep "\nsetopt " [
+ "setopt AUTO_CD" # This is needed as first item
+ "AUTO_PUSHD"
+ "CHASE_DOTS"
+
+ "ALWAYS_TO_END"
+
+ "EXTENDED_HISTORY"
+ "HIST_ALLOW_CLOBBER"
+ "HIST_VERIFY"
+ "HIST_FCNTL_LOCK"
+ "APPEND_HISTORY"
+
+ "DVORAK"
+ "CORRECT"
+
+ "PROMPT_SUBST"
+ "TRANSIENT_RPROMPT" # maybe?
+
+ "COMBINING_CHARS"
+ "VI"
+ ];
+
+ initExtraFirst =
+ builtins.readFile ./config/zsh-init.zsh
+ + ''
+ SHELL_LIBRARY_VERSION="2.1.2" source ${shell_library.rawLib.${system}}
+ # This next line buffers the first line of the following item:
+
+ ''
+ # NOTE: This must be before the insult, as we otherwise override the previous handler <2024-02-28>
+ + builtins.readFile ./config/command_not_found.sh
+ + builtins.readFile ./config/command_not_found_insult.sh
+ + builtins.readFile ./config/custom_cursor.zsh
+ + builtins.readFile "${pkgs.fzf}/share/fzf/key-bindings.zsh";
+
+ shellAliases = {
+ ll = ". ll";
+ hisea = "history 0 | grep";
+ };
+ sessionVariables = {
+ IVIEWER = "imv";
+ READER = "zathura";
+
+ LIBVIRT_DEFAULT_URI = "qemu:///system";
+
+ BEMENU_SCALE = "1.5";
+ BEMENU_BACKEND = "wayland";
+ BEMENU_OPTS = "--fn 'Source Code Pro 10' -c -l 30 -B 1 -W 0.9 --hf #ffffff";
+
+ # Export Wayland env Vars {{{
+ QT_QPA_PLATFORM = "wayland";
+ QT_QPA_PLATFORMTHEME = "qt5ct"; # needs qt5ct
+ CLUTTER_BACKEND = "wayland";
+ SDL_VIDEODRIVER = "wayland"; # might brake some things
+ # }}}
+ };
+ };
+}