commit fa90efd10c71fb19a2903bab3e88ac00c87099bc
parent fc3b3124e19bedc919cd9750596fa7142df7637a
Author: Chris Bracken <chris@bracken.jp>
Date: Fri, 19 Sep 2025 19:34:06 +0900
nvim: move indent config to after/ftplugin
Diffstat:
4 files changed, 8 insertions(+), 12 deletions(-)
diff --git a/.config/nvim/after/ftplugin/beancount.lua b/.config/nvim/after/ftplugin/beancount.lua
@@ -1,5 +1,4 @@
vim.api.nvim_create_autocmd("BufWritePost", {
- pattern = "*.beancount",
command = "silent !bean-format % -c 100 -o %",
desc = "Run bean-format on save",
})
diff --git a/.config/nvim/after/ftplugin/python.lua b/.config/nvim/after/ftplugin/python.lua
@@ -0,0 +1,4 @@
+vim.opt_local.tabstop = 2
+vim.opt_local.shiftwidth = 2
+vim.opt_local.softtabstop = 2
+vim.opt_local.expandtab = true
diff --git a/.config/nvim/after/ftplugin/swift.lua b/.config/nvim/after/ftplugin/swift.lua
@@ -0,0 +1,4 @@
+vim.opt_local.tabstop = 2
+vim.opt_local.shiftwidth = 2
+vim.opt_local.softtabstop = 2
+vim.opt_local.expandtab = true
diff --git a/.config/nvim/lua/config/options.lua b/.config/nvim/lua/config/options.lua
@@ -22,17 +22,6 @@ vim.opt.shiftwidth = 2 -- Number of spaces for each step of auto
vim.opt.softtabstop = 2 -- Number of spaces per tab when editing.
vim.opt.expandtab = true -- Insert spaces in place of tabs.
--- Fix Python's indent overrides.
-vim.api.nvim_create_autocmd('FileType', {
- pattern = {'python', 'swift'},
- callback = function()
- vim.opt_local.tabstop = 2
- vim.opt_local.shiftwidth = 2
- vim.opt_local.softtabstop = 2
- vim.opt_local.expandtab = true
- end
-})
-
-- Don't show warnings, errors, etc. by default.
vim.diagnostic.enable(false)