neovim-confs/lua/custom/autocmds.lua

45 lines
982 B
Lua
Raw Normal View History

2024-07-08 10:32:51 +02:00
local augroup = vim.api.nvim_create_augroup('plex_generic_autocmds', {})
2024-07-09 01:25:42 +02:00
-- enable text wrapping for text filetypes
vim.api.nvim_create_autocmd('FileType', {
group = augroup,
pattern = {
'tex',
'text',
'markdown',
'help',
},
callback = function()
vim.opt_local.wrap = true
end,
})
2024-07-08 10:32:51 +02:00
-- always use the tex filetype for latex things, as those are most supported by
-- latex language servers.
vim.api.nvim_create_autocmd('FileType', {
group = augroup,
pattern = {
'latex',
'plaintex',
},
callback = function()
vim.bo.filetype = 'tex'
end,
})
-- conceallevel is what converts things like **bold** to be displayed as bold
-- without the stars. This is useful, but we might not want it for some
-- filetypes.
vim.api.nvim_create_autocmd('FileType', {
group = augroup,
pattern = {
'latex',
'plaintex',
'tex',
},
callback = function()
vim.opt_local.conceallevel = 0
2024-07-09 01:51:49 +02:00
vim.opt_local.concealcursor = ''
2024-07-08 10:32:51 +02:00
end,
})