lunarvim init
This commit is contained in:
parent
4e372a5b82
commit
70b1001864
9 changed files with 934 additions and 0 deletions
18
.config/lvim/snips/lua.lua
Normal file
18
.config/lvim/snips/lua.lua
Normal file
|
@ -0,0 +1,18 @@
|
|||
local ls = require('luasnip')
|
||||
local f = ls.function_node
|
||||
local i = ls.insert_node
|
||||
-- local rep = require('luasnip.extras').rep
|
||||
local fmt = require('luasnip.extras.fmt').fmt
|
||||
-- local snips = {
|
||||
-- snip.parser.parse_snippet("lf", "local $1 = function($2)\n $0\nend"),
|
||||
-- s("req", fmt("local {} = require('{}')", { i(1, "module") , rep(1)})),
|
||||
-- }
|
||||
return {
|
||||
req = fmt(
|
||||
[[local {} = require "{}"]],
|
||||
{ f(function(import_name)
|
||||
local parts = vim.split(import_name[1][1], ".", true)
|
||||
return parts[#parts] or ""
|
||||
end, { 1 }), i(1) }
|
||||
),
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue