From 30ba1496fdb83caebe0e03ac6e3e299193b760e2 Mon Sep 17 00:00:00 2001 From: Yigit Sever Date: Mon, 21 Aug 2023 23:18:19 +0300 Subject: nvim: add cmp-omni for vimwiki path completion and tag completion --- .config/nvim/lua/plugins/cmp.lua | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to '.config/nvim/lua') diff --git a/.config/nvim/lua/plugins/cmp.lua b/.config/nvim/lua/plugins/cmp.lua index 828d7c2..7f3163f 100644 --- a/.config/nvim/lua/plugins/cmp.lua +++ b/.config/nvim/lua/plugins/cmp.lua @@ -7,6 +7,7 @@ return { "hrsh7th/cmp-nvim-lua", "hrsh7th/cmp-buffer", "hrsh7th/cmp-path", + "hrsh7th/cmp-omni", "L3MON4D3/LuaSnip", "saadparwaiz1/cmp_luasnip", "rafamadriz/friendly-snippets", @@ -132,8 +133,8 @@ return { sources = cmp.config.sources({ { name = 'git' }, }, { - { name = 'buffer' }, - }) + { name = 'buffer' }, + }) }) -- use buffer source for `/` . @@ -152,8 +153,19 @@ return { sources = cmp.config.sources({ { name = 'path' } }, { - { name = 'cmdline' } - }) + { name = 'cmdline' } + }) + }) + + -- use omnifunc in vimwiki to complete paths and tags + ---@diagnostic disable-next-line: missing-fields + cmp.setup.filetype('vimwiki', { + sources = cmp.config.sources({ + { name = 'omni' }, + option = { + disable_omnifuncs = {}, + }, + }) }) end, }, -- cgit v1.2.3-70-g09d2