Created
June 5, 2025 14:36
-
-
Save edgarogh/ab94d995e74ea174771746ae0d228599 to your computer and use it in GitHub Desktop.
Custom default CD directory (I'm using this with IntelliJ to cd to the content root)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- /usr/share/fish/functions/cd.fish 2024-01-01 10:15:17.000000000 -0500 | |
| +++ /home/edgar/.config/fish/functions/cd.fish 2025-06-05 10:32:20.670430570 -0400 | |
| @@ -4,6 +4,11 @@ | |
| function cd --description "Change directory" | |
| set -l MAX_DIR_HIST 25 | |
| + if test (count $argv) = 0 -a -n "$CD_HOME" | |
| + builtin cd $CD_HOME | |
| + return 0 | |
| + end | |
| + | |
| if test (count $argv) -gt (test "$argv[1]" = "--" && echo 2 || echo 1) | |
| printf "%s\n" (_ "Too many args for cd command") >&2 | |
| return 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment