added vimtex and changed some plugins for rendering faster
This commit is contained in:
@@ -38,14 +38,14 @@ require("lazy").setup({
|
|||||||
{ "m4xshen/hardtime.nvim", lazy = false, dependencies = { "MunifTanjim/nui.nvim" }}, --annoying
|
{ "m4xshen/hardtime.nvim", lazy = false, dependencies = { "MunifTanjim/nui.nvim" }}, --annoying
|
||||||
{ "nvzone/typr", dependencies = "nvzone/volt", cmd = { "Typr", "TyprStats" }, }, --typing practice
|
{ "nvzone/typr", dependencies = "nvzone/volt", cmd = { "Typr", "TyprStats" }, }, --typing practice
|
||||||
{ 'norcalli/nvim-colorizer.lua', config = function() require('colorizer').setup{"*"} end,}, -- preview colors
|
{ 'norcalli/nvim-colorizer.lua', config = function() require('colorizer').setup{"*"} end,}, -- preview colors
|
||||||
{ 'edluffy/hologram.nvim', auto_display = true,}, --image viewer
|
-- { 'edluffy/hologram.nvim', auto_display = true,}, -- image viewer (replaced by 3rd/image.nvim)
|
||||||
{ "denialofsandwich/sudo.nvim", dependencies = { "MunifTanjim/nui.nvim", },config = true, }, --write restricted files without restart
|
{ "denialofsandwich/sudo.nvim", dependencies = { "MunifTanjim/nui.nvim", },config = true, }, --write restricted files without restart
|
||||||
{ 'akinsho/toggleterm.nvim', version = "*", config = true}, -- terminal toggling and commands
|
{ 'akinsho/toggleterm.nvim', version = "*", config = true}, -- terminal toggling and commands
|
||||||
{ 'nvim-java/nvim-java', config = function() require('java').setup() vim.lsp.enable('jdtls') end, }, --java QOL
|
{ 'nvim-java/nvim-java', config = function() require('java').setup() vim.lsp.enable('jdtls') end, }, --java QOL
|
||||||
-- disable matugen if not using noctalia shell
|
-- disable matugen if not using noctalia shell
|
||||||
{ 'RRethy/base16-nvim', config = function() require('matugen').setup() end,}, --colorshceme for noctalia integration
|
{ 'RRethy/base16-nvim', config = function() require('matugen').setup() end,}, --colorshceme for noctalia integration
|
||||||
|
|
||||||
{ "lervag/vimtex", lazy = false, init = function() vim.g.vimtex_view_method = "zathura" end }, -- for latex editing
|
-- { "lervag/vimtex", lazy = false, init = function() vim.g.vimtex_view_method = "zathura" end }, -- for latex editing
|
||||||
{ 'windwp/nvim-autopairs', event = "InsertEnter", config = true },
|
{ 'windwp/nvim-autopairs', event = "InsertEnter", config = true },
|
||||||
{ "folke/ts-comments.nvim", event = "VeryLazy", }, -- qol for commenting
|
{ "folke/ts-comments.nvim", event = "VeryLazy", }, -- qol for commenting
|
||||||
{ "marcinjahn/gemini-cli.nvim", cmd = "Gemini", dependencies = { "folke/snacks.nvim", }, config = true, },
|
{ "marcinjahn/gemini-cli.nvim", cmd = "Gemini", dependencies = { "folke/snacks.nvim", }, config = true, },
|
||||||
|
|||||||
+2
-1
@@ -31,7 +31,8 @@ vim.keymap.set('n','<Esc>' ,'<cmd>nohlsearch<CR>')
|
|||||||
vim.keymap.set('t','<Esc><Esc>' ,'<C-\\><C-n>' ,{ desc = 'Exit terminal mode' })
|
vim.keymap.set('t','<Esc><Esc>' ,'<C-\\><C-n>' ,{ desc = 'Exit terminal mode' })
|
||||||
vim.keymap.set('t','<C-h>' ,'<C-\\><C-n><C-w><C-h>' ,{ desc = 'Move focus to the left window' })
|
vim.keymap.set('t','<C-h>' ,'<C-\\><C-n><C-w><C-h>' ,{ desc = 'Move focus to the left window' })
|
||||||
-- vim.keymap.set('n','<leader>r' ,'<cmd>TermExec cmd="clear && make"<CR>' ,{ desc = '[r]un make in terminal' })
|
-- vim.keymap.set('n','<leader>r' ,'<cmd>TermExec cmd="clear && make"<CR>' ,{ desc = '[r]un make in terminal' })
|
||||||
vim.keymap.set('n','<leader>l' ,function() utils.RunCommand("l") end ,{ desc = 'run [l]ast command in terminal' })
|
vim.keymap.set('n','<leader>L' ,function() utils.RunCommand("l") end ,{ desc = 'run [l]ast command in terminal' })
|
||||||
|
vim.keymap.set('n','<C-CR>' ,function() utils.RunCommand("l") end ,{ desc = 'run [l]ast command in terminal' })
|
||||||
vim.keymap.set('n','<leader>ss' ,function() utils.saveSnapshot() end ,{ desc = '[S]ave a [S]napshot of the current windows' })
|
vim.keymap.set('n','<leader>ss' ,function() utils.saveSnapshot() end ,{ desc = '[S]ave a [S]napshot of the current windows' })
|
||||||
vim.keymap.set('n','<leader>sr' ,function() utils.returnSnapshot() end ,{ desc = '[R]eturn to saved [S]napshot' })
|
vim.keymap.set('n','<leader>sr' ,function() utils.returnSnapshot() end ,{ desc = '[R]eturn to saved [S]napshot' })
|
||||||
vim.keymap.set('n','<leader>n' ,'<cmd>ToggleTerm direction=vertical name=compile size=70<CR>', { desc = 'open a [n]ew terminal' })
|
vim.keymap.set('n','<leader>n' ,'<cmd>ToggleTerm direction=vertical name=compile size=70<CR>', { desc = 'open a [n]ew terminal' })
|
||||||
|
|||||||
@@ -0,0 +1,76 @@
|
|||||||
|
-- Mostly Generated with Antigravity CLI Gemini 3.7 Flash
|
||||||
|
return {
|
||||||
|
"lervag/vimtex",
|
||||||
|
lazy = false,
|
||||||
|
init = function()
|
||||||
|
vim.g.vimtex_compiler_method = "tectonic"
|
||||||
|
vim.g.vimtex_quickfix_mode = 0
|
||||||
|
vim.g.vimtex_view_enabled = 0 -- Disable external GUI popup
|
||||||
|
end,
|
||||||
|
config = function()
|
||||||
|
local function open_pdf_split()
|
||||||
|
local pdf_path = vim.fn.expand("%:p:r") .. ".pdf"
|
||||||
|
if vim.fn.filereadable(pdf_path) == 1 then
|
||||||
|
vim.cmd("vsplit " .. vim.fn.fnameescape(pdf_path))
|
||||||
|
else
|
||||||
|
vim.notify("PDF not found: " .. pdf_path .. "\nCompile first with <Space>ll", vim.log.levels.WARN)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Provide user command :VimtexPreviewBuffer
|
||||||
|
vim.api.nvim_create_user_command("VimtexPreviewBuffer", open_pdf_split, { desc = "VimTeX: Open PDF in vertical split" })
|
||||||
|
|
||||||
|
-- Buffer-local keymaps for TeX files
|
||||||
|
vim.api.nvim_create_autocmd("FileType", {
|
||||||
|
pattern = { "tex", "latex" },
|
||||||
|
callback = function(ev)
|
||||||
|
local opts = { buffer = ev.buf, desc = "VimTeX: View PDF in Neovim split" }
|
||||||
|
vim.keymap.set("n", "<localleader>lv", open_pdf_split, opts)
|
||||||
|
vim.keymap.set("n", "<leader>lv", open_pdf_split, opts)
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Helper function to refresh and re-render all open PDF splits with image.nvim
|
||||||
|
local function reload_pdf_buffers()
|
||||||
|
local ok, image_api = pcall(require, "image")
|
||||||
|
for _, win in ipairs(vim.api.nvim_list_wins()) do
|
||||||
|
local buf = vim.api.nvim_win_get_buf(win)
|
||||||
|
local buf_name = vim.api.nvim_buf_get_name(buf)
|
||||||
|
if buf_name:match("%.pdf$") then
|
||||||
|
vim.api.nvim_win_call(win, function()
|
||||||
|
vim.cmd("edit!")
|
||||||
|
end)
|
||||||
|
if ok and image_api then
|
||||||
|
local imgs = image_api.get_images({ window = win, buffer = buf })
|
||||||
|
if #imgs > 0 then
|
||||||
|
for _, img in ipairs(imgs) do
|
||||||
|
img:clear()
|
||||||
|
img:render()
|
||||||
|
end
|
||||||
|
else
|
||||||
|
image_api.hijack_buffer(buf_name, win, buf)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Automatically trigger compilation on save (:w)
|
||||||
|
vim.api.nvim_create_autocmd("BufWritePost", {
|
||||||
|
pattern = "*.tex",
|
||||||
|
callback = function()
|
||||||
|
if vim.b.vimtex and vim.fn.exists(":VimtexCompileSS") == 2 then
|
||||||
|
vim.cmd("VimtexCompileSS")
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Automatically reload and re-render PDF splits when compilation finishes
|
||||||
|
vim.api.nvim_create_autocmd("User", {
|
||||||
|
pattern = { "VimtexEventCompileSuccess", "VimtexEventCompileStopped" },
|
||||||
|
callback = function()
|
||||||
|
reload_pdf_buffers()
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user