Mercurial > dotfiles
comparison .chezmoitemplates/init.lua @ 518:784b931c51b7
Enable cmp completion for cmdline
author | zegervdv <zegervdv@me.com> |
---|---|
date | Sun, 02 Jan 2022 18:49:10 +0100 |
parents | 0ed17680bf08 |
children | d919c1590230 |
comparison
equal
deleted
inserted
replaced
517:0ed17680bf08 | 518:784b931c51b7 |
---|---|
278 | 278 |
279 -- Completion/snippets/LSP | 279 -- Completion/snippets/LSP |
280 use { 'neovim/nvim-lspconfig' } | 280 use { 'neovim/nvim-lspconfig' } |
281 use { | 281 use { |
282 'hrsh7th/nvim-cmp', | 282 'hrsh7th/nvim-cmp', |
283 requires = { 'hrsh7th/cmp-buffer', 'hrsh7th/cmp-nvim-lsp', 'saadparwaiz1/cmp_luasnip', 'hrsh7th/cmp-path' }, | 283 requires = { |
284 'hrsh7th/cmp-buffer', | |
285 'hrsh7th/cmp-nvim-lsp', | |
286 'saadparwaiz1/cmp_luasnip', | |
287 'hrsh7th/cmp-path', | |
288 'hrsh7th/cmp-cmdline', | |
289 }, | |
284 config = function() | 290 config = function() |
285 local cmp = require 'cmp' | 291 local cmp = require 'cmp' |
286 local luasnip = require 'luasnip' | 292 local luasnip = require 'luasnip' |
287 | 293 |
288 local has_words_before = function() | 294 local has_words_before = function() |
342 experimental = { | 348 experimental = { |
343 native_menu = false, | 349 native_menu = false, |
344 ghost_text = true, | 350 ghost_text = true, |
345 }, | 351 }, |
346 } | 352 } |
353 | |
354 cmp.setup.cmdline(':', { | |
355 sources = cmp.config.sources({ | |
356 { name = 'path' }, | |
357 }, { | |
358 { name = 'cmdline' }, | |
359 }), | |
360 }) | |
347 end, | 361 end, |
348 after = 'luasnip', | 362 after = 'luasnip', |
349 } | 363 } |
350 use { | 364 use { |
351 { | 365 { |