diff options
author | christianchiarulli <[email protected]> | 2021-07-10 00:15:33 -0400 |
---|---|---|
committer | christianchiarulli <[email protected]> | 2021-07-10 00:15:33 -0400 |
commit | 6d17635b31e2bf3af0f1f03284249daafe9be62f (patch) | |
tree | d908597bdba9dd4ab9f39455fac95eb10c498430 | |
parent | cdce596bc0771c483bb03f15c05ac20fc3416009 (diff) |
refactor tex to use ftplugin only
-rw-r--r-- | ftplugin/tex.lua | 26 | ||||
-rw-r--r-- | lua/lv-vimtex/init.lua | 25 | ||||
-rw-r--r-- | lua/plugins.lua | 3 |
3 files changed, 26 insertions, 28 deletions
diff --git a/ftplugin/tex.lua b/ftplugin/tex.lua index 7ad35000..87f7c598 100644 --- a/ftplugin/tex.lua +++ b/ftplugin/tex.lua @@ -6,3 +6,29 @@ require("lspconfig").texlab.setup { cmd = { DATA_PATH .. "/lspinstall/latex/texlab" }, on_attach = require("lsp").common_on_attach, } + +vim.g.vimtex_compiler_method = "latexmk" +vim.g.vimtex_view_method = "zathura" +vim.g.vimtex_fold_enabled = 0 + +O.plugin.which_key.mappings["L"] = { + name = "+Latex", + c = { "<cmd>VimtexCompile<cr>", "Toggle Compilation Mode" }, + f = { "<cmd>call vimtex#fzf#run()<cr>", "Fzf Find" }, + i = { "<cmd>VimtexInfo<cr>", "Project Information" }, + s = { "<cmd>VimtexStop<cr>", "Stop Project Compilation" }, + t = { "<cmd>VimtexTocToggle<cr>", "Toggle Table Of Content" }, + v = { "<cmd>VimtexView<cr>", "View PDF" }, +} + +-- Compile on initialization, cleanup on quit +vim.api.nvim_exec( + [[ + augroup vimtex_event_1 + au! + au User VimtexEventQuit call vimtex#compiler#clean(0) + au User VimtexEventInitPost call vimtex#compiler#compile() + augroup END + ]], + false +) diff --git a/lua/lv-vimtex/init.lua b/lua/lv-vimtex/init.lua deleted file mode 100644 index 4d7b93bd..00000000 --- a/lua/lv-vimtex/init.lua +++ /dev/null @@ -1,25 +0,0 @@ -vim.g.vimtex_compiler_method = "latexmk" -vim.g.vimtex_view_method = "zathura" -vim.g.vimtex_fold_enabled = 0 - -O.user_which_key["L"] = { - name = "+Latex", - c = { "<cmd>VimtexCompile<cr>", "Toggle Compilation Mode" }, - f = { "<cmd>call vimtex#fzf#run()<cr>", "Fzf Find" }, - i = { "<cmd>VimtexInfo<cr>", "Project Information" }, - s = { "<cmd>VimtexStop<cr>", "Stop Project Compilation" }, - t = { "<cmd>VimtexTocToggle<cr>", "Toggle Table Of Content" }, - v = { "<cmd>VimtexView<cr>", "View PDF" }, -} - --- Compile on initialization, cleanup on quit -vim.api.nvim_exec( - [[ - augroup vimtex_event_1 - au! - au User VimtexEventQuit call vimtex#compiler#clean(0) - au User VimtexEventInitPost call vimtex#compiler#compile() - augroup END - ]], - false -) diff --git a/lua/plugins.lua b/lua/plugins.lua index 3b776b7c..4f65192c 100644 --- a/lua/plugins.lua +++ b/lua/plugins.lua @@ -248,9 +248,6 @@ return require("packer").startup(function(use) use { "lervag/vimtex", ft = "tex", - config = function() - require "lv-vimtex" - end, } -- Rust tools |