views:

242

answers:

2

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?

A: 

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'
Inshallah
+1  A: 

This seems to fix it for me:

setopt extendedglob
unsetopt CASE_GLOB

I got the solution from this question

maxhawkins
Nevermind. This solves completion but not the alias problem.
maxhawkins