autocommand: move ftplugin to autocommands
This commit is contained in:
parent
a88aec9556
commit
5670348cfb
@ -1,10 +0,0 @@
|
||||
-- vimtex configuration
|
||||
vim.g.vimtex_view_method = 'zathura'
|
||||
vim.g.maplocalleader = ' '
|
||||
-- Legacy shortcut from my vim-latexsuite days
|
||||
vim.api.nvim_set_keymap("n", "<Leader>ls", ":VimtexView<CR>", {noremap = true, silent = true, desc = 'View [L]atex Document'})
|
||||
|
||||
vim.o.foldmethod = 'expr'
|
||||
vim.o.foldexpr='vimtex#fold#level(v:lnum)'
|
||||
vim.o.foldtext='vimtex#fold#text()'
|
||||
vim.o.spell = true
|
@ -46,3 +46,23 @@ vim.api.nvim_create_autocmd({"OptionSet"}, {
|
||||
end
|
||||
end
|
||||
})
|
||||
|
||||
-- LaTeX configuration
|
||||
local texgroup = vim.api.nvim_create_augroup("latex", { clear = true })
|
||||
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
pattern = {"latex"},
|
||||
group = texgroup,
|
||||
callback = function()
|
||||
-- vimtex configuration
|
||||
vim.g.vimtex_view_method = 'zathura'
|
||||
vim.g.maplocalleader = ' '
|
||||
-- Legacy shortcut from my vim-latexsuite days
|
||||
vim.api.nvim_set_keymap("n", "<Leader>ls", ":VimtexView<CR>", {noremap = true, silent = true, desc = 'View [L]atex Document'})
|
||||
|
||||
vim.o.foldmethod = 'expr'
|
||||
vim.o.foldexpr='vimtex#fold#level(v:lnum)'
|
||||
vim.o.foldtext='vimtex#fold#text()'
|
||||
vim.o.spell = true
|
||||
end,
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user