summaryrefslogtreecommitdiffstats
path: root/.config/nvim/lua
diff options
context:
space:
mode:
authorYigit Sever2023-08-21 23:18:19 +0300
committerYigit Sever2023-08-21 23:18:19 +0300
commit30ba1496fdb83caebe0e03ac6e3e299193b760e2 (patch)
tree6fcdc7215d9edaa076a6a53d0da6569d504fc07a /.config/nvim/lua
parent49b0f23821690ac4b58aa4edf5f4608b43f1e8bf (diff)
downloaddotfiles-30ba1496fdb83caebe0e03ac6e3e299193b760e2.tar.gz
dotfiles-30ba1496fdb83caebe0e03ac6e3e299193b760e2.tar.bz2
dotfiles-30ba1496fdb83caebe0e03ac6e3e299193b760e2.zip
nvim: add cmp-omni for vimwiki
path completion and tag completion
Diffstat (limited to '.config/nvim/lua')
-rw-r--r--.config/nvim/lua/plugins/cmp.lua20
1 files changed, 16 insertions, 4 deletions
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 {
7 "hrsh7th/cmp-nvim-lua", 7 "hrsh7th/cmp-nvim-lua",
8 "hrsh7th/cmp-buffer", 8 "hrsh7th/cmp-buffer",
9 "hrsh7th/cmp-path", 9 "hrsh7th/cmp-path",
10 "hrsh7th/cmp-omni",
10 "L3MON4D3/LuaSnip", 11 "L3MON4D3/LuaSnip",
11 "saadparwaiz1/cmp_luasnip", 12 "saadparwaiz1/cmp_luasnip",
12 "rafamadriz/friendly-snippets", 13 "rafamadriz/friendly-snippets",
@@ -132,8 +133,8 @@ return {
132 sources = cmp.config.sources({ 133 sources = cmp.config.sources({
133 { name = 'git' }, 134 { name = 'git' },
134 }, { 135 }, {
135 { name = 'buffer' }, 136 { name = 'buffer' },
136 }) 137 })
137 }) 138 })
138 139
139 -- use buffer source for `/` . 140 -- use buffer source for `/` .
@@ -152,8 +153,19 @@ return {
152 sources = cmp.config.sources({ 153 sources = cmp.config.sources({
153 { name = 'path' } 154 { name = 'path' }
154 }, { 155 }, {
155 { name = 'cmdline' } 156 { name = 'cmdline' }
156 }) 157 })
158 })
159
160 -- use omnifunc in vimwiki to complete paths and tags
161 ---@diagnostic disable-next-line: missing-fields
162 cmp.setup.filetype('vimwiki', {
163 sources = cmp.config.sources({
164 { name = 'omni' },
165 option = {
166 disable_omnifuncs = {},
167 },
168 })
157 }) 169 })
158 end, 170 end,
159 }, 171 },