config.nvim

NeoVim config
git clone git://popovic.xyz/nvim.config.git/
Log | Files | Refs

commit 245555e22829a513703b9a0c6508a6cc35492e0a
parent 56cf572114b569bf650476289ab680019429ffe5
Author: Milutin Popovic <milutin@popovic.xyz>
Date:   Sat, 11 Apr 2026 09:36:39 +0100

move from cmp to blimp

Diffstat:
Dlazy-lock.json | 33---------------------------------
Mlua/config/autocmd.lua | 11++++++-----
Mlua/config/diagnostics.lua | 19+++++++++++++++++--
Mlua/config/init.lua | 3++-
Mlua/config/keymaps.lua | 9++-------
Mlua/config/lazy.lua | 15+--------------
Alua/config/native.lua | 25+++++++++++++++++++++++++
Mlua/config/set.lua | 27++-------------------------
Alua/config/undotree.lua | 7+++++++
Mlua/plugins/autorepair.lua | 4++--
Alua/plugins/blimp.lua | 49+++++++++++++++++++++++++++++++++++++++++++++++++
Mlua/plugins/color.lua | 15++++++++-------
Dlua/plugins/completions.lua | 113-------------------------------------------------------------------------------
Mlua/plugins/copilot.lua | 2+-
Mlua/plugins/copilotchat.lua | 13+++++++------
Mlua/plugins/floaterm.lua | 1+
Mlua/plugins/hints.lua | 5+++--
Mlua/plugins/ibl.lua | 8++++----
Mlua/plugins/lsp.lua | 52++++++++++++++++++++++++++++++++++++++++++----------
Mlua/plugins/luasnip.lua | 4+---
Mlua/plugins/rustacean.lua | 1-
Mlua/plugins/telescope.lua | 1+
Mlua/plugins/treesitter.lua | 13+++++++------
Dlua/plugins/undotree.lua | 6------
Mlua/plugins/vimtex.lua | 2+-
Mlua/snippets/basic.lua | 2+-
Mlua/snippets/latex.lua | 556+++++++++++++++++++++++++++++++++++++++----------------------------------------
Mlua/snippets/rust.lua | 2+-
28 files changed, 466 insertions(+), 532 deletions(-)

diff --git a/lazy-lock.json b/lazy-lock.json @@ -1,33 +0,0 @@ -{ - "CopilotChat.nvim": { "branch": "main", "commit": "d2d2574863529cb76b62b028cb5c3196ef5796d6" }, - "LuaSnip": { "branch": "master", "commit": "03c8e67eb7293c404845b3982db895d59c0d1538" }, - "cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" }, - "cmp-cmdline": { "branch": "main", "commit": "d126061b624e0af6c3a556428712dd4d4194ec6d" }, - "cmp-nvim-lsp": { "branch": "main", "commit": "cbc7b02bb99fae35cb42f514762b89b5126651ef" }, - "cmp-path": { "branch": "main", "commit": "c642487086dbd9a93160e1679a1327be111cbc25" }, - "cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" }, - "conform.nvim": { "branch": "master", "commit": "086a40dc7ed8242c03be9f47fbcee68699cc2395" }, - "copilot-cmp": { "branch": "master", "commit": "15fc12af3d0109fa76b60b5cffa1373697e261d1" }, - "copilot.lua": { "branch": "master", "commit": "07aa57148ac28986bab9f55e87ee3d929e2726b1" }, - "fidget.nvim": { "branch": "main", "commit": "889e2e96edef4e144965571d46f7a77bcc4d0ddf" }, - "indent-blankline.nvim": { "branch": "master", "commit": "d28a3f70721c79e3c5f6693057ae929f3d9c0a03" }, - "lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "25f609e7fca78af7cede4f9fa3af8a94b1c4950b" }, - "mason-registry": { "branch": "main", "commit": "7fc5206b853056aef6670542eac00f49ed9bd749" }, - "mason.nvim": { "branch": "main", "commit": "44d1e90e1f66e077268191e3ee9d2ac97cc18e65" }, - "nvim-autopairs": { "branch": "master", "commit": "59bce2eef357189c3305e25bc6dd2d138c1683f5" }, - "nvim-cmp": { "branch": "main", "commit": "a1d504892f2bc56c2e79b65c6faded2fd21f3eca" }, - "nvim-highlight-colors": { "branch": "main", "commit": "e2cb22089cc2358b2b995c09578224f142de6039" }, - "nvim-lsp-endhints": { "branch": "main", "commit": "85d072ab00ada2b0eeb738c76b11580cf74faf13" }, - "nvim-lspconfig": { "branch": "master", "commit": "9ccd58a7949091c0cc2777d4e92a45a209c808c1" }, - "nvim-treesitter": { "branch": "main", "commit": "4916d6592ede8c07973490d9322f187e07dfefac" }, - "plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" }, - "popup.nvim": { "branch": "master", "commit": "b7404d35d5d3548a82149238289fa71f7f6de4ac" }, - "rose-pine": { "branch": "main", "commit": "cf2a288696b03d0934da713d66c6d71557b5c997" }, - "rustaceanvim": { "branch": "master", "commit": "f69c85a955b9a83d495e3dc8d43adb6364a0b765" }, - "telescope-fzy-native.nvim": { "branch": "master", "commit": "282f069504515eec762ab6d6c89903377252bf5b" }, - "telescope.nvim": { "branch": "master", "commit": "cfb85dcf7f822b79224e9e6aef9e8c794211b20b" }, - "undotree": { "branch": "master", "commit": "6fa6b57cda8459e1e4b2ca34df702f55242f4e4d" }, - "vim-floaterm": { "branch": "master", "commit": "0ab5eb8135dc884bc543a819ac7033c15e72a76b" }, - "vimtex": { "branch": "master", "commit": "9306903316c3ddd250676b7cf97c84a84c9c8f99" } -} diff --git a/lua/config/autocmd.lua b/lua/config/autocmd.lua @@ -1,22 +1,23 @@ +---@diagnostic disable: undefined-global local autocmd = vim.api.nvim_create_autocmd -- Delete trailing whitespace -autocmd({'BufWritePre'}, { +autocmd({ 'BufWritePre' }, { pattern = '*', command = [[%s/\s\+$//e]], }) -autocmd({'BufEnter'}, { +autocmd({ 'BufEnter' }, { pattern = 'justfile', - command = "set filetype=make"; + command = "set filetype=make", }) -autocmd({'BufWritePost'}, { +autocmd({ 'BufWritePost' }, { pattern = vim.fn.expand('~') .. '/.config/X/Xresources', command = '!xrdb %', }) -autocmd({'BufWritePost'}, { +autocmd({ 'BufWritePost' }, { pattern = vim.fn.expand('~') .. '/.config/X/Xresources.mon', command = '!xrdb %', }) diff --git a/lua/config/diagnostics.lua b/lua/config/diagnostics.lua @@ -1,4 +1,4 @@ - +---@diagnostic disable: undefined-global local palette = { err = "#51202A", warn = "#3B3B1B", @@ -61,7 +61,22 @@ local diagnostic_goto = function(next, severity) end end -map = vim.keymap.set +local map = vim.keymap.set + +map("n", "<leader>h", function() + local bufnr = vim.api.nvim_get_current_buf() + local enabled = vim.lsp.inlay_hint.is_enabled({ bufnr = bufnr }) + vim.lsp.inlay_hint.enable(not enabled, { bufnr = bufnr }) + vim.notify("Inlay hints " .. (enabled and "OFF" or "ON")) +end, { silent = true, desc = "Toggle inlay hints" }) + +map("n", "<leader>d", function() + local bufnr = vim.api.nvim_get_current_buf() + local enabled = vim.diagnostic.is_enabled({ bufnr = bufnr }) + vim.diagnostic.enable(not enabled, { bufnr = bufnr }) + vim.notify("Diagnostics " .. (enabled and "OFF" or "ON")) +end, { silent = true, desc = "Toggle diagnostics" }) + map("n", "<C-w>d", vim.diagnostic.open_float, { desc = "Line Diagnostics" }) map("n", "]d", diagnostic_goto(true), { desc = "Next Diagnostic" }) map("n", "[d", diagnostic_goto(false), { desc = "Prev Diagnostic" }) diff --git a/lua/config/init.lua b/lua/config/init.lua @@ -1,11 +1,12 @@ +---@diagnostic disable: undefined-global require("config.keymaps") require("config.set") require("config.autocmd") require("config.diagnostics") +require("config.native") local lazyconfpath = vim.fn.stdpath("config") .. "/lua/config/lazy.lua" local pluginspath = vim.fn.stdpath("config") .. "/lua/plugins" if vim.uv.fs_stat(lazyconfpath) and vim.uv.fs_stat(pluginspath) then require("config.lazy") end - diff --git a/lua/config/keymaps.lua b/lua/config/keymaps.lua @@ -1,3 +1,4 @@ +---@diagnostic disable: undefined-global vim.g.mapleader = " " vim.g.maplocalleader = "," vim.keymap.set("n", "<leader>pv", vim.cmd.Ex) @@ -11,12 +12,6 @@ vim.keymap.set("n", "<C-j>", "<C-w>j") vim.keymap.set("n", "<C-k>", "<C-w>k") vim.keymap.set("n", "<C-l>", "<C-w>l") -vim.keymap.set("n", "<leader>b", ":! firefox %") +vim.keymap.set("n", "<leader>b", ":! $BROWSER %") vim.keymap.set('c', 'w!!', ':w ! sudo tee % > /dev/null') - -vim.keymap.set('n', '<C-S>', function() - local bad = vim.fn.expand("<cword>") - local word_list = vim.fn.spellsuggest(bad) - end -) diff --git a/lua/config/lazy.lua b/lua/config/lazy.lua @@ -1,4 +1,3 @@ --- Bootstrap lazy.nvim local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" if not (vim.uv or vim.loop).fs_stat(lazypath) then local lazyrepo = "https://github.com/folke/lazy.nvim.git" @@ -6,7 +5,7 @@ if not (vim.uv or vim.loop).fs_stat(lazypath) then if vim.v.shell_error ~= 0 then vim.api.nvim_echo({ { "Failed to clone lazy.nvim:\n", "ErrorMsg" }, - { out, "WarningMsg" }, + { out, "WarningMsg" }, { "\nPress any key to exit..." }, }, true, {}) vim.fn.getchar() @@ -15,21 +14,9 @@ if not (vim.uv or vim.loop).fs_stat(lazypath) then end vim.opt.rtp:prepend(lazypath) --- Make sure to setup `mapleader` and `maplocalleader` before --- loading lazy.nvim so that mappings are correct. --- This is also a good place to setup other settings (vim.opt) -vim.g.mapleader = " " -vim.g.maplocalleader = "," - --- Setup lazy.nvim require("lazy").setup({ spec = { - -- import your plugins { import = "plugins" }, }, - -- Configure any other settings here. See the documentation for more details. - -- colorscheme that will be used when installing plugins. - install = { colorscheme = { "habamax" } }, - -- automatically check for plugin updates checker = { enabled = false }, }) diff --git a/lua/config/native.lua b/lua/config/native.lua @@ -0,0 +1,25 @@ +---@diagnostic disable: undefined-global +-- Undotree toggle +vim.keymap.set("n", "<leader>u", function() + vim.cmd("packadd nvim.undotree") + require("undotree").open({ + command = "topleft " .. math.floor(vim.api.nvim_win_get_width(0) / 4) .. "vnew", + }) +end, { desc = "[U]ndotree toggle" }) + +-- incremental selection treesitter/lsp +vim.keymap.set({ "n", "x", "o" }, "<A-o>", function() + if vim.treesitter.get_parser(nil, nil, { error = false }) then + require("vim.treesitter._select").select_parent(vim.v.count1) + else + vim.lsp.buf.selection_range(vim.v.count1) + end +end, { desc = "Select parent treesitter node or outer incremental lsp selections" }) + +vim.keymap.set({ "n", "x", "o" }, "<A-i>", function() + if vim.treesitter.get_parser(nil, nil, { error = false }) then + require("vim.treesitter._select").select_child(vim.v.count1) + else + vim.lsp.buf.selection_range(-vim.v.count1) + end +end, { desc = "Select child treesitter node or inner incremental lsp selections" }) diff --git a/lua/config/set.lua b/lua/config/set.lua @@ -1,3 +1,4 @@ +---@diagnostic disable: undefined-global vim.cmd('filetype on') vim.cmd('filetype plugin indent on') @@ -7,6 +8,7 @@ vim.opt.relativenumber = true vim.g.show_whitespace = 1 vim.g.loaded_perl_provider = false vim.opt.termguicolors = true +vim.o.winborder = "single" vim.opt.clipboard = "unnamedplus" @@ -41,28 +43,3 @@ vim.opt.splitbelow = true vim.opt.splitright = true vim.opt.spellsuggest = { "best", 5 } - --- Undotree toggle -vim.cmd("packadd nvim.undotree") -vim.keymap.set("n", "<leader>u", function() - require("undotree").open({ - command = math.floor(vim.api.nvim_win_get_width(0) / 3) .. "vnew", - }) -end, { desc = "[U]ndotree toggle" }) - --- incremental selection treesitter/lsp -vim.keymap.set({ "n", "x", "o" }, "<A-o>", function() - if vim.treesitter.get_parser(nil, nil, { error = false }) then - require("vim.treesitter._select").select_parent(vim.v.count1) - else - vim.lsp.buf.selection_range(vim.v.count1) - end -end, { desc = "Select parent treesitter node or outer incremental lsp selections" }) - -vim.keymap.set({ "n", "x", "o" }, "<A-i>", function() - if vim.treesitter.get_parser(nil, nil, { error = false }) then - require("vim.treesitter._select").select_child(vim.v.count1) - else - vim.lsp.buf.selection_range(-vim.v.count1) - end -end, { desc = "Select child treesitter node or inner incremental lsp selections" }) diff --git a/lua/config/undotree.lua b/lua/config/undotree.lua @@ -0,0 +1,7 @@ +---@diagnostic disable: undefined-global +vim.cmd("packadd nvim.undotree") +vim.keymap.set("n", "<leader>u", function() + require("undotree").open({ + command = math.floor(vim.api.nvim_win_get_width(0) / 3) .. "vnew", + }) +end, { desc = "[U]ndotree toggle" }) diff --git a/lua/plugins/autorepair.lua b/lua/plugins/autorepair.lua @@ -1,6 +1,6 @@ return { - 'windwp/nvim-autopairs', + "windwp/nvim-autopairs", event = "InsertEnter", config = true, - disable_filetype = { "TelescopePrompt" , "vim" }, + disable_filetype = { "TelescopePrompt", "vim" }, } diff --git a/lua/plugins/blimp.lua b/lua/plugins/blimp.lua @@ -0,0 +1,49 @@ +---@diagnostic disable: undefined-global +return { + "saghen/blink.cmp", + event = "InsertEnter", + version = "v1", + dependencies = { + "L3MON4D3/LuaSnip", + "fang2hou/blink-copilot" + }, + opts = { + keymap = { + ['<C-a>'] = { 'accept', 'fallback' }, + ['<C-n>'] = { 'select_next', 'show' }, + ['<C-p>'] = { 'select_prev' }, + ['<C-b>'] = { 'scroll_documentation_up', 'fallback' }, + ['<C-f>'] = { 'scroll_documentation_down', 'fallback' }, + }, + completion = { + documentation = { + auto_show = true, + auto_show_delay_ms = 200, + }, + }, + cmdline = { enabled = false }, + snippets = { preset = "luasnip" }, + sources = { + default = { + "copilot", + 'lsp', + 'path', + 'snippets', + 'buffer' + }, + providers = { + copilot = { + name = "copilot", + module = "blink-copilot", + score_offset = 100, + async = true, + } + } + }, + appearance = { + kind_icons = { + copilot = " ", + } + } + } +} diff --git a/lua/plugins/color.lua b/lua/plugins/color.lua @@ -1,3 +1,4 @@ +---@diagnostic disable: undefined-global function ColorMyPencils(color) color = color or "rose-pine-moon" vim.cmd.colorscheme(color) @@ -5,15 +6,15 @@ function ColorMyPencils(color) vim.api.nvim_set_hl(0, "Normal", { bg = "none" }) vim.api.nvim_set_hl(0, "NormalNC", { bg = "none" }) - vim.api.nvim_set_hl(0, "MatchParen", { bg= "darkred" }) - vim.api.nvim_set_hl(0, "SpellBad", { bold=true, underline=true, fg= "red" }) + vim.api.nvim_set_hl(0, "MatchParen", { bg = "darkred" }) + vim.api.nvim_set_hl(0, "SpellBad", { bold = true, underline = true, fg = "red" }) -- separators - vim.api.nvim_set_hl(0, "WinSeparator", { fg="#A96C8A", bold=true }) - vim.api.nvim_set_hl(0, "StatusLine", { fg="#6CA98A" }) + vim.api.nvim_set_hl(0, "WinSeparator", { fg = "#A96C8A", bold = true }) + vim.api.nvim_set_hl(0, "StatusLine", { fg = "#6CA98A" }) vim.fn.matchadd("ExtraWhiteSpace", '\\v\\s+$') - vim.api.nvim_set_hl(0, "ExtraWhiteSpace", { ctermbg="red", bg="red" }) + vim.api.nvim_set_hl(0, "ExtraWhiteSpace", { ctermbg = "red", bg = "red" }) local nontexthl = vim.api.nvim_get_hl_by_name("NonText", true) -- colpilot chat @@ -21,8 +22,8 @@ function ColorMyPencils(color) vim.api.nvim_set_hl(0, 'CopilotChatSeparator', { fg = '#374151' }) -- TelescopeBorder - vim.api.nvim_set_hl(0, 'TelescopeBorder', { fg = '#A96C8A', bold=true }) - vim.api.nvim_set_hl(0, 'TelescopeTitle', { fg = '#6CA98A', bold=true }) + vim.api.nvim_set_hl(0, 'TelescopeBorder', { fg = '#A96C8A', bold = true }) + vim.api.nvim_set_hl(0, 'TelescopeTitle', { fg = '#6CA98A', bold = true }) -- lsp hints vim.api.nvim_set_hl(0, "LspInlayHint", { bg = "none", fg = nontexthl.foreground }) diff --git a/lua/plugins/completions.lua b/lua/plugins/completions.lua @@ -1,113 +0,0 @@ ----@diagnostic disable: undefined-global -return { - "hrsh7th/nvim-cmp", - event = "InsertEnter", - dependencies = { - "hrsh7th/cmp-nvim-lsp", - "hrsh7th/cmp-buffer", - "hrsh7th/cmp-path", - "hrsh7th/cmp-cmdline", - "L3MON4D3/LuaSnip", - "saadparwaiz1/cmp_luasnip", - "zbirenbaum/copilot-cmp", - }, - config = function() - vim.o.winborder = "single" - - local map = vim.keymap.set - - local ok_copilot_cmp, copilot_cmp = pcall(require, "copilot_cmp") - if ok_copilot_cmp then - copilot_cmp.setup() - end - - local cmp = require("cmp") - local luasnip = require("luasnip") - - cmp.setup({ - snippet = { - expand = function(args) - luasnip.lsp_expand(args.body) - end, - }, - - mapping = cmp.mapping.preset.insert({ - ["<C-n>"] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Insert }), - ["<C-p>"] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Insert }), - ["<`-j>"] = cmp.mapping.scroll_docs(-4), - ["<`-k>"] = cmp.mapping.scroll_docs(4), - ["<C-a>"] = cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Insert, select = true }), - }), - - sources = cmp.config.sources({ - { name = "copilot" }, - { name = "nvim_lsp" }, - { name = "luasnip" }, - }, { - { name = "buffer" }, - { name = "path" }, - }), - - window = { - completion = cmp.config.window.bordered({ - winhighlight = "Normal:CmpPmenu,CursorLine:PmenuSel,Search:None,NormalFloat:Normal", - }), - documentation = cmp.config.window.bordered({ - winhighlight = "Normal:CmpPmenu,CursorLine:PmenuSel,Search:None,NormalFloat:Normal", - }), - }, - - formatting = { - fields = { "abbr", "kind", "menu" }, - format = function(entry, item) - local menu_icon = { - nvim_lsp = "λ", - luasnip = "⋗", - buffer = "Ω", - path = "🖫", - copilot = " ", - } - item.menu = menu_icon[entry.source.name] or "" - return item - end, - }, - }) - - local ok_endhints, endhints = pcall(require, "lsp-endhints") - if ok_endhints then - endhints.setup({ - icons = { - type = "-> ", - parameter = "<= ", - offspec = "<= ", - unknown = "? ", - }, - label = { - truncateAtChars = 50, - padding = 1, - marginLeft = 0, - sameKindSeparator = ", ", - }, - extmark = { - priority = 50, - }, - autoEnableHints = true, - }) - endhints.enable() - end - - map("n", "<leader>h", function() - local bufnr = vim.api.nvim_get_current_buf() - local enabled = vim.lsp.inlay_hint.is_enabled({ bufnr = bufnr }) - vim.lsp.inlay_hint.enable(not enabled, { bufnr = bufnr }) - vim.notify("Inlay hints " .. (enabled and "OFF" or "ON")) - end, { silent = true, desc = "Toggle inlay hints" }) - - map("n", "<leader>d", function() - local bufnr = vim.api.nvim_get_current_buf() - local enabled = vim.diagnostic.is_enabled({ bufnr = bufnr }) - vim.diagnostic.enable(not enabled, { bufnr = bufnr }) - vim.notify("Diagnostics " .. (enabled and "OFF" or "ON")) - end, { silent = true, desc = "Toggle diagnostics" }) - end, -} diff --git a/lua/plugins/copilot.lua b/lua/plugins/copilot.lua @@ -3,7 +3,7 @@ return { cmd = "Copilot", event = "InsertEnter", requires = { - "copilotlsp-nvim/copilot-lsp", -- (optional) for NES functionality + "copilotlsp-nvim/copilot-lsp", }, config = function() require("copilot").setup({ diff --git a/lua/plugins/copilotchat.lua b/lua/plugins/copilotchat.lua @@ -1,3 +1,4 @@ +---@diagnostic disable: undefined-global return { "CopilotC-Nvim/CopilotChat.nvim", dependencies = { @@ -9,18 +10,18 @@ return { opts = { model = "gpt-5.2", window = { - layout = 'horizontal', + layout = "horizontal", width = 1, height = 0.3, - title = '🤖 AI Assistant', + title = "🤖 AI Assistant", }, headers = { - user = '👤 You', - assistant = '🤖 Copilot', - tool = '🔧 Tool', + user = "👤 You", + assistant = "🤖 Copilot", + tool = "🔧 Tool", }, suggestion = { enabled = true }, - separator = '━━', + separator = "━━", auto_fold = true, }, config = function(_, opts) diff --git a/lua/plugins/floaterm.lua b/lua/plugins/floaterm.lua @@ -1,3 +1,4 @@ +---@diagnostic disable: undefined-global return { "voldikss/vim-floaterm", config = function() diff --git a/lua/plugins/hints.lua b/lua/plugins/hints.lua @@ -1,7 +1,8 @@ +---@diagnostic disable: undefined-global return { "chrisgrieser/nvim-lsp-endhints", event = "VeryLazy", - config = function () + config = function() local endhints = require("lsp-endhints") endhints.enable() endhints.setup { @@ -9,7 +10,7 @@ return { type = "-> ", parameter = "<= ", offspec = "<= ", -- hint kind not defined in official LSP spec - unknown = "? ", -- hint kind is nil + unknown = "? ", -- hint kind is nil }, label = { truncateAtChars = 50, diff --git a/lua/plugins/ibl.lua b/lua/plugins/ibl.lua @@ -1,10 +1,10 @@ return { - 'lukas-reineke/indent-blankline.nvim', - main = 'ibl', - event = 'VeryLazy', + "lukas-reineke/indent-blankline.nvim", + main = "ibl", + event = "VeryLazy", opts = { indent = { - char = '│' + char = "│" }, scope = { show_start = false, diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua @@ -1,3 +1,4 @@ +---@diagnostic disable: undefined-global return { "neovim/nvim-lspconfig", dependencies = { @@ -5,19 +6,51 @@ return { "williamboman/mason.nvim", "williamboman/mason-lspconfig.nvim", "j-hui/fidget.nvim", - "hrsh7th/nvim-cmp", - "hrsh7th/cmp-nvim-lsp", + "saghen/blink.cmp", }, config = function() local map = vim.keymap.set + local ok_blink, blink = pcall(require, "blink.cmp") + if ok_blink then + blink.setup({ + snippets = { preset = "luasnip" }, + sources = { + default = { "lsp", "path", "snippets", "buffer" }, + }, + }) + end + local capabilities = vim.lsp.protocol.make_client_capabilities() - capabilities = vim.tbl_deep_extend( - "force", - capabilities, - require("cmp_nvim_lsp").default_capabilities() - ) - require("lspconfig").util.default_config.capabilities = capabilities + if ok_blink and type(blink.get_lsp_capabilities) == "function" then + capabilities = vim.tbl_deep_extend("force", capabilities, blink.get_lsp_capabilities()) + end + + local ok_endhints, endhints = pcall(require, "lsp-endhints") + if ok_endhints then + endhints.setup({ + icons = { + type = "-> ", + parameter = "<= ", + offspec = "<= ", + unknown = "? ", + }, + label = { + truncateAtChars = 50, + padding = 1, + marginLeft = 0, + sameKindSeparator = ", ", + }, + extmark = { + priority = 50, + }, + autoEnableHints = true, + }) + endhints.enable() + end + + local lspconfig = require("lspconfig") + lspconfig.util.default_config.capabilities = capabilities require("conform").setup({ formatters_by_ft = { @@ -28,7 +61,7 @@ return { vue = { "prettier" }, css = { "prettier" }, scss = { "prettier" }, - lua = { "prettier" }, + lua = { "stylua" }, less = { "prettier" }, html = { "prettier" }, json = { "prettier" }, @@ -79,7 +112,6 @@ return { require("fidget").setup({}) - local lspconfig = require("lspconfig") require("mason").setup() require("mason-lspconfig").setup({ diff --git a/lua/plugins/luasnip.lua b/lua/plugins/luasnip.lua @@ -1,3 +1,4 @@ +---@diagnostic disable: undefined-global return { "L3MON4D3/LuaSnip", version = "v2.3.0", @@ -11,8 +12,5 @@ return { for _, ft_path in ipairs(vim.api.nvim_get_runtime_file("lua/snippets/*.lua", true)) do loadfile(ft_path)() end - - - end } diff --git a/lua/plugins/rustacean.lua b/lua/plugins/rustacean.lua @@ -1,4 +1,3 @@ --- lua/plugins/rustacean.lua ---@diagnostic disable: undefined-global return { "mrcjkb/rustaceanvim", diff --git a/lua/plugins/telescope.lua b/lua/plugins/telescope.lua @@ -1,3 +1,4 @@ +---@diagnostic disable: undefined-global return { "nvim-telescope/telescope.nvim", dependencies = { diff --git a/lua/plugins/treesitter.lua b/lua/plugins/treesitter.lua @@ -1,9 +1,10 @@ +---@diagnostic disable: undefined-global return { "nvim-treesitter/nvim-treesitter", build = ":TSUpdate", - config = function () + config = function() require("nvim-treesitter").setup({ --- ensure_installed = "none", + -- ensure_installed = "none", auto_install = true, indent = { enable = true @@ -11,8 +12,8 @@ return { highlight = { enable = true, disable = function(lang, buf) - local langs = { "latex", "html" , "markdown", "text"} - for i=1,#langs do + local langs = { "latex", "html", "markdown", "text" } + for i = 1, #langs do if lang == langs[i] then return true end @@ -24,12 +25,12 @@ return { vim.notify( "File larger than 100KB treesitter disabled for performance", vim.log.levels.WARN, - {title = "Treesitter"} + { title = "Treesitter" } ) return true end end, - additional_vim_regex_highlighting=false, + additional_vim_regex_highlighting = false, }, }) end diff --git a/lua/plugins/undotree.lua b/lua/plugins/undotree.lua @@ -1,6 +0,0 @@ -return { - "mbbill/undotree", - config = function() - vim.keymap.set('n', '<leader>u', ":UndotreeToggle<CR>") - end -} diff --git a/lua/plugins/vimtex.lua b/lua/plugins/vimtex.lua @@ -1,3 +1,4 @@ +---@diagnostic disable: undefined-global return { "lervag/vimtex", lazy = false, @@ -24,6 +25,5 @@ return { vim.keymap.set('n', '<leader>tp', "<Esc>:w<CR>:VimtexCompile<CR>") vim.keymap.set('n', '<leader>te', "<Esc>:w<CR>:VimtexErrors<CR>") - end } diff --git a/lua/snippets/basic.lua b/lua/snippets/basic.lua @@ -2,7 +2,7 @@ local ls = require("luasnip") local s = ls.snippet -local date = function() return {os.date('%Y-%m-%d')} end +local date = function() return { os.date('%Y-%m-%d') } end local func = ls.function_node ls.add_snippets(nil, { diff --git a/lua/snippets/latex.lua b/lua/snippets/latex.lua @@ -1,3 +1,4 @@ +---@diagnostic disable: undefined-global local ls = require("luasnip") local s = ls.snippet local i = ls.insert_node @@ -7,26 +8,19 @@ local extras = require("luasnip.extras") local rep = extras.rep local function math() - return vim.api.nvim_eval('vimtex#syntax#in_mathzone()') == 1 -end -local function env(name) - local is_inside = vim.fn['vimtex#env#is_inside'](name) - return (is_inside[1] > 0 and is_inside[2] > 0) -end -local function tikz() - return env("tikzpicture") + return vim.api.nvim_eval('vimtex#syntax#in_mathzone()') == 1 end ls.add_snippets("tex", { -s({ trig = "beg", snippetType = "snippet", descr = "begin env"}, fmt([[ + s({ trig = "beg", snippetType = "snippet", descr = "begin env" }, fmt([[ \begin{<>} <> \end{<>}]], { i(1, "env"), i(0), rep(1) }, { delimiters = "<>" } -)), -s({ trig = "...", wordTrig = false, snippetType = "autosnippet", descr = "ldots" }, { t("\\ldots") }), -s("template", fmt([[ + )), + s({ trig = "...", wordTrig = false, snippetType = "autosnippet", descr = "ldots" }, { t("\\ldots") }), + s("template", fmt([[ \documentclass[a4paper]{article} \usepackage[T1]{fontenc} @@ -78,9 +72,9 @@ s("template", fmt([[ ]], { i(1, "Title"), i(0) }, { - delimiters = "<>", + delimiters = "<>", })), -s({ trig = "document", descr = "document environment", snippetType = "snippet" }, + s({ trig = "document", descr = "document environment", snippetType = "snippet" }, fmt([[ \begin{document} \tableofcontents @@ -88,10 +82,10 @@ s({ trig = "document", descr = "document environment", snippetType = "snippet" } \printbibliography \end{document} ]], - { i(0) }, - { delimiters = "<>" } + { i(0) }, + { delimiters = "<>" } )), -s({ trig = "table", descr = "table environment" , snippetType = "snippet" }, + s({ trig = "table", descr = "table environment", snippetType = "snippet" }, fmt([[ \begin{table}[htb] \centering @@ -102,10 +96,10 @@ s({ trig = "table", descr = "table environment" , snippetType = "snippet" }, \end{tabular} \end{table} ]], - { i(1, "caption"), i(2, "label"), i(3, "c"), i(0) }, - { delimiters = "<>" } + { i(1, "caption"), i(2, "label"), i(3, "c"), i(0) }, + { delimiters = "<>" } )), -s({ trig = "fig", descr = "figure environment" }, + s({ trig = "fig", descr = "figure environment" }, fmt([[ \begin{figure}[htb!] \centering @@ -114,510 +108,510 @@ s({ trig = "fig", descr = "figure environment" }, \label{fig:<>} \end{figure} ]], - { i(1, "path"), i(2, "caption"), i(3, "0") }, - { delimiters = "<>" } + { i(1, "path"), i(2, "caption"), i(3, "0") }, + { delimiters = "<>" } )), -s({ trig = "align", descr = "align", snippetType = "autosnippet" }, + s({ trig = "align", descr = "align", snippetType = "autosnippet" }, fmt([[ \begin{align} <> \end{align} ]], - { i(1) }, - { delimiters = "<>" } + { i(1) }, + { delimiters = "<>" } )), -s({ trig = "enumerate", descr = "enumerate", snippetType = "autosnippet" }, + s({ trig = "enumerate", descr = "enumerate", snippetType = "autosnippet" }, fmt([[ \begin{enumerate} \item <> \end{enumerate} ]], - { i(1) }, - { delimiters = "<>" } + { i(1) }, + { delimiters = "<>" } )), -s({ trig = "itemize", descr = "itemize", snippetType = "autosnippet" }, + s({ trig = "itemize", descr = "itemize", snippetType = "autosnippet" }, fmt([[ \begin{itemize} \item <> \end{itemize} ]], - { i(1) }, - { delimiters = "<>" } + { i(1) }, + { delimiters = "<>" } )), -s({ trig = "frame", descr = "frame", snippetType = "snippet" }, + s({ trig = "frame", descr = "frame", snippetType = "snippet" }, fmt([[ \begin{frame}{<>} <> \end{frame} ]], - { i(1), i(0) }, - { delimiters = "<>" } + { i(1), i(0) }, + { delimiters = "<>" } )), -s({ trig = "desc", descr = "description", snippetType = "snippet" }, + s({ trig = "desc", descr = "description", snippetType = "snippet" }, fmt([[ \begin{description} \item[<>] <> \end{description} ]], - { i(1), i(0) }, - { delimiters = "<>" } + { i(1), i(0) }, + { delimiters = "<>" } )), -s({ trig = "pac", descr = "package", snippetType = "snippet" }, + s({ trig = "pac", descr = "package", snippetType = "snippet" }, fmt([[\usepackage[<>]{<>}<> ]], - { i(1, "options"), i(2, "package"), i(0) }, - { delimiters = "<>" } + { i(1, "options"), i(2, "package"), i(0) }, + { delimiters = "<>" } )), -s({ trig = "=>", wordTrig = false, descr = "implies", snippetType = "autosnippet" }, + s({ trig = "=>", wordTrig = false, descr = "implies", snippetType = "autosnippet" }, { t("\\implies") }, { condition = math, show_condition = math } - ), -s({ trig = "=<", wordTrig = false, descr = "impliedby", snippetType = "autosnippet" }, + ), + s({ trig = "=<", wordTrig = false, descr = "impliedby", snippetType = "autosnippet" }, { t("\\impliedby") }, { condition = math, show_condition = math } - ), -s({ trig = "iff", wordTrig = false, descr = "iff", snippetType = "autosnippet" }, + ), + s({ trig = "iff", wordTrig = false, descr = "iff", snippetType = "autosnippet" }, { t("\\iff") }, { condition = math, show_condition = math } - ), -s({ trig = "//", wordTrig = false, descr = "Fraction", snippetType = "autosnippet" }, + ), + s({ trig = "//", wordTrig = false, descr = "Fraction", snippetType = "autosnippet" }, fmt([[\frac{<>}{<>}<>]], { i(1), i(2), i(0) }, { delimiters = "<>" }), { condition = math, show_condition = math } - ), -s({ trig = "==", wordTrig = false, descr = "equals", snippetType = "autosnippet" }, + ), + s({ trig = "==", wordTrig = false, descr = "equals", snippetType = "autosnippet" }, fmt([[ &= <> \\ ]], { i(1) }, { delimiters = "<>" }), { condition = math, show_condition = math } - ), -s({ trig = "!=", wordTrig = false, descr = "not equals", snippetType = "autosnippet" }, + ), + s({ trig = "!=", wordTrig = false, descr = "not equals", snippetType = "autosnippet" }, { t("\\neq") }, { condition = math, show_condition = math } - ), -s({ trig = "ceil", wordTrig = false, descr = "ceiling function", snippetType = "autosnippet" }, + ), + s({ trig = "ceil", wordTrig = false, descr = "ceiling function", snippetType = "autosnippet" }, fmt([[\left\lceil <> \right\rceil <>]], { i(1), i(0) }, { delimiters = "<>" }), { condition = math, show_condition = math } - ), -s({ trig = "floor", wordTrig = false, descr = "floor function", snippetType = "autosnippet" }, + ), + s({ trig = "floor", wordTrig = false, descr = "floor function", snippetType = "autosnippet" }, fmt([[\left\lfloor <> \right\rfloor <>]], { i(1), i(0) }, { delimiters = "<>" }), { condition = math, show_condition = math } - ), -s({ trig = "pmat", wordTrig = false, descr = "pmatrix", snippetType = "autosnippet" }, + ), + s({ trig = "pmat", wordTrig = false, descr = "pmatrix", snippetType = "autosnippet" }, fmt([[\begin{pmatrix} <> \end{pmatrix} <>]], { i(1), i(0) }, { delimiters = "<>" }), { condition = math, show_condition = math } - ), -s({ trig = "bmat", wordTrig = false, descr = "pmatrix", snippetType = "autosnippet" }, + ), + s({ trig = "bmat", wordTrig = false, descr = "pmatrix", snippetType = "autosnippet" }, fmt([[\begin{bmatrix} <> \end{bmatrix} <>]], { i(1), i(0) }, { delimiters = "<>" }), { condition = math, show_condition = math } - ), -s({ trig = "lr", wordTrig = false, descr = "left* right*", snippetType = "snippet" }, + ), + s({ trig = "lr", wordTrig = false, descr = "left* right*", snippetType = "snippet" }, fmt([[\left<> <> \right<>]], { i(1), i(0), rep(1) }, { delimiters = "<>" }), { condition = math, show_condition = math } - ), -s({ trig = "lr(", wordTrig = false, descr = "left( right)", snippetType = "autosnippet" }, + ), + s({ trig = "lr(", wordTrig = false, descr = "left( right)", snippetType = "autosnippet" }, fmt([[\left( <> \right)]], { i(1) }, { delimiters = "<>" }), { condition = math, show_condition = math } - ), -s({ trig = "lr|", wordTrig = false, descr = "left| right|", snippetType = "autosnippet" }, + ), + s({ trig = "lr|", wordTrig = false, descr = "left| right|", snippetType = "autosnippet" }, fmt([[\left| <> \right|]], { i(1) }, { delimiters = "<>" }), { condition = math, show_condition = math } - ), -s({ trig = "lr{", wordTrig = false, descr = "left{ right}", snippetType = "autosnippet" }, + ), + s({ trig = "lr{", wordTrig = false, descr = "left{ right}", snippetType = "autosnippet" }, fmt([[\left\{ <> \right\}]], { i(1) }, { delimiters = "<>" }), { condition = math, show_condition = math } - ), -s({ trig = "lr[", wordTrig = false, descr = "left{ right}", snippetType = "autosnippet" }, + ), + s({ trig = "lr[", wordTrig = false, descr = "left{ right}", snippetType = "autosnippet" }, fmt([[\left[ <> \right] ]], { i(1) }, { delimiters = "<>" }), { condition = math, show_condition = math } - ), -s({ trig = "lra", wordTrig = false, descr = "left< right>", snippetType = "autosnippet" }, + ), + s({ trig = "lra", wordTrig = false, descr = "left< right>", snippetType = "autosnippet" }, fmt([[\left\langle <> \right\rangle] ]], { i(1) }, { delimiters = "<>" }), { condition = math, show_condition = math } - ), -s({ trig = "conj", descr = "conjugate", snippetType = "autosnippet" }, + ), + s({ trig = "conj", descr = "conjugate", snippetType = "autosnippet" }, fmt([[\overline{<>}<>]], { i(1), i(0) }, { delimiters = "<>" }), { condition = math, show_condition = math } - ), -s({ trig = "sum", wordTrig = false, descr = "sum", snippetType = "autosnippet" }, + ), + s({ trig = "sum", wordTrig = false, descr = "sum", snippetType = "autosnippet" }, fmt([[\sum_{<>}^{<>} <>]], { i(1), i(2), i(0) }, { delimiters = "<>" }), { condition = math, show_condition = math } - ), -s({ trig = "lim", wordTrig = false, descr = "lim", snippetType = "autosnippet" }, + ), + s({ trig = "lim", wordTrig = false, descr = "lim", snippetType = "autosnippet" }, fmt([[\lim_{<> \to <>} <>]], { i(1), i(2, "\\infty"), i(0) }, { delimiters = "<>" }), { condition = math, show_condition = math } - ), -s({ trig = "limsup", wordTrig = false, descr = "limsup", snippetType = "autosnippet" }, + ), + s({ trig = "limsup", wordTrig = false, descr = "limsup", snippetType = "autosnippet" }, fmt([[\limsup_{<> \to <>} <>]], { i(1), i(2, "\\infty"), i(0) }, { delimiters = "<>" }), { condition = math, show_condition = math } - ), -s({ trig = "prod", wordTrig = false, descr = "product", snippetType = "autosnippet" }, + ), + s({ trig = "prod", wordTrig = false, descr = "product", snippetType = "autosnippet" }, fmt([[\prod_{<>}^{<>} <>]], { i(1), i(2), i(0) }, { delimiters = "<>" }), { condition = math, show_condition = math } - ), -s({ trig = "part", wordTrig = false, descr = "d/dx", snippetType = "snippet" }, + ), + s({ trig = "part", wordTrig = false, descr = "d/dx", snippetType = "snippet" }, fmt( - [[\frac{\partial <>}{\partial <>} <>]], - { i(1, "f"), i(2, "x"), i(0) }, - { delimiters = "<>" } + [[\frac{\partial <>}{\partial <>} <>]], + { i(1, "f"), i(2, "x"), i(0) }, + { delimiters = "<>" } ), { condition = math, show_condition = math } - ), -s({ trig = "sqrt", wordTrig = false, descr = "sqrt", snippetType = "autosnippet" }, + ), + s({ trig = "sqrt", wordTrig = false, descr = "sqrt", snippetType = "autosnippet" }, fmt( - [[\sqrt{<>} <>]], - { i(1), i(0) }, - { delimiters = "<>" } + [[\sqrt{<>} <>]], + { i(1), i(0) }, + { delimiters = "<>" } ), { condition = math, show_condition = math } - ), -s({ trig = "hat", wordTrig = false, descr = "hat", snippetType = "autosnippet" }, + ), + s({ trig = "hat", wordTrig = false, descr = "hat", snippetType = "autosnippet" }, fmt( - [[\hat{<>}<>]], - { i(1), i(0) }, - { delimiters = "<>" } + [[\hat{<>}<>]], + { i(1), i(0) }, + { delimiters = "<>" } ), { condition = math, show_condition = math } - ), -s({ trig = "tilde", wordTrig = false, descr = "tilde", snippetType = "autosnippet" }, + ), + s({ trig = "tilde", wordTrig = false, descr = "tilde", snippetType = "autosnippet" }, fmt( - [[\tilde{<>}<>]], - { i(1), i(0) }, - { delimiters = "<>" } + [[\tilde{<>}<>]], + { i(1), i(0) }, + { delimiters = "<>" } ), { condition = math, show_condition = math } - ), -s({ trig = "td", wordTrig = false, descr = "to the .. power", snippetType = "autosnippet" }, + ), + s({ trig = "td", wordTrig = false, descr = "to the .. power", snippetType = "autosnippet" }, fmt( - [[^{<>} <>]], - { i(1), i(0) }, - { delimiters = "<>" } + [[^{<>} <>]], + { i(1), i(0) }, + { delimiters = "<>" } ), { condition = math, show_condition = math } - ), -s({ trig = "rd", wordTrig = false, descr = "to the .. (power)", snippetType = "autosnippet" }, + ), + s({ trig = "rd", wordTrig = false, descr = "to the .. (power)", snippetType = "autosnippet" }, fmt( - [[^{(<>)} <>]], - { i(1), i(0) }, - { delimiters = "<>" } + [[^{(<>)} <>]], + { i(1), i(0) }, + { delimiters = "<>" } ), { condition = math, show_condition = math } - ), -s({ trig = "rd", wordTrig = false, descr = "to the .. (power)", snippetType = "autosnippet" }, + ), + s({ trig = "rd", wordTrig = false, descr = "to the .. (power)", snippetType = "autosnippet" }, fmt( - [[^{(<>)} <>]], - { i(1), i(0) }, - { delimiters = "<>" } + [[^{(<>)} <>]], + { i(1), i(0) }, + { delimiters = "<>" } ), { condition = math, show_condition = math } - ), -s({ trig = "__", wordTrig = false, descr = "subscript", snippetType = "autosnippet" }, + ), + s({ trig = "__", wordTrig = false, descr = "subscript", snippetType = "autosnippet" }, fmt( - [[_{<>}<>]], - { i(1), i(0) }, - { delimiters = "<>" } + [[_{<>}<>]], + { i(1), i(0) }, + { delimiters = "<>" } ), { condition = math, show_condition = math } - ), -s({ trig = "ooo", wordTrig = false, descr = "infty", snippetType = "autosnippet" }, + ), + s({ trig = "ooo", wordTrig = false, descr = "infty", snippetType = "autosnippet" }, { t("\\infty") }, { condition = math, show_condition = math } - ), -s({ trig = "<=", wordTrig = false, descr = "leq", snippetType = "autosnippet" }, + ), + s({ trig = "<=", wordTrig = false, descr = "leq", snippetType = "autosnippet" }, { t("\\le") }, { condition = math, show_condition = math } - ), -s({ trig = ">=", wordTrig = false, descr = "geq", snippetType = "autosnippet" }, + ), + s({ trig = ">=", wordTrig = false, descr = "geq", snippetType = "autosnippet" }, { t("\\ge") }, { condition = math, show_condition = math } - ), -s({ trig = "EE", wordTrig = false, descr = "exists", snippetType = "autosnippet" }, + ), + s({ trig = "EE", wordTrig = false, descr = "exists", snippetType = "autosnippet" }, { t("\\exists") }, { condition = math, show_condition = math } - ), -s({ trig = "AA", wordTrig = false, descr = "forall", snippetType = "autosnippet" }, + ), + s({ trig = "AA", wordTrig = false, descr = "forall", snippetType = "autosnippet" }, { t("\\forall") }, { condition = math, show_condition = math } - ), -s({ trig = "xnn", wordTrig = false, descr = "x_n", snippetType = "autosnippet" }, + ), + s({ trig = "xnn", wordTrig = false, descr = "x_n", snippetType = "autosnippet" }, { t("x_{n}") }, { condition = math, show_condition = math } - ), -s({ trig = "ynn", wordTrig = false, descr = "y_n", snippetType = "autosnippet" }, + ), + s({ trig = "ynn", wordTrig = false, descr = "y_n", snippetType = "autosnippet" }, { t("y_{n}") }, { condition = math, show_condition = math } - ), -s({ trig = "xii", wordTrig = false, descr = "x_i", snippetType = "autosnippet" }, + ), + s({ trig = "xii", wordTrig = false, descr = "x_i", snippetType = "autosnippet" }, { t("x_{i}") }, { condition = math, show_condition = math } - ), -s({ trig = "yii", wordTrig = false, descr = "y_i", snippetType = "autosnippet" }, + ), + s({ trig = "yii", wordTrig = false, descr = "y_i", snippetType = "autosnippet" }, { t("y_{i}") }, { condition = math, show_condition = math } - ), -s({ trig = "xjj", wordTrig = false, descr = "x_j", snippetType = "autosnippet" }, + ), + s({ trig = "xjj", wordTrig = false, descr = "x_j", snippetType = "autosnippet" }, { t("x_{j}") }, { condition = math, show_condition = math } - ), -s({ trig = "yjj", wordTrig = false, descr = "y_j", snippetType = "autosnippet" }, + ), + s({ trig = "yjj", wordTrig = false, descr = "y_j", snippetType = "autosnippet" }, { t("y_{j}") }, { condition = math, show_condition = math } - ), -s({ trig = "mcal", wordTrig = false, descr = "mathcal", snippetType = "autosnippet" }, + ), + s({ trig = "mcal", wordTrig = false, descr = "mathcal", snippetType = "autosnippet" }, fmt( - [[\mathcal{<>}<>]], - { i(1), i(0) }, - { delimiters = "<>" } + [[\mathcal{<>}<>]], + { i(1), i(0) }, + { delimiters = "<>" } ), { condition = math, show_condition = math } - ), -s({ trig = "lll", wordTrig = false, descr = "l", snippetType = "autosnippet" }, + ), + s({ trig = "lll", wordTrig = false, descr = "l", snippetType = "autosnippet" }, { t("\\ell") }, { condition = math, show_condition = math } - ), -s({ trig = "nabl", wordTrig = false, descr = "nabla", snippetType = "autosnippet" }, + ), + s({ trig = "nabl", wordTrig = false, descr = "nabla", snippetType = "autosnippet" }, { t("\\nabla") }, { condition = math, show_condition = math } - ), -s({ trig = "xx", wordTrig = false, descr = "cross", snippetType = "autosnippet" }, + ), + s({ trig = "xx", wordTrig = false, descr = "cross", snippetType = "autosnippet" }, { t("\\times") }, { condition = math, show_condition = math } - ), -s({ trig = "**", wordTrig = false, descr = "cdot", snippetType = "autosnippet" }, + ), + s({ trig = "**", wordTrig = false, descr = "cdot", snippetType = "autosnippet" }, { t("\\cdot") }, { condition = math, show_condition = math } - ), -s({ trig = "pi", wordTrig = false, descr = "fill", snippetType = "autosnippet" }, + ), + s({ trig = "pi", wordTrig = false, descr = "fill", snippetType = "autosnippet" }, { t("\\pi") }, { condition = math, show_condition = math } - ), -s({ trig = "arcsin", wordTrig = false, descr = "fill", snippetType = "autosnippet" }, + ), + s({ trig = "arcsin", wordTrig = false, descr = "fill", snippetType = "autosnippet" }, { t("\\arcsin") }, { condition = math, show_condition = math } - ), -s({ trig = "sin", wordTrig = false, descr = "fill", snippetType = "autosnippet" }, + ), + s({ trig = "sin", wordTrig = false, descr = "fill", snippetType = "autosnippet" }, { t("\\sin") }, { condition = math, show_condition = math } - ), -s({ trig = "cos", wordTrig = false, descr = "fill", snippetType = "autosnippet" }, + ), + s({ trig = "cos", wordTrig = false, descr = "fill", snippetType = "autosnippet" }, { t("\\cos") }, { condition = math, show_condition = math } - ), -s({ trig = "arccot", wordTrig = false, descr = "fill", snippetType = "autosnippet" }, + ), + s({ trig = "arccot", wordTrig = false, descr = "fill", snippetType = "autosnippet" }, { t("\\arrcot") }, { condition = math, show_condition = math } - ), -s({ trig = "cot", wordTrig = false, descr = "fill", snippetType = "autosnippet" }, + ), + s({ trig = "cot", wordTrig = false, descr = "fill", snippetType = "autosnippet" }, { t("\\cot") }, { condition = math, show_condition = math } - ), -s({ trig = "csc", wordTrig = false, descr = "fill", snippetType = "autosnippet" }, + ), + s({ trig = "csc", wordTrig = false, descr = "fill", snippetType = "autosnippet" }, { t("\\csc") }, { condition = math, show_condition = math } - ), -s({ trig = "ln", wordTrig = false, descr = "fill", snippetType = "autosnippet" }, + ), + s({ trig = "ln", wordTrig = false, descr = "fill", snippetType = "autosnippet" }, { t("\\ln") }, { condition = math, show_condition = math } - ), -s({ trig = "log", wordTrig = false, descr = "fill", snippetType = "autosnippet" }, + ), + s({ trig = "log", wordTrig = false, descr = "fill", snippetType = "autosnippet" }, { t("\\log") }, { condition = math, show_condition = math } - ), -s({ trig = "exp", wordTrig = false, descr = "fill", snippetType = "autosnippet" }, + ), + s({ trig = "exp", wordTrig = false, descr = "fill", snippetType = "autosnippet" }, { t("\\exp") }, { condition = math, show_condition = math } - ), -s({ trig = "star", wordTrig = false, descr = "fill", snippetType = "autosnippet" }, + ), + s({ trig = "star", wordTrig = false, descr = "fill", snippetType = "autosnippet" }, { t("\\star") }, { condition = math, show_condition = math } - ), -s({ trig = "perp", wordTrig = false, descr = "fill", snippetType = "autosnippet" }, + ), + s({ trig = "perp", wordTrig = false, descr = "fill", snippetType = "autosnippet" }, { t("\\perp") }, { condition = math, show_condition = math } - ), -s({ trig = "int ", wordTrig = false, descr = "fill", snippetType = "autosnippet" }, + ), + s({ trig = "int ", wordTrig = false, descr = "fill", snippetType = "autosnippet" }, { t("\\int") }, { condition = math, show_condition = math } - ), -s({ trig = "zeta", wordTrig = false, descr = "fill", snippetType = "autosnippet" }, + ), + s({ trig = "zeta", wordTrig = false, descr = "fill", snippetType = "autosnippet" }, { t("\\zeta") }, { condition = math, show_condition = math } - ), -s({ trig = "arccos", wordTrig = false, descr = "fill", snippetType = "autosnippet" }, + ), + s({ trig = "arccos", wordTrig = false, descr = "fill", snippetType = "autosnippet" }, { t("\\arccos") }, { condition = math, show_condition = math } - ), -s({ trig = "actan", wordTrig = false, descr = "fill", snippetType = "autosnippet" }, + ), + s({ trig = "actan", wordTrig = false, descr = "fill", snippetType = "autosnippet" }, { t("\\arctan") }, { condition = math, show_condition = math } - ), -s({ trig = "tan", wordTrig = false, descr = "fill", snippetType = "autosnippet" }, + ), + s({ trig = "tan", wordTrig = false, descr = "fill", snippetType = "autosnippet" }, { t("\\tan") }, { condition = math, show_condition = math } - ), -s({ trig = "arccsc", wordTrig = false, descr = "fill", snippetType = "autosnippet" }, + ), + s({ trig = "arccsc", wordTrig = false, descr = "fill", snippetType = "autosnippet" }, { t("\\arcsc") }, { condition = math, show_condition = math } - ), -s({ trig = "dint", wordTrig = false, descr = "integral", snippetType = "autosnippet" }, + ), + s({ trig = "dint", wordTrig = false, descr = "integral", snippetType = "autosnippet" }, fmt( - [[\int_{<>}^{<>} <> <>]], - { i(1), i(2), i(3), i(4) }, - { delimiters = "<>" } + [[\int_{<>}^{<>} <> <>]], + { i(1), i(2), i(3), i(4) }, + { delimiters = "<>" } ), { condition = math, show_condition = math } - ), -s({ trig = "->", wordTrig = false, descr = "to", snippetType = "autosnippet" }, + ), + s({ trig = "->", wordTrig = false, descr = "to", snippetType = "autosnippet" }, { t("\\to") }, { condition = math, show_condition = math } - ), -s({ trig = "<->", wordTrig = false, descr = "leftrightarrow", snippetType = "autosnippet" }, + ), + s({ trig = "<->", wordTrig = false, descr = "leftrightarrow", snippetType = "autosnippet" }, { t("\\leftrightarrow") }, { condition = math, show_condition = math } - ), -s({ trig = "!>", wordTrig = false, descr = "mapsto", snippetType = "autosnippet" }, + ), + s({ trig = "!>", wordTrig = false, descr = "mapsto", snippetType = "autosnippet" }, { t("\\mapsto") }, { condition = math, show_condition = math } - ), -s({ trig = "ivs", wordTrig = false, descr = "inverse", snippetType = "autosnippet" }, + ), + s({ trig = "ivs", wordTrig = false, descr = "inverse", snippetType = "autosnippet" }, { t("^{-1}") }, { condition = math, show_condition = math } - ), -s({ trig = "compl", wordTrig = false, descr = "compliment", snippetType = "autosnippet" }, + ), + s({ trig = "compl", wordTrig = false, descr = "compliment", snippetType = "autosnippet" }, { t("^{c}") }, { condition = math, show_condition = math } - ), -s({ trig = "\\\\\\", wordTrig = false, descr = "setminus", snippetType = "autosnippet" }, + ), + s({ trig = "\\\\\\", wordTrig = false, descr = "setminus", snippetType = "autosnippet" }, { t("\\setminus") }, { condition = math, show_condition = math } - ), -s({ trig = ">>", wordTrig = false, descr = ">>", snippetType = "autosnippet" }, + ), + s({ trig = ">>", wordTrig = false, descr = ">>", snippetType = "autosnippet" }, { t("\\gg") }, { condition = math, show_condition = math } - ), -s({ trig = "<<", wordTrig = false, descr = "<<", snippetType = "autosnippet" }, + ), + s({ trig = "<<", wordTrig = false, descr = "<<", snippetType = "autosnippet" }, { t("\\ll") }, { condition = math, show_condition = math } - ), -s({ trig = "~~", wordTrig = false, descr = "~", snippetType = "autosnippet" }, + ), + s({ trig = "~~", wordTrig = false, descr = "~", snippetType = "autosnippet" }, { t("\\sim") }, { condition = math, show_condition = math } - ), -s({ trig = "sub", wordTrig = false, descr = "~", snippetType = "autosnippet" }, + ), + s({ trig = "sub", wordTrig = false, descr = "~", snippetType = "autosnippet" }, { t("\\subseteq") }, { condition = math, show_condition = math } - ), -s({ trig = "set", wordTrig = false, descr = "set", snippetType = "autosnippet" }, + ), + s({ trig = "set", wordTrig = false, descr = "set", snippetType = "autosnippet" }, fmt( - [[\{<>\} <>]], - { i(1), i(0) }, - { delimiters = "<>" } + [[\{<>\} <>]], + { i(1), i(0) }, + { delimiters = "<>" } ), { condition = math, show_condition = math } - ), -s({ trig = "||", wordTrig = false, descr = "mid", snippetType = "autosnippet" }, + ), + s({ trig = "||", wordTrig = false, descr = "mid", snippetType = "autosnippet" }, { t("\\mid") }, { condition = math, show_condition = math } - ), -s({ trig = "cc", wordTrig = false, descr = "subseet", snippetType = "autosnippet" }, + ), + s({ trig = "cc", wordTrig = false, descr = "subseet", snippetType = "autosnippet" }, { t("\\subset") }, { condition = math, show_condition = math } - ), -s({ trig = "notin", wordTrig = false, descr = "not in", snippetType = "autosnippet" }, + ), + s({ trig = "notin", wordTrig = false, descr = "not in", snippetType = "autosnippet" }, { t("\\not\\in") }, { condition = math, show_condition = math } - ), -s({ trig = "inn", wordTrig = false, descr = "in", snippetType = "autosnippet" }, + ), + s({ trig = "inn", wordTrig = false, descr = "in", snippetType = "autosnippet" }, { t("\\in") }, { condition = math, show_condition = math } - ), -s({ trig = "Nn", wordTrig = false, descr = "cap", snippetType = "autosnippet" }, + ), + s({ trig = "Nn", wordTrig = false, descr = "cap", snippetType = "autosnippet" }, { t("\\cap") }, { condition = math, show_condition = math } - ), -s({ trig = "UU", wordTrig = false, descr = "cup", snippetType = "autosnippet" }, + ), + s({ trig = "UU", wordTrig = false, descr = "cup", snippetType = "autosnippet" }, { t("\\cup") }, { condition = math, show_condition = math } - ), -s({ trig = "uuu", wordTrig = false, descr = "bigcup", snippetType = "autosnippet" }, + ), + s({ trig = "uuu", wordTrig = false, descr = "bigcup", snippetType = "autosnippet" }, fmt( - [[\bigcup_{<>} <>]], - { i(1), i(0) }, - { delimiters = "<>" } + [[\bigcup_{<>} <>]], + { i(1), i(0) }, + { delimiters = "<>" } ), { condition = math, show_condition = math } - ), -s({ trig = "nnn", wordTrig = false, descr = "bigcap", snippetType = "autosnippet" }, + ), + s({ trig = "nnn", wordTrig = false, descr = "bigcap", snippetType = "autosnippet" }, fmt( - [[\bigcap_{<>} <>]], - { i(1), i(0) }, - { delimiters = "<>" } + [[\bigcap_{<>} <>]], + { i(1), i(0) }, + { delimiters = "<>" } ), { condition = math, show_condition = math } - ), -s({ trig = "OO", wordTrig = false, descr = "emptyset", snippetType = "autosnippet" }, + ), + s({ trig = "OO", wordTrig = false, descr = "emptyset", snippetType = "autosnippet" }, { t("\\O") }, { condition = math, show_condition = math } - ), -s({ trig = "<!", wordTrig = false, descr = "normal", snippetType = "autosnippet" }, + ), + s({ trig = "<!", wordTrig = false, descr = "normal", snippetType = "autosnippet" }, { t("\\triangleleft") }, { condition = math, show_condition = math } - ), -s({ trig = "<>", wordTrig = false, descr = "hokje", snippetType = "autosnippet" }, + ), + s({ trig = "<>", wordTrig = false, descr = "hokje", snippetType = "autosnippet" }, { t("\\diamond") }, { condition = math, show_condition = math } - ), -s({ trig = "tt", wordTrig = false, descr = "text", snippetType = "autosnippet" }, + ), + s({ trig = "tt", wordTrig = false, descr = "text", snippetType = "autosnippet" }, fmt( - [[\text{<>} <>]], - { i(1), i(0) }, - { delimiters = "<>" } + [[\text{<>} <>]], + { i(1), i(0) }, + { delimiters = "<>" } ), { condition = math, show_condition = math } - ), -s({ trig = "case", wordTrig = false, descr = "cases", snippetType = "autosnippet" }, + ), + s({ trig = "case", wordTrig = false, descr = "cases", snippetType = "autosnippet" }, fmt([[ \begin{cases} <> \end{cases} ]], - { i(1) }, - { delimiters = "<>" } + { i(1) }, + { delimiters = "<>" } ), { condition = math, show_condition = math } - ), -s({ trig = "cvec", wordTrig = false, descr = "column vector", snippetType = "autosnippet" }, + ), + s({ trig = "cvec", wordTrig = false, descr = "column vector", snippetType = "autosnippet" }, fmt( - [[\begin{pmatrix} <>_<> \\ \vdots \\ <>_<> \end{pmatrix}]], - { i(1, "x"), i(2, "1"), i(3, "x"), i(4, "n") }, - { delimiters = "<>" } + [[\begin{pmatrix} <>_<> \\ \vdots \\ <>_<> \end{pmatrix}]], + { i(1, "x"), i(2, "1"), i(3, "x"), i(4, "n") }, + { delimiters = "<>" } ), { condition = math, show_condition = math } - ), -s({ trig = "bar", wordTrig = false, descr = "bar", snippetType = "autosnippet" }, + ), + s({ trig = "bar", wordTrig = false, descr = "bar", snippetType = "autosnippet" }, fmt( - [[\overline{<>}<>]], - { i(1), i(0) }, - { delimiters = "<>" } + [[\overline{<>}<>]], + { i(1), i(0) }, + { delimiters = "<>" } ), { condition = math, show_condition = math } - ), -s({ trig = "dL", wordTrig = false, descr = "double letter", snippetType = "autosnippet" }, + ), + s({ trig = "dL", wordTrig = false, descr = "double letter", snippetType = "autosnippet" }, fmt( - [[ \mathbb{<>}<> ]], - { i(1), i(0) }, - { delimiters = "<>" } + [[ \mathbb{<>}<> ]], + { i(1), i(0) }, + { delimiters = "<>" } ), { condition = math, show_condition = math } - ), -s({ trig = "eps", wordTrig = false, descr = "varepsilon", snippetType = "autosnippet" }, + ), + s({ trig = "eps", wordTrig = false, descr = "varepsilon", snippetType = "autosnippet" }, { t("\\varepsilon") }, { condition = math, show_condition = math } - ), -s({ trig = "vrho", wordTrig = false, descr = "varrho", snippetType = "autosnippet" }, + ), + s({ trig = "vrho", wordTrig = false, descr = "varrho", snippetType = "autosnippet" }, { t("\\varrho") }, { condition = math, show_condition = math } - ), -s({ trig = "vphi", wordTrig = false, descr = "varphi", snippetType = "autosnippet" }, + ), + s({ trig = "vphi", wordTrig = false, descr = "varphi", snippetType = "autosnippet" }, { t("\\varphi") }, { condition = math, show_condition = math } - ), + ), }) diff --git a/lua/snippets/rust.lua b/lua/snippets/rust.lua @@ -15,5 +15,5 @@ ls.add_snippets("rust", { {} }} }};]], { i(1), i(2), i(3), i(4), i(5) } - )), + )), })