Skip to content

Remap locally without autocommands #55

@KabbAmine

Description

@KabbAmine

I know that the default mappings are defined locally, so how can I remap them?

Example, I want to use D for <Plug>(agit-diff) and nnoremap D <Plug>(agit-diff) is of course not the way to do it.

I can use autocommands (FileType agit,agit_diff.....), but is there not a better way?

e.g.

let g:agit_no_default_mappings = 1
augroup Agit
    autocmd!
    autocmd Filetype agit,agit_stat,agit_diff nmap <buffer> D <Plug>(agit-diff)
    autocmd Filetype agit,agit_stat,agit_diff nmap <buffer> q <Plug>(agit-exit)
    autocmd Filetype agit,agit_stat,agit_diff nmap <buffer> R <Plug>(agit-reload)
augroup END

Thanks in advance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions