Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Case-Insensitive ZSH Suffix Aliases

In my .zshrc I've set up suffix completion aliases like this so that I can open files more easily:

alias -s -- txt='mate -w'

Which allows me to open text files in my text editor without prepending the editor command.

There is a problem, however, when I am attempting to open a file with a capitalized suffix. ZSH will recognize '.txt' and open it in my text editor but not '.TXT.'

Is there any way to make ZSH suffix recognition case-insensitive so that I can open files like these?

like image 255
maxhawkins Avatar asked Jul 18 '09 18:07

maxhawkins


1 Answers

Let me hazard a guess :)

alias -s -- TXT='mate -w'
alias -s -- Txt='mate -w'
alias -s -- TXt='mate -w'
alias -s -- tXt='mate -w'
alias -s -- txT='mate -w'
alias -s -- tXT='mate -w'
alias -s -- TxT='mate -w'
like image 75
Inshallah Avatar answered Sep 30 '22 05:09

Inshallah