All Projects → stevearc → qf_helper.nvim

stevearc / qf_helper.nvim

Licence: MIT license
A collection of improvements for the quickfix buffer

Programming Languages

lua
6591 projects

Projects that are alternatives of or similar to qf helper.nvim

code runner.nvim
Neovim plugin.The best code runner you could have, it is like the one in vscode but with super powers, it manages projects like in intellij but without being slow
Stars: ✭ 234 (+234.29%)
Mutual labels:  vim-plugin, nvim, neovim-plugin, nvim-plugin
nvim-highlite
A colorscheme template that is "lite" on logic for the developer.
Stars: ✭ 163 (+132.86%)
Mutual labels:  nvim, neovim-plugin, nvim-plugin
cutlass.nvim
Plugin that adds a 'cut' operation separate from 'delete'
Stars: ✭ 78 (+11.43%)
Mutual labels:  nvim, neovim-plugin, nvim-plugin
lspcontainers.nvim
Neovim plugin for lspcontainers.
Stars: ✭ 157 (+124.29%)
Mutual labels:  nvim, neovim-plugin, nvim-plugin
substitute.nvim
Neovim plugin introducing a new operators motions to quickly replace and exchange text.
Stars: ✭ 82 (+17.14%)
Mutual labels:  nvim, neovim-plugin, nvim-plugin
nvim-toggle-terminal
NeoVim plugin that toggles a terminal buffer in the current window maintaining the same shell instance
Stars: ✭ 54 (-22.86%)
Mutual labels:  vim-plugin, nvim, nvim-plugin
aerial.nvim
Neovim plugin for a code outline window
Stars: ✭ 485 (+592.86%)
Mutual labels:  nvim, neovim-plugin, nvim-plugin
nvim-ghost.nvim
👻 GhostText plugin for Neovim with zero dependencies 🎉 Supports neovim running inside WSL too! 🥳 Windows/Linux/macOS supported out-of-the-box! 😄 (Other OSes need python3.6+ installed)
Stars: ✭ 32 (-54.29%)
Mutual labels:  nvim, neovim-plugin, nvim-plugin
vim-lamp
💡Language Server Protocol client for Vim.
Stars: ✭ 34 (-51.43%)
Mutual labels:  vim-plugin, nvim, nvim-plugin
bolt.nvim
⚡ Ultrafast multi-pane file manager for Neovim with fuzzy matching
Stars: ✭ 100 (+42.86%)
Mutual labels:  vim-plugin, nvim, neovim-plugin
Coc.nvim
Nodejs extension host for vim & neovim, load extensions like VSCode and host language servers.
Stars: ✭ 18,268 (+25997.14%)
Mutual labels:  vim-plugin, nvim, neovim-plugin
Asyncrun.vim
🚀 Run Async Shell Commands in Vim 8.0 / NeoVim and Output to the Quickfix Window !!
Stars: ✭ 1,332 (+1802.86%)
Mutual labels:  vim-plugin, neovim-plugin
Indent Blankline.nvim
Indent guides for Neovim
Stars: ✭ 203 (+190%)
Mutual labels:  vim-plugin, neovim-plugin
Ncm R
R autocompletion for Neovim and vim 8 📝 📊 ⚡️
Stars: ✭ 102 (+45.71%)
Mutual labels:  vim-plugin, nvim
Nvim Treesitter Context
Show code context
Stars: ✭ 113 (+61.43%)
Mutual labels:  vim-plugin, neovim-plugin
Todoist.nvim
A todoist extension for neovim
Stars: ✭ 84 (+20%)
Mutual labels:  vim-plugin, neovim-plugin
Neovim Fuzzy
Fuzzy file finding for neovim
Stars: ✭ 103 (+47.14%)
Mutual labels:  vim-plugin, neovim-plugin
Vim Clap
👏 Modern performant fuzzy picker for Vim and NeoVim
Stars: ✭ 1,802 (+2474.29%)
Mutual labels:  vim-plugin, neovim-plugin
Ale
Check syntax in Vim asynchronously and fix files, with Language Server Protocol (LSP) support
Stars: ✭ 11,380 (+16157.14%)
Mutual labels:  vim-plugin, neovim-plugin
Targets.vim
Vim plugin that provides additional text objects
Stars: ✭ 2,114 (+2920%)
Mutual labels:  vim-plugin, neovim-plugin

qf_helper.nvim

A collection of improvements for neovim quickfix.

The goal of this plugin is to be small and unobtrusive. It should make your normal quickfix workflows smoother, but it does not aim to change your workflows.

Why another quickfix plugin?

Why not just use vim-qf, nvim-bqf, QFEnter, etc?

Those are all great plugins, but I wanted two features that I could not find:

  1. Keep the quickfix location in sync with cursor location in the file
  2. Have one keybinding for next/prev that intelligently chooses between quickfix and loclist

position tracking in action

Installation

It's a standard neovim plugin. Follow your plugin manager's instructions.

Need a plugin manager? Try pathogen, paq, packer.nvim, vim-packager, dein, or vim-plug

Configuration

All features can be disabled to play nice with any other quickfix plugins or personal customizations you have. Configuration is done by calling setup():

-- Set up qf_helper with the default config
require("qf_helper").setup()

That one line is all you need, but if you want to change some options you can pass them in like so:

require("qf_helper").setup({
  prefer_loclist = true,       -- Used for QNext/QPrev (see Commands below)
  sort_lsp_diagnostics = true, -- Sort LSP diagnostic results
  quickfix = {
    autoclose = true,          -- Autoclose qf if it's the only open window
    default_bindings = true,   -- Set up recommended bindings in qf window
    default_options = true,    -- Set recommended buffer and window options
    max_height = 10,           -- Max qf height when using open() or toggle()
    min_height = 1,            -- Min qf height when using open() or toggle()
    track_location = true,     -- Keep qf updated with your current location
  },
  loclist = {                  -- The same options, but for the loclist
    autoclose = true,
    default_bindings = true,
    default_options = true,
    max_height = 10,
    min_height = 1,
    track_location = true,
  },
})

I also recommend setting up some useful keybindings

-- use <C-N> and <C-P> for next/prev.
vim.keymap.set("n", "<C-N>", "<CMD>QNext<CR>")
vim.keymap.set("n", "<C-P>", "<CMD>QPrev<CR>")
-- toggle the quickfix open/closed without jumping to it
vim.keymap.set("n", "<leader>q", "<CMD>QFToggle!<CR>")
vim.keymap.set("n", "<leader>l", "<CMD>LLToggle!<CR>")

Commands

Command arg description
QNext[!] N=1 Go to next quickfix or loclist entry, choosing based on which is non-empty and which is open. Uses prefer_loclist option to tiebreak.
QPrev[!] N=1 Go to previous quickfix or loclist entry, choosing based on which is non-empty and which is open. Uses prefer_loclist option to tiebreak.
QFNext[!] N=1 Same as cnext, but wraps at the end of the list
QFPrev[!] N=1 Same as cprev, but wraps at the beginning of the list
LLNext[!] N=1 Same as lnext, but wraps at the end of the list
LLPrev[!] N=1 Same as lprev, but wraps at the beginning of the list
QFOpen[!] Same as copen, but dynamically sizes the window. With [!] cursor stays in current window.
LLOpen[!] Same as lopen, but dynamically sizes the window. With [!] cursor stays in current window.
QFToggle[!] Open or close the quickfix window. With [!] cursor stays in current window.
LLToggle[!] Open or close the loclist window. With [!] cursor stays in current window.
Cclear Clear the entries in the quickfix list
Lclear Clear the entries in the loclist
Keep (In qf buffer) Keep the item or range of items, remove the rest
Reject (In qf buffer) Remove the item or range of items

Bindings

When default_bindings = true, the following keybindings are set in the quickfix/loclist buffer:

Key Command
<C-t> open in a new tab
<C-s> open in a horizontal split
<C-v> open in a vertical split
<C-p> open the entry but keep the cursor in the quickfix window
<C-k> scroll up and open entry while keeping the cursor in the quickfix window
<C-j> scroll down and open entry while keeping the cursor in the quickfix window
{ scroll up to the previous file
} scroll down to the next file

FAQ

Q: Why isn't the location tracking working?

Tracking your location requires that the quickfix or loclist items are sorted by both row and col. Chances are you have some items that are out of order.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].