▲ 1396 ▼ D or d come on (i.imgur.com) submitted 2 years ago by genfood@feddit.de to c/programmer_humor@programming.dev 221 comments fedilink hide all child comments
[–] xnasero@programming.dev 11 points 2 years ago* (1 child) Op does not know about $CDPATH and tab completion keke permalink fedilink source hideshow 2 child comments replies: [–] PennyJim@lemmy.world 5 points 2 years ago (2 children) 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 permalink fedilink source parent hideshow 4 child comments replies: [–] zlatko@programming.dev 8 points 2 years ago (3 children) For bash, this is enough: # Bash TAB-completition enhancements # Case-insensitive bind "set completion-ignore-case on" # Treat - and _ as equivalent in tab-compl bind "set completion-map-case on" # Expand options on the _first_ TAB press. bind "set show-all-if-ambiguous on" If you also add e.g.CDPATH=~/Documents, it will also always autocomplete from your Documents no matter which directory you're on. permalink fedilink source parent hideshow 6 child comments replies: [–] PennyJim@lemmy.world 3 points 2 years ago Setting CDPATH=:~/Documents/Dev makes navigating to any of my projects so much easier. Thanks for bringing it to my attention permalink fedilink source parent [–] csm10495@sh.itjust.works 2 points 2 years ago (1 child) Thanks kind stranger. Never knew of this. permalink fedilink source parent hideshow 2 child comments replies: [–] zlatko@programming.dev 1 point 2 years ago 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. permalink fedilink source parent [–] kattfisk@lemmy.dbzer0.com 1 point 2 years ago* 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 see ...1-CrashLog2022-12-22 ...1.config ...2 ...2-CrashLog2023-10-02 ...2.config ...2.userprofiles $vim FoobarSystem-v20.69.1 GNU 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 $include /etc/inputrc set completion-ignore-case on set show-all-if-ambiguous on set completion-map-case on set completion-prefix-display-length 9 permalink fedilink source parent [–] F04118F@feddit.nl 2 points 2 years ago* (1 child) There's probably some way to add it in bash, but if you install zsh and use the default options for everything, it just works! I especially love zsh for things "just work": not just tab completion for directories but also having completion for tools like git, docker, kubectl, etc is super easy, and you don't need any weird magic like in Bash if you want to use an alias with the same completion permalink fedilink source parent hideshow 2 child comments replies: [–] bnjmn@programming.dev 4 points 2 years ago (1 child) Hmm, it didn't "just work" for me. I had to set it up recently: zstyle ':completion:*' matcher-list '' 'm:{a-zA-Z}={A-Za-z}' 'r:|=*' 'l:|=* r:|=*' That line needs to go in .zshrc. Maybe it's enabled by default with oh-my-zsh? permalink fedilink source parent hideshow 2 child comments replies: [–] F04118F@feddit.nl 1 point 2 years ago (1 child) I'm sorry, that must be it, I immediately installed oh-my-zsh after switching to zsh permalink fedilink source parent hideshow 2 child comments replies: [–] bnjmn@programming.dev 2 points 2 years ago I tend to always install both of them together too! Which makes it a little hard to know where things are coming from. This time I decided to start from scratch, so certain aspects of the config are still salient in my mind permalink fedilink source parent
[–] PennyJim@lemmy.world 5 points 2 years ago (2 children) 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 permalink fedilink source parent hideshow 4 child comments replies: [–] zlatko@programming.dev 8 points 2 years ago (3 children) For bash, this is enough: # Bash TAB-completition enhancements # Case-insensitive bind "set completion-ignore-case on" # Treat - and _ as equivalent in tab-compl bind "set completion-map-case on" # Expand options on the _first_ TAB press. bind "set show-all-if-ambiguous on" If you also add e.g.CDPATH=~/Documents, it will also always autocomplete from your Documents no matter which directory you're on. permalink fedilink source parent hideshow 6 child comments replies: [–] PennyJim@lemmy.world 3 points 2 years ago Setting CDPATH=:~/Documents/Dev makes navigating to any of my projects so much easier. Thanks for bringing it to my attention permalink fedilink source parent [–] csm10495@sh.itjust.works 2 points 2 years ago (1 child) Thanks kind stranger. Never knew of this. permalink fedilink source parent hideshow 2 child comments replies: [–] zlatko@programming.dev 1 point 2 years ago 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. permalink fedilink source parent [–] kattfisk@lemmy.dbzer0.com 1 point 2 years ago* 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 see ...1-CrashLog2022-12-22 ...1.config ...2 ...2-CrashLog2023-10-02 ...2.config ...2.userprofiles $vim FoobarSystem-v20.69.1 GNU 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 $include /etc/inputrc set completion-ignore-case on set show-all-if-ambiguous on set completion-map-case on set completion-prefix-display-length 9 permalink fedilink source parent [–] F04118F@feddit.nl 2 points 2 years ago* (1 child) There's probably some way to add it in bash, but if you install zsh and use the default options for everything, it just works! I especially love zsh for things "just work": not just tab completion for directories but also having completion for tools like git, docker, kubectl, etc is super easy, and you don't need any weird magic like in Bash if you want to use an alias with the same completion permalink fedilink source parent hideshow 2 child comments replies: [–] bnjmn@programming.dev 4 points 2 years ago (1 child) Hmm, it didn't "just work" for me. I had to set it up recently: zstyle ':completion:*' matcher-list '' 'm:{a-zA-Z}={A-Za-z}' 'r:|=*' 'l:|=* r:|=*' That line needs to go in .zshrc. Maybe it's enabled by default with oh-my-zsh? permalink fedilink source parent hideshow 2 child comments replies: [–] F04118F@feddit.nl 1 point 2 years ago (1 child) I'm sorry, that must be it, I immediately installed oh-my-zsh after switching to zsh permalink fedilink source parent hideshow 2 child comments replies: [–] bnjmn@programming.dev 2 points 2 years ago I tend to always install both of them together too! Which makes it a little hard to know where things are coming from. This time I decided to start from scratch, so certain aspects of the config are still salient in my mind permalink fedilink source parent
[–] zlatko@programming.dev 8 points 2 years ago (3 children) For bash, this is enough: # Bash TAB-completition enhancements # Case-insensitive bind "set completion-ignore-case on" # Treat - and _ as equivalent in tab-compl bind "set completion-map-case on" # Expand options on the _first_ TAB press. bind "set show-all-if-ambiguous on" If you also add e.g.CDPATH=~/Documents, it will also always autocomplete from your Documents no matter which directory you're on. permalink fedilink source parent hideshow 6 child comments replies: [–] PennyJim@lemmy.world 3 points 2 years ago Setting CDPATH=:~/Documents/Dev makes navigating to any of my projects so much easier. Thanks for bringing it to my attention permalink fedilink source parent [–] csm10495@sh.itjust.works 2 points 2 years ago (1 child) Thanks kind stranger. Never knew of this. permalink fedilink source parent hideshow 2 child comments replies: [–] zlatko@programming.dev 1 point 2 years ago 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. permalink fedilink source parent [–] kattfisk@lemmy.dbzer0.com 1 point 2 years ago* 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 see ...1-CrashLog2022-12-22 ...1.config ...2 ...2-CrashLog2023-10-02 ...2.config ...2.userprofiles $vim FoobarSystem-v20.69.1 GNU 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 $include /etc/inputrc set completion-ignore-case on set show-all-if-ambiguous on set completion-map-case on set completion-prefix-display-length 9 permalink fedilink source parent
[–] PennyJim@lemmy.world 3 points 2 years ago Setting CDPATH=:~/Documents/Dev makes navigating to any of my projects so much easier. Thanks for bringing it to my attention permalink fedilink source parent
[–] csm10495@sh.itjust.works 2 points 2 years ago (1 child) Thanks kind stranger. Never knew of this. permalink fedilink source parent hideshow 2 child comments replies: [–] zlatko@programming.dev 1 point 2 years ago 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. permalink fedilink source parent
[–] zlatko@programming.dev 1 point 2 years ago 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. permalink fedilink source parent
[–] kattfisk@lemmy.dbzer0.com 1 point 2 years ago* 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 see ...1-CrashLog2022-12-22 ...1.config ...2 ...2-CrashLog2023-10-02 ...2.config ...2.userprofiles $vim FoobarSystem-v20.69.1 GNU 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 $include /etc/inputrc set completion-ignore-case on set show-all-if-ambiguous on set completion-map-case on set completion-prefix-display-length 9 permalink fedilink source parent
[–] F04118F@feddit.nl 2 points 2 years ago* (1 child) There's probably some way to add it in bash, but if you install zsh and use the default options for everything, it just works! I especially love zsh for things "just work": not just tab completion for directories but also having completion for tools like git, docker, kubectl, etc is super easy, and you don't need any weird magic like in Bash if you want to use an alias with the same completion permalink fedilink source parent hideshow 2 child comments replies: [–] bnjmn@programming.dev 4 points 2 years ago (1 child) Hmm, it didn't "just work" for me. I had to set it up recently: zstyle ':completion:*' matcher-list '' 'm:{a-zA-Z}={A-Za-z}' 'r:|=*' 'l:|=* r:|=*' That line needs to go in .zshrc. Maybe it's enabled by default with oh-my-zsh? permalink fedilink source parent hideshow 2 child comments replies: [–] F04118F@feddit.nl 1 point 2 years ago (1 child) I'm sorry, that must be it, I immediately installed oh-my-zsh after switching to zsh permalink fedilink source parent hideshow 2 child comments replies: [–] bnjmn@programming.dev 2 points 2 years ago I tend to always install both of them together too! Which makes it a little hard to know where things are coming from. This time I decided to start from scratch, so certain aspects of the config are still salient in my mind permalink fedilink source parent
[–] bnjmn@programming.dev 4 points 2 years ago (1 child) Hmm, it didn't "just work" for me. I had to set it up recently: zstyle ':completion:*' matcher-list '' 'm:{a-zA-Z}={A-Za-z}' 'r:|=*' 'l:|=* r:|=*' That line needs to go in .zshrc. Maybe it's enabled by default with oh-my-zsh? permalink fedilink source parent hideshow 2 child comments replies: [–] F04118F@feddit.nl 1 point 2 years ago (1 child) I'm sorry, that must be it, I immediately installed oh-my-zsh after switching to zsh permalink fedilink source parent hideshow 2 child comments replies: [–] bnjmn@programming.dev 2 points 2 years ago I tend to always install both of them together too! Which makes it a little hard to know where things are coming from. This time I decided to start from scratch, so certain aspects of the config are still salient in my mind permalink fedilink source parent
[–] F04118F@feddit.nl 1 point 2 years ago (1 child) I'm sorry, that must be it, I immediately installed oh-my-zsh after switching to zsh permalink fedilink source parent hideshow 2 child comments replies: [–] bnjmn@programming.dev 2 points 2 years ago I tend to always install both of them together too! Which makes it a little hard to know where things are coming from. This time I decided to start from scratch, so certain aspects of the config are still salient in my mind permalink fedilink source parent
[–] bnjmn@programming.dev 2 points 2 years ago I tend to always install both of them together too! Which makes it a little hard to know where things are coming from. This time I decided to start from scratch, so certain aspects of the config are still salient in my mind permalink fedilink source parent