fix: snippets

This commit is contained in:
Fabio Lenherr 2022-11-09 17:45:58 +01:00
parent 4cca98941e
commit 14c9fc6498
7 changed files with 50 additions and 26 deletions

View file

@ -25,4 +25,8 @@ require("telescope").load_extension("fzy_native")
require("impatient").enable_profile() require("impatient").enable_profile()
require("nightfox") require("nightfox")
require('Comment').setup() require('Comment').setup()
require('vgit').setup() -- require('vgit').setup()
-- vim.o.updatetime = 3000
-- vim.o.incsearch = false
-- vim.wo.signcolumn = 'yes'

View file

@ -26,7 +26,7 @@ luasnip.config.set_config({
}, },
}) })
vim.cmd('let g:snipMate = {"snippet_version" : 1 }') --vim.cmd('let g:snipMate = {"snippet_version" : 1 }')
require("luasnip/loaders/from_vscode").lazy_load() require("luasnip/loaders/from_vscode").lazy_load()
--require("luasnip.loaders.from_snipmate").lazy_load() --require("luasnip.loaders.from_snipmate").lazy_load()
@ -147,17 +147,22 @@ cmp.setup({
sources = { sources = {
{ name = "nvim_lsp" }, { name = "nvim_lsp" },
{ name = "luasnip" }, { name = "luasnip" },
{ name = "buffer" }, --{
-- name = "buffer",
-- option = {
-- keyword_pattern = [[\k\+]],
-- }
--},
{ name = "path" }, { name = "path" },
{ -- {
name = "spell", -- name = "spell",
option = { -- option = {
keep_all_entries = false, -- keep_all_entries = false,
enable_in_context = function() -- enable_in_context = function()
return true -- return true
end, -- end,
}, -- },
}, -- },
}, },
confirm_opts = { confirm_opts = {
behavior = cmp.ConfirmBehavior.Replace, behavior = cmp.ConfirmBehavior.Replace,

View file

@ -4,7 +4,6 @@ require("mason-null-ls").setup({
ensure_installed = { ensure_installed = {
"prettierd", "prettierd",
"clang_format", "clang_format",
"latexindent",
"shellharden", "shellharden",
"sql_formatter", "sql_formatter",
"fixjson", "fixjson",
@ -28,7 +27,6 @@ null_ls.setup({
},} },}
), ),
require("null-ls").builtins.formatting.clang_format, require("null-ls").builtins.formatting.clang_format,
require("null-ls").builtins.formatting.latexindent,
require("null-ls").builtins.formatting.shellharden, require("null-ls").builtins.formatting.shellharden,
require("null-ls").builtins.formatting.sql_formatter, require("null-ls").builtins.formatting.sql_formatter,
require("null-ls").builtins.formatting.fixjson, require("null-ls").builtins.formatting.fixjson,

View file

@ -3,6 +3,7 @@ local options = {
mouse = "a", mouse = "a",
fileencoding = "utf-8", fileencoding = "utf-8",
relativenumber = true, relativenumber = true,
cursorline = false,
number = true, number = true,
smartindent = true, smartindent = true,
smartcase = true, smartcase = true,
@ -17,10 +18,10 @@ local options = {
expandtab = true, -- convert tabs to spaces expandtab = true, -- convert tabs to spaces
shiftwidth = 2, -- the number of spaces inserted for each indentation shiftwidth = 2, -- the number of spaces inserted for each indentation
tabstop = 2, -- insert 2 spaces for a tab tabstop = 2, -- insert 2 spaces for a tab
cursorline = true,
scrolloff = 8, -- is one of my fav scrolloff = 8, -- is one of my fav
sidescrolloff = 8, sidescrolloff = 8,
spell = true, spell = false,
syntax = "off",
spelllang = "en_us", spelllang = "en_us",
mousemodel = "popup_setpos", mousemodel = "popup_setpos",
} }

View file

@ -21,10 +21,10 @@ Plug("nvim-treesitter/nvim-treesitter",
{ ["do"] = vim.fn[":TSUpdate"] }) -- syntax colors { ["do"] = vim.fn[":TSUpdate"] }) -- syntax colors
Plug("hrsh7th/nvim-cmp") -- completions Plug("hrsh7th/nvim-cmp") -- completions
Plug("hrsh7th/cmp-nvim-lsp") -- lsp integration with completions Plug("hrsh7th/cmp-nvim-lsp") -- lsp integration with completions
Plug("hrsh7th/cmp-buffer") -- buffer completion --Plug("hrsh7th/cmp-buffer") -- buffer completion
Plug("hrsh7th/cmp-path") -- path completion Plug("hrsh7th/cmp-path") -- path completion
Plug("hrsh7th/cmp-cmdline") -- command completion Plug("hrsh7th/cmp-cmdline") -- command completion
Plug("f3fora/cmp-spell") -- spelling completion --Plug("f3fora/cmp-spell") -- spelling completion
Plug("saadparwaiz1/cmp_luasnip") -- snip completion Plug("saadparwaiz1/cmp_luasnip") -- snip completion
Plug("L3MON4D3/LuaSnip") -- snippet plugin Plug("L3MON4D3/LuaSnip") -- snippet plugin
Plug("kyazdani42/nvim-tree.lua") -- file viewer on the right Plug("kyazdani42/nvim-tree.lua") -- file viewer on the right

View file

@ -5,8 +5,24 @@ end
require("nvim-treesitter.configs").setup({ require("nvim-treesitter.configs").setup({
-- A list of parser names, or "all" -- A list of parser names, or "all"
ensure_installed = { "latex", "c", "cpp", "rust", "lua", "haskell", "java", "javascript", "typescript", "python", "html", "css", ensure_installed = {
"yaml", "bash", "json", "c_sharp"}, "latex",
"c",
"cpp",
"rust",
"lua",
"haskell",
"java",
"javascript",
"typescript",
"python",
"html",
"css",
"yaml",
"bash",
"json",
"c_sharp",
},
highlight = { highlight = {
enable = true, enable = true,
additional_vim_regex_highlighting = false, additional_vim_regex_highlighting = false,

View file

@ -26,7 +26,7 @@ local listSnippet = s(
\item \textcolor{{{2}}}{{{6}}} \item \textcolor{{{2}}}{{{6}}}
\item \textcolor{{{3}}}{{{7}}} \item \textcolor{{{3}}}{{{7}}}
\item \textcolor{{{4}}}{{{8}}} \item \textcolor{{{4}}}{{{8}}}
\vspace{{2mm}} \vspace{{-3mm}}
\end{{itemize}} \end{{itemize}}
]], ]],
{ {
@ -34,8 +34,8 @@ local listSnippet = s(
rep(1), rep(1),
rep(1), rep(1),
rep(1), rep(1),
i(2, "item 2"), i(2, "item 1"),
i(3, "item 1"), i(3, "item 2"),
i(4, "item 3"), i(4, "item 3"),
i(5, "item 4"), i(5, "item 4"),
} }
@ -52,7 +52,7 @@ local enumerateSnippet = s(
\item \textcolor{{{2}}}{{{6}}} \item \textcolor{{{2}}}{{{6}}}
\item \textcolor{{{3}}}{{{7}}} \item \textcolor{{{3}}}{{{7}}}
\item \textcolor{{{4}}}{{{8}}} \item \textcolor{{{4}}}{{{8}}}
\vspace{{2mm}} \vspace{{-3mm}}
\end{{enumerate}} \end{{enumerate}}
]], ]],
{ {
@ -60,8 +60,8 @@ local enumerateSnippet = s(
rep(1), rep(1),
rep(1), rep(1),
rep(1), rep(1),
i(2, "item 2"), i(2, "item 1"),
i(3, "item 1"), i(3, "item 2"),
i(4, "item 3"), i(4, "item 3"),
i(5, "item 4"), i(5, "item 4"),
} }