Updated vimtex and snippets

This commit is contained in:
Minhazul Haque 2024-03-02 19:25:49 +06:00
parent 84a6b218fe
commit 10bf23a6ec
44 changed files with 4209 additions and 69 deletions

View file

@ -1,17 +0,0 @@
-- File: lua/custom/plugins/autopairs.lua
return {
"windwp/nvim-autopairs",
-- Optional dependency
dependencies = { 'hrsh7th/nvim-cmp' },
config = function()
require("nvim-autopairs").setup {}
-- If you want to automatically add `(` after selecting a function or method
local cmp_autopairs = require('nvim-autopairs.completion.cmp')
local cmp = require('cmp')
cmp.event:on(
'confirm_done',
cmp_autopairs.on_confirm_done()
)
end,
}

View file

@ -25,5 +25,5 @@ return {
}
}
end,
vim.keymap.set('n', '<leader>ft', '<Cmd>Neotree toggle<CR>', {desc = "Open File Tree"})
vim.keymap.set('n', '<C-t>', '<Cmd>Neotree toggle<CR>', { desc = "Open File Tree" })
}

View file

@ -1,5 +1,47 @@
return {
'akinsho/toggleterm.nvim', version = "*", config = true,
'akinsho/toggleterm.nvim',
version = "*",
config = function()
require("toggleterm").setup {
size = 20,
open_mapping = [[<c-\>]],
hide_numbers = true,
shade_filetypes = {},
shade_terminals = true,
shading_factor = 2,
start_in_insert = true,
insert_mappings = true,
persist_size = true,
direction = "float",
auto_scroll = true,
close_on_exit = true,
shell = vim.o.shell,
float_opts = {
border = "curved",
winblend = 0,
highlights = {
border = "Normal",
background = "Normal",
},
},
}
function _G.set_terminal_keymaps()
local opts = { buffer = 0 }
vim.keymap.set('t', '<esc>', [[<C-\><C-n>]], opts)
vim.keymap.set('t', 'jk', [[<C-\><C-n>]], opts)
vim.keymap.set('t', '<C-[>', [[<Cmd>wincmd h<CR>]], opts)
-- vim.keymap.set('t', '<C-j>', [[<Cmd>wincmd j<CR>]], opts)
-- vim.keymap.set('t', '<C-k>', [[<Cmd>wincmd k<CR>]], opts)
vim.keymap.set('t', '<C-]>', [[<Cmd>wincmd l<CR>]], opts)
-- vim.keymap.set('t', '<C-w>', [[<C-\><C-n><C-w>]], opts)
vim.keymap.set('n', '<C-j>', '<Cmd>ToggleTerm<CR>')
-- vim.keymap.set('n', '<Leader>tt', '<Cmd>ToggleTerm<CR>')
-- vim.keymap.set('n', '<Leader>t1', '<Cmd>1ToggleTerm<CR>')
-- vim.keymap.set('n', '<Leader>t2', '<Cmd>2ToggleTerm<CR>')
end
-- if you only want these mappings for toggle term use term://*toggleterm#* instead
vim.cmd('autocmd! TermOpen term://* lua set_terminal_keymaps()')
end
}

View file

@ -8,22 +8,62 @@ return {
build_dir = 'build',
executable = 'latexmk',
options = {
'-pdf',
'-pdflua',
'-interaction=nonstopmode',
'-synctex=1',
'-file-line-error',
'-verbose',
},
}
-- Enable automatic compilation on save
vim.g.vimtex_autocompile = {
callback = 1,
continuous = 1,
on_insert_leave = 1,
}
-- Turn off VimTeX indentation
-- vim.g.vimtex_indent_enabled = 0
-- Disable default mappings; I'll define my own
-- vim.g.vimtex_mappings_enabled = 0
-- Disable insert mode mappings (in favor of a dedicated snippet engine)
-- vim.g.vimtex_imaps_enabled = 0
-- Disable syntax conceal
vim.g.vimtex_syntax_conceal_disable = 0
-- Default is 500 lines and gave me lags on missed key presses
vim.g.vimtex_delim_stopline = 50
-- VimTeX toggle delimeter configuration
vim.g.vimtex_delim_toggle_mod_list = {
{'\\left', '\\right'},
{'\\big', '\\big'},
}
-- Don't open quickfix for warning messages if no errors are present
vim.g.vimtex_quickfix_open_on_warning = 0
--Disable some compilation warning messages
vim.g.vimtex_quickfix_ignore_filters = {
'LaTeX hooks Warning',
'Underfull \\hbox',
'Overfull \\hbox',
'LaTeX Warning: .+ float specifier changed to',
'Package siunitx Warning: Detected the "physics" package:',
'Package hyperref Warning: Token not allowed in a PDF string',
'Fatal error occurred, no output PDF file produced!',
}
-- Enable PDF preview using your favorite PDF viewer
vim.g.vimtex_view_method = 'zathura'
vim.g.vimtex_view_method = 'zathura_simple'
-- vim.g.vimtex_view_general_viewer = 'okular'
-- vim.g.vimtex_view_general_options = '--unique file:@pdf\\#src:@line@tex'
end,
-- Define the VimtexHookZathura function
end,
}