You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be great if e.g. :e %:h/foo suggested completions for the expanded %:h (i.e. the parent directory of the current file name). Right now I either get no completion suggestions when paths include %, or I get incorrectly expanded paths (where the %:h is still present after confirming the completion). A minimal init is:
vim.cmd[[set runtimepath=$VIMRUNTIME]]vim.cmd[[set packpath=/tmp/nvim/site]]localpackage_root='/tmp/nvim/site/pack'localinstall_path=package_root..'/packer/start/packer.nvim'localfunctionload_plugins()
require('packer').startup {
{
'hrsh7th/nvim-cmp',
'hrsh7th/cmp-path',
'hrsh7th/cmp-cmdline,'wbthomason/packer.nvim',
},
config= {
package_root=package_root,
compile_path=install_path..'/plugin/packer_compiled.lua',
},
}
endifvim.fn.isdirectory(install_path) ==0thenvim.fn.system { 'git', 'clone', 'https://github.com/wbthomason/packer.nvim', install_path }
load_plugins()
require('packer').sync()
elseload_plugins()
require('packer').sync()
endlocalcmp=require'cmp'cmp.setup({
mapping= {
['<C-b>'] =cmp.mapping(cmp.mapping.scroll_docs(-4), { 'i', 'c' }),
['<C-f>'] =cmp.mapping(cmp.mapping.scroll_docs(4), { 'i', 'c' }),
['<C-Space>'] =cmp.mapping(cmp.mapping.complete(), { 'i', 'c' }),
['<C-y>'] =cmp.config.disable, -- Specify `cmp.config.disable` if you want to remove the default `<C-y>` mapping.
['<C-e>'] =cmp.mapping({
i=cmp.mapping.abort(),
c=cmp.mapping.close(),
}),
['<CR>'] =cmp.mapping.confirm({ select=true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
},
sources=cmp.config.sources({
{ name='nvim_lsp' },
{ name='path' },
{ name='vsnip' }, -- For vsnip users.
}, {
{ name='buffer' },
})
})
-- Use buffer source for `/` (if you enabled `native_menu`, this won't work anymore).cmp.setup.cmdline('/', {
sources= {
{ name='buffer' }
}
})
-- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore).cmp.setup.cmdline(':', {
sources=cmp.config.sources({
{ name='path' }
}, {
{ name='cmdline' }
})
})
Which seems to exhibit the first behavior (no completion suggestions). My full config exhibits the latter, I have to bisect why, but neither seems to support the expansion. Let me know if this makes sense for cmp-path! (And thanks for making cmp)
The text was updated successfully, but these errors were encountered:
It would be great if e.g.
:e %:h/foo
suggested completions for the expanded%:h
(i.e. the parent directory of the current file name). Right now I either get no completion suggestions when paths include%
, or I get incorrectly expanded paths (where the%:h
is still present after confirming the completion). A minimal init is:Which seems to exhibit the first behavior (no completion suggestions). My full config exhibits the latter, I have to bisect why, but neither seems to support the expansion. Let me know if this makes sense for cmp-path! (And thanks for making cmp)
The text was updated successfully, but these errors were encountered: