From 2a1acc796896d235569ddc5e9180ce796d44c124 Mon Sep 17 00:00:00 2001 From: Jacek Kiedrowski <33070637+atropos112@users.noreply.github.com> Date: Sun, 11 Jul 2021 19:07:08 +0100 Subject: Added autosave on focus loss option and list of errors to be ignored to vimtex. (#873) --- ftplugin/tex.lua | 5 +++++ lua/default-config.lua | 5 ++++- utils/installer/lv-config.example-no-ts.lua | 5 +++++ utils/installer/lv-config.example.lua | 4 ++++ 4 files changed, 18 insertions(+), 1 deletion(-) diff --git a/ftplugin/tex.lua b/ftplugin/tex.lua index 87f7c598..a81a6ff7 100644 --- a/ftplugin/tex.lua +++ b/ftplugin/tex.lua @@ -10,6 +10,7 @@ require("lspconfig").texlab.setup { vim.g.vimtex_compiler_method = "latexmk" vim.g.vimtex_view_method = "zathura" vim.g.vimtex_fold_enabled = 0 +vim.g.vimtex_quickfix_ignore_filters = O.lang.latex.ignore_errors O.plugin.which_key.mappings["L"] = { name = "+Latex", @@ -32,3 +33,7 @@ vim.api.nvim_exec( ]], false ) +if (O.lang.latex.auto_save) +then + vim.api.nvim_exec([[au FocusLost * :wa]],false) +end diff --git a/lua/default-config.lua b/lua/default-config.lua index 7630601c..9c7bfbd0 100644 --- a/lua/default-config.lua +++ b/lua/default-config.lua @@ -149,7 +149,10 @@ O = { }, }, kotlin = {}, - latex = {}, + latex = { + auto_save = false, + ignore_errors = { }, + }, lua = { diagnostics = { virtual_text = { spacing = 0, prefix = "" }, diff --git a/utils/installer/lv-config.example-no-ts.lua b/utils/installer/lv-config.example-no-ts.lua index 50f1537c..72c53ee9 100644 --- a/utils/installer/lv-config.example-no-ts.lua +++ b/utils/installer/lv-config.example-no-ts.lua @@ -40,6 +40,11 @@ O.lang.python.analysis.use_library_code_types = true -- javascript O.lang.tsserver.linter = nil +-- latex +-- O.lang.latex.auto_save = false +-- O.lang.latex.ignore_errors = { } + + -- Additional Plugins -- O.user_plugins = { -- {"folke/tokyonight.nvim"}, { diff --git a/utils/installer/lv-config.example.lua b/utils/installer/lv-config.example.lua index 93b69dcd..05c29c58 100644 --- a/utils/installer/lv-config.example.lua +++ b/utils/installer/lv-config.example.lua @@ -46,6 +46,10 @@ O.lang.rust.formatter = { args = {"--emit=stdout"}, } +-- latex +-- O.lang.latex.auto_save = false +-- O.lang.latex.ignore_errors = { } + -- Additional Plugins -- O.user_plugins = { -- {"folke/tokyonight.nvim"}, { -- cgit v1.2.3