vim-qf-diagnostics : Highlight quickfix errors, and display error messages in a popup window
| script karma
Downloaded by 45
Comments, bugs, improvements
script versions (upload new version)
|- Highlight the diagnostics (of a project-build, linter, grep) stored in a quickfix list in the buffer and sign column.
- Display the error message for the current line in a popup window next to the cursor.
<plug>(qf-diagnostics-popup-quickfix) -- Display a popup window at the current cursor position with the error message found for the current line in the quickfix list. If the line contains several errors, all entries are collected and displayed in the same popup window.
<plug>(qf-diagnostics-popup-loclist) -- Same as above but display the error messages from the current location-list of the current window.
If not all quickfix errors (for the current line) fit into the popup window, a scrollbar will appear on the right side. The popup window can then be scrolled with CTRL-J and CTRL-K, or alternatively, using the mouse wheel. Pressing CTRL-C or moving the cursor in any direction will close the popup window.
nmap gh <plug>(qf-diagnostics-popup-quickfix)
nmap gH <plug>(qf-diagnostics-popup-loclist)
Signs and text highlightings:
The items in the quickfix and location list can be highlighted in the sign column and in the buffer directly. Both highlightings are optional and can be individually configured in g:qfdiagnostics. By default, only signs are placed.
:DiagnosticsPlace -- Highlight the diagnostics from the current quickfix list.
:LDiagnosticsPlace -- Same as :DiagnosticsPlace but use the current location list of the current window.
:DiagnosticsClear -- Remove the highlightings placed by :DiagnosticsPlace.
:LDiagnosticsClear[!] -- Remove the highlightings placed by :LDiagnosticsPlace.
:DiagnosticsToggle -- Toggle the diagnostics from the quickfix list.
:LDiagnosticsToggle -- Toggle the diagnostics from the location list.
:DiagnosticsPlace and :LDiagnosticsPlace will first remove any highlightings that have been previously placed by the respective command.
:LDiagnosticsPlace can be run in multiple windows to simultaneously highlight diagnostics from several location lists.
:LDiagnosticsClear must always be run in the same window where :LDiagnosticsPlace has been executed to remove the previously placed diagnostics.
To remove the highlightings of all diagnostics from all location lists at once, run :LDiagnosticsClear!.
Toggle the diagnostics of the quickfix and location lists with F7 and F8, respectively:
nnoremap <F7> <Cmd>DiagnosticsToggle<Cr>
nnoremap <F8> <Cmd>LDiagnosticsToggle<Cr>
If you want to place the diagnostics automatically after running :make or :lmake, add the following to your vimrc:
autocmd QuickfixCmdPost make DiagnosticsPlace
autocmd QuickfixCmdPost lmake LDiagnosticsPlace
|Run the following in the terminal:
git clone https://github.com/bfrg/vim-qf-diagnostics
vim -u NONE -c 'helptags vim-qf-diagnostics/doc | quit'
Note: The directory name git-plugins is arbitrary, you can pick any other name. For more details see :help packages. Alternatively, use your favorite plugin manager.
Click on the package to download.
ip used for rating: 188.8.131.52