1
0
mirror of https://github.com/tiyn/dotfiles.git synced 2025-03-19 02:17:44 +01:00
dotfiles/.config/nvim/lua/autocmd.lua

117 lines
2.2 KiB
Lua
Raw Normal View History

-- read files correctly
vim.filetype.add({
extension = {
c = 'c',
h = 'c',
html = 'html',
java = 'java',
js = 'javascript',
lua = 'lua',
md = 'markdown',
nim = 'nim',
py = 'python',
tex = 'tex',
}
})
2023-01-13 04:03:00 +01:00
2023-08-08 02:56:29 +02:00
-- settings for filetype: c
vim.api.nvim_create_autocmd({ 'VimLeave' },
{
2023-08-10 03:48:56 +02:00
pattern = { '*.c' },
command = '!cclear'
})
2023-01-13 04:03:00 +01:00
vim.api.nvim_create_autocmd({ 'BufEnter', 'FileType' },
{
pattern = { 'c' },
command = 'set colorcolumn=80'
})
-- settings for filetype: java
vim.api.nvim_create_autocmd({ 'FileType' },
{
pattern = { 'java' },
command = 'setlocal shiftwidth=2 softtabstop=2',
})
2023-01-13 04:03:00 +01:00
vim.api.nvim_create_autocmd({ 'BufEnter', 'FileType' },
{
pattern = { 'java' },
command = 'set colorcolumn=100'
})
-- settings for filetype: javascript
vim.api.nvim_create_autocmd({ 'FileType' },
{
pattern = { 'javascript' },
command = 'setlocal shiftwidth=2 softtabstop=2',
})
2023-01-13 04:03:00 +01:00
-- settings for filetype: lua
2023-01-13 04:03:00 +01:00
vim.api.nvim_create_autocmd({ 'FileType' },
{
pattern = { 'lua' },
command = 'setlocal shiftwidth=2 softtabstop=2',
})
2023-01-13 04:03:00 +01:00
vim.api.nvim_create_autocmd({ 'BufEnter', 'FileType' },
{
pattern = { 'lua' },
command = 'set colorcolumn=100'
})
-- settings for filetype: markdown
vim.api.nvim_create_autocmd({ 'FileType' },
{
pattern = { 'markdown' },
command = 'setlocal shiftwidth=2 softtabstop=2',
})
2023-01-13 04:03:00 +01:00
vim.api.nvim_create_autocmd({ 'BufEnter', 'FileType' },
{
pattern = { 'markdown' },
command = 'set colorcolumn=100'
})
2023-01-13 04:03:00 +01:00
vim.api.nvim_create_autocmd({ 'BufEnter', 'FileType' },
{
pattern = { 'markdown' },
2023-08-08 02:56:29 +02:00
command = 'set nofoldenable'
})
2023-01-13 04:03:00 +01:00
-- settings for filetype: nim
vim.api.nvim_create_autocmd({ 'BufEnter', 'FileType' },
{
pattern = { 'nim' },
command = 'set colorcolumn=80'
})
2023-01-13 04:03:00 +01:00
-- settings for filetype: python
vim.api.nvim_create_autocmd({ 'BufEnter', 'FileType' },
{
pattern = { 'python' },
command = 'set colorcolumn=80'
})
2023-01-13 04:03:00 +01:00
-- settings for filetype: tex
vim.api.nvim_create_autocmd({ 'VimLeave' },
{
2023-08-10 03:48:56 +02:00
pattern = { '*.tex' },
command = '!texclear %'
})
vim.api.nvim_create_autocmd({ 'BufEnter', 'FileType' },
{
pattern = { 'tex' },
command = 'set colorcolumn=80'
})