add custom snippets
This commit is contained in:
parent
8aaadac855
commit
dfa4d03042
15
init.lua
15
init.lua
|
|
@ -584,6 +584,7 @@ require('lazy').setup({
|
||||||
cmd = {'/home/utils/llvm-17.0.6/bin/clangd',
|
cmd = {'/home/utils/llvm-17.0.6/bin/clangd',
|
||||||
"--background-index",
|
"--background-index",
|
||||||
"--clang-tidy",
|
"--clang-tidy",
|
||||||
|
"--header-insertion=iwyu",
|
||||||
"--j=2"},
|
"--j=2"},
|
||||||
filetypes = {"cpp"},
|
filetypes = {"cpp"},
|
||||||
single_file_support = true,
|
single_file_support = true,
|
||||||
|
|
@ -720,12 +721,14 @@ require('lazy').setup({
|
||||||
-- `friendly-snippets` contains a variety of premade snippets.
|
-- `friendly-snippets` contains a variety of premade snippets.
|
||||||
-- See the README about individual language/framework/plugin snippets:
|
-- See the README about individual language/framework/plugin snippets:
|
||||||
-- https://github.com/rafamadriz/friendly-snippets
|
-- https://github.com/rafamadriz/friendly-snippets
|
||||||
-- {
|
{
|
||||||
-- 'rafamadriz/friendly-snippets',
|
'rafamadriz/friendly-snippets',
|
||||||
-- config = function()
|
config = function()
|
||||||
-- require('luasnip.loaders.from_vscode').lazy_load()
|
require('luasnip.loaders.from_vscode').lazy_load({ include={"cpp", "python", "lua"} })
|
||||||
-- end,
|
local snip_loader = require('luasnip.loaders.from_vscode')
|
||||||
-- },
|
snip_loader.lazy_load({ paths = vim.fn.stdpath("config").."/snippets/" })
|
||||||
|
end,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
opts = {},
|
opts = {},
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,13 @@
|
||||||
|
{
|
||||||
|
"name": "custom snippets",
|
||||||
|
"contributes": {
|
||||||
|
"snippets": [
|
||||||
|
{
|
||||||
|
"language": [
|
||||||
|
"cpp"
|
||||||
|
],
|
||||||
|
"path": "snippets/cpp.json"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
{
|
||||||
|
"iterator": {
|
||||||
|
"prefix": "iterator",
|
||||||
|
"body": [
|
||||||
|
"class Iterator {",
|
||||||
|
"}",
|
||||||
|
""
|
||||||
|
],
|
||||||
|
"description": "iterator class"
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue