mirror of
https://github.com/kristoferssolo/SoloVim.git
synced 2026-02-04 06:42:05 +00:00
Update 2025-10-31
update 2025-10-08 chore: update readme Update 2025-10-09 Update 2025-10-15 Update 2025-10-22 Update 2025-10-31
This commit is contained in:
@@ -3,20 +3,13 @@ return {
|
||||
"L3MON4D3/LuaSnip",
|
||||
build = "make install_jsregexp",
|
||||
version = "v2.*",
|
||||
dependencies = {
|
||||
"rafamadriz/friendly-snippets", -- a bunch of snippets to use
|
||||
},
|
||||
dependencies = { "rafamadriz/friendly-snippets" },
|
||||
opts = function()
|
||||
local types = require("luasnip.util.types")
|
||||
return {
|
||||
-- This tells LuaSnip to remember to keep around the last snippet.
|
||||
-- You can jump back into it even if you move outside of the selection
|
||||
history = true,
|
||||
-- This one is cool cause if you have dynamic snippets, it updates as you type!
|
||||
updateevents = "TextChanged,TextChangedI",
|
||||
-- Autosnippets:
|
||||
enable_autosnippets = true,
|
||||
-- Crazy highlights!!
|
||||
ext_opts = {
|
||||
[types.choiceNode] = {
|
||||
active = {
|
||||
@@ -29,32 +22,6 @@ return {
|
||||
config = function(_, opts)
|
||||
local ls = require("luasnip")
|
||||
|
||||
local s = ls.snippet
|
||||
local sn = ls.snippet_node
|
||||
local isn = ls.indent_snippet_node
|
||||
local t = ls.text_node
|
||||
local i = ls.insert_node
|
||||
local f = ls.function_node
|
||||
local c = ls.choice_node
|
||||
local d = ls.dynamic_node
|
||||
local r = ls.restore_node
|
||||
local events = require("luasnip.util.events")
|
||||
local ai = require("luasnip.nodes.absolute_indexer")
|
||||
local extras = require("luasnip.extras")
|
||||
local l = extras.lambda
|
||||
local rep = extras.rep
|
||||
local p = extras.partial
|
||||
local m = extras.match
|
||||
local n = extras.nonempty
|
||||
local dl = extras.dynamic_lambda
|
||||
local fmt = require("luasnip.extras.fmt").fmt
|
||||
local fmta = require("luasnip.extras.fmt").fmta
|
||||
local conds = require("luasnip.extras.expand_conditions")
|
||||
local postfix = require("luasnip.extras.postfix").postfix
|
||||
local types = require("luasnip.util.types")
|
||||
local parse = require("luasnip.util.parser").parse_snippet
|
||||
local ms = ls.multi_snippet
|
||||
|
||||
vim.keymap.set({ "i", "s" }, "<C-j>", function()
|
||||
if ls.expand_or_jumpable() then
|
||||
ls.expand_or_jump()
|
||||
@@ -81,31 +48,24 @@ return {
|
||||
|
||||
ls.config.setup(opts)
|
||||
|
||||
require("luasnip.loaders.from_vscode").load({
|
||||
exclude = {
|
||||
"rust",
|
||||
rust = {
|
||||
"modtest",
|
||||
},
|
||||
},
|
||||
})
|
||||
vim.tbl_map(function(type)
|
||||
require("luasnip.loaders.from_" .. type).lazy_load()
|
||||
end, { "vscode", "snipmate", "lua" })
|
||||
require("luasnip.loaders.from_vscode").lazy_load()
|
||||
|
||||
require("luasnip.loaders.from_lua").load({ paths = vim.fn.stdpath("config") .. "/snippets/" })
|
||||
|
||||
ls.filetype_extend("typescript", { "tsdoc" })
|
||||
ls.filetype_extend("javascript", { "jsdoc" })
|
||||
ls.filetype_extend("lua", { "luadoc" })
|
||||
ls.filetype_extend("python", { "pydoc" })
|
||||
ls.filetype_extend("rust", { "rustdoc" })
|
||||
ls.filetype_extend("cs", { "csharpdoc" })
|
||||
ls.filetype_extend("java", { "javadoc" })
|
||||
ls.filetype_extend("c", { "cdoc" })
|
||||
ls.filetype_extend("cpp", { "cppdoc" })
|
||||
ls.filetype_extend("php", { "phpdoc" })
|
||||
ls.filetype_extend("cs", { "csharpdoc" })
|
||||
ls.filetype_extend("html", { "djangohtml" })
|
||||
ls.filetype_extend("java", { "javadoc" })
|
||||
ls.filetype_extend("javascript", { "jsdoc" })
|
||||
ls.filetype_extend("kotlin", { "kdoc" })
|
||||
ls.filetype_extend("lua", { "luadoc" })
|
||||
ls.filetype_extend("php", { "phpdoc" })
|
||||
ls.filetype_extend("python", { "pydoc", "django" })
|
||||
ls.filetype_extend("ruby", { "rdoc" })
|
||||
-- ls.filetype_extend("rust", { "rustdoc" })
|
||||
ls.filetype_extend("sh", { "shelldoc" })
|
||||
ls.filetype_extend("typescript", { "tsdoc" })
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user