about summary refs log tree commit diff
path: root/home/zsh
diff options
context:
space:
mode:
authorFranck Cuny <franck@fcuny.net>2022-05-15 19:55:50 -0700
committerFranck Cuny <franck@fcuny.net>2022-05-15 19:55:50 -0700
commit7b64fa1b3f5020f833bc44081dcc64b04015284d (patch)
tree95d9aed39cb2926bc5f150deabf35896f61c235e /home/zsh
parentterminal: once again, fix the colors (diff)
downloadworld-7b64fa1b3f5020f833bc44081dcc64b04015284d.tar.gz
zsh: some cleanup
Diffstat (limited to 'home/zsh')
-rw-r--r--home/zsh/default.nix8
-rw-r--r--home/zsh/options.zsh4
-rw-r--r--home/zsh/prompt.zsh12
3 files changed, 20 insertions, 4 deletions
diff --git a/home/zsh/default.nix b/home/zsh/default.nix
index cc19579..392ccfc 100644
--- a/home/zsh/default.nix
+++ b/home/zsh/default.nix
@@ -20,7 +20,9 @@ in {
         ignoreSpace = true;
         ignoreDups = true;
         share = false;
-        path = "${config.xdg.dataHome}/zsh/zsh_history";
+        # see
+        # https://github.com/nix-community/home-manager/blob/32a7da69dc53c9eb5ad0675eb7fdc58f7fe35272/modules/programs/zsh.nix#L537
+        path = ".local/share/zsh/zsh_history";
       };
 
       localVariables = {
@@ -29,14 +31,14 @@ in {
         REPORTTIME = 5;
       };
 
+      shellAliases = { ll = "ls -l --color=auto"; };
+
       defaultKeymap = "emacs";
       initExtra = lib.concatMapStrings builtins.readFile [
         ./completion-style.zsh
         ./options.zsh
         ./prompt.zsh
       ];
-
     };
-    programs.dircolors = { enable = true; };
   };
 }
diff --git a/home/zsh/options.zsh b/home/zsh/options.zsh
index 84ae8da..6d39bc1 100644
--- a/home/zsh/options.zsh
+++ b/home/zsh/options.zsh
@@ -21,3 +21,7 @@ setopt hist_reduce_blanks
 
 # Those options aren't wanted
 unsetopt beep extendedglob notify
+
+# word select works like in bash
+autoload -U select-word-style
+select-word-style bash
diff --git a/home/zsh/prompt.zsh b/home/zsh/prompt.zsh
index c1277e9..1c21d4b 100644
--- a/home/zsh/prompt.zsh
+++ b/home/zsh/prompt.zsh
@@ -1 +1,11 @@
-PROMPT="%K{cyan}%F{black}%m%k%f %~ %% "
+setopt prompt_subst
+
+PROMPT='%K{cyan}%F{black}%m%k%f %~ %% '
+
+# For tramp (emacs).
+if [ "$TERM" = "dumb" ]; then
+  unset PROMPT
+  PS1='$ '
+  unsetopt zle
+fi
+