wincent/ferret

:Black command shadows vim-black :Black (main command)

scanny opened this issue · 2 comments

Hi Greg, just a note to let you know that for Python developers like myself, the choice of :Black for buffer-location-list Ack shadows the (main) command of the same name in vim-black, the "opinionated" Python code formatter that I personally believe all sane Python teams should use to escape the "I like it formatted this way, I like it formatted that way" treadmill :)

I commented out this line in the plugin code after it was installed, and that seemed to do the trick:
https://github.com/wincent/ferret/blob/master/plugin/ferret.vim#L661

I searched for other possible resolutions for quite a while and didn't find anything. I suppose other plugins generally avoid that by prefixing their commands (like:PlugInstall instead of just :Install), but I see of course why it makes sense to keep such a potentially commonly used command short.

Anyway, not sure if you have a better idea for how to work around this; my Vimscript/Plugin-fu is still nascent, but I'm learning a lot and ambitious for more after watching your YouTube video series, thanks very, very much for those! :)

We have an suffix-based theme going on with the command names here, so namespacing with a prefix isn't going to work (ie. started with :Ack and later added :Lack, :Back, :Black etc).

It probably wouldn't be too bad though to make this configurable. eg.

let g:FerretCommandNames = {
    \    'Black': 'SomeOtherName',
    \    'Ack': 'AnotherName',
    \ }

Or something like that; it would let you override one or more command names. That seems more robust than trying to autodetect the presence of an existing command (because that would be sensitive to load order).

Great news, thanks @wincent :)