From beca7d35668320c3e011038093875f81c5ef7219 Mon Sep 17 00:00:00 2001 From: Alex Selimov Date: Tue, 7 Apr 2026 11:30:06 -0400 Subject: [PATCH] Latest configuration changes --- ftplugin/java.lua | 2 +- ftplugin/sh.lua | 37 ++++++++++++++++++++++ ftplugin/sh.vim | 2 -- lazy-lock.json | 64 +++++++++++++++++++------------------- lua/plugins/dev-tools.lua | 1 + lua/plugins/editor.lua | 5 +-- lua/plugins/formatting.lua | 33 +++++++++----------- lua/plugins/lsp.lua | 7 ++--- lua/plugins/ui.lua | 2 ++ 9 files changed, 93 insertions(+), 60 deletions(-) create mode 100644 ftplugin/sh.lua delete mode 100644 ftplugin/sh.vim diff --git a/ftplugin/java.lua b/ftplugin/java.lua index e9b8248..7aa6bc5 100644 --- a/ftplugin/java.lua +++ b/ftplugin/java.lua @@ -1,4 +1,4 @@ vim.opt_local.shiftwidth = 2 vim.opt_local.tabstop = 2 -vim.opt_local.tw = 180 +vim.opt_local.tw = 100 vim.opt_local.colorcolumn = "+1" diff --git a/ftplugin/sh.lua b/ftplugin/sh.lua new file mode 100644 index 0000000..5093592 --- /dev/null +++ b/ftplugin/sh.lua @@ -0,0 +1,37 @@ +vim.opt_local.colorcolumn = "100" +vim.opt_local.textwidth = 100 +vim.opt_local.expandtab = true + +local function detect_indent(bufnr) + local lines = vim.api.nvim_buf_get_lines(bufnr, 0, 100, false) + local counts = {} + for _, line in ipairs(lines) do + local spaces = line:match("^( +)[^ ]") + if spaces then + local n = #spaces + counts[n] = (counts[n] or 0) + 1 + end + end + -- find the smallest indent size with meaningful usage + for _, size in ipairs({ 2, 4, 8 }) do + if (counts[size] or 0) > 0 then + return size + end + end + return 4 -- default +end + +local bufnr = vim.api.nvim_get_current_buf() +local size = detect_indent(bufnr) + +vim.opt_local.shiftwidth = size +vim.opt_local.tabstop = size +vim.opt_local.softtabstop = size + +-- update beautysh indent size for this buffer +local ok, conform = pcall(require, "conform") +if ok then + conform.formatters.beautysh = { + prepend_args = { "--indent-size", tostring(size) }, + } +end diff --git a/ftplugin/sh.vim b/ftplugin/sh.vim deleted file mode 100644 index 5d70679..0000000 --- a/ftplugin/sh.vim +++ /dev/null @@ -1,2 +0,0 @@ -set colorcolumn=100 -set tw=100 diff --git a/lazy-lock.json b/lazy-lock.json index 59ac9a6..734a439 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,48 +1,48 @@ { - "LuaSnip": { "branch": "master", "commit": "c9b9a22904c97d0eb69ccb9bab76037838326817" }, - "asyncrun.vim": { "branch": "master", "commit": "e17c49c67d1dd847cd1d7d6077a7168816f546cc" }, - "cmp-nvim-lsp": { "branch": "main", "commit": "a8912b88ce488f411177fc8aed358b04dc246d7b" }, - "cmp-path": { "branch": "main", "commit": "c6635aae33a50d6010bf1aa756ac2398a2d54c32" }, + "LuaSnip": { "branch": "master", "commit": "a62e1083a3cfe8b6b206e7d3d33a51091df25357" }, + "asyncrun.vim": { "branch": "master", "commit": "98d3c0fdeb983f0ef62fe3a49da440f6d2c045ce" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "cbc7b02bb99fae35cb42f514762b89b5126651ef" }, + "cmp-path": { "branch": "main", "commit": "c642487086dbd9a93160e1679a1327be111cbc25" }, "cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" }, - "conform.nvim": { "branch": "master", "commit": "eebc724d12c5579d733d1f801386e0ceb909d001" }, - "fidget.nvim": { "branch": "main", "commit": "d9ba6b7bfe29b3119a610892af67602641da778e" }, - "git-blame.nvim": { "branch": "main", "commit": "8503b199edf9a666fe7b1a989cf14e3c26b2eb03" }, - "iron.nvim": { "branch": "master", "commit": "93b3b97cf4313613fba5e91055deaf091cd78483" }, - "lazy.nvim": { "branch": "main", "commit": "85c7ff3711b730b4030d03144f6db6375044ae82" }, - "lush.nvim": { "branch": "main", "commit": "45a79ec4acb5af783a6a29673a999ce37f00497e" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "1a31f824b9cd5bc6f342fc29e9a53b60d74af245" }, - "mason-tool-installer.nvim": { "branch": "main", "commit": "1255518cb067e038a4755f5cb3e980f79b6ab89c" }, - "mason.nvim": { "branch": "main", "commit": "fc98833b6da5de5a9c5b1446ac541577059555be" }, - "mini.nvim": { "branch": "main", "commit": "e744b5dbb3158242af77124bd6763a8647ea82ed" }, + "conform.nvim": { "branch": "master", "commit": "086a40dc7ed8242c03be9f47fbcee68699cc2395" }, + "fidget.nvim": { "branch": "main", "commit": "889e2e96edef4e144965571d46f7a77bcc4d0ddf" }, + "git-blame.nvim": { "branch": "main", "commit": "5c536e2d4134d064aa3f41575280bc8a2a0e03d7" }, + "iron.nvim": { "branch": "master", "commit": "88cd340407b959f1168af2a6ae5a3d180e6df32c" }, + "lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" }, + "lush.nvim": { "branch": "main", "commit": "9c60ec2279d62487d942ce095e49006af28eed6e" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "25f609e7fca78af7cede4f9fa3af8a94b1c4950b" }, + "mason-tool-installer.nvim": { "branch": "main", "commit": "443f1ef8b5e6bf47045cb2217b6f748a223cf7dc" }, + "mason.nvim": { "branch": "main", "commit": "b03fb0f20bc1d43daf558cda981a2be22e73ac42" }, + "mini.nvim": { "branch": "main", "commit": "2431902e78b76f435542d1e606f08475360068ca" }, "neogen": { "branch": "main", "commit": "b2e78708876f4da507839726816010a68e33fec8" }, - "nvim-autopairs": { "branch": "master", "commit": "2a406cdd8c373ae7fe378a9e062a5424472bd8d8" }, - "nvim-cmp": { "branch": "main", "commit": "059e89495b3ec09395262f16b1ad441a38081d04" }, - "nvim-colorizer.lua": { "branch": "master", "commit": "a065833f35a3a7cc3ef137ac88b5381da2ba302e" }, - "nvim-jdtls": { "branch": "master", "commit": "c23f200fee469a415c77265ca55b496feb646992" }, - "nvim-lspconfig": { "branch": "master", "commit": "d3ad666b7895f958d088cceb6f6c199672c404fe" }, - "nvim-markdown": { "branch": "master", "commit": "cfe80a1054ccc168ae9ef28062472e78f710f9f4" }, - "nvim-treesitter": { "branch": "main", "commit": "205faba1768a6e4c854f156bc6a21a41b242599c" }, - "nvim-web-devicons": { "branch": "master", "commit": "57dfa947cc88cdf1baa2c7e13ed31edddd8fb1d1" }, - "plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" }, + "nvim-autopairs": { "branch": "master", "commit": "59bce2eef357189c3305e25bc6dd2d138c1683f5" }, + "nvim-cmp": { "branch": "main", "commit": "a1d504892f2bc56c2e79b65c6faded2fd21f3eca" }, + "nvim-colorizer.lua": { "branch": "master", "commit": "c8c2c19436d33165ec34fa90c975bc0a739fe3fb" }, + "nvim-jdtls": { "branch": "master", "commit": "77ccaeb422f8c81b647605da5ddb4a7f725cda90" }, + "nvim-lspconfig": { "branch": "master", "commit": "bedca8b426b2fee0ccac596d167d71bbe971253f" }, + "nvim-markdown": { "branch": "master", "commit": "37850581fdaec153ce84af677d43bf8fce60813a" }, + "nvim-treesitter": { "branch": "master", "commit": "cfc6f2c117aaaa82f19bcce44deec2c194d900ab" }, + "nvim-web-devicons": { "branch": "master", "commit": "95b7a002d5dba1a42eb58f5fac5c565a485eefd0" }, + "plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" }, "rainbow_csv": { "branch": "master", "commit": "3dbbfd7d17536aebfb80f571255548495574c32b" }, - "render-markdown.nvim": { "branch": "main", "commit": "a615baed85137a8c6fc8e95f5545f64d33f5f384" }, + "render-markdown.nvim": { "branch": "main", "commit": "4ae2f2e8e8c66d070f33cfb57cb6f867e3baf5d9" }, "runst.nvim": { "branch": "main", "commit": "9760caf73d8f020b6054d34f5527a85836a11a24" }, - "rustaceanvim": { "branch": "master", "commit": "88575b98bb9937fb9983ddec5e532b67e75ce677" }, - "snacks.nvim": { "branch": "main", "commit": "bc0630e43be5699bb94dadc302c0d21615421d93" }, + "rustaceanvim": { "branch": "main", "commit": "88575b98bb9937fb9983ddec5e532b67e75ce677" }, + "snacks.nvim": { "branch": "main", "commit": "ad9ede6a9cddf16cedbd31b8932d6dcdee9b716e" }, "tabular": { "branch": "master", "commit": "12437cd1b53488e24936ec4b091c9324cafee311" }, "telescope-live-grep-args.nvim": { "branch": "master", "commit": "b80ec2c70ec4f32571478b501218c8979fab5201" }, "telescope.nvim": { "branch": "0.1.x", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" }, "tex-conceal.vim": { "branch": "master", "commit": "93ae39d9222b0892684d02324b85ee9d3647bf8e" }, - "todo-comments.nvim": { "branch": "main", "commit": "304a8d204ee787d2544d8bc23cd38d2f929e7cc5" }, - "trouble.nvim": { "branch": "main", "commit": "85bedb7eb7fa331a2ccbecb9202d8abba64d37b3" }, + "todo-comments.nvim": { "branch": "main", "commit": "31e3c38ce9b29781e4422fc0322eb0a21f4e8668" }, + "trouble.nvim": { "branch": "main", "commit": "bd67efe408d4816e25e8491cc5ad4088e708a69a" }, "vim-abolish": { "branch": "master", "commit": "dcbfe065297d31823561ba787f51056c147aa682" }, "vim-cmake": { "branch": "master", "commit": "896bc2189c8ade62d00a0ebedc59c65d9d9b0d65" }, - "vim-gitgutter": { "branch": "main", "commit": "6620e5fbbe6a28de0bfed081f5bd2767023b7eea" }, + "vim-gitgutter": { "branch": "main", "commit": "21c977e8597c468c7dc76001389b0b430d46a4b0" }, "vim-sleuth": { "branch": "master", "commit": "be69bff86754b1aa5adcbb527d7fcd1635a84080" }, - "vim-table-mode": { "branch": "master", "commit": "e4365bde024f73e205eefa2fb78e3029ddb92ea9" }, + "vim-table-mode": { "branch": "master", "commit": "bb025308a45c67c7c8f0763ba37bc2ee3f534df0" }, "vim-textobj-hydrogen": { "branch": "master", "commit": "e6f9a6b26a3524615bac347503c35327636fab72" }, "vim-textobj-user": { "branch": "master", "commit": "41a675ddbeefd6a93664a4dc52f302fe3086a933" }, - "vim-tmux-navigator": { "branch": "master", "commit": "791dacfcfc8ccb7f6eb1c853050883b03e5a22fe" }, + "vim-tmux-navigator": { "branch": "master", "commit": "e41c431a0c7b7388ae7ba341f01a0d217eb3a432" }, "windsurf.vim": { "branch": "main", "commit": "a8d47ec54fe82df920b2545559f767003e8a7f8d" }, - "zenbones.nvim": { "branch": "main", "commit": "dbd485fa5d5230d175e024374d41dab5ad71b119" } + "zenbones.nvim": { "branch": "main", "commit": "22b7fb75593412e0dc81b4bdefae718e9e84aa82" } } diff --git a/lua/plugins/dev-tools.lua b/lua/plugins/dev-tools.lua index 7306561..5838064 100644 --- a/lua/plugins/dev-tools.lua +++ b/lua/plugins/dev-tools.lua @@ -25,6 +25,7 @@ return { "f-person/git-blame.nvim", opts = { enabled = false, + message_template = "<> • ", }, }, diff --git a/lua/plugins/editor.lua b/lua/plugins/editor.lua index 5e45b8e..b385e85 100644 --- a/lua/plugins/editor.lua +++ b/lua/plugins/editor.lua @@ -12,11 +12,12 @@ return { }, "godlygeek/tabular", "tpope/vim-sleuth", - "norcalli/nvim-colorizer.lua", + "catgoose/nvim-colorizer.lua", { "ixru/nvim-markdown", ft = "markdown" }, "KeitaNakamura/tex-conceal.vim", "skywind3000/asyncrun.vim", "airblade/vim-gitgutter", "tpope/vim-abolish", "dhruvasagar/vim-table-mode", -} \ No newline at end of file +} + diff --git a/lua/plugins/formatting.lua b/lua/plugins/formatting.lua index 8b4df2d..8b9fe39 100644 --- a/lua/plugins/formatting.lua +++ b/lua/plugins/formatting.lua @@ -3,29 +3,26 @@ return { { "stevearc/conform.nvim", - setup = { - formatters = { - black = { - command = "black", - prepend_args = { "--line-length", "100" }, - }, - "prettier", - formatters = { - golines = { - args = { - "--max-len=100", - "--base-formatter=gofmt", - }, - }, - }, - }, - }, opts = { notify_on_error = false, format_on_save = { timeout_ms = 2500, lsp_fallback = true, }, + formatters = { + black = { + prepend_args = { "--line-length", "100" }, + }, + beautysh = { + prepend_args = { "--indent-size", "2" }, + }, + golines = { + prepend_args = { + "--max-len=100", + "--base-formatter=gofmt", + }, + }, + }, formatters_by_ft = { lua = { "stylua" }, python = { "black" }, @@ -33,7 +30,7 @@ return { c = { "clang-format" }, sh = { "beautysh" }, tex = { "latexindent" }, - java = { "java" }, + java = { "google-java-format" }, javascript = { "prettier" }, typescript = { "prettier" }, typescriptreact = { "prettier" }, diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua index 54af8ab..2b344c0 100644 --- a/lua/plugins/lsp.lua +++ b/lua/plugins/lsp.lua @@ -11,7 +11,7 @@ return { local root_dir = require("jdtls.setup").find_root({ ".git", "mvnw", "gradlew" }) -- Path to your exported Eclipse/IntelliJ style xml - local style_path = vim.fn.expand("~/.config/nvim/GoogleStyle.xml") + local style_path = vim.fn.expand("~/.config/nvim/formatters/eclipse-java-google-style.xml") local java_home = os.getenv("NVIM_JDTLS_JAVA_HOME") @@ -42,10 +42,7 @@ return { settings = { java = { format = { - settings = { - url = "file://" .. style_path, - profile = "GoogleStyle", -- must match the profile inside the xml - }, + enabled = false, }, }, }, diff --git a/lua/plugins/ui.lua b/lua/plugins/ui.lua index 863cff6..d44d816 100644 --- a/lua/plugins/ui.lua +++ b/lua/plugins/ui.lua @@ -62,6 +62,8 @@ return { { "nvim-treesitter/nvim-treesitter", + branch = "master", + tag = "v0.9.3", build = ":TSUpdate", config = function() require("nvim-treesitter.configs").setup({