A Vim/Neovim plugin for navigating the quicklist and location lists relative to the current cursor position.
Install using your favourite package manager, or use Vim's built-in package support. Example for vim-plug:
Plug 'infokiller/vim-errorlist'
" On-demand lazy loading
Plug 'infokiller/vim-errorlist', { 'on': ['errorlist#Navigate'] }The plugin offers 4 commands:
QuickFixPrev: go to quickfix error before the cursorQuickFixNext: go to quickfix error after the cursorLoclistPrev: go to location list error before the cursorLoclistNext: go to location list error after the cursor
By default, the plugin doesn't do any remappings. Example configuration:
" Navigate quickfix list with Ctrl+{p,n}
nnoremap <C-p> :QuickFixPrev<cr>
nnoremap <C-n> :QuickFixNext<cr>
" Navigate location list with Alt+{p,n}
nnoremap <M-p> :LoclistPrev<cr>
nnoremap <M-n> :LoclistNext<cr>You can define a command that will be executed right after the navigation. For example, the snippet below will scroll so that the cursor in the center of the window:
let g:error_list_post_command = 'normal! zz'By default, the plugin will fall back to vim's built in navigation commands (:cn etc.) if the number of items is more than 2,000. The reason for this is that navigating relative to the cursor can become slow with a large number of items.
To change the maximum number of items:
let g:error_list_max_items = 2000