# cmp-path **Repository Path**: nvpack/cmp-path ## Basic Information - **Project Name**: cmp-path - **Description**: https://github.com/hrsh7th/cmp-path.git - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-01-27 - **Last Updated**: 2026-01-27 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # cmp-path nvim-cmp source for filesystem paths. # Setup support path alias, But don't start too much at a time, or there will be performance issues ```lua require'cmp'.setup { sources = cmp.config.sources({ { name = 'nvim_lsp' }, { name = 'path', option = { pathMappings = { ['@'] = '${folder}/src', -- ['/'] = '${folder}/src/public/', -- ['~@'] = '${folder}/src', -- ['/images'] = '${folder}/src/images', -- ['/components'] = '${folder}/src/components', }, }, }, { name = 'buffer' }, { name = 'luasnip' }, }), } ``` ## Configuration The below source configuration options are available. To set any of these options, do: ```lua cmp.setup({ sources = { { name = 'path', option = { -- Options go into this table }, }, }, }) ``` ### trailing_slash (type: boolean) _Default:_ `false` Specify if completed directory names should include a trailing slash. Enabling this option makes this source behave like Vim's built-in path completion. ### label_trailing_slash (type: boolean) _Default:_ `true` Specify if directory names in the completion menu should include a trailing slash. ### get_cwd (type: function) _Default:_ returns the current working directory of the current buffer Specifies the base directory for relative paths.