e2ab10a5674b7495a992a75cfe3d47234ae03c2d

Author
TheEdgeOfRage <git@theedgeofrage.com>
Committer
TheEdgeOfRage <git@theedgeofrage.com>
Date

Message

Set json and yaml indent to 2 in neovim

Diff

 1diff --git a/dot_config/nvim/lua/autocmd.lua b/dot_config/nvim/lua/autocmd.lua
 2index ebe93e11174b3432064b540ad4a40bce4b911f51..8a286e0d473003d0961f3311a962958e90b77c02 100644
 3--- a/dot_config/nvim/lua/autocmd.lua
 4+++ b/dot_config/nvim/lua/autocmd.lua
 5@@ -18,3 +18,13 @@ vim.api.nvim_create_autocmd({ "FileType", "BufWinEnter" }, {
 6 		vim.wo.foldmethod = vim.bo[args.buf].filetype == "markdown" and "manual" or "expr"
 7 	end,
 8 })
 9+
10+vim.api.nvim_create_autocmd("FileType", {
11+	group = vim.api.nvim_create_augroup("two_space_indent", { clear = true }),
12+	pattern = { "json", "jsonc", "yaml" },
13+	callback = function()
14+		vim.opt_local.tabstop = 2
15+		vim.opt_local.shiftwidth = 2
16+		vim.opt_local.softtabstop = 2
17+	end,
18+})