forked from LazyVim/starter
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlatex.lua
More file actions
120 lines (119 loc) · 4.25 KB
/
Copy pathlatex.lua
File metadata and controls
120 lines (119 loc) · 4.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
return {
{
"nvim-treesitter/nvim-treesitter",
opts = function(_, opts)
if type(opts.ensure_installed) == "table" then
vim.list_extend(opts.ensure_installed, { "bibtex", "latex" })
end
if type(opts.highlight.disable) == "table" then
vim.list_extend(opts.highlight.disable, { "latex" })
else
opts.highlight.disable = { "latex" }
end
end,
},
{
"lervag/vimtex",
lazy = false, -- lazy-loading will disable inverse search
dependencies = {
"micangl/cmp-vimtex",
},
config = function()
-- vim.api.nvim_create_autocmd({ "FileType" }, {
-- group = vim.api.nvim_create_augroup("lazyvim_vimtex_conceal", { clear = true }),
-- pattern = { "bib", "tex" },
-- callback = function()
-- vim.g.conceallevel = 2
-- vim.g.tex_conceal = "abdmg"
-- end,
-- })
vim.g.vimtex_indent_enabled = 0
vim.g.vimtex_view_method = "skim"
-- vim.g.vimtex_quickfix_method = vim.fn.executable("pplatex") == 1 and "pplatex" or "latexlog"
end,
},
{
"micangl/cmp-vimtex",
config = function()
require("cmp_vimtex").setup({
additional_information = {
info_in_menu = true,
info_in_window = true,
info_max_length = 60,
match_against_info = true,
symbols_in_menu = true,
},
bibtex_parser = {
enabled = true,
},
search = {
browser = "xdg-open",
default = "google_scholar",
search_engines = {
google_scholar = {
name = "Google Scholar",
get_url = require("cmp_vimtex").url_default_format(
"https://scholar.google.com/scholar?hl=en&q=%s"
),
},
-- Other search engines.
},
},
})
end,
},
{
"L3MON4D3/LuaSnip",
build = (not jit.os:find("Windows"))
and "echo 'NOTE: jsregexp is optional, so not a big deal if it fails to build'; make install_jsregexp"
or nil,
dependencies = {
"rafamadriz/friendly-snippets",
config = function()
require("luasnip.loaders.from_vscode").lazy_load()
end,
},
opts = {
history = true,
delete_check_events = "TextChanged",
enable_autosnippets = true,
store_selection_keys = "<Tab>",
},
-- stylua: ignore
keys = {
{
"<tab>",
function()
return require("luasnip").jumpable(1) and "<Plug>luasnip-jump-next" or "<tab>"
end,
expr = true, silent = true, mode = "i",
},
{ "<tab>", function() require("luasnip").jump(1) end, mode = "s" },
{ "<s-tab>", function() require("luasnip").jump(-1) end, mode = { "i", "s" } },
},
config = function()
require("luasnip.loaders.from_lua").load({ paths = "~/.config/nvim/snippets" })
end,
},
{
"brennier/quicktex",
config = function()
-- vim.g.quicktex_tex = {
-- ' ' = "<ESC>:call search('<+.*+>')\<CR>\"_c/+>/e\<CR>",
-- 'm' = '\( <+++> \) <++>',
-- 'prf' = "\\begin{proof}\<CR><+++>\<CR>\\end{proof}",
-- }
-- vim.g.quicktex_math = {
-- ' ' : "\<ESC>:call search('<+.*+>')\<CR>\"_c/+>/e\<CR>",
-- 'fr' : '\mathcal{R} ',
-- 'eq' : '= ',
-- 'set' : '\{ <+++> \} <++>',
-- 'frac' : '\frac{<+++>}{<++>} <++>',
-- 'one' : '1 ',
-- 'st' : ': ',
-- 'in' : '\in ',
-- 'bn' : '\mathbb{N} ',
-- }
end,
},
}