Skip to content
项目

关于

nvim-cmp 的 luasnip 补全源

开发工具

这些数字如何统计

实测星标增长

24小时
0
7天
0
15天
-1
1个月
正在收集历史

各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。

README.md

原文

cmp_luasnip

luasnip completion source for nvim-cmp

-- Installation
use { 'L3MON4D3/LuaSnip' }
use {
  'hrsh7th/nvim-cmp',
  config = function ()
    require'cmp'.setup {
    snippet = {
      expand = function(args)
        require'luasnip'.lsp_expand(args.body)
      end
    },

    sources = {
      { name = 'luasnip' },
      -- more sources
    },
  }
  end
}
use { 'saadparwaiz1/cmp_luasnip' }

To disable filtering completion candidates by snippet's show_condition use the following options in sources:

sources = {
  { name = 'luasnip', option = { use_show_condition = false } },
  -- more sources
},

This can also be configured on per-buffer basis as described in cmp's README here and here.

The same way you can de-/activate whether autosnippets should be included in the completion list or not (including them can be a bit problematic since when you select the entry, the text gets inserted and the snippet automatically triggers). This option defaults to false to be backwards compatible. Example:

sources = {
  { name = 'luasnip', option = { show_autosnippets = true } },
  -- more sources
},

Hint: If you want to just hide some autosnippets consider the hidden option of luaSnip

探索相关项目

加载中…