From 4321f6ff89268b346ab6975072118492a7f01848 Mon Sep 17 00:00:00 2001 From: Tony Blyler Date: Fri, 4 Oct 2024 10:06:21 -0400 Subject: [PATCH] nvim: use tabs by default and use `guess-indent.nvim` to determine tabs vs spaces via statistics --- chezmoi/private_dot_config/nvim/init.lua | 12 +++++++++++- chezmoi/private_dot_config/nvim/mini-deps-snap | 1 + 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/chezmoi/private_dot_config/nvim/init.lua b/chezmoi/private_dot_config/nvim/init.lua index b947e8c..7ff977b 100644 --- a/chezmoi/private_dot_config/nvim/init.lua +++ b/chezmoi/private_dot_config/nvim/init.lua @@ -37,7 +37,7 @@ end now(function() local opts = { -- tabs look like 4 spaces { - expandtab = true, + expandtab = false, -- use tabs by default tabstop = 4, shiftwidth = 4, softtabstop = 4, @@ -60,6 +60,16 @@ now(function() end) -- }}} vim options +-- {{{ automatically determine indentation via statistics +now(function() + add({ + source = 'nmac427/guess-indent.nvim' + }) + + require('guess-indent').setup() +end) +-- }}} + -- {{{ color themes now(function() -- {{{ gruvbox diff --git a/chezmoi/private_dot_config/nvim/mini-deps-snap b/chezmoi/private_dot_config/nvim/mini-deps-snap index c8cf76c..8ae0721 100644 --- a/chezmoi/private_dot_config/nvim/mini-deps-snap +++ b/chezmoi/private_dot_config/nvim/mini-deps-snap @@ -2,6 +2,7 @@ return { ["dracula-pro.vim.git"] = "f4c019956a9fc9054ffc02553920519e3beadc21", ["gitsigns.nvim"] = "863903631e676b33e8be2acb17512fdc1b80b4fb", ["gruvbox.nvim"] = "7a1b23e4edf73a39642e77508ee6b9cbb8c60f9e", + ["guess-indent.nvim"] = "6cd61f7a600bb756e558627cd2e740302c58e32d", ["indent-blankline.nvim"] = "18603eb949eba08300799f64027af11ef922283f", ["mason-lspconfig.nvim"] = "25c11854aa25558ee6c03432edfa0df0217324be", ["mason.nvim"] = "e2f7f9044ec30067bc11800a9e266664b88cda22",