diff --git a/nvim/lazy-lock.json b/nvim/lazy-lock.json index 3e66c2b..974e93f 100644 --- a/nvim/lazy-lock.json +++ b/nvim/lazy-lock.json @@ -62,5 +62,6 @@ "vim-illuminate": { "branch": "master", "commit": "49062ab1dd8fec91833a69f0a1344223dd59d643" }, "vim-repeat": { "branch": "master", "commit": "24afe922e6a05891756ecf331f39a1f6743d3d5a" }, "vim-startuptime": { "branch": "master", "commit": "6580cf539c33a212f4f5542068a3b4dd2b3ad834" }, + "vimtex": { "branch": "master", "commit": "b527d75dca0e2fef64b9d0ef8ccd6d707e1c0d33" }, "which-key.nvim": { "branch": "main", "commit": "5224c261825263f46f6771f1b644cae33cd06995" } } \ No newline at end of file diff --git a/nvim/lua/plugins/cmp.lua b/nvim/lua/plugins/cmp.lua index b726f8a..0fa4d85 100644 --- a/nvim/lua/plugins/cmp.lua +++ b/nvim/lua/plugins/cmp.lua @@ -12,6 +12,7 @@ return { }, opts = function() local cmp = require("cmp") + local luasnip = require("luasnip") return { completion = { completeopt = "menu,menuone,noinsert", @@ -30,6 +31,28 @@ return { [""] = cmp.mapping.complete(), [""] = cmp.mapping.abort(), [""] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. + [""] = cmp.mapping(function(fallback) + if luasnip.expandable() then + luasnip.expand() + elseif luasnip.expand_or_jumpable() then + luasnip.expand_or_jump() + else + fallback() + end + end, { + "i", + "s", + }), + [""] = cmp.mapping(function(fallback) + if luasnip.expand_or_jumpable(-1) then + luasnip.jump(-1) + else + fallback() + end + end, { + "i", + "s", + }), }), sources = cmp.config.sources({ { name = "nvim_lsp" }, diff --git a/nvim/lua/plugins/lsp.lua b/nvim/lua/plugins/lsp.lua index 9eeb7a7..2b31de6 100644 --- a/nvim/lua/plugins/lsp.lua +++ b/nvim/lua/plugins/lsp.lua @@ -74,7 +74,7 @@ return { }, }, }, - ltex = {}, + -- ltex = {}, jdtls = {}, gopls = {}, sqls = {}, diff --git a/nvim/lua/plugins/plugins.lua b/nvim/lua/plugins/plugins.lua index 3b6e30c..7704469 100644 --- a/nvim/lua/plugins/plugins.lua +++ b/nvim/lua/plugins/plugins.lua @@ -91,4 +91,18 @@ return { t.load_extension("zoxide") end, }, + { + "lervag/vimtex", + lazy = true, + event = "FileType tex", + config = function() + -- require("vimtex").setup() + vim.cmd("let g:vimtex_quickfix_mode=0") + vim.cmd("let g:vimtex_view_general_viewer = 'evince'") + vim.cmd("let g:vimtex_compiler_method = 'latexmk'") + vim.cmd( + "let g:vimtex_compiler_latexmk = {'options': ['-pdf', '-shell-escape', '-file-line-error', '--extra-mem-bot=10000000', '-synctex=1', '-interaction=nonstopmode',],}" + ) + end, + }, }