]> git.armaanb.net Git - config.org.git/commitdiff
zsh: improve zle accept-line
authorArmaan Bhojwani <me@armaanb.net>
Sun, 11 Apr 2021 16:29:30 +0000 (12:29 -0400)
committerArmaan Bhojwani <me@armaanb.net>
Sun, 11 Apr 2021 16:29:50 +0000 (12:29 -0400)
config.org

index 5c68592d2fa3726872710a0563b4d279511d2094..4fa5adc4af7639c66f3d84fdf0581260286635ba 100644 (file)
@@ -981,12 +981,12 @@ I manage plugins using my own plugin manager, ZPE. https://git.sr.ht/~armaan/zpe
 If no command given, =ls=, if in a Git repo, =git status= as well.
 #+begin_src shell :tangle ~/.config/zsh/zshrc
   acheam-accept-line () {
+      zle accept-line
       if [ ${#${(z)BUFFER}} -eq 0 ]; then
           echo
-          [ git rev-parse --git-dir > /dev/null 2>&1 ] && git status
           exa -h --icons --git --group-directories-first
+          [ -d ".git" ] && git status
       fi
-      zle accept-line
   }
   zle -N acheam-accept-line
   bindkey '^M' acheam-accept-line