More snippets
This commit is contained in:
@@ -11,6 +11,7 @@ local d = ls.dynamic_node
|
||||
local fmt = require('luasnip.extras.fmt').fmt
|
||||
local rep = require('luasnip.extras').rep
|
||||
local line_begin = require('luasnip.extras.conditions').line_begin
|
||||
local line_end = require('luasnip.extras.conditions').line_end
|
||||
local extend_decorator = require 'luasnip.util.extend_decorator'
|
||||
local fmta = extend_decorator.apply(fmt, { delimiters = '#~' })
|
||||
|
||||
@@ -109,6 +110,21 @@ utils.atr = function(trigger, description, options)
|
||||
)
|
||||
end
|
||||
|
||||
--- Create a trigger for a snippet to expand at the end of a line
|
||||
---@param trigger string
|
||||
---@param description? string
|
||||
---@param options? table
|
||||
---@return table
|
||||
utils.Etr = function(trigger, description, options)
|
||||
return utils.tr(
|
||||
trigger,
|
||||
description,
|
||||
vim.tbl_extend('force', {
|
||||
condition = line_end
|
||||
}, options or {})
|
||||
)
|
||||
end
|
||||
|
||||
--- Create a snippet that will expand anywhere but in the middle of a word
|
||||
---@param trigger any
|
||||
---@param nodes any
|
||||
|
||||
Reference in New Issue
Block a user