add latex config using vimtex and change neotree to auto chdir work dir

This commit is contained in:
gameloader
2023-09-20 23:55:31 +08:00
parent e559ba5a58
commit 2e06e0d601
11 changed files with 75 additions and 15 deletions

View File

@ -2,5 +2,7 @@ require("neo-tree").setup({
window = {
width = "25%", -- Width of the Neo-tree window
},
update_cwd = true,
filesystem = {
bind_to_cwd = true,
},
})

View File

@ -24,13 +24,16 @@ require("nvim-treesitter.configs").setup({
-- list of language that will be disabled
-- disable = { "c", "rust" },
-- Or use a function for more flexibility, e.g. to disable slow treesitter highlight for large files
disable = function(lang, buf)
local max_filesize = 100 * 1024 -- 100 KB
local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf))
if ok and stats and stats.size > max_filesize then
return true
end
end,
disable = {
"latex",
function(lang, buf)
local max_filesize = 100 * 1024 -- 100 KB
local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf))
if ok and stats and stats.size > max_filesize then
return true
end
end,
},
-- Setting this to true will run `:h syntax` and tree-sitter at the same time.
-- Set this to `true` if you depend on 'syntax' being enabled (like for indentation).

View File

@ -0,0 +1,17 @@
-- This is necessary for VimTeX to load properly. The "indent" is optional.
-- Note that most plugin managers will do this automatically.
vim.cmd("filetype plugin indent on")
-- This enables Vim's and Neovim's syntax-related features. Without this, some
-- VimTeX features will not work (see ":help vimtex-requirements" for more info).
vim.cmd("syntax enable")
-- Viewer options: One may configure the viewer either by specifying a built-in
-- viewer method:
vim.g.vimtex_view_method = "skim"
-- vim.g.vimtex_view_general_options = "--unique file:@pdf\\#src:@line@tex"
vim.g.vimtex_complete_close_braces = 1
vim.g.vimtex_syntax_enabled = 1
vim.g.vimtex_compiler_latexmk_engines = {
["_"] = "-xelatex",
}