Coder Social home page Coder Social logo

kevinhwang91 / nvim-bqf Goto Github PK

View Code? Open in Web Editor NEW
1.7K 14.0 28.0 352 KB

Better quickfix window in Neovim, polish old quickfix window.

License: BSD 3-Clause "New" or "Revised" License

Lua 99.48% Vim Script 0.26% Makefile 0.26%
neovim quickfix neovim-lua neovim-plugin nvim lua vim fzf qf

nvim-bqf's People

Contributors

ajitid avatar disrupted avatar kevinhwang91 avatar mbenford avatar mehalter avatar n3wborn avatar rockyzhang24 avatar sefidel avatar subjective avatar technicalpickles avatar wookayin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nvim-bqf's Issues

Delete quickfixlist window

Feature description

I know we have a shortcut "<", ">" to switch to the next/previous quick fix list window, I am wondering can we also support some keymap to delete the current quick fix list window? Thanks

Describe the solution you'd like

Support keymap that delete quickfixlist window

Additional context

No response

Feedback: I can't tell why I should use this library

Hello! I've landed on this library about a half-dozen times while looking for new plugins for Neovim. Every time I read the README however, I never walk away with an answer to "what will this plugin actually do for me?"

This list of features here doesn't really trigger anything in my mind: https://github.com/kevinhwang91/nvim-bqf#features

If you expand this out into real-world stories, it would probably help sell the library better!

Example:

By default, of the quickfix window is really hard to use for , . This library lets you to make that experience way better, simply by <pressing some key, setting up some config, whatever>.

Sometimes the preview window does not close

  • nvim --version: NVIM v0.5.0-dev+1293-ga0da4c3a4
  • Operating system/version: Manjaro

Describe the bug

Preview window does not close when it loses focus after opening a new window in :new.

To Reproduce using nvim -u mini.vim

set encoding=utf-8

filetype plugin indent on
if has('vim_starting')
  let s:pluin_manager_dir='~/.config/nvim/.plugged/vim-plug'
  execute 'set runtimepath+=' . s:pluin_manager_dir
endif
call plug#begin('~/.config/nvim/.plugged')
Plug 'kevinhwang91/nvim-bqf'
call plug#end()

set nobackup
set nowritebackup
set noswapfile
set updatecount=0
set backspace=indent,eol,start
language messages en_US.utf8

lua << EOF

require'bqf'.setup{
  preview = {
    win_height = 10
  }
}

EOF

Steps to reproduce the behavior:

  1. nvim -u mini.vim -i NONE ./sample.vim
    sample.vim

    hello world
    
    hello
    
  2. :vimgrep /hello/ %:p | cwindow (open quickfix window)

  3. :new

  4. :cclose

  5. The preview window stays open.

Expected behavior
Close the preview window when a new window is opened in :new.

Screenshots

bqf_issue.mp4

Thank you!

Toggle the Quickfix list

Is there anyway I can have a keybind option to toggle the Quickfix list open and close through this plugin

After :BqfDisable, cannot jump to cursor location with `enter`

  • nvim --version: nvim-0.5, stable version
  • Operating system/version: Windows10, centos7, wsl-ubunt18.04

Describe the bug
After :BqfDisable, try to open the cursor location in qf with enter, a error message rised up.

E5108: Error executing lua /home/xxxxxx/.leovim.plug/nvim-bqf/lua/bqf/wsession.lua:61: attempt to index local 'ws' (a nil value)

The do BqfEnable, it works well.

Steps to reproduce the behavior:

  1. do search to qf
  2. :BqfDisable to close preview window
  3. try to open the cursor location in qf with enter

And also, I found cannot do ctrl-v ctrl-x t/T when preview window is close.

Removing current quickfix list from stack

Describe the solution you'd like
It would be great if nvim-bqf would support a function to remove the currently opened quickfix list from the stack. If there are no other quickfix lists remaining in the stack, it would be best to close quickfix alltogether, if there are other quickfix lists available in the stack, it would be most practical to move to the most nearby list.

This allows for a more efficient use of quickfix lists as old ones do not keep lingering around making it more difficult to find your way through quickfix lists if you have quite a few.

Describe alternatives you've considered
I currently use a filetype plugin for filetype qf to set a keymap that clears all quickfix lists. This is more of a nuclear action as it clears all quickfix lists in the stack all together. I'm not sure if it's possible to just clear the current quickfix list from the stack, so if this can be done Neovim native that will be fine too.

vim.api.nvim_set_keymap('n', 'C', '<CMD>call setqflist([], "f")<CR><CMD>cclose<CR><CMD>echon \'\'<CR>', { noremap = true, silent = true })

Additional context
Cheers on the plugin, great work !

The command `bd` seems to close vim when a quickfix exists.

  • nvim --version:
    NVIM v0.5.0-dev+1133-g0869cbd55
    Build type: RelWithDebInfo
    LuaJIT 2.1.0-beta3
    Compilation: /usr/bin/cc -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -O2 -g -Og -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wmissing-prototypes -Wvla -fstack-protector-strong -fno-common -fdiagnostics-color=always -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -DMIN_LOG_LEVEL=3 -I/home/runner/work/neovim/neovim/build/config -I/home/runner/work/neovim/neovim/src -I/home/runner/work/neovim/neovim/.deps/usr/include -I/usr/include -I/home/runner/work/neovim/neovim/build/src/nvim/auto -I/home/runner/work/neovim/neovim/build/include
    Compiled by runner@fv-az49-948

  • Operating system/version:
    Arch Linux

2021-03-16.15-48-17.mp4

Why mark 'p' ?

It is annoying that it adds a mark p after selecting result from quickfix window.

The code seems to be cmd('mark p') in lua/bqf/preview.lua @ line 95

I see there is sign feature, is the p a feature or bug? If it's feature, maybe make it configurable?

Thanks for the great plugin :)

argument #1 winid or current window is not a quickfix window

  • nvim --version:
  • Operating system/version:
nvim -v
NVIM v0.5.0-dev+1083-g1aec5ba85
Build type: Release
LuaJIT 2.1.0-beta3

MacOs BigSur 11.2.3

Describe the bug
copen generates the error "argument #1 winid or current window is not a quickfix window"

To Reproduce using nvim -u mini.vim

" use your plugin manager, here is `vim-plug`
call plug#begin('~/.config/nvim/plugged')
Plug 'kevinhwang91/nvim-bqf'
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
call plug#end()

Steps to reproduce the behavior:

  1. issue copen
  2. error appears

Expected behavior
No errors being generated

Additional context
It seems the error is generated by the following lines of code:

-----------
qftool.lua:
-----------

 57 function M.type(winid)
 58     winid = winid or api.nvim_get_current_win()
 59  
 60     assert(M.validate_qf(winid), 'argument #1 winid or current window is not a quickfix window') <---- this line
 61  
 62     if not qfs[winid].qf_type then
 63         qfs[winid].qf_type = fn.getwininfo(winid)[1].loclist == 1 and 'loc' or 'qf'
 64     end
 65     return qfs[winid].qf_type
 66 end

git blame showing that it was due to a recent update on 2021-03-11?

Wrap lines in preview

Is your feature request related to a problem? Please describe.
I wish there was a way to enable line soft wrap in the preview buffer.

Describe the solution you'd like
A config that allows me to enable line soft wrap. Could be preview.soft_wrap.

Describe alternatives you've considered
N/A

Additional context
N/A

Moving through the qf list pollutes v:oldfiles

First of all this plugin is great! so thanks for that.

I found out that moving through the qf list, will populate v:oldfiles, you can easily check that by running :oldfiles. So any plugin that depends on this information to show most recently used files will become useless. Example: vim-startify

It will be great if the plugin can avoid doing that.

Set number for pages

Hello. I'm not using set numbers opriton for my nvim windows but nvim-bqf enables it. How can i disable this option for all windows except quick-fix list?

Allow to add a custom opener to func_map

Feature description

Hi,

it seems for me (i'm fresh in Lua) that the set of allowed keys of func_map is restricted to action_funcref from keymap.

I'd like to attach a custom opener that does an action similar to tab drop (see links below).

Describe the solution you'd like

Please allow to attach a function (as the opener) that get the path, (and, if provided) line and column to allow make a customized jumping.

Additional context

neovim/neovim#14567
https://github.com/przepompownia/vim-arctgx/blob/master/plugin/tab.vim#L11

Creates unnamed buffer in buffer tab plugins (ex: barbar)

Neovim version (nvim -v | head -n1)

NVIM v0.6.0-dev+1993-g1dbbaf89b

Operating system/version

macOS 12.0.1

How to reproduce the issue

  1. Install nvim-bqf and barbar.nvim
  2. Open up location list. Bask in the glory that is vim-bqf.
  3. Notice there is a weird extra unnamed buffer visible that is the same contents as the loc list window. If you close it then you get the file open in both the original split and lower split where location list used to be.
    ...
    image

Expected behavior

The buffer created by vim-bqf not visible in buffer tab.

It could be ignored in barbar as there is functionality for excludes. But you can't exclude an unnamed buffer really.

Maybe the vim-bqf buffer should have a specific discoverable name?

Actual behavior

vim-bqf creates a new unnamed buffer that you can accidentally tab towards which can break the layout.

[FR] Option to disable preview window only for some file types

Is your feature request related to a problem? Please describe.
Sometimes, I grep over PDF files (using rga) and list them in the quickfix window just to load them into a vim buffer.
nvim-bqf opens the preview window for the PDF files, which is lagging and not very helpful.

Describe the solution you'd like
I wish there is an option to list file types or file extensions for which nvim-bqf does not show the preview window.

Describe alternatives you've considered
I currently call :BqfDisable manually, but even opening the preview window for the first item in the quickfix window is slow.
I wouldn't set auto_preview or auto_enable to false since I find this plugin really useful in general.

Unexpectedly set number

  • nvim --version:
    NVIM v0.5.0-dev+1298-g4ad30f775
  • Operating system/version:
    Linux 5.11.16-arch1-1

Describe the bug

I use set nonumber in init.vim

use vimgrep /\w\+/j % | copen work ok

but use this plug(about quickfix) ack.vim , :Ack pattern open a quickfix, then enter file, new file will auto set number

if not use nvim-bqf, not auto set number

To Reproduce using nvim -u mini.vim

call plug#begin('~/.config/nvim/plugged')
        Plug 'kevinhwang91/nvim-bqf'
        Plug 'mileszs/ack.vim'
call  plug#end()

set nonumber

cannot customise Function commands

  • nvim --version:
nvim --version
NVIM v0.5.0-dev+1083-g1aec5ba85
Build type: Release
LuaJIT 2.1.0-beta3

Describe the bug
As per documentation one can customise Function commands via lua require('bqf').setup({func_map = {}}). It is however unclear what the correct string grammar must be, I have tried all possible cominations of quotation marks and the like but nothing works. In particular I am trying, for example

lua require('bqf').setup({openc = {'<CR>'}})

to no avail. lua require('bqf').setup({'openc' = {'<CR>'}}) generates an error and removing quotation marks from everywhere seems to have no effect either.

Expected behavior
Provide a clear example of command customisation that can be copied and pasted.

Additional context
Add any other context about the problem here.

"Applying" The FZF Filter

Feature description

First of all, awesome plugin! Thank you so much for your hard work.

When using zf to filter the quickfix list, it's very easy to type out the filter and then visually inspect the quickfix list to see that it's correct. How can we easily "apply" this filter to create a new quickfix list using this filter?

After typing out an FZF filter, my current workflow is to select the values in the list with <C-o> and then pressing <C-q> to apply a tab to all of them, and then pressing zn to create a new quickfix list with the selected entries.

Describe the solution you'd like

An easier way of applying an FZF filter to the current quickfix list, to create a new quickfix list with all the values it contains. Ideally this would occur without modifying the original list.

Additional context

No response

Garbled view when using FZF with additional qf formatter plugin

Neovim version (nvim -v | head -n1)

NVIM v0.7.0-dev+1109-gfaeff49cb

Operating system/version

Ubuntu 21.04 on WSL2

How to reproduce the issue

  1. Install https://gitlab.com/yorickpeterse/nvim-pqf
  2. Put items in quick fix list

image

  1. Now open fzf using zf keybinding

Expected behavior

Text in FZF list should be same as what we see in quick fix list

Actual behavior

Garbled text is being seen (notice many {m, [m and numbers across the list)

image

This, as you previously mentioned, could be related to concealing.

Support for Telescope

Is your feature request related to a problem?
You mentioned that Preview with fzf needs a pipe command, Windows can't be supported.. But there is an awesome telescope.nvim that works fast and allows to avoid using external program. It would be nice to support it :)

Describe the solution you'd like
It would be nice to have an option to use Telescope instead of FZF.

Preview syntax highlighting not working, unless buffer has already been opened

Neovim version (nvim -v | head -n1)

NVIM v0.5.1

Operating system/version

macOS 11.5.2 + Ubuntu 20.04 LTS

How to reproduce the issue

  1. Send items to Quickfix list
  2. Scroll through Quickfix items in order to see preview via nvim-bqf
  3. Conclude syntax highlighting is not working

Expected behavior

I would expect syntax highlighting to work in the preview window without having to open the buffer prior to opening the Quickfix list

Actual behavior

There is no syntax highlighting applied when previewing files via the Quickfix list. However, if I already had the buffer opened, or would open the buffer prior to using the Quickfix list, syntax highlighting does work. See the different in the screenshots below:

Example :: Previewing markdown.lua via Quickfix :: Syntax highlighting works because the buffer markdown.lua was already opened
image

Example :: Previewing marks.lua via Quickfix :: Syntax highlighting does not work because the buffer has not been opened
image

Let me reconfigure the setup

  • nvim --version:ใ€€v0.5.0-dev+1272-g4570d04b1
  • Operating system/version: ArchLinux

Describe the bug
I am using nvim-bqf with packer's lazy loading feature. But in that state, I cannot change the mapping because it is caught by the following reload prevention.

nvim-bqf/lua/bqf.lua

Lines 7 to 9 in 7c750a7

if initialized then
return
end

I would like to be able to change the mapping even for lazy loading.

To Reproduce using nvim -u mini.vim

Example:
cat mini.vim

syntax enable
filetype plugin indent on

lua <<EOF
local execute = vim.api.nvim_command
local fn = vim.fn
local install_path = fn.stdpath('data')..'/site/pack/packer/opt/packer.nvim'

if fn.empty(fn.glob(install_path)) > 0 then
  execute('!git clone https://github.com/wbthomason/packer.nvim '..install_path)
end

vim.cmd [[packadd packer.nvim]]
return require('packer').startup(function()
  use {'wbthomason/packer.nvim', opt = true}
  use {'kevinhwang91/nvim-bqf', opt = true,
    event = 'VimEnter',
    config = function() require('bqf').setup({func_map = { pscrollup = '<C-u>', pscrolldown = '<C-d>'}}) end
  }
  use {'junegunn/fzf',
    run="call fzf#install()",
  }
end)
EOF

Steps to reproduce the behavior:

  1. :copen
  2. :nmap <buffer> <C-f>
  3. :nmap <buffer> <C-u>

Expected behavior
I'd like to be able to change the mapping even if I use a lazy load.

min wind width conflict with bqf

Neovim version (nvim -v | head -n1)

NVIM v0.6.0-dev+575-g2ef9d2a66

Operating system/version

manjaro

How to reproduce the issue

1.Set following options inf vim config:

vim.opt.winwidth=60
vim.opt.winminwidth=50  

2.Now if you open quick list error is displayed:
image

Expected behavior

bqf should be able to work with opt.minwinwidth ?

Actual behavior

Error as showna above, but then after closing it - bqf works ok...

lots of error if open file in readonly mode

  • nvim --version:
NVIM v0.6.0-dev+12-gf515baedc
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
  • Operating system/version:
ArchLinux latest

or 

Ubuntu 21.04 (Hirsute Hippo)

Describe the bug

nvim -M the-file-to-open

Rg keyword

result in error if move up and down between quickfix list item:

E5108: Error executing lua ...vim/site/pack/packer/start/nvim-bqf/lua/bqf/floatwin.lua:90: Buffer is not 'modifiable'
Error detected while processing CursorMoved Autocommands for "<buffer=11>":
E5108: Error executing lua ...vim/site/pack/packer/start/nvim-bqf/lua/bqf/floatwin.lua:90: Buffer is not 'modifiable'
E5108: Error executing lua ...vim/site/pack/packer/start/nvim-bqf/lua/bqf/floatwin.lua:90: Buffer is not 'modifiable'
E5108: Error executing lua ...vim/site/pack/packer/start/nvim-bqf/lua/bqf/floatwin.lua:90: Buffer is not 'modifiable'

To Reproduce using nvim -u /tmp/mini_bqf.lua

cat /tmp/mini_bqf.lua

--
-- this mini config is desired for demonstrate kevinhwang91/nvim-bqf issue
--

local execute = vim.api.nvim_command
local fn = vim.fn

local install_path = "/tmp/site/pack/packer/opt/packer.nvim"

if fn.empty(fn.glob(install_path)) > 0 then
    execute("!git clone https://github.com/wbthomason/packer.nvim " .. install_path)
end

execute "packadd packer.nvim"

vim.cmd [[packadd packer.nvim]]
vim.cmd [[autocmd BufWritePost mini_bqf.lua PackerCompile]]
vim.cmd [[autocmd BufWritePost mini_bqf.lua PackerInstall]]

-- basic ui config
vim.wo.number = true

local use = require("packer").use
require("packer").startup {
    function()
        use "jremmen/vim-ripgrep"
        use "kevinhwang91/nvim-bqf"
    end,
    config = { package_root = "/tmp/site/pack" },
}

Steps to reproduce the behavior:

  1. nvim -i NONE -u /tmp/mini_bqf.lua
  2. nvim -i NONE -u /tmp/mini_bqf.lua -c "PackerInstall"
  3. nvim -i NONE -u /tmp/mini_bqf.lua -c "PackerCompile"
  4. cd /tmp && git clone https://github.com/kevinhwang91/nvim-bqf
  5. cd nvim-bqf && nvim -i NONE -u /tmp/mini_bqf.lua -M ./lua/bqf.lua
  6. :Rg api
E5108: Error executing lua ...vim/site/pack/packer/start/nvim-bqf/lua/bqf/floatwin.lua:90: Buffer is not 'modifiable'
Error detected while processing CursorMoved Autocommands for "<buffer=11>":
E5108: Error executing lua ...vim/site/pack/packer/start/nvim-bqf/lua/bqf/floatwin.lua:90: Buffer is not 'modifiable'
E5108: Error executing lua ...vim/site/pack/packer/start/nvim-bqf/lua/bqf/floatwin.lua:90: Buffer is not 'modifiable'
E5108: Error executing lua ...vim/site/pack/packer/start/nvim-bqf/lua/bqf/floatwin.lua:90: Buffer is not 'modifiable'

Expected behavior

no error happened

Screenshots

bqf-2021-07-05_12-00

Additional context

without -M (readonly) limit, this plugin works very well. (and -m also works well)

Cannot make :copen work, still shows the normal one

  • NVIM v0.5.0-dev+1274-gbb3372792
  • archlinux

Describe the bug
when I do :copen I still see the old one

To Reproduce using nvim -u mini.vim

I cannot test using your mini.vim, it gives some error :O

2021-04-24_21-58

Steps to reproduce the behavior:

  1. :copen

Expected behavior
I expect to see the floating window with list of quickfixes, but I still see the default one

Screenshots
2021-04-24_22-00

Additional context
I am sure it's something wrong on my side, I just don't know where..

this is my dotfiles

Preview window not working with files set from telescope.nvim after e3dbcae

  • nvim --version: NVIM v0.5.0-dev+1305-g21035cff9
  • Operating system/version: Manjaro

Describe the bug
After e3dbcae, preview window doesn't work with files set from telescope.nvim

To Reproduce using nvim -u mini.vim

Example:
cat mini.vim

" vim: expandtab:shiftwidth=2:tabstop=2:softtabstop=2
set noundofile
set nowritebackup
set noswapfile
set nowritebackup
set clipboard=unnamed,unnamedplus
set wildignorecase
set ignorecase
set hidden

lua << EOF
local install_path = vim.fn.expand(vim.fn.stdpath('data') .. '/site/pack/packer/opt/packer.nvim')

if vim.fn.empty(vim.fn.glob(install_path)) > 0 then
  vim.cmd('!git clone https://github.com/wbthomason/packer.nvim ' .. install_path)
end

vim.cmd([[packadd packer.nvim]])

require('packer').startup(
function(use)
  use { 'wbthomason/packer.nvim', opt = true }

  use {
    'nvim-telescope/telescope.nvim',
    config = function()
      require('telescope').setup {
        defaults = {
          layout_defaults = {
            horizontal = {
              preview_width = 0.6,
              width_padding = 0.08
            },
            vertical = {
              preview_height = 0.4,
              width_padding = 0.08
            }
          }
        }
      }
    end,
    requires = {
      { 'nvim-lua/plenary.nvim' },
      { 'nvim-lua/popup.nvim' }
    }
  }

  use {
    'kevinhwang91/nvim-bqf'
  }
end)
EOF

Steps to reproduce the behavior:

  1. nvim -u mini.vim
  2. :Telescope find_files
  3. (Press <C-q> to send files to quickfix and open quickfix window)
  4. Preview window doesn't work

Expected behavior
Preview window working for those files

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
It looks like it only happens when using telescope to send files to the quickfix, e.g. using :Telescope grep_string works just as expected

bqf preview window became a seperate floating windows after press `ctrl-o` in quickfix window

  • nvim --version: 0.5, stable version
  • Operating system/version: windows-wsl , debian9, windows
  • updated to the latest dev branch commits

Describe the bug
I found this bug is imported by latest commits.
Actually, on my debian system , before PlugUpdate this morning, I did Ctrl-o the preview windows worked and disappeared normally, but after the updating , things became wired.

To Reproduce using nvim -u mini.vim
Not need , this bug is invoked by some latest commits.

Steps to reproduce the behavior:

  1. Seach,
  2. mv cursor to quickfix windows, then the preview window popup
  3. press ctrl-o, please notice I did not enter fzf mode.

Expected behavior

Screenshots

Snipaste_2021-09-25_05-50-52
You can see the preview window become a no-related window, acctually the windows is splited
image

Additional context
I have setted this bug by lazy qf buffer nmaps

au FileType qf nmap <buffer> i zf
au FileType qf nmap <buffer> <C-o> T
au FileType qf nmap <buffer> <C-t> t

windows resizes

Neovim version (nvim -v | head -n1)

NVIM v0.6.0-dev+640-gb51b0aecc

Operating system/version

linux

How to reproduce the issue

When using this plugin equalalways options is not respected. It's handy when window sizes are equalised after closing quickfix window. As i see in :help equalalways it says

If a window size is specified when creating a new window sizes are
currently not equalized (it's complicated, but may be implemented in the future).

I tried setting

require('bqf').setup(
{
 	auto_enable = {
 	        default = true,
 	},
 	auto_resize_height = {
        	default = false,
     	},
 })

But it does not help.
Is it possible to maybe make parameter of not specifying window size when creating quick-fix window to respect equalalways?

Expected behavior

Windows height made equal after closing quick-fix window

Peek 2021-11-29 14-46

Actual behavior

As you see top left window is left shorter after closing quick-fix window.

Peek 2021-11-29 15-13

Pressing 'zf' in quickfix throw error

Error : E5108: Error executing lua ...e/nvim/site/pack/packer/start/nvim-bqf/lua/bqf/utils.lua:18: attempt to perform arithmetic on local 'color_num' (a nil value)

Looks like :
Function 'color2csi24b' expect argument, but in 'local color2csi = gui and color2csi24b or color2csi8b ' not passing arg

[Feature] Add map to close quickfix

Please add a keymap to close the quickfix window (for example, by pressing q).

config.lua:

...
        func_map = {
            close = 'q' -- โ† NEW MAP
            open = '<CR>',
            openc = 'o',
            split = '<C-x>',
            vsplit = '<C-v>',
            tab = 't',
            tabb = 'T',
            ptogglemode = 'zp',
            ptoggleitem = 'p',
            ptoggleauto = 'P',
            pscrollup = '<C-b>',
            pscrolldown = '<C-f>',
            pscrollorig = 'zo',
            prevfile = '<C-p>',
            nextfile = '<C-n>',
            prevhist = '<',
            nexthist = '>',
            stoggleup = '<S-Tab>',
            stoggledown = '<Tab>',
            stogglevm = '<Tab>',
            stogglebuf = [['<Tab>]],
            sclear = 'z<Tab>',
            filter = 'zn',
            filterr = 'zN',
            fzffilter = 'zf'
        },
...

[Question] Using Ag to build quickfix list with pattern highlight

I use :Ag {pattern} to search with fzf and then alt-a - Enter to populate the quickfix list with the results but the quickfix list does not highlight the search pattern.
I've tried to create a keybind ctrl-q for fzf to populate quickfix list with 'context' like below based on the example for Grepper in the README but no luck so far:

function! s:build_quickfix_list(lines)
  call setqflist(map(copy(a:lines), '{ "filename": v:val }'), 'r',
                \ {'context': {'bqf': {'pattern_hl': histget('/')}}})
  copen
  cc
endfunction

let g:fzf_action = {
            \ 'ctrl-q': function('s:build_quickfix_list'),
            \ 'ctrl-t': 'tab split',
            \ 'ctrl-s': 'split',
            \ 'ctrl-v': 'vsplit' 
}

How can I get the pattern highlighted in quickfix list?

Why not map <esc> to cclose on filetype qf?

Hi,
Thank you for this great plugin.

Would you add mapping for <esc> to cclose in this plugin ?
It's easy to close the quickfix window.

I add some code to do this.

augroup BQF
  au!
  au FileType qf nnoremap <esc> :cclose<CR>
augroup END

[Conflict With quickfix-reflector.vim] Once with `quickfix-reflector.vim` enabled, the auto preview not work

Neovim version (nvim -v | head -n1)

NVIM v0.5.1

Operating system/version

macOS 12.0.1

How to reproduce the issue

Install both nvim-bqf and quickfix-reflector.vim, then search something, the auto-preview not work when switch quickfix item, and the preview window will keep there after cclose.

If call BqfEnable manually, everything will be OK.

Expected behavior

Expect also work with quickfix-reflector.vim installed.

Actual behavior

auto-preview not work when with quickfix-reflector.vim

[Feature Request] Toggle buffer for the buffer of file window

To be noted, file window_id = win_getid(winnr('#')) for quickfix or getloclist(0, {'filewinid':0}) for locatioinlist.

Don't waste time deciding to use all the buffers in the session or the current buffer unless has a performance issue.
We can simply list all buffers in session and filter the buffer of file window to the new list after entering qf window.

Option to enable max size preview

Feature description

I quite like max-size preview as upon selecting an item, the cursor stays to that position.

anim-rg

Describe the solution you'd like

I would like a new option under opts.preview or, if possible, assigning a value to existing opts.preview.win_height that would make the preview full screen.

Additional context

Options I tried:

  • Addding
lua require"bqf.preview.handler".toggle_mode()

in after/ftplugin/qf.vim. Using this results in an error when qf is opened.

  • Right now, I have to manually press zp everytime I open qf list

Cursor jumps back to original location when closing quickfix window after opening any item

Neovim version (nvim -v | head -n1)

NVIM v0.6.1

Operating system/version

macOS 11.6.2 (20G314)

How to reproduce the issue

  1. Open any new file with any context
  2. Find a word with grep :grep window .
  3. Open a quickfix window with :copen
  4. Navigate to any new item (not the first item)
  5. Press enter to go to new location where that item is
  6. Use :cclose to close the quickfix window

Expected behavior

The cursor still stays at its current location after closing the quickfix window

Actual behavior

The cursor still jumps back to the previous location

Support to visual select till next or previous file

I believe currently there is no way to select all matches of a file. This is useful to exclude files in new list that is created out from it by marking all matches of those files.

Solution proposal

  1. Leverage existing <tab> implementation with <c-n> and <c-p> โ€” for visual mode, add <c-n> and <c-p> keybindings that behave slightly different from their normal mode counterparts; or
  2. Add shortcuts for normal mode โ€” z<tab> and z<s-tab> (preferable, otherwise zm and zM) to toggle all matches of file and go to next or previous file respectively.

I prefer point 2.

Alternatives I considered
I wasn't able to find a good enough alternative for this.

Additional context
romainl/vim-qf provides a command to act on occurrences in a file.

Nothing happened after I press enter key when I signed some items in fzf mode.

Neovim version (nvim -v | head -n1)

NVIM v0.7.0-dev+1055-g2db0a5207

Operating system/version

wsl2 Arch

How to reproduce the issue

  1. open a file and create a qflist
  2. press zf to go to fzf mode and use tab key to selected some items.
  3. Then press enter key, We can notice that nothing happened and the qflist has not been changed.

Expected behavior

fzf can filter items when I selecte some items and press enter key

Actual behavior

the qflist not been changed.

Separate out "magic window" functionality into a new plugin

Kind of a weird request, but I've found myself abusing floating windows to avoid jarring other split windows for a number of different things, not just quickfix lists. It would be nice if this functionality was in a separate plugin that could wrap other commands that open splits in the bottom pane. My most common use case would be for a terminal.

IDK if this is actually possible, but I thought I'd ask, since to my knowledge this is the only plugin that does this with any window at all.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.