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

how to ignore the root of the system

Open Manix80 opened this issue 2 years ago • 3 comments

hi,

is it possible not to display the root of the system? for example: /sys ...

when I type / I automatically get the root.

in the doc there is the option "get_cwd" but I don't know how to do it.

the best would be to be able to display the current directory.

I have the same configuration as here: https://github.com/sar/cmp.nvim#setup

with the exception that I added this:

cmp.setup({
...
  sources = cmp.config.sources({
    ...
    { name = "path" },
    ...
  )}
...
})

thanks

Manix80 avatar Mar 29 '23 09:03 Manix80

Yeah, at the moment using default configs this is causing :e <anything> to hang for 1 minute on WSL2, it's finding things like random DLLs from IDK where. Need to make this configurable otherwise it's not usable atm.

From looking at the source it doesn't appear there's a way to do this through the existing options atm.

Edit: nvm, this seems to be a cmp-cmdline issue:

  -- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore).
  cmp.setup.cmdline(':', {
    mapping = cmp.mapping.preset.cmdline(),
    sources = cmp.config.sources(
	{
      { name = 'path' }
    })
	-- {
    --   { name = 'cmdline' }
    -- })
  })

above doesn't freeze when I do :e /, everything works and I get path completions.

But when I enable cmdline, then :e <anything> lags.

  -- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore).
  cmp.setup.cmdline(':', {
    mapping = cmp.mapping.preset.cmdline(),
    sources = cmp.config.sources(
	{
      { name = 'path' }
    },
	{
      { name = 'cmdline' }
    })
  })

EDIT: OK actually my cwd was in system32 for some reason (thanks wsl) so that's why cmp-path was picking up all these DLLs. It's not a global search afterall; user error, please ignore 😅. Still it shouldn't block this hard though, but I guess that's an issue with cmp-cmdline

liquiddandruff avatar Apr 12 '23 19:04 liquiddandruff

I haven't found a solution for this problem, which isn't a problem in fact, just a habit to get into and be a little more careful with a "/".

Manix80 avatar Apr 17 '23 13:04 Manix80

I just ran in to this and had to disable cmp-path -- I thought neovim was freezing whenever I typed a comment (// or /*) -- or a self-closing element (<br />) -- or ever just / in the middle of a sentence (this / related-this)

NullVoxPopuli avatar Sep 03 '23 16:09 NullVoxPopuli