Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

overriding/disabling conflicting keybindings #215

Open
towc opened this issue Nov 19, 2018 · 1 comment
Open

overriding/disabling conflicting keybindings #215

towc opened this issue Nov 19, 2018 · 1 comment

Comments

@towc
Copy link

towc commented Nov 19, 2018

I use vim inside of tmux, and I set vim up so that when I press c-j/c-k, I go to whatever is below/above, either a vim window, or a tmux pane.

Vmail is overriding this by opening the previous/next email. I tried to put a bunch of stuff in vim_opts in the .vmailrc, but I can't seem to disable/re-override (ideally elegantly) these mappings. Any suggestions? What can I do?

Also, running :nunmap <buffer> <c-j> after opening vmail correctly restores the behaviour in that particular buffer, but I don't want to manually do that every time

@towc towc changed the title conflicting keybindings overriding/disabling conflicting keybindings Nov 19, 2018
@notalex
Copy link
Collaborator

notalex commented Dec 2, 2018

The mapping is defined here:

vmail/lib/vmail.vim

Lines 864 to 874 in 9ccbb59

if !hasmapto('<Plug>VmailMessageWindow_ShowNext')
nmap <buffer> <C-j> <Plug>VmailMessageWindow_ShowNext
nmap <buffer> <leader>j <Plug>VmailMessageWindow_ShowNext
endif
nnoremap <buffer> <unique> <script> <Plug>VmailMessageWindow_ShowNext :call <SID>show_next_message()<CR>
if !hasmapto('<Plug>VmailMessageWindow_ShowPrev')
nmap <buffer> <C-k> <Plug>VmailMessageWindow_ShowPrev
nmap <buffer> <leader>k <Plug>VmailMessageWindow_ShowPrev
endif
nnoremap <buffer> <unique> <script> <Plug>VmailMessageWindow_ShowPrev :call <SID>show_previous_message()<CR>

So if one wants vmail to not map c-j and c-k, they would need to add mappings for these <Plug>... functions in their .vimrc. For e.g. if you want only the <leader>j/<leader>k mappings to go to the next/previous message, define the following in your .vimrc:

  nmap <buffer> <leader>j <Plug>VmailMessageWindow_ShowNext
  nmap <buffer> <leader>k <Plug>VmailMessageWindow_ShowPrev

Let me know if this works for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants