diff --git a/README.md b/README.md index bcdc6289..74a113de 100644 --- a/README.md +++ b/README.md @@ -350,7 +350,19 @@ and display any new diagnostics it encounters. Do note that recompilation with this command may take a while and during this time the Vim GUI _will_ be blocked. -TODO: extending the semantic engine for other langs, using ListToggle +After the errors are displayed by Syntastic, it will display a short diagnostic +message when you move your cursor to the line with the error. You can get a +detailed diagnostic message with the `d` key mapping (can be changed in +the options) YCM provides when your cursor is on the line with the diagnostic. + +You can also see the full diagnostic message for all the diagnostics in the +current file in Vim's `locationlist`, which can be opened with the `:lopen` and +`:lclose` commands. A good way to toggle the display of the `locationlist` with +a single key mapping is provided by another (very small) Vim plugin called +[ListToggle][] (which also makes it possible to change the height of the +`locationlist` window), also written by yours truly. + +TODO: extending the semantic engine for other langs Options ------- @@ -510,11 +522,19 @@ 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. - Default: `` let g:ycm_key_invoke_completion = '' +### 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. + +Default: `d` + + let g:ycm_key_detailed_diagnostics = 'd' + ### The `g:ycm_global_ycm_extra_conf` option Normally, YCM searches for a `.ycm_extra_conf.py` file for compilation flags @@ -603,3 +623,4 @@ This software is licensed under the [GPL v3 license][gpl]. [flags_example]: https://github.com/Valloric/YouCompleteMe/blob/master/cpp/ycm/.ycm_extra_conf.py [compdb]: http://clang.llvm.org/docs/JSONCompilationDatabase.html [subsequence]: http://en.wikipedia.org/wiki/Subsequence +[listtoggle]: https://github.com/Valloric/ListToggle diff --git a/autoload/youcompleteme.vim b/autoload/youcompleteme.vim index 45f28140..babc46b2 100644 --- a/autoload/youcompleteme.vim +++ b/autoload/youcompleteme.vim @@ -72,8 +72,8 @@ function! youcompleteme#Enable() " candidate that vim selects by default exe 'inoremap ' . g:ycm_key_invoke_completion . ' ' - " TODO: make this a nicer, customizable map - nnoremap d :call ShowDetailedDiagnostic() + exe 'nnoremap ' . g:ycm_key_detailed_diagnostics . + \ ' :call ShowDetailedDiagnostic()' py import sys py import vim diff --git a/plugin/youcompleteme.vim b/plugin/youcompleteme.vim index 2a3b4446..43acc035 100644 --- a/plugin/youcompleteme.vim +++ b/plugin/youcompleteme.vim @@ -85,6 +85,9 @@ let g:ycm_key_previous_completion = let g:ycm_key_invoke_completion = \ get( g:, 'ycm_key_invoke_completion', '' ) +let g:ycm_key_detailed_diagnostics = + \ get( g:, 'ycm_key_detailed_diagnostics', 'd' ) + let g:ycm_global_ycm_extra_conf = \ get( g:, 'ycm_global_ycm_extra_conf', '' )