Commit 7a8b195a469a

Vincent Demeester <vincent@sbr.pm>
2020-03-13 09:11:41
Move emacs "detection" up
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
1 parent bdcf0cf
Changed files (1)
modules
profiles
modules/profiles/zsh.nix
@@ -104,15 +104,6 @@ in
           for func ($HOME/${config.programs.zsh.dotDir}/functions) autoload -U $func/*(x:t)
           autoload -Uz select-word-style; select-word-style bash
           if [ -e /home/vincent/.nix-profile/etc/profile.d/nix.sh ]; then . /home/vincent/.nix-profile/etc/profile.d/nix.sh; fi
-          # make sure navigation using emacs keybindings works on all non-alphanumerics
-          # syntax highlighting
-          source ${pkgs.zsh-syntax-highlighting}/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
-          ZSH_HIGHLIGHT_PATTERNS+=('rm -rf *' 'fg=white,bold,bg=red')
-          ZSH_HIGHLIGHT_PATTERNS+=('rm -fR *' 'fg=white,bold,bg=red')
-          ZSH_HIGHLIGHT_PATTERNS+=('rm -fr *' 'fg=white,bold,bg=red')
-          source $HOME/${config.programs.zsh.dotDir}/completion.zsh
-          source $HOME/${config.programs.zsh.dotDir}/plugins/powerlevel10k/powerlevel10k.zsh-theme
-          source $HOME/${config.programs.zsh.dotDir}/prompt.zsh
           #if [ -n "$INSIDE_EMACS" ]; then
           #  chpwd() { print -P "\033AnSiTc %d" }
           #  print -P "\033AnSiTu %n"
@@ -128,6 +119,15 @@ in
             unfunction preexec
             PS1='$ '
           fi
+          # make sure navigation using emacs keybindings works on all non-alphanumerics
+          # syntax highlighting
+          source ${pkgs.zsh-syntax-highlighting}/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
+          ZSH_HIGHLIGHT_PATTERNS+=('rm -rf *' 'fg=white,bold,bg=red')
+          ZSH_HIGHLIGHT_PATTERNS+=('rm -fR *' 'fg=white,bold,bg=red')
+          ZSH_HIGHLIGHT_PATTERNS+=('rm -fr *' 'fg=white,bold,bg=red')
+          source $HOME/${config.programs.zsh.dotDir}/completion.zsh
+          source $HOME/${config.programs.zsh.dotDir}/plugins/powerlevel10k/powerlevel10k.zsh-theme
+          source $HOME/${config.programs.zsh.dotDir}/prompt.zsh
           setopt hist_ignore_space
           alias -g L="|less"
           alias -g EEL=' 2>&1 | less'