diff --git a/README.md b/README.md index 5d4d7f90..78e43aa2 100644 --- a/README.md +++ b/README.md @@ -415,6 +415,11 @@ A better option would be to use Syntastic which will keep your `locationlist` up to date automatically and will also show error/warning notifications in Vim's gutter. +### The `YcmShowDetailedDiagnostic` command + +This command shows the full diagnostic text when the user's cursor is on the +line with the diagnostic. + ### The `YcmDebugInfo` command This will print out various debug information for the current file. Useful to @@ -579,6 +584,8 @@ default mapping will probably only work in GUI Vim (Gvim or MacVim) and not in plain console Vim because the terminal usually does not forward modifier key combinations to Vim. +Setting this option to an empty string will make sure no mapping is created. + Default: `` let g:ycm_key_invoke_completion = '' @@ -586,7 +593,10 @@ Default: `` ### The `g:ycm_key_detailed_diagnostics` option This option controls the key mapping used to show the full diagnostic text when -the user's cursor is on the line with the diagnostic. +the user's cursor is on the line with the diagnostic. It basically calls +`:YcmShowDetailedDiagnostic`. + +Setting this option to an empty string will make sure no mapping is created. Default: `d` diff --git a/autoload/youcompleteme.vim b/autoload/youcompleteme.vim index dc25cc7a..b13c2aac 100644 --- a/autoload/youcompleteme.vim +++ b/autoload/youcompleteme.vim @@ -74,12 +74,16 @@ function! youcompleteme#Enable() exe 'inoremap ' . g:ycm_key_previous_completion . \ ' pumvisible() ? "\" : "\' . g:ycm_key_previous_completion .'"' - " trigger omni completion, deselects the first completion - " candidate that vim selects by default - exe 'inoremap ' . g:ycm_key_invoke_completion . ' ' + if strlen(g:ycm_key_invoke_completion) + " trigger omni completion, deselects the first completion + " candidate that vim selects by default + exe 'inoremap ' . g:ycm_key_invoke_completion . ' ' + endif - exe 'nnoremap ' . g:ycm_key_detailed_diagnostics . - \ ' :call ShowDetailedDiagnostic()' + if strlen(g:ycm_key_detailed_diagnostics) + exe 'nnoremap ' . g:ycm_key_detailed_diagnostics . + \ ' :YcmShowDetailedDiagnostic' + endif py import sys py import vim @@ -404,6 +408,8 @@ function! s:ShowDetailedDiagnostic() py ycm_state.ShowDetailedDiagnostic() endfunction +command! YcmShowDetailedDiagnostic call s:ShowDetailedDiagnostic() + " This is what Syntastic calls indirectly when it decides an auto-check is " required (currently that's on buffer save) OR when the SyntasticCheck command