this post was submitted on 02 Oct 2023
1407 points (96.7% liked)
Programmer Humor
19480 readers
175 users here now
Welcome to Programmer Humor!
This is a place where you can post jokes, memes, humor, etc. related to programming!
For sharing awful code theres also Programming Horror.
Rules
- Keep content in english
- No advertisements
- Posts must be related to programming or programmer topics
founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Op does not know about $CDPATH and tab completion keke
I've seen a number of comments imply the possibility of case insensitive tab completion. Is this real and how do I do it?
I have multiple times fumbled with forgetting to capitalize something, only for the terminal to 'dunk' at me
For bash, this is enough:
If you also add e.g.
CDPATH=~/Documents
, it will also always autocomplete from your Documents no matter which directory you're on.Setting
CDPATH=:~/Documents/Dev
makes navigating to any of my projects so much easier.Thanks for bringing it to my attention
Thanks kind stranger. Never knew of this.
No problem!
As an aside, I see we're bringing the strangers thing over from Reddit. I hope more of the fun and funny stuff gets over, I miss some of the light shitposting.
Well
completion-ignore-case
is enough to solve this particular problem, the other options are just sugar on top :)I'm going to add
completion-prefix-display-length
to these related bonus tips (I have it set to 9). This makes it a lot easier to compare files with long names in your tab completion.For example if you have a folder with these files:
FoobarSystem-v20.69.11-CrashLog2022-12-22 FoobarSystem-v20.69.11.config FoobarSystem-v20.69.12 FoobarSystem-v20.69.12-CrashLog2023-10-02 FoobarSystem-v20.69.12.config FoobarSystem-v20.69.12.userprofiles
Just type
vim TAB
to seeGNU Readline (which is what Bash uses for input) has a lot of options (e.g. making it behave like vim), and your settings are also used in any other programs that use it for their CLI which is a nice bonus. The config file is
~/.inputrc
and you'd enable the above mentioned options like this