skywind3000 / z.lua

:zap: A new cd command that helps you navigate faster by learning your habits.
MIT License
3k stars 141 forks source link

Feature request: support postcommand hook #107

Closed trbjo closed 4 years ago

trbjo commented 4 years ago

First of all, thank you for a really nice plugin!

I have experimented with the $_ZL_CD variable to no avail. I would like if z.lua could support a post command hook, so that it automatically runs a command after changing dir.

In my .zshrc I have alias cd='clear; cd $@; ls'

That way, I am always told what is in the dir I am switching to.

skywind3000 commented 4 years ago

try this:

my_cd() { clear; builtin cd "$@"; ls; }
_ZL_CD=my_cd
trbjo commented 4 years ago

Works perfectly, thanks!