vimagit icon indicating copy to clipboard operation
vimagit copied to clipboard

unable to override <leader>M mapping

Open mpareja opened this issue 5 years ago • 2 comments

Short description of the problem

The plugin maps <leader>M without checking if it was already mapped. This prevents users from easily overriding the mapping. I, for instance, would like to override the mapping to open in a new tab.

Steps to reproduce

  1. Update vmrc to include: map <silent> <Leader>M :tabnew +MagitOnly<CR>
  2. Restart VIM and hit <leader>M
  3. Unexpected: magit is not opened in a tab

Environment

I am using pathogen, so .vim/after/ftplugin doesn't work to easily address this.

  • vim: 8.0
  • current vimagit version: bf7b16e99e075b019e56f2fbfb96c493ca3635e2
  • ubuntu
  • terminal

mpareja avatar Feb 04 '20 11:02 mpareja

It would be better if users had more control over mapping this plugin. I would like to remove the default <leader>M mapping and set my own. Opening in a new tab, as above, would really useful. Others want this also.

Amparose avatar Apr 21 '21 21:04 Amparose

I've forked vimagit and hacked it up a bit to get all the things I like. But would something like this work, maybe ?

autocmd FileType magit noremap <buffer> <Leader>M :tabnew +MagitOnly<CR>

mckellygit avatar Apr 23 '21 14:04 mckellygit