tex.lua 1.0 KB

12345678910111213141516171819202122232425262728293031323334
  1. if require("lv-utils").check_lsp_client_active "texlab" then
  2. return
  3. end
  4. require("lspconfig").texlab.setup {
  5. cmd = { DATA_PATH .. "/lspinstall/latex/texlab" },
  6. on_attach = require("lsp").common_on_attach,
  7. }
  8. vim.g.vimtex_compiler_method = "latexmk"
  9. vim.g.vimtex_view_method = "zathura"
  10. vim.g.vimtex_fold_enabled = 0
  11. O.plugin.which_key.mappings["L"] = {
  12. name = "+Latex",
  13. c = { "<cmd>VimtexCompile<cr>", "Toggle Compilation Mode" },
  14. f = { "<cmd>call vimtex#fzf#run()<cr>", "Fzf Find" },
  15. i = { "<cmd>VimtexInfo<cr>", "Project Information" },
  16. s = { "<cmd>VimtexStop<cr>", "Stop Project Compilation" },
  17. t = { "<cmd>VimtexTocToggle<cr>", "Toggle Table Of Content" },
  18. v = { "<cmd>VimtexView<cr>", "View PDF" },
  19. }
  20. -- Compile on initialization, cleanup on quit
  21. vim.api.nvim_exec(
  22. [[
  23. augroup vimtex_event_1
  24. au!
  25. au User VimtexEventQuit call vimtex#compiler#clean(0)
  26. au User VimtexEventInitPost call vimtex#compiler#compile()
  27. augroup END
  28. ]],
  29. false
  30. )