version 18.6b4, also true on master.
black.vim contains:
nmap ,= :Black<CR>
vmap ,= :Black<CR>
But there are problems with this:
- First, this hijacks the comma - which is a standard vim command, that some of us find useful. It's not OK for for plugins to do this!
- Second, this mapping applies to all files - so even when I'm not doing anything python-related at all,
black.vim has hijacked my comma
I'd suggest a couple of options:
-
My preference: simply don't provide a mapping at all. Users can perfectly well set up their own mapping for :Black according to what works for them.
- Suggest a mapping in the README, if you like
-
If you think it's important to provide a mapping out of the box, then my understanding of the conventions (though I'm not completely sure of this) is that:
black.vim should be filetype-specific - that is, you should move it to ftplugin/python.vim
- the mapping that you provide should be scoped to the current
<buffer>
- the mapping should begin with
<localleader>
That way your mapping will only affect python files, and not clash with any standard mappings.
version 18.6b4, also true on master.
black.vimcontains:But there are problems with this:
black.vimhas hijacked my commaI'd suggest a couple of options:
My preference: simply don't provide a mapping at all. Users can perfectly well set up their own mapping for
:Blackaccording to what works for them.If you think it's important to provide a mapping out of the box, then my understanding of the conventions (though I'm not completely sure of this) is that:
black.vimshould be filetype-specific - that is, you should move it toftplugin/python.vim<buffer><localleader>That way your mapping will only affect python files, and not clash with any standard mappings.