swaydots

my dotfiles
git clone https://git.awy.one/swaydots.git
Log | Files | Refs | README | LICENSE

completions.lua (1054B)


      1 return {
      2   {
      3     "hrsh7th/cmp-nvim-lsp"
      4   },
      5   {
      6     "L3MON4D3/LuaSnip",
      7     dependencies = {
      8       "saadparwaiz1/cmp_luasnip",
      9       "rafamadriz/friendly-snippets"
     10     }
     11   },
     12   {
     13     "hrsh7th/nvim-cmp",
     14     config = function()
     15       local cmp = require'cmp'
     16       cmp.setup({
     17         snippet = {
     18           expand = function(args)
     19             require('luasnip').lsp_expand(args.body)
     20           end,
     21         },
     22         window = {
     23           -- completion = cmp.config.window.bordered(),
     24           -- documentation = cmp.config.window.bordered(),
     25         },
     26         mapping = cmp.mapping.preset.insert({
     27           ['<C-b>'] = cmp.mapping.scroll_docs(-4),
     28           ['<C-f>'] = cmp.mapping.scroll_docs(4),
     29           ['<C-Space>'] = cmp.mapping.complete(),
     30           ['<C-e>'] = cmp.mapping.abort(),
     31           ['<CR>'] = cmp.mapping.confirm({ select = true }),
     32         }),
     33         sources = cmp.config.sources({
     34           { name = 'nvim_lsp' },
     35           { name = 'luasnip' },
     36         }, {
     37             { name = 'buffer' },
     38           })
     39       })
     40     end
     41   }
     42 }