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/lazy-lock.json | 3 ++- .config/nvim/lua/plugins/cmp.lua | 20 ++++++++++++++++---- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index b2bb81a..cf2687f 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -2,10 +2,11 @@ "Comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" }, "LuaSnip": { "branch": "master", "commit": "c4d6298347f7707e9757351b2ee03d0c00da5c20" }, "barbar.nvim": { "branch": "master", "commit": "8cca17ea0ced3ba564e5da972a25600edafe7d7b" }, - "catppuccin": { "branch": "main", "commit": "e2d6ce295eb537c92b567ec5d31f120de46e8d13" }, + "catppuccin": { "branch": "main", "commit": "91f9f6fb413caff2bd06e326ec174deee1c1b7a9" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, "cmp-nvim-lsp": { "branch": "main", "commit": "44b16d11215dce86f253ce0c30949813c0a90765" }, "cmp-nvim-lua": { "branch": "main", "commit": "f12408bdb54c39c23e67cab726264c10db33ada8" }, + "cmp-omni": { "branch": "main", "commit": "9436e6cdd7c5dfa24a99a60d9280b24dbdea3649" }, "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, "cmp_luasnip": { "branch": "master", "commit": "18095520391186d634a0045dacaa346291096566" }, "dashboard-nvim": { "branch": "master", "commit": "c17d3210b3dec8798b4fc82a11c542989251f85d" }, 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