mirror of
https://github.com/kristoferssolo/SoloVim.git
synced 2026-02-04 06:42:05 +00:00
chore: minor changes
This commit is contained in:
3
after/ftplugin/c.lua
Normal file
3
after/ftplugin/c.lua
Normal file
@@ -0,0 +1,3 @@
|
||||
vim.opt_local.tabstop = 4
|
||||
vim.opt_local.shiftwidth = 4
|
||||
vim.opt_local.softtabstop = 4
|
||||
3
after/ftplugin/sshconfig.lua
Normal file
3
after/ftplugin/sshconfig.lua
Normal file
@@ -0,0 +1,3 @@
|
||||
vim.opt_local.tabstop = 2
|
||||
vim.opt_local.shiftwidth = 2
|
||||
vim.opt_local.softtabstop = 2
|
||||
61
after/plugin/snips/c.lua
Normal file
61
after/plugin/snips/c.lua
Normal file
@@ -0,0 +1,61 @@
|
||||
if not pcall(require, "luasnip") then
|
||||
return
|
||||
end
|
||||
|
||||
local ls = require("luasnip")
|
||||
local s = ls.snippet
|
||||
local i = ls.insert_node
|
||||
local f = ls.function_node
|
||||
local fmt = require("luasnip.extras.fmt").fmt
|
||||
|
||||
local shared = require("solo.snips")
|
||||
local same = shared.same
|
||||
local year = shared.year
|
||||
local date = shared.date
|
||||
|
||||
ls.add_snippets("c", {
|
||||
s(
|
||||
"auth",
|
||||
fmt(
|
||||
[[
|
||||
// Copyright {}
|
||||
// Author - Kristiāns Francis Cagulis, kc22015
|
||||
// {}
|
||||
// Created: {}
|
||||
]],
|
||||
{
|
||||
year(),
|
||||
i(1),
|
||||
date(),
|
||||
}
|
||||
)
|
||||
),
|
||||
s(
|
||||
"fn",
|
||||
fmt(
|
||||
[[
|
||||
// {};
|
||||
// Funkcija {}({}) -
|
||||
// {}
|
||||
{} {{
|
||||
}}
|
||||
]],
|
||||
{
|
||||
same(1),
|
||||
f(function(function_name)
|
||||
if not function_name[1][1] then
|
||||
function_name[1][1] = ""
|
||||
end
|
||||
local words = {}
|
||||
for word in function_name[1][1]:gmatch("%w+") do
|
||||
table.insert(words, word)
|
||||
end
|
||||
return words[2] or ""
|
||||
end, { 1 }),
|
||||
i(2),
|
||||
i(0),
|
||||
i(1),
|
||||
}
|
||||
)
|
||||
),
|
||||
})
|
||||
Reference in New Issue
Block a user