josean-dev / dev-environment-files

2.98k stars 800 forks source link

Fixed cmp-path not working properly #38

Closed chigges closed 1 year ago

chigges commented 1 year ago

cmp-path was not working properly for me despite copying the config from your recent video. This seems to fix it though.

josean-dev commented 1 year 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
    })
})