Case-Insensitive ZSH Suffix Aliases

linux, shell, unix, zsh

Solution

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'

Problem

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?

Original source

Related problems