@@ -27,7 +27,6 @@ return {
27
27
},
28
28
{ ' kdheepak/cmp-latex-symbols' },
29
29
},
30
-
31
30
version = ' v0.*' ,
32
31
-- OR build from source, requires nightly: https://rust-lang.github.io/rustup/concepts/channels.html#working-with-nightly-rust
33
32
-- build = 'cargo build --release',
@@ -80,271 +79,6 @@ return {
80
79
},
81
80
},
82
81
83
- { -- completion
84
- ' hrsh7th/nvim-cmp' ,
85
- enabled = false ,
86
- event = ' InsertEnter' ,
87
- dependencies = {
88
- ' hrsh7th/cmp-nvim-lsp' ,
89
- ' jmbuhr/cmp-nvim-lsp-signature-help' ,
90
- ' hrsh7th/cmp-buffer' ,
91
- ' hrsh7th/cmp-path' ,
92
- ' hrsh7th/cmp-calc' ,
93
- ' hrsh7th/cmp-emoji' ,
94
- ' saadparwaiz1/cmp_luasnip' ,
95
- ' f3fora/cmp-spell' ,
96
- ' ray-x/cmp-treesitter' ,
97
- ' kdheepak/cmp-latex-symbols' ,
98
- ' jmbuhr/cmp-pandoc-references' ,
99
- ' L3MON4D3/LuaSnip' ,
100
- ' rafamadriz/friendly-snippets' ,
101
- ' onsails/lspkind-nvim' ,
102
- },
103
- config = function ()
104
- local cmp = require ' cmp'
105
- local luasnip = require ' luasnip'
106
- local lspkind = require ' lspkind'
107
-
108
- local has_words_before = function ()
109
- local line , col = unpack (vim .api .nvim_win_get_cursor (0 ))
110
- return col ~= 0 and vim .api .nvim_buf_get_lines (0 , line - 1 , line , true )[1 ]:sub (col , col ):match ' %s' == nil
111
- end
112
-
113
- cmp .setup {
114
- snippet = {
115
- expand = function (args )
116
- luasnip .lsp_expand (args .body )
117
- end ,
118
- },
119
- completion = { completeopt = ' menu,menuone,noinsert' },
120
- mapping = {
121
- [' <C-f>' ] = cmp .mapping .scroll_docs (- 4 ),
122
- [' <C-d>' ] = cmp .mapping .scroll_docs (4 ),
123
-
124
- [' <C-n>' ] = cmp .mapping (function (fallback )
125
- if luasnip .expand_or_jumpable () then
126
- luasnip .expand_or_jump ()
127
- fallback ()
128
- end
129
- end , { ' i' , ' s' }),
130
- [' <C-p>' ] = cmp .mapping (function (fallback )
131
- if luasnip .jumpable (- 1 ) then
132
- luasnip .jump (- 1 )
133
- else
134
- fallback ()
135
- end
136
- end , { ' i' , ' s' }),
137
- [' <C-e>' ] = cmp .mapping .abort (),
138
- [' <c-y>' ] = cmp .mapping .confirm {
139
- select = true ,
140
- },
141
- [' <CR>' ] = cmp .mapping .confirm {
142
- select = true ,
143
- },
144
-
145
- [' <Tab>' ] = cmp .mapping (function (fallback )
146
- if cmp .visible () then
147
- cmp .select_next_item ()
148
- elseif has_words_before () then
149
- cmp .complete ()
150
- else
151
- fallback ()
152
- end
153
- end , { ' i' , ' s' }),
154
- [' <S-Tab>' ] = cmp .mapping (function (fallback )
155
- if cmp .visible () then
156
- cmp .select_prev_item ()
157
- else
158
- fallback ()
159
- end
160
- end , { ' i' , ' s' }),
161
-
162
- [' <C-l>' ] = cmp .mapping (function ()
163
- if luasnip .expand_or_locally_jumpable () then
164
- luasnip .expand_or_jump ()
165
- end
166
- end , { ' i' , ' s' }),
167
- [' <C-h>' ] = cmp .mapping (function ()
168
- if luasnip .locally_jumpable (- 1 ) then
169
- luasnip .jump (- 1 )
170
- end
171
- end , { ' i' , ' s' }),
172
- },
173
- autocomplete = false ,
174
-
175
- --- @diagnostic disable-next-line : missing-fields
176
- formatting = {
177
- format = lspkind .cmp_format {
178
- mode = ' symbol' ,
179
- menu = {
180
- nvim_lsp = ' [LSP]' ,
181
- nvim_lsp_signature_help = ' [sig]' ,
182
- luasnip = ' [snip]' ,
183
- buffer = ' [buf]' ,
184
- path = ' [path]' ,
185
- spell = ' [spell]' ,
186
- pandoc_references = ' [ref]' ,
187
- tags = ' [tag]' ,
188
- treesitter = ' [TS]' ,
189
- calc = ' [calc]' ,
190
- latex_symbols = ' [tex]' ,
191
- emoji = ' [emoji]' ,
192
- },
193
- },
194
- },
195
- },
196
- signature = { enabled = true },
197
- appearance = {
198
- use_nvim_cmp_as_default = false ,
199
- }
200
- }
201
- },
202
-
203
- -- { -- completion
204
- -- 'hrsh7th/nvim-cmp',
205
- -- enabled = false,
206
- -- event = 'InsertEnter',
207
- -- dependencies = {
208
- -- 'hrsh7th/cmp-nvim-lsp',
209
- -- 'jmbuhr/cmp-nvim-lsp-signature-help',
210
- -- 'hrsh7th/cmp-buffer',
211
- -- 'hrsh7th/cmp-path',
212
- -- 'hrsh7th/cmp-calc',
213
- -- 'hrsh7th/cmp-emoji',
214
- -- 'saadparwaiz1/cmp_luasnip',
215
- -- 'f3fora/cmp-spell',
216
- -- 'ray-x/cmp-treesitter',
217
- -- 'kdheepak/cmp-latex-symbols',
218
- -- 'jmbuhr/cmp-pandoc-references',
219
- -- 'L3MON4D3/LuaSnip',
220
- -- 'rafamadriz/friendly-snippets',
221
- -- 'onsails/lspkind-nvim',
222
- -- },
223
- -- config = function()
224
- -- local cmp = require 'cmp'
225
- -- local luasnip = require 'luasnip'
226
- -- local lspkind = require 'lspkind'
227
- --
228
- -- local has_words_before = function()
229
- -- local line, col = unpack(vim.api.nvim_win_get_cursor(0))
230
- -- return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match '%s' == nil
231
- -- end
232
- --
233
- -- cmp.setup {
234
- -- snippet = {
235
- -- expand = function(args)
236
- -- luasnip.lsp_expand(args.body)
237
- -- end,
238
- -- },
239
- -- completion = { completeopt = 'menu,menuone,noinsert' },
240
- -- mapping = {
241
- -- ['<C-f>'] = cmp.mapping.scroll_docs(-4),
242
- -- ['<C-d>'] = cmp.mapping.scroll_docs(4),
243
- --
244
- -- ['<C-n>'] = cmp.mapping(function(fallback)
245
- -- if luasnip.expand_or_jumpable() then
246
- -- luasnip.expand_or_jump()
247
- -- fallback()
248
- -- end
249
- -- end, { 'i', 's' }),
250
- -- ['<C-p>'] = cmp.mapping(function(fallback)
251
- -- if luasnip.jumpable(-1) then
252
- -- luasnip.jump(-1)
253
- -- else
254
- -- fallback()
255
- -- end
256
- -- end, { 'i', 's' }),
257
- -- ['<C-e>'] = cmp.mapping.abort(),
258
- -- ['<c-y>'] = cmp.mapping.confirm {
259
- -- select = true,
260
- -- },
261
- -- ['<CR>'] = cmp.mapping.confirm {
262
- -- select = true,
263
- -- },
264
- --
265
- -- ['<Tab>'] = cmp.mapping(function(fallback)
266
- -- if cmp.visible() then
267
- -- cmp.select_next_item()
268
- -- elseif has_words_before() then
269
- -- cmp.complete()
270
- -- else
271
- -- fallback()
272
- -- end
273
- -- end, { 'i', 's' }),
274
- -- ['<S-Tab>'] = cmp.mapping(function(fallback)
275
- -- if cmp.visible() then
276
- -- cmp.select_prev_item()
277
- -- else
278
- -- fallback()
279
- -- end
280
- -- end, { 'i', 's' }),
281
- --
282
- -- ['<C-l>'] = cmp.mapping(function()
283
- -- if luasnip.expand_or_locally_jumpable() then
284
- -- luasnip.expand_or_jump()
285
- -- end
286
- -- end, { 'i', 's' }),
287
- -- ['<C-h>'] = cmp.mapping(function()
288
- -- if luasnip.locally_jumpable(-1) then
289
- -- luasnip.jump(-1)
290
- -- end
291
- -- end, { 'i', 's' }),
292
- -- },
293
- -- autocomplete = false,
294
- --
295
- -- ---@diagnostic disable-next-line: missing-fields
296
- -- formatting = {
297
- -- format = lspkind.cmp_format {
298
- -- mode = 'symbol',
299
- -- menu = {
300
- -- nvim_lsp = '[LSP]',
301
- -- nvim_lsp_signature_help = '[sig]',
302
- -- luasnip = '[snip]',
303
- -- buffer = '[buf]',
304
- -- path = '[path]',
305
- -- spell = '[spell]',
306
- -- pandoc_references = '[ref]',
307
- -- tags = '[tag]',
308
- -- treesitter = '[TS]',
309
- -- calc = '[calc]',
310
- -- latex_symbols = '[tex]',
311
- -- emoji = '[emoji]',
312
- -- },
313
- -- },
314
- -- },
315
- -- sources = {
316
- -- { name = 'path' },
317
- -- { name = 'nvim_lsp_signature_help' },
318
- -- { name = 'nvim_lsp' },
319
- -- { name = 'luasnip', keyword_length = 3, max_item_count = 3 },
320
- -- { name = 'pandoc_references' },
321
- -- { name = 'buffer', keyword_length = 5, max_item_count = 3 },
322
- -- { name = 'spell' },
323
- -- { name = 'treesitter', keyword_length = 5, max_item_count = 3 },
324
- -- { name = 'calc' },
325
- -- { name = 'latex_symbols' },
326
- -- { name = 'emoji' },
327
- -- },
328
- -- view = {
329
- -- entries = 'native',
330
- -- },
331
- -- window = {
332
- -- documentation = {
333
- -- border = require('misc.style').border,
334
- -- },
335
- -- },
336
- -- }
337
- --
338
- -- -- for friendly snippets
339
- -- require('luasnip.loaders.from_vscode').lazy_load()
340
- -- -- for custom snippets
341
- -- require('luasnip.loaders.from_vscode').lazy_load { paths = { vim.fn.stdpath 'config' .. '/snips' } }
342
- -- -- link quarto and rmarkdown to markdown snippets
343
- -- luasnip.filetype_extend('quarto', { 'markdown' })
344
- -- luasnip.filetype_extend('rmarkdown', { 'markdown' })
345
- -- end,
346
- -- },
347
- --
348
82
{ -- gh copilot
349
83
' zbirenbaum/copilot.lua' ,
350
84
enabled = true ,
0 commit comments