/ nvim / lua / plugins / lazydev.lua
lazydev.lua
 1  --- LazyDev + blink.cmp (Lua completions, wezterm types). LuaSnip lives in luasnip.lua.
 2  return {
 3    specs = {
 4      { src = 'https://github.com/folke/lazydev.nvim', name = 'lazydev.nvim' },
 5      { src = 'https://github.com/justinsgithub/wezterm-types', name = 'wezterm-types' },
 6      { src = 'https://github.com/moyiz/blink-emoji.nvim', name = 'blink-emoji.nvim' },
 7      { src = 'https://github.com/saghen/blink.cmp', name = 'blink.cmp' },
 8      { src = 'https://github.com/rafamadriz/friendly-snippets', name = 'friendly-snippets' },
 9    },
10    config = function()
11      local lazydev_ok, lazydev = pcall(require, 'lazydev')
12      if lazydev_ok and type(lazydev) == 'table' and lazydev.setup then
13        lazydev.setup({
14          library = { { path = 'wezterm-types', mods = { 'wezterm' } } },
15        })
16      end
17      local blink_ok, blink = pcall(require, 'blink.cmp')
18      if blink_ok and type(blink) == 'table' and blink.setup then
19        blink.setup({
20          fuzzy = { implementation = 'prefer_rust' },
21          sources = {
22            default = { 'lazydev', 'lsp', 'path', 'snippets', 'buffer', 'emoji' },
23            providers = {
24              lazydev = { name = 'LazyDev', module = 'lazydev.integrations.blink', score_offset = 100 },
25              emoji = { module = 'blink-emoji', name = 'Emoji', score_offset = -9999, opts = { insert = true } },
26            },
27          },
28          appearance = { nerd_font_variant = 'mono' },
29          completion = {
30            menu = {
31              draw = {
32                columns = {
33                  { 'kind_icon', 'label', 'label_description', gap = 1 },
34                  { 'kind', gap = 1 },
35                  { 'source_name' },
36                },
37              },
38            },
39          },
40          keymap = {
41            preset = 'enter', -- binds <CR> to { 'accept', 'fallback' }
42          },
43        })
44      end
45    end,
46  }