josean-dev / dev-environment-files

2.63k stars 740 forks source link

cmp path not completing the path #37

Closed CtrlAltDelight closed 10 months ago

CtrlAltDelight commented 10 months ago

It works in your recent video for you, but when I tried it I had to add some code before file paths would auto complete.

I'll make a pull request and link it here.

CtrlAltDelight commented 10 months ago

38

Submitted a pull request.

josean-dev commented 10 months ago

Hmm, not sure why it isn't working for you as is. The cmp sources includes the path and it is working for me. The setup function's sources property should look like this:

cmp.setup({
    -- sources for autocompletion
    sources = cmp.config.sources({
      { name = "nvim_lsp" },
      { name = "luasnip" }, -- snippets
      { name = "buffer" }, -- text within current buffer
      { name = "path" }, -- file system paths
    })
})