etc/nvim/lua/filetypes.lua

53 lines
1,015 B
Lua
Raw Normal View History

2024-05-20 20:35:49 +03:00
vim.filetype.add({
extension = {
pmd = "markdown",
},
})
2024-06-03 20:48:28 +03:00
createAutoCmd = vim.api.nvim_create_autocmd
--
-- Basic thing for compiling languages.
createAutoCmd({
"BufNewFile",
"BufRead",
},{
2024-06-09 18:03:40 +03:00
pattern = "*.tengo,*.go,*.c,*.cc,*.C,*.cpp,*.rs,*.lua,*.sql,*.tengo,*.xgo,*.tpp",
2024-06-03 20:48:28 +03:00
callback = function()
local buf = vim.bo[vim.api.nvim_get_current_buf()]
vim.o.expandtab = false
vim.o.tabstop = 4
vim.o.shiftwidth = 4
end,
})
createAutoCmd({
"BufNewFile",
"BufRead",
},{
2024-06-09 18:03:40 +03:00
pattern = "*.md,*.txt,*.js,*.jsx,*.scss"..
2024-06-03 20:48:28 +03:00
",*.css,*.sass,*.htm,*.html,*.htmlx,*.tmpl"..
",*.tpl,*.yml,*.yaml,*.toml,*.tml",
callback = function()
local buf = vim.bo[vim.api.nvim_get_current_buf()]
buf.expandtab = true
buf.shiftwidth=2
2024-06-23 14:45:24 +03:00
buf.tabstop=4
2024-06-03 20:48:28 +03:00
buf.softtabstop = 0
end,
})
createAutoCmd({
"BufNewFile",
"BufRead",
},{
pattern = "*.py,*.zig",
2024-06-03 20:48:28 +03:00
callback = function()
local buf = vim.bo[vim.api.nvim_get_current_buf()]
buf.expandtab = true
buf.shiftwidth=4
buf.tabstop=4
buf.softtabstop = 0
end,
})