From 7b64fa1b3f5020f833bc44081dcc64b04015284d Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Sun, 15 May 2022 19:55:50 -0700 Subject: zsh: some cleanup --- home/zsh/default.nix | 8 +++++--- home/zsh/options.zsh | 4 ++++ home/zsh/prompt.zsh | 12 +++++++++++- 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 + -- cgit 1.4.1