From b2ea6eb142dc40a42af3ee4d5d5ba1957b4630bc Mon Sep 17 00:00:00 2001 From: vladstojna Date: Wed, 30 Aug 2023 21:10:16 +0300 Subject: [PATCH] vimtex: get editor based on OS --- lua/custom/plugins/vimtex.lua | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/lua/custom/plugins/vimtex.lua b/lua/custom/plugins/vimtex.lua index 7d5d951a..7e8bb9dc 100644 --- a/lua/custom/plugins/vimtex.lua +++ b/lua/custom/plugins/vimtex.lua @@ -1,6 +1,18 @@ +local function get_editor(sys) + local editor + if sys == "Darwin" then + editor = "skim" + elseif sys == "Linux" then + editor = "zathura" + else -- windows? + editor = "zathura" + end + return editor +end + return { "lervag/vimtex", config = function() - vim.g.vimtex_view_method = "zathura" + vim.g.vimtex_view_method = get_editor(vim.loop.os_uname().sysname) end }