dotfiles/.config/nvim/lua/user/plugins/07_vimtex.lua

89 lines
2.6 KiB
Lua

return {
"lervag/vimtex",
lazy = false, -- we don't want to lazy load VimTeX
-- tag = "v2.15", -- uncomment to pin to a specific release
init = function()
local f = io.popen("uname -s")
if f ~= nil then
MY_OS = f:read("*a")
MY_OS = string.gsub(MY_OS, "%s+", "")
f:close()
end
if MY_OS == "Linux" then
-- on Linux
-- Vimtex options:
vim.g.vimtex_view_method = "zathura"
vim.g.vimtex_general_viewer = "zathura"
vim.g.vimtex_quickfix_mode = 0
-- Ignore mappings
vim.g.vimtex_mappings_enabled = 1
---- Auto Indent
vim.g["vimtex_indent_enabled"] = 1
---- Syntax highlighting
vim.g.vimtex_syntax_enabled = 0
-- Error suppression:
vim.g.vimtex_log_ignore = {
"Underfull",
"Overfull",
"specifier changed to",
"Token not allowed in a PDF string",
}
elseif (MY_OS == "FreeBSD") or (MY_OS == "OpenBSD") then
-- on BSD
-- Vimtex options:
vim.g.vimtex_view_method = "zathura"
vim.g.vimtex_general_viewer = "zathura"
vim.g.vimtex_quickfix_mode = 0
-- OBSD options
--vim.g.vimtex_compiler_latexmk={ 'cmd': '' }
-- Ignore mappings
vim.g.vimtex_mappings_enabled = 1
---- Auto Indent
vim.g["vimtex_indent_enabled"] = 1
---- Syntax highlighting
vim.g.vimtex_syntax_enabled = 0
-- Error suppression:
vim.g.vimtex_log_ignore = {
"Underfull",
"Overfull",
"specifier changed to",
"Token not allowed in a PDF string",
}
elseif MY_OS == "Darwin" then
-- on MacOS
-- Vimtex options:
vim.g.vimtex_view_method = "sioyek"
vim.g.vimtex_view_sioyek_exe = "/Applications/sioyek.app/Contents/MacOS/sioyek"
vim.g.vimtex_quickfix_mode = 0
-- Ignore mappings
vim.g.vimtex_mappings_enabled = 1
---- Auto Indent
vim.g.vimtex_indent_enabled = 1
---- Syntax highlighting
vim.g.vimtex_syntax_enabled = 0
-- Error suppression:
vim.g.vimtex_log_ignore = {
"Underfull",
"Overfull",
"specifier changed to",
"Token not allowed in a PDF string",
}
else
print("Should never be here")
end
end,
}