diff --git a/ftplugin/java.lua b/ftplugin/java.lua index 7aa6bc5..e9b8248 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 = 100 +vim.opt_local.tw = 180 vim.opt_local.colorcolumn = "+1" diff --git a/ftplugin/sh.lua b/ftplugin/sh.lua deleted file mode 100644 index 5093592..0000000 --- a/ftplugin/sh.lua +++ /dev/null @@ -1,37 +0,0 @@ -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 new file mode 100644 index 0000000..5d70679 --- /dev/null +++ b/ftplugin/sh.vim @@ -0,0 +1,2 @@ +set colorcolumn=100 +set tw=100 diff --git a/lazy-lock.json b/lazy-lock.json index 8fc837a..59ac9a6 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,49 +1,48 @@ { - "LuaSnip": { "branch": "master", "commit": "a62e1083a3cfe8b6b206e7d3d33a51091df25357" }, - "asyncrun.vim": { "branch": "master", "commit": "98d3c0fdeb983f0ef62fe3a49da440f6d2c045ce" }, - "claude-code.nvim": { "branch": "main", "commit": "55c0cb59828fbc3bec744288286a46f5d5750b83" }, - "cmp-nvim-lsp": { "branch": "main", "commit": "cbc7b02bb99fae35cb42f514762b89b5126651ef" }, - "cmp-path": { "branch": "main", "commit": "c642487086dbd9a93160e1679a1327be111cbc25" }, + "LuaSnip": { "branch": "master", "commit": "c9b9a22904c97d0eb69ccb9bab76037838326817" }, + "asyncrun.vim": { "branch": "master", "commit": "e17c49c67d1dd847cd1d7d6077a7168816f546cc" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "a8912b88ce488f411177fc8aed358b04dc246d7b" }, + "cmp-path": { "branch": "main", "commit": "c6635aae33a50d6010bf1aa756ac2398a2d54c32" }, "cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" }, - "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": "63a3c6a80538de1003373a619e29aeda27809ad3" }, - "mason-tool-installer.nvim": { "branch": "main", "commit": "443f1ef8b5e6bf47045cb2217b6f748a223cf7dc" }, - "mason.nvim": { "branch": "main", "commit": "b03fb0f20bc1d43daf558cda981a2be22e73ac42" }, - "mini.nvim": { "branch": "main", "commit": "2431902e78b76f435542d1e606f08475360068ca" }, + "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" }, "neogen": { "branch": "main", "commit": "b2e78708876f4da507839726816010a68e33fec8" }, - "nvim-autopairs": { "branch": "master", "commit": "59bce2eef357189c3305e25bc6dd2d138c1683f5" }, - "nvim-cmp": { "branch": "main", "commit": "a1d504892f2bc56c2e79b65c6faded2fd21f3eca" }, - "nvim-colorizer.lua": { "branch": "master", "commit": "5cfe7fffbd01e17b3c1e14af85d5febdef88bd8c" }, - "nvim-jdtls": { "branch": "master", "commit": "77ccaeb422f8c81b647605da5ddb4a7f725cda90" }, - "nvim-lspconfig": { "branch": "master", "commit": "bedca8b426b2fee0ccac596d167d71bbe971253f" }, - "nvim-markdown": { "branch": "master", "commit": "37850581fdaec153ce84af677d43bf8fce60813a" }, - "nvim-treesitter": { "branch": "main", "commit": "4916d6592ede8c07973490d9322f187e07dfefac" }, - "nvim-web-devicons": { "branch": "master", "commit": "95b7a002d5dba1a42eb58f5fac5c565a485eefd0" }, - "plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" }, + "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" }, "rainbow_csv": { "branch": "master", "commit": "3dbbfd7d17536aebfb80f571255548495574c32b" }, - "render-markdown.nvim": { "branch": "main", "commit": "54d4b5431e9634ee3d8d30784e017239b5b89d41" }, + "render-markdown.nvim": { "branch": "main", "commit": "a615baed85137a8c6fc8e95f5545f64d33f5f384" }, "runst.nvim": { "branch": "main", "commit": "9760caf73d8f020b6054d34f5527a85836a11a24" }, - "rustaceanvim": { "branch": "main", "commit": "88575b98bb9937fb9983ddec5e532b67e75ce677" }, - "snacks.nvim": { "branch": "main", "commit": "ad9ede6a9cddf16cedbd31b8932d6dcdee9b716e" }, + "rustaceanvim": { "branch": "master", "commit": "88575b98bb9937fb9983ddec5e532b67e75ce677" }, + "snacks.nvim": { "branch": "main", "commit": "bc0630e43be5699bb94dadc302c0d21615421d93" }, "tabular": { "branch": "master", "commit": "12437cd1b53488e24936ec4b091c9324cafee311" }, - "telescope-live-grep-args.nvim": { "branch": "master", "commit": "53e9df55b3651dd7cf77e172f1e8c9a17407acca" }, + "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": "31e3c38ce9b29781e4422fc0322eb0a21f4e8668" }, - "trouble.nvim": { "branch": "main", "commit": "bd67efe408d4816e25e8491cc5ad4088e708a69a" }, + "todo-comments.nvim": { "branch": "main", "commit": "304a8d204ee787d2544d8bc23cd38d2f929e7cc5" }, + "trouble.nvim": { "branch": "main", "commit": "85bedb7eb7fa331a2ccbecb9202d8abba64d37b3" }, "vim-abolish": { "branch": "master", "commit": "dcbfe065297d31823561ba787f51056c147aa682" }, "vim-cmake": { "branch": "master", "commit": "896bc2189c8ade62d00a0ebedc59c65d9d9b0d65" }, - "vim-gitgutter": { "branch": "main", "commit": "21c977e8597c468c7dc76001389b0b430d46a4b0" }, + "vim-gitgutter": { "branch": "main", "commit": "6620e5fbbe6a28de0bfed081f5bd2767023b7eea" }, "vim-sleuth": { "branch": "master", "commit": "be69bff86754b1aa5adcbb527d7fcd1635a84080" }, - "vim-table-mode": { "branch": "master", "commit": "bb025308a45c67c7c8f0763ba37bc2ee3f534df0" }, + "vim-table-mode": { "branch": "master", "commit": "e4365bde024f73e205eefa2fb78e3029ddb92ea9" }, "vim-textobj-hydrogen": { "branch": "master", "commit": "e6f9a6b26a3524615bac347503c35327636fab72" }, "vim-textobj-user": { "branch": "master", "commit": "41a675ddbeefd6a93664a4dc52f302fe3086a933" }, - "vim-tmux-navigator": { "branch": "master", "commit": "e41c431a0c7b7388ae7ba341f01a0d217eb3a432" }, + "vim-tmux-navigator": { "branch": "master", "commit": "791dacfcfc8ccb7f6eb1c853050883b03e5a22fe" }, "windsurf.vim": { "branch": "main", "commit": "a8d47ec54fe82df920b2545559f767003e8a7f8d" }, - "zenbones.nvim": { "branch": "main", "commit": "22b7fb75593412e0dc81b4bdefae718e9e84aa82" } + "zenbones.nvim": { "branch": "main", "commit": "dbd485fa5d5230d175e024374d41dab5ad71b119" } } diff --git a/lua/plugins/dev-tools.lua b/lua/plugins/dev-tools.lua index 94c606e..7306561 100644 --- a/lua/plugins/dev-tools.lua +++ b/lua/plugins/dev-tools.lua @@ -25,7 +25,6 @@ return { "f-person/git-blame.nvim", opts = { enabled = false, - message_template = "<> • ", }, }, @@ -47,28 +46,4 @@ return { end, version = "*", }, - { - "greggh/claude-code.nvim", - dependencies = { - "nvim-lua/plenary.nvim", -- Required for git operations - }, - config = function() - require("claude-code").setup({ - window = { - split_ratio = 0.3, -- Percentage of screen for the terminal window (height for horizontal, width for vertical splits) - position = "vertical", -- Position of the window: "botright", "topleft", "vertical", "float", etc. - }, - keymaps = { - toggle = { - normal = "cc", -- Normal mode keymap for toggling Claude Code, false to disable - terminal = "cc", -- Terminal mode keymap for toggling Claude Code, false to disable - variants = { - continue = "cC", -- Normal mode keymap for Claude Code with continue flag - verbose = "cV", -- Normal mode keymap for Claude Code with verbose flag - }, - }, - }, - }) - end, - }, } diff --git a/lua/plugins/editor.lua b/lua/plugins/editor.lua index b385e85..5e45b8e 100644 --- a/lua/plugins/editor.lua +++ b/lua/plugins/editor.lua @@ -12,12 +12,11 @@ return { }, "godlygeek/tabular", "tpope/vim-sleuth", - "catgoose/nvim-colorizer.lua", + "norcalli/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 8b9fe39..8b4df2d 100644 --- a/lua/plugins/formatting.lua +++ b/lua/plugins/formatting.lua @@ -3,26 +3,29 @@ 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" }, @@ -30,7 +33,7 @@ return { c = { "clang-format" }, sh = { "beautysh" }, tex = { "latexindent" }, - java = { "google-java-format" }, + java = { "java" }, javascript = { "prettier" }, typescript = { "prettier" }, typescriptreact = { "prettier" }, diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua index 2b344c0..54af8ab 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/formatters/eclipse-java-google-style.xml") + local style_path = vim.fn.expand("~/.config/nvim/GoogleStyle.xml") local java_home = os.getenv("NVIM_JDTLS_JAVA_HOME") @@ -42,7 +42,10 @@ return { settings = { java = { format = { - enabled = false, + settings = { + url = "file://" .. style_path, + profile = "GoogleStyle", -- must match the profile inside the xml + }, }, }, }, diff --git a/lua/plugins/ui.lua b/lua/plugins/ui.lua index 0187104..863cff6 100644 --- a/lua/plugins/ui.lua +++ b/lua/plugins/ui.lua @@ -62,21 +62,14 @@ return { { "nvim-treesitter/nvim-treesitter", - branch = "main", - main = "nvim-treesitter", build = ":TSUpdate", - init = function() - -- Install parsers that aren't already present - local ensure_installed = { "bash", "c", "html", "lua", "markdown", "vim", "vimdoc" } - local already_installed = require("nvim-treesitter.config").get_installed() - local to_install = vim.iter(ensure_installed) - :filter(function(parser) - return not vim.tbl_contains(already_installed, parser) - end) - :totable() - if #to_install > 0 then - require("nvim-treesitter").install(to_install) - end + config = function() + require("nvim-treesitter.configs").setup({ + ensure_installed = { "bash", "c", "html", "lua", "markdown", "vim", "vimdoc" }, + auto_install = true, + highlight = { enable = false }, + indent = { enable = false }, + }) end, },