feat: add vimtex
This commit is contained in:
parent
a373856ad5
commit
76b5001e19
4 changed files with 39 additions and 1 deletions
|
|
@ -62,5 +62,6 @@
|
||||||
"vim-illuminate": { "branch": "master", "commit": "49062ab1dd8fec91833a69f0a1344223dd59d643" },
|
"vim-illuminate": { "branch": "master", "commit": "49062ab1dd8fec91833a69f0a1344223dd59d643" },
|
||||||
"vim-repeat": { "branch": "master", "commit": "24afe922e6a05891756ecf331f39a1f6743d3d5a" },
|
"vim-repeat": { "branch": "master", "commit": "24afe922e6a05891756ecf331f39a1f6743d3d5a" },
|
||||||
"vim-startuptime": { "branch": "master", "commit": "6580cf539c33a212f4f5542068a3b4dd2b3ad834" },
|
"vim-startuptime": { "branch": "master", "commit": "6580cf539c33a212f4f5542068a3b4dd2b3ad834" },
|
||||||
|
"vimtex": { "branch": "master", "commit": "b527d75dca0e2fef64b9d0ef8ccd6d707e1c0d33" },
|
||||||
"which-key.nvim": { "branch": "main", "commit": "5224c261825263f46f6771f1b644cae33cd06995" }
|
"which-key.nvim": { "branch": "main", "commit": "5224c261825263f46f6771f1b644cae33cd06995" }
|
||||||
}
|
}
|
||||||
|
|
@ -12,6 +12,7 @@ return {
|
||||||
},
|
},
|
||||||
opts = function()
|
opts = function()
|
||||||
local cmp = require("cmp")
|
local cmp = require("cmp")
|
||||||
|
local luasnip = require("luasnip")
|
||||||
return {
|
return {
|
||||||
completion = {
|
completion = {
|
||||||
completeopt = "menu,menuone,noinsert",
|
completeopt = "menu,menuone,noinsert",
|
||||||
|
|
@ -30,6 +31,28 @@ return {
|
||||||
["<C-Space>"] = cmp.mapping.complete(),
|
["<C-Space>"] = cmp.mapping.complete(),
|
||||||
["<C-e>"] = cmp.mapping.abort(),
|
["<C-e>"] = cmp.mapping.abort(),
|
||||||
["<CR>"] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
|
["<CR>"] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
|
||||||
|
["<C-j>"] = 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",
|
||||||
|
}),
|
||||||
|
["<C-k>"] = cmp.mapping(function(fallback)
|
||||||
|
if luasnip.expand_or_jumpable(-1) then
|
||||||
|
luasnip.jump(-1)
|
||||||
|
else
|
||||||
|
fallback()
|
||||||
|
end
|
||||||
|
end, {
|
||||||
|
"i",
|
||||||
|
"s",
|
||||||
|
}),
|
||||||
}),
|
}),
|
||||||
sources = cmp.config.sources({
|
sources = cmp.config.sources({
|
||||||
{ name = "nvim_lsp" },
|
{ name = "nvim_lsp" },
|
||||||
|
|
|
||||||
|
|
@ -74,7 +74,7 @@ return {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
ltex = {},
|
-- ltex = {},
|
||||||
jdtls = {},
|
jdtls = {},
|
||||||
gopls = {},
|
gopls = {},
|
||||||
sqls = {},
|
sqls = {},
|
||||||
|
|
|
||||||
|
|
@ -91,4 +91,18 @@ return {
|
||||||
t.load_extension("zoxide")
|
t.load_extension("zoxide")
|
||||||
end,
|
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,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue