gelguy / wilder.nvim

A more adventurous wildmenu
MIT License
1.37k stars 34 forks source link

Unable to Complete with Tab #120

Closed typkrft closed 2 years ago

typkrft commented 2 years ago

When entering the cmdline with : I see suggestions appear on the statusline, but when I hit tab it does nothing. I don't believe I have <Tab> mapped anywhere but here.

Additionally when I enter search with / I also see suggestions on the statusline, but when I hit tab they disappear and a popup menu appears.

I'm sure it's pilot error, but any help would be appreciated.

vim.cmd([[
call wilder#setup({
      \'modes': [':', '/', '?'],
      \ 'next_key': '<Tab>',
      \ 'previous_key': '<S-Tab>',
      \ 'accept_key': '<Down>',
      \ 'reject_key': '<Up>',
      \ })

" 'file_command' : for ripgrep : ['rg', '--files']
"                : for fd      : ['fd', '-tf']
" 'dir_command'  : for fd      : ['fd', '-td']
" 'filters'      : use ['cpsm_filter'] for performance, requires cpsm vim plugin
"                  found at https://github.com/nixprime/cpsm
call wilder#set_option('pipeline', [
      \   wilder#branch(
      \     wilder#python_file_finder_pipeline({
      \       'file_command': ['rg', '--files'],
      \       'dir_command': ['fd', '-td'],
      \       'filters': ['cpsm_filter'],
      \     }),
      \     wilder#cmdline_pipeline(),
      \     wilder#python_search_pipeline(),
      \   ),
      \ ])

call wilder#set_option('renderer', wilder#wildmenu_renderer({
      \ 'highlighter': wilder#basic_highlighter(),
      \ }))

]])

Full Setup here.

gelguy commented 2 years ago

Thanks for trying out the plugin!

You have hrsh7th/cmp-cmdline installed which is conflicting with wilder.

typkrft commented 2 years ago

Sorry that's actually commented out and uninstalled in my current config. I just forgot to push it. The repository should be reflecting the actual current config now.

:PackerStatus

               packer.nvim - Total plugins: 21
 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 • LuaSnip
 • cmp-buffer
 • cmp-nvim-lsp
 • cmp-path
 • cmp_luasnip
 • cpsm
 • dashboard-nvim
 • friendly-snippets
 • gitsigns.nvim
 • nvim-cmp
 • nvim-cokeline
 • nvim-lsp-installer
 • nvim-lspconfig
 • nvim-treesitter
 • nvim-web-devicons
 • packer.nvim
 • plenary.nvim
 • telescope.nvim
 • themer.lua
 • wilder.nvim
 • windline.nvim
gelguy commented 2 years ago

The cmdline setup for cmp needs to be removed as well: https://github.com/typkrft/nvim/blob/03c74be29558f4b0b26dc519fce0e1cf880e8ca2/lua/plugins/cmp.lua#L35-L47

typkrft commented 2 years ago

Of course it does lol. Sorry! Thanks!

Integralist commented 2 years ago

I'm having issues with this plugin as well, and after some experimentation, even though I do use the various plugins mentioned here, it's actually fzf that's causing issues (I guess because it maps a tab to multiple selections).

Integralist commented 2 years ago

@gelguy As per my previous comment, I've since opened an issue with FZF.vim here: https://github.com/junegunn/fzf.vim/issues/1386

Interestingly :verbose map <Tab> doesn't actually show anything as mapping to <Tab> although I know that it is being used by FZF.vim to allow multiple results in a popup window to be selected.

In the mean time, do you know of any way to force an override of the mapping? I don't think there is and the closest suggestion I've found is to use the VimEnter event, but that wouldn't really work in this instance I don't think. An example of which could be something like...

autocmd VimEnter * noremap <Tab> call wilder#setup({
      \ 'modes': ['/', '?', ':'],
      \ 'next_key': '<Tab>',
      \ })
gelguy commented 2 years ago

Can you try :verbose cmap <Tab>? This will show the mapping for commandline mode.

As mentioned in the fzf issue, I don't think FZF interferes with the mappings since it runs in its own separate terminal.

Integralist commented 2 years ago

Thanks @gelguy

Looks like that reports:

c  <Tab>       * <Cmd>call v:lua.cmp.utils.keymap.set_map(13)<CR>
        Last set from Lua
Integralist commented 2 years ago

Which looks to be related to https://github.com/hrsh7th/nvim-cmp

gelguy commented 2 years ago

See https://github.com/gelguy/wilder.nvim/issues/120#issuecomment-1028181765 and https://github.com/gelguy/wilder.nvim/issues/120#issuecomment-1028187235.

It looks like nvim-cmp and cmp-cmdline are interfering with the mappings.

Integralist commented 2 years ago

I decided to just use <S-Down> and <S-Up> in the end.