diff --git a/home/any/neovim/.config/nvim/lua/crthaze/init.lua b/home/any/neovim/.config/nvim/lua/crthaze/init.lua index 6b35ff9..e3ac67c 100644 --- a/home/any/neovim/.config/nvim/lua/crthaze/init.lua +++ b/home/any/neovim/.config/nvim/lua/crthaze/init.lua @@ -1,6 +1,7 @@ require("crthaze.set") require("crthaze.remap") require("crthaze.lazy_init") +require("crthaze.langs") local augroup = vim.api.nvim_create_augroup local autocmd = vim.api.nvim_create_autocmd diff --git a/home/any/neovim/.config/nvim/lua/crthaze/langs.lua b/home/any/neovim/.config/nvim/lua/crthaze/langs.lua new file mode 100644 index 0000000..e62859f --- /dev/null +++ b/home/any/neovim/.config/nvim/lua/crthaze/langs.lua @@ -0,0 +1,42 @@ +vim.api.nvim_create_autocmd("FileType", { + -- This autocommand will only trigger if the buffer name matches the following patterns + pattern = "rust", + -- The autocommand will trigger the following lua function + callback = function() + vim.opt_local.colorcolumn = "100" + vim.opt_local.expandtab = false + vim.opt_local.tabstop = 2 + vim.opt_local.softtabstop = 2 + vim.opt_local.shiftwidth = 2 + end +}) + +vim.api.nvim_create_autocmd("FileType", { + -- This autocommand will only trigger if the buffer name matches the following patterns + pattern = "html", + -- The autocommand will trigger the following lua function + callback = function() + vim.opt_local.colorcolumn = "100" + end +}) + +vim.api.nvim_create_autocmd("FileType", { + -- This autocommand will only trigger if the buffer name matches the following patterns + pattern = "go", + -- The autocommand will trigger the following lua function + callback = function() + vim.opt_local.colorcolumn = "100" + end +}) + +vim.api.nvim_create_autocmd("FileType", { + -- This autocommand will only trigger if the buffer name matches the following patterns + pattern = "python", + -- The autocommand will trigger the following lua function + callback = function() + vim.opt_local.expandtab = true + vim.opt_local.tabstop = 4 + vim.opt_local.softtabstop = 4 + vim.opt_local.shiftwidth = 4 + end +})