Add vimtex
This commit is contained in:
25
lua/custom/snippets/tex.lua
Normal file
25
lua/custom/snippets/tex.lua
Normal file
@@ -0,0 +1,25 @@
|
||||
local ls = require "luasnip"
|
||||
local s = ls.snippet
|
||||
local t = ls.text_node
|
||||
local i = ls.insert_node
|
||||
|
||||
return {
|
||||
-- Italic snippet: type "it" in insert mode and expand to \textit{...}
|
||||
s({trig="it", desc="Insert italic text"}, {
|
||||
t "\\textit{",
|
||||
i(1, "text"),
|
||||
t "}",
|
||||
}),
|
||||
-- Bold snippet example:
|
||||
s({trig="bf", desc="Insert bold text"}, {
|
||||
t "\\textbf{",
|
||||
i(1, "text"),
|
||||
t "}",
|
||||
}),
|
||||
-- Emph snippet example:
|
||||
s({trig="em", desc="Insert emphasized text"}, {
|
||||
t "\\emph{",
|
||||
i(1, "text"),
|
||||
t "}",
|
||||
}),
|
||||
}
|
||||
@@ -1,11 +1,27 @@
|
||||
require "nvchad.options"
|
||||
|
||||
-- Set global options
|
||||
vim.o.cursorlineopt ='both' -- to enable cursorline!
|
||||
vim.o.scrolloff = 10
|
||||
vim.opt.relativenumber = true
|
||||
vim.g.wiki_root = "~/wiki"
|
||||
vim.o.formatexpr = "v:lua.require'conform'.formatexpr()"
|
||||
|
||||
-- Set vimtex options
|
||||
vim.g.tex_flavour = "latex"
|
||||
vim.g.vimtex_view_method = "skim"
|
||||
vim.g.vimtex_view_skim_reading_bar = 1
|
||||
vim.g.vimtex_view_skim_sync = 1
|
||||
-- vim.g.vimtex_quickfix_mode = 0
|
||||
vim.g.vimtex_compiler_method = "latexmk"
|
||||
vim.g.vimtex_mappings_prefix = "å"
|
||||
vim.g.complete_close_brackets = 1
|
||||
|
||||
-- Set luasnip path
|
||||
local snippets = require "luasnip.loaders.from_lua"
|
||||
snippets.load({ paths = "~/.config/nvim/lua/custom/snippets" })
|
||||
|
||||
-- Set window-local options
|
||||
local highlight_group = vim.api.nvim_create_augroup("yankhighlight", { clear = true })
|
||||
vim.api.nvim_create_autocmd("textyankpost", {
|
||||
callback = function()
|
||||
@@ -15,6 +31,7 @@ vim.api.nvim_create_autocmd("textyankpost", {
|
||||
pattern = "*",
|
||||
})
|
||||
|
||||
-- dap
|
||||
require "dap"
|
||||
|
||||
local sign = vim.fn.sign_define
|
||||
@@ -33,3 +50,14 @@ vim.api.nvim_create_autocmd("QuickFixCmdPost", {
|
||||
end,
|
||||
pattern = "*",
|
||||
})
|
||||
|
||||
-- Surround
|
||||
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
pattern = "tex",
|
||||
callback = function()
|
||||
vim.b.surround_105 = "\\textit{" .. "\n" .. "}"
|
||||
vim.b.surround_101 = "\\emph{" .. "\n" .. "}"
|
||||
vim.b.surround_102 = "\\textbf{" .. "\n" .. "}"
|
||||
end,
|
||||
})
|
||||
|
||||
@@ -36,6 +36,11 @@ return {
|
||||
lazy = false,
|
||||
},
|
||||
|
||||
{
|
||||
"lervag/vimtex",
|
||||
lazy = false,
|
||||
},
|
||||
|
||||
{
|
||||
"jay-babu/mason-nvim-dap.nvim",
|
||||
opts = {
|
||||
|
||||
Reference in New Issue
Block a user