1
Fork 0
dots/nvim/lua/filetypes.lua
2024-12-11 23:45:06 +05:00

43 lines
1.2 KiB
Lua

vim.filetype.add({
filename = {
["user-dirs.dirs"] = "conf",
["gruvbox.conf"] = "kitty",
["keys.conf"] = "kitty",
["kitty.conf"] = "kitty",
["ssh.conf"] = "kitty",
["dot-zshenv"] = "zsh",
["dot-zshrc"] = "zsh"
},
pattern = {
[".*/git/config"] = "gitconfig"
}
})
vim.api.nvim_create_autocmd("Filetype", {
group = vim.api.nvim_create_augroup("setIndent", {}),
pattern = { "lua" },
command = "setlocal tabstop=2 softtabstop=2 shiftwidth=2"
})
vim.api.nvim_create_autocmd("Filetype", {
group = vim.api.nvim_create_augroup("webDev", {}),
pattern = { "html", "css", "javascript", "svelte", "javascriptreact", "json" },
callback = function()
vim.cmd [[setlocal tabstop=2 softtabstop=2 shiftwidth=2]]
vim.bo.formatprg = "prettier --stdin-filepath " .. vim.fn.expand("%:p")
require("minimal-format").enable_autocmd(0)
end
})
vim.api.nvim_create_autocmd("Filetype", {
group = vim.api.nvim_create_augroup("zola", {}),
pattern = { "htmldjango" },
callback = function()
vim.cmd [[setlocal tabstop=2 softtabstop=2 shiftwidth=2]]
vim.bo.formatprg = "djhtml -; echo"
require("minimal-format").enable_autocmd(0)
end
})