3 ms·
Interesting... would love to use it, but I'm using haml and sass files, and I can't seem to --type-add anything. I get this: > ack --type-add haml=.haml a
by Groxx 15y ago
Interesting... would love to use it, but I'm using haml and sass files, and I can't seem to --type-add anything. I get this:
> ack --type-add haml=.haml
ack: --type-add: Type "haml" does not exist, creating with ".haml" ...
ack: No regular expression found.
followed by being unable to use the type, and not showing it in --help types. Am I using it incorrectly? I got it via `brew install ack`, so that could be the problem as well.
edit: --type-set=haml=.haml in a .ackrc file works. Though I may have to tweak it to look in the current directory as well - not all projects need the same settings, and in `~` it's not git-able.
- shabble 15y agoif you want a dir-specific one, you could specify export ACKRC=./.ackrc.local as an env variable, and then create that file where-ever you need to override default behaviour, otherwise it'll use ~/.ackrc The downside to doing it this way is that you only get one or the other, you can't (afaik) load ~/.ackrc, and then only override certain aspects of it locally. Also, you're constrained to running it from the basedir of your project. (You might be able to overcome this with a hack based on PROMPT_COMMAND (for bash), or a precmd/preexec function for zsh), which redefines ACKRC appropriately. Regarding the 'gitability' of it, there's no reason why you can't have a ~/.dotfiles/ackrc, with a symlink to ~ That's how I manage my dotfiles anyway, along with a makefile to create any missing symlinks. Something like http://kitenet.net/~joey/code/etckeeper/ http://kitenet.net/~joey/code/etckeeper/ might work out even better, although I've never really found time to play with it.