Blog: 2026-01-23: Difference between revisions

From razwiki
Jump to navigation Jump to search
(Created page with "Thinking about this cd double directory completion Found the current cd completion here: /opt/homebrew/Cellar/fish/4.3.3/share/fish/completions/cd.fish This function: <code>functions __fish_complete_cd</code> I guess it mostly handles this feature called CDPATH that I don't plan to use. It lets you put directories where you can cd into their subdirectories from anywhere... but then your cd tab completion is always full of maybe irrelevant options.")
 
No edit summary
 
(2 intermediate revisions by the same user not shown)
Line 6: Line 6:


I guess it mostly handles this feature called CDPATH that I don't plan to use. It lets you put directories where you can cd into their subdirectories from anywhere... but then your cd tab completion is always full of maybe irrelevant options.
I guess it mostly handles this feature called CDPATH that I don't plan to use. It lets you put directories where you can cd into their subdirectories from anywhere... but then your cd tab completion is always full of maybe irrelevant options.

This post about StackOverflow's decline https://news.ycombinator.com/item?id=46482345

This new cd trick `cdh`

<pre>
$ cdh
g 7) ~
f 6) ~/Downloads
e 5) ~/.config/fish/functions
d 4) ~/.config/fish
c 3) ~/forks
b 2) ~/forks/2026_Rebuilt
a 1) ~/hack
</pre>

zoxide has a similar ui with `zi` but I don't get how to use it and don't really care to try to figure it out.

I learned a bit about CDPATH but I don't like it so whatevs

<pre>
completions $ function __fish_complete_cd
printf "%s\thoho %s\n" fofo
printf "%s\thogo %s\n" olo
end
completions $ cd ~/forks/2026_Rebuilt/
fofo (hoho) olo (hogo)
</pre>

Latest revision as of 23:26, 23 January 2026

Thinking about this cd double directory completion

Found the current cd completion here: /opt/homebrew/Cellar/fish/4.3.3/share/fish/completions/cd.fish

This function: functions __fish_complete_cd

I guess it mostly handles this feature called CDPATH that I don't plan to use. It lets you put directories where you can cd into their subdirectories from anywhere... but then your cd tab completion is always full of maybe irrelevant options.

This post about StackOverflow's decline https://news.ycombinator.com/item?id=46482345

This new cd trick `cdh`

$ cdh
 g  7)  ~
 f  6)  ~/Downloads
 e  5)  ~/.config/fish/functions
 d  4)  ~/.config/fish
 c  3)  ~/forks
 b  2)  ~/forks/2026_Rebuilt
 a  1)  ~/hack

zoxide has a similar ui with `zi` but I don't get how to use it and don't really care to try to figure it out.

I learned a bit about CDPATH but I don't like it so whatevs

completions $ function __fish_complete_cd
                  printf "%s\thoho %s\n" fofo
                  printf "%s\thogo %s\n" olo
              end
completions $ cd ~/forks/2026_Rebuilt/
fofo  (hoho)  olo  (hogo)