Skip to content
This repository was archived by the owner on Apr 16, 2024. It is now read-only.

Commit 990a818

Browse files
committed
Add configuration for completion on searc and cmdline
1 parent d878cd9 commit 990a818

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

lua/doom/modules/features/lsp/init.lua

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,11 @@ lsp.packages = {
158158
},
159159
event = "VeryLazy",
160160
},
161+
["cmp-cmdline"] = {
162+
"hrsh7th/cmp-cmdline",
163+
commit = "23c51b2a3c00f6abc4e922dbd7c3b9aca6992063",
164+
after = "nvim-cmp",
165+
},
161166
}
162167

163168
lsp.configs = {}
@@ -306,6 +311,34 @@ lsp.configs["nvim-cmp"] = function()
306311
end,
307312
}))
308313
end
314+
lsp.configs["cmp-cmdline"] = function()
315+
local cmp = require("cmp")
316+
317+
-- autocomplete for search
318+
cmp.setup.cmdline('/', {
319+
mapping = cmp.mapping.preset.cmdline(),
320+
sources = {
321+
{ name = 'buffer' }
322+
}
323+
})
324+
325+
-- autocomplete for search
326+
cmp.setup.cmdline(':', {
327+
mapping = cmp.mapping.preset.cmdline(),
328+
sources = cmp.config.sources({
329+
{ name = 'path' }
330+
},
331+
{
332+
{
333+
name = 'cmdline',
334+
option = {
335+
ignore_cmds = { 'Man', '!' }
336+
}
337+
}
338+
})
339+
})
340+
341+
end
309342
lsp.configs["lsp_signature.nvim"] = function()
310343
-- Signature help
311344
require("lsp_signature").setup(

0 commit comments

Comments
 (0)