nvim-cmp icon indicating copy to clipboard operation
nvim-cmp copied to clipboard

No selection possible with :%s/ in cmdline

Open Perry3D opened this issue 1 year ago • 1 comments

FAQ

  • [X] I have checked the FAQ and it didn't resolve my problem.

Announcement

Minimal reproducible full config

if has('vim_starting')
  set encoding=utf-8
endif
scriptencoding utf-8

if &compatible
  set nocompatible
endif

let s:plug_dir = expand('/tmp/plugged/vim-plug')
if !filereadable(s:plug_dir .. '/plug.vim')
  execute printf('!curl -fLo %s/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim', s:plug_dir)
end

execute 'set runtimepath+=' . s:plug_dir
call plug#begin(s:plug_dir)
Plug 'hrsh7th/nvim-cmp'
Plug 'hrsh7th/cmp-buffer'
Plug 'hrsh7th/cmp-nvim-lsp'
Plug 'hrsh7th/vim-vsnip'
Plug 'hrsh7th/cmp-cmdline',
Plug 'neovim/nvim-lspconfig'
call plug#end()
PlugInstall | quit

" Setup global configuration. More on configuration below.
lua << EOF
local cmp = require "cmp"
cmp.setup {
  snippet = {
    expand = function(args)
      vim.fn["vsnip#anonymous"](args.body)
    end,
  },

  mapping = {
    ['<CR>'] = cmp.mapping.confirm({ select = true }),
    ['<Up>'] = cmp.mapping(cmp.mapping.select_prev_item(), { 'i', 'c', 's' }),
    ['<Down>'] = cmp.mapping(cmp.mapping.select_next_item(), { 'i', 'c', 's' }),
  },

  sources = cmp.config.sources({
    { name = "nvim_lsp" },
    { name = "buffer" },
  }),
}
cmp.setup.cmdline(':', {
  sources = {
    { name = 'cmdline' },
    { name = 'buffer' },
  },
})
EOF

lua << EOF
local capabilities = require('cmp_nvim_lsp').default_capabilities()

require'lspconfig'.cssls.setup {
  capabilities = capabilities,
}
EOF


Description

Hi,

When i try to a search and replace with `%s/keyword' i cannot select any completion items from the dropdown menu after the first slash.

Steps to reproduce

  • Use the minimal config with source buffer in the cmdline setup.
  • Open a file and type :%s/someChars with someChars existing in the buffer.

Expected behavior

I should be able to select an item from the dropdown and confirm it.

Actual behavior

I am no able to select items from the dropdown with select_prev_item oder select_next_item.

Additional context

No response

Perry3D avatar Jul 26 '23 14:07 Perry3D

Screenshot of the issue. <up> and <down> do nothing after writing the slash image

Perry3D avatar Jul 26 '23 16:07 Perry3D