From 085031114f7580f9ce84469316a1fcd61425116c Mon Sep 17 00:00:00 2001 From: "Scott E. Graves" Date: Fri, 28 Aug 2026 20:05:00 -0500 Subject: [PATCH] reduced package installations and plugin dependencies --- Dockerfile | 21 ------ common.sh | 6 -- nvim/lua/darcula/config/init.lua | 2 + nvim/lua/darcula/keymaps.lua | 10 ++- nvim/lua/darcula/plugins.lua | 4 -- .../lua/darcula/setup/400_mini_hipatterns.lua | 67 +++++++++++++++++++ nvim/lua/darcula/setup/500_colorizer.lua | 20 ------ 7 files changed, 77 insertions(+), 53 deletions(-) create mode 100644 nvim/lua/darcula/setup/400_mini_hipatterns.lua delete mode 100644 nvim/lua/darcula/setup/500_colorizer.lua diff --git a/Dockerfile b/Dockerfile index 2d8fcc0..76e5c26 100644 --- a/Dockerfile +++ b/Dockerfile @@ -61,7 +61,6 @@ RUN \ bzip2 \ clang \ cmake \ - codespell \ containerd.io \ cppcheck \ curl \ @@ -99,7 +98,6 @@ RUN \ python3-venv \ ripgrep \ rsync \ - shellcheck \ sed \ tar \ tidy \ @@ -130,33 +128,17 @@ RUN \ chown ${UNAME}:${GNAME} /entrypoint.sh RUN \ - git clone https://github.com/LuaLS/lua-language-server && \ - cd lua-language-server && \ - chmod +x ./make.sh && \ - ./make.sh && \ - mv lua-language-server /usr/bin && \ - chmod +x /usr/bin/lua-language-server && \ - cd - && \ - rm -rf lua-language-server - -RUN \ - npm i -g cspell && \ npm i -g eslint && \ npm i -g js-beautify && \ npm i -g lua-fmt && \ npm i -g neovim && \ npm i -g npm && \ - npm i -g prettier && \ npm i -g tree-sitter-cli RUN \ python3 -m venv /python && \ pip3 install -U pip && \ - pip3 install -U cmake-language-server && \ pip3 install -U coverage && \ - pip3 install -U cpplint && \ - pip3 install -U jedi && \ - pip3 install -U jedi-language-server && \ pip3 install -U neovim && \ pip3 install -U pylint && \ CFLAGS=-Wno-incompatible-pointer-types pip3 install -U cppman @@ -270,9 +252,6 @@ RUN \ nvim --headless "+LspInstall vimls" "+qall"; \ fi -RUN \ - go install mvdan.cc/sh/v3/cmd/shfmt@latest - ENTRYPOINT ["/entrypoint.sh"] # vim:filetype=dockerfile diff --git a/common.sh b/common.sh index 34d3861..45569b4 100755 --- a/common.sh +++ b/common.sh @@ -44,7 +44,6 @@ NVIM_REQUIRED_BINARIES=( cppman curl dart - eslint flutter fzf g++ @@ -61,7 +60,6 @@ NVIM_REQUIRED_BINARIES=( rg rsync sed - shfmt sqlite3 tar tidy @@ -118,10 +116,6 @@ function ensure_brew_keg_binary() { export PATH="${HOME}/.local/bin:${PATH}" -if ! command -v eslint >/dev/null 2>&1; then - npm install --global --prefix "${HOME}/.local" eslint -fi - if ! command -v luafmt >/dev/null 2>&1; then npm install --global --prefix "${HOME}/.local" lua-fmt fi diff --git a/nvim/lua/darcula/config/init.lua b/nvim/lua/darcula/config/init.lua index f0c08b4..baf10c7 100644 --- a/nvim/lua/darcula/config/init.lua +++ b/nvim/lua/darcula/config/init.lua @@ -211,6 +211,8 @@ NV_DARCULA_MASON_TOOL_LIST = "NV_DARCULA_MASON_TOOL_LIST", { "clang-format", + "codespell", + "cpplint", "delve", "gofumpt", "google-java-format", diff --git a/nvim/lua/darcula/keymaps.lua b/nvim/lua/darcula/keymaps.lua index 7ebe464..a08ba10 100644 --- a/nvim/lua/darcula/keymaps.lua +++ b/nvim/lua/darcula/keymaps.lua @@ -1206,11 +1206,17 @@ function M.toggle() opts ) - -- Colorizer + -- Color highlighting km.nmap( km.leader2 "tc", function() - vim.cmd("ColorizerToggle") + local hipatterns = require("mini.hipatterns") + local bufnr = vim.api.nvim_get_current_buf() + hipatterns.toggle(bufnr) + utils.notify_setting_enabled( + "Color highlighting", + vim.tbl_contains(hipatterns.get_enabled_buffers(), bufnr) + ) end, opts ) diff --git a/nvim/lua/darcula/plugins.lua b/nvim/lua/darcula/plugins.lua index b429aaf..09acfe9 100644 --- a/nvim/lua/darcula/plugins.lua +++ b/nvim/lua/darcula/plugins.lua @@ -94,10 +94,6 @@ end vim.list_extend( packages, { - { - src = "https://github.com/catgoose/nvim-colorizer.lua", - version = "85a5e83cd4daa258cf95c3204e277991d6fbe747" - }, {src = "https://github.com/dart-lang/dart-vim-plugin"}, {src = "https://github.com/dstein64/nvim-scrollview"}, {src = "https://github.com/kyazdani42/nvim-tree.lua"}, diff --git a/nvim/lua/darcula/setup/400_mini_hipatterns.lua b/nvim/lua/darcula/setup/400_mini_hipatterns.lua new file mode 100644 index 0000000..9da55d7 --- /dev/null +++ b/nvim/lua/darcula/setup/400_mini_hipatterns.lua @@ -0,0 +1,67 @@ +-- The MIT License (MIT) +-- +-- Copyright © 2026 Scott E. Graves +-- +-- Permission is hereby granted, free of charge, to any person obtaining a copy of this software +-- and associated documentation files (the “Software”), to deal in the Software without restriction, +-- including without limitation the rights to use, copy, modify, merge, publish, distribute, +-- sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is +-- furnished to do so, subject to the following conditions: +-- +-- The above copyright notice and this permission notice shall be included in all copies or +-- substantial portions of the Software. +-- +-- THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +-- BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +-- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +-- +local hipatterns = require("mini.hipatterns") + +local color_group = function(_, match) + local hex = match + if #match == 4 or #match == 5 then + local red, green, blue = match:sub(2, 2), match:sub(3, 3), match:sub(4, 4) + hex = "#" .. red .. red .. green .. green .. blue .. blue + end + + return hipatterns.compute_hex_color_group(hex:sub(1, 7), "bg") +end + +local named_color_group = function(_, match) + -- Match colorizer's default of accepting lower- and CamelCase names, but + -- not names written entirely in uppercase. + if #match > 1 and match == match:upper() then + return nil + end + + local ok, color = pcall(vim.api.nvim_get_color_by_name, match) + if not ok or color < 0 then + return nil + end + + return hipatterns.compute_hex_color_group( + string.format("#%06x", color), + "bg" + ) +end + +hipatterns.setup( + { + highlighters = { + hex_color = hipatterns.gen_highlighter.hex_color(), + hex_short = { + pattern = { + "()#%x%x%x()%f[^%x]", + "()#%x%x%x%x()%f[^%x]" + }, + group = color_group + }, + named_color = { + pattern = "%f[%w]()[%a][%w]*()%f[^%w]", + group = named_color_group + } + } + } +) diff --git a/nvim/lua/darcula/setup/500_colorizer.lua b/nvim/lua/darcula/setup/500_colorizer.lua deleted file mode 100644 index 5b02867..0000000 --- a/nvim/lua/darcula/setup/500_colorizer.lua +++ /dev/null @@ -1,20 +0,0 @@ --- The MIT License (MIT) --- --- Copyright © 2026 Scott E. Graves --- --- Permission is hereby granted, free of charge, to any person obtaining a copy of this software --- and associated documentation files (the “Software”), to deal in the Software without restriction, --- including without limitation the rights to use, copy, modify, merge, publish, distribute, --- sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is --- furnished to do so, subject to the following conditions: --- --- The above copyright notice and this permission notice shall be included in all copies or --- substantial portions of the Software. --- --- THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING --- BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND --- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, --- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, --- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --- -require("colorizer").setup()