Timeline for Is it possible to define directory-sensitive aliases in zsh (or any other shell)?
Current License: CC BY-SA 3.0
5 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Jul 5, 2017 at 15:52 | comment | added | k.stm | As I said, I want to add or overwrite existing aliases depending on the current working directory. So this would have to take advantage of some (maybe nonexisting) feature of zsh interpreting aliases differently depending on some context. | |
| Jul 5, 2017 at 15:51 | comment | added | Jeff Schaller♦ | how would the alias know what to do if you rename a folder? I think you'd have to tell it ahead of time. | |
| Jul 5, 2017 at 15:51 | comment | added | Jeff Schaller♦ | extend the [[ to be a case statement, if you have other variations you want to use | |
| Jul 5, 2017 at 15:51 | comment | added | k.stm | Then I would still have to change the alias when renaming ~/pictures to ~/videos. | |
| Jul 5, 2017 at 15:50 | history | answered | Jeff Schaller♦ | CC BY-SA 3.0 |