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

Change ]c to ]C to avoid conflicting with vimdiff #1119

Closed
rkulla opened this issue Aug 27, 2019 · 3 comments
Closed

Change ]c to ]C to avoid conflicting with vimdiff #1119

rkulla opened this issue Aug 27, 2019 · 3 comments

Comments

@rkulla
Copy link

rkulla commented Aug 27, 2019

The readme suggests creating these mappings:

" Use [c and ]c to navigate diagnostics.
nmap [c (coc-diagnostic-prev)
nmap ]c (coc-diagnostic-next)

but doing so will stop those shortcuts from working with vimdiff. I recommend changing the README to suggesting capitalized versions ]C and [C to not conflict.

Thanks

@chemzqm
Copy link
Member

chemzqm commented Aug 27, 2019

I don't like uppercase letter with keymapping.

@rkulla
Copy link
Author

rkulla commented Aug 27, 2019

@chemzqm well doesn't have to be uppercase, just a suggestion.

@JoosepAlviste
Copy link
Contributor

I use ]g and [g to navigate diagnostics:

nmap <silent> [g <Plug>(coc-diagnostic-prev)
nmap <silent> ]g <Plug>(coc-diagnostic-next)

And ]c and [c to navigate coc-git diff chunks so that the mapping matches vimdiff:

nmap <silent> <expr> [c &diff ? '[c' : '<Plug>(coc-git-prevchunk)'
nmap <silent> <expr> ]c &diff ? ']c' : '<Plug>(coc-git-nextchunk)'

I guess if you like ]c for navigating diagnostics but don't want it to conflict with vimdiff you can have similar mappings:

nmap <silent> <expr> [c &diff ? '[c' : '<Plug>(coc-diagnostic-prev)'
nmap <silent> <expr> ]c &diff ? ']c' : '<Plug>(coc-diagnostic-next)'

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

3 participants