Skip to content

Commit

Permalink
change diagnostic map key setting
Browse files Browse the repository at this point in the history
  • Loading branch information
jayli committed Aug 29, 2023
1 parent 08724d9 commit 6afed63
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,11 @@ Set trigger completion mapping:
let g:easycomplete_tab_trigger="<c-space>"
```

The plugin has already map diagnostic jumping to `<C-j>` and `<C-k>`. You can change these mapping via:
The plugin has already map diagnostic jumping to `<C-n>` and `<S-C-n>`. You can change these mapping via:

```vim
nnoremap <silent> <C-k> :EasyCompleteNextDiagnostic<CR>
nnoremap <silent> <C-j> :EasyCompletePreviousDiagnostic<CR>
let g:easycomplete_diagnostics_next = "<C-J>"
let g:easycomplete_diagnostics_prev = "<C-k>"
```

- Set `let g:easycomplete_diagnostics_enable = 0` to disable lsp diagnostics.
Expand Down
4 changes: 2 additions & 2 deletions autoload/easycomplete.vim
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,8 @@ function! s:BindingTypingCommandOnce()
exec "inoremap <silent><expr> " . g:easycomplete_tab_trigger . " easycomplete#CleverTab()"
exec "inoremap <silent><expr> " . g:easycomplete_shift_tab_trigger . " easycomplete#CleverShiftTab()"
try
nnoremap <silent><unique> <C-j> :EasyCompleteNextDiagnostic<CR>
nnoremap <silent><unique> <C-k> :EasyCompletePreviousDiagnostic<CR>
exec "nnoremap <silent><unique> " . g:easycomplete_diagnostics_next . " :EasyCompleteNextDiagnostic<CR>"
exec "nnoremap <silent><unique> " . g:easycomplete_diagnostics_prev . " :EasyCompletePreviousDiagnostic<CR>"
catch /^Vim\%((\a\+)\)\=:E227/
if g:easycomplete_lsp_checking != 0
call easycomplete#util#log(
Expand Down
6 changes: 6 additions & 0 deletions plugin/easycomplete.vim
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,12 @@ endif
if !exists("g:easycomplete_signature_offset")
let g:easycomplete_signature_offset = 0
endif
if !exists("g:easycomplete_diagnostics_next")
let g:easycomplete_diagnostics_next = "<C-n>"
endif
if !exists("g:easycomplete_diagnostics_prev")
let g:easycomplete_diagnostics_prev= "<S-C-n>"
endif

let g:easycomplete_config = {
\ 'g:easycomplete_diagnostics_hover': 1,
Expand Down

0 comments on commit 6afed63

Please sign in to comment.