chore: remove neo-tree; add CHANGELOG.md and Makefile for deps
This commit is contained in:
parent
ed8b347cff
commit
4f789780d9
|
|
@ -0,0 +1,58 @@
|
||||||
|
# Changelog
|
||||||
|
|
||||||
|
## 2026-07-07 — Full Decoupling Refactor
|
||||||
|
|
||||||
|
### Architecture: Monolith → Modular
|
||||||
|
|
||||||
|
Extracted all plugin configurations from `init.lua` into individual files under `lua/kickstart/plugins/`. init.lua shrank from **949 → 334 lines** and now serves as a spine: options, keymaps, build hooks, and a clean `require` table in Section 10.
|
||||||
|
|
||||||
|
Each plugin is now a self-contained file — to enable or disable, comment or uncomment a single `require` line.
|
||||||
|
|
||||||
|
### New Files Created
|
||||||
|
|
||||||
|
| File | Purpose |
|
||||||
|
|---|---|
|
||||||
|
| `lua/kickstart/util.lua` | Shared `gh()` helper for GitHub URL shorthand |
|
||||||
|
| `lua/kickstart/plugins/guess-indent.lua` | Auto-detect indentation |
|
||||||
|
| `lua/kickstart/plugins/gitsigns.lua` | Git signs + hunk keymaps (consolidated) |
|
||||||
|
| `lua/kickstart/plugins/which-key.lua` | Pending keybind display |
|
||||||
|
| `lua/kickstart/plugins/tokyonight.lua` | Colorscheme (tokyonight-night) |
|
||||||
|
| `lua/kickstart/plugins/todo-comments.lua` | Highlight TODO/FIXME in comments |
|
||||||
|
| `lua/kickstart/plugins/mini.lua` | mini.ai + mini.surround + mini.statusline |
|
||||||
|
| `lua/kickstart/plugins/telescope.lua` | Fuzzy finder + LSP pickers + keymaps |
|
||||||
|
| `lua/kickstart/plugins/lsp.lua` | LSP servers + Mason + LspAttach keymaps |
|
||||||
|
| `lua/kickstart/plugins/conform.lua` | Formatting (go, hcl, ps1, lua) + hclfmt |
|
||||||
|
| `lua/kickstart/plugins/blink.lua` | blink.cmp + LuaSnip autocomplete |
|
||||||
|
| `lua/kickstart/plugins/treesitter.lua` | Syntax parsing + auto-install |
|
||||||
|
|
||||||
|
### Existing Files Modified
|
||||||
|
|
||||||
|
| File | Change |
|
||||||
|
|---|---|
|
||||||
|
| `init.lua` | Sections 4-9 extracted into plugin files; Section 10 rewritten as clean require table |
|
||||||
|
| `lua/kickstart/plugins/lint.lua` | Expanded from markdown-only to shell/bash/zsh + Go linting |
|
||||||
|
| `lua/kickstart/plugins/gitsigns.lua` | Consolidated signs config + on_attach keymaps (was duplicated) |
|
||||||
|
| `README.md` | Rewritten with full stack docs, keymap table, modular architecture guide |
|
||||||
|
|
||||||
|
### Files Removed
|
||||||
|
|
||||||
|
- `lazy-lock.json` — leftover from lazy.nvim era (migrated to vim.pack)
|
||||||
|
- `lua/kickstart/plugins/neo-tree.lua` — removed (user prefers Telescope for file navigation)
|
||||||
|
- `lua/custom/plugins/init.lua` — removed in prior cleanup
|
||||||
|
- `containerfix` branch — deprecated, deleted
|
||||||
|
|
||||||
|
### New Features
|
||||||
|
|
||||||
|
- **Linting enabled**: shellcheck for bash/sh/zsh, golangci-lint for Go
|
||||||
|
- **Gitsigns keymaps**: hunk navigation (`]c`/`[c`), staging (`<leader>hs`), blame (`<leader>tb`), word diff (`<leader>tw`)
|
||||||
|
- **System deps documented**: `Makefile` for one-command dependency installation
|
||||||
|
|
||||||
|
### How to Use
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Install system dependencies
|
||||||
|
make install
|
||||||
|
|
||||||
|
# Enable/disable plugins: edit init.lua Section 10
|
||||||
|
# Add a plugin: create lua/kickstart/plugins/<name>.lua, add require in Section 10
|
||||||
|
```
|
||||||
|
|
@ -0,0 +1,44 @@
|
||||||
|
# Neovim Config — Dependency Installation
|
||||||
|
# Run: make install
|
||||||
|
|
||||||
|
.PHONY: install check clean help
|
||||||
|
|
||||||
|
# Core dependencies (required)
|
||||||
|
CORE_DEPS := neovim gcc make git ripgrep fd tree-sitter-cli unzip xclip
|
||||||
|
|
||||||
|
# Linting (recommended)
|
||||||
|
LINT_DEPS := shellcheck golangci-lint
|
||||||
|
|
||||||
|
# All deps combined
|
||||||
|
ALL_DEPS := $(CORE_DEPS) $(LINT_DEPS)
|
||||||
|
|
||||||
|
install:
|
||||||
|
@echo "==> Installing core dependencies..."
|
||||||
|
sudo pacman -S --needed --noconfirm $(CORE_DEPS)
|
||||||
|
@echo "==> Installing linting dependencies..."
|
||||||
|
sudo pacman -S --needed --noconfirm $(LINT_DEPS) 2>/dev/null || true
|
||||||
|
@echo "==> Done. Launch nvim to auto-install plugins."
|
||||||
|
|
||||||
|
check:
|
||||||
|
@echo "==> Checking dependencies..."
|
||||||
|
@missing=0; \
|
||||||
|
for dep in $(ALL_DEPS); do \
|
||||||
|
if command -v $$dep >/dev/null 2>&1; then \
|
||||||
|
echo " [OK] $$dep"; \
|
||||||
|
else \
|
||||||
|
echo " [MISSING] $$dep"; \
|
||||||
|
missing=1; \
|
||||||
|
fi; \
|
||||||
|
done; \
|
||||||
|
if [ $$missing -eq 0 ]; then echo "==> All dependencies installed."; \
|
||||||
|
else echo "==> Run 'make install' to install missing deps."; fi
|
||||||
|
|
||||||
|
clean:
|
||||||
|
@echo "==> This removes Neovim's local data (plugins, cache). Use with caution."
|
||||||
|
@echo " Run: rm -rf ~/.local/share/nvim ~/.local/state/nvim ~/.cache/nvim"
|
||||||
|
|
||||||
|
help:
|
||||||
|
@echo "Targets:"
|
||||||
|
@echo " make install Install all system dependencies via pacman"
|
||||||
|
@echo " make check Check which dependencies are installed"
|
||||||
|
@echo " make clean Instructions for wiping Neovim data"
|
||||||
2
init.lua
2
init.lua
|
|
@ -285,7 +285,7 @@ do
|
||||||
require 'kickstart.plugins.treesitter'
|
require 'kickstart.plugins.treesitter'
|
||||||
|
|
||||||
-- Optional plugins (uncomment to enable)
|
-- Optional plugins (uncomment to enable)
|
||||||
require 'kickstart.plugins.neo-tree'
|
-- require 'kickstart.plugins.neo-tree'
|
||||||
require 'kickstart.plugins.lint'
|
require 'kickstart.plugins.lint'
|
||||||
-- require 'kickstart.plugins.debug'
|
-- require 'kickstart.plugins.debug'
|
||||||
-- require 'kickstart.plugins.autopairs'
|
-- require 'kickstart.plugins.autopairs'
|
||||||
|
|
|
||||||
|
|
@ -1,133 +0,0 @@
|
||||||
-- Neo-tree is a Neovim plugin to browse the file system
|
|
||||||
-- https://github.com/nvim-neo-tree/neo-tree.nvim
|
|
||||||
|
|
||||||
local neo_tree_spec = {
|
|
||||||
src = 'https://github.com/nvim-neo-tree/neo-tree.nvim',
|
|
||||||
version = vim.version.range '*',
|
|
||||||
dependencies = {
|
|
||||||
'nvim-lua/plenary.nvim',
|
|
||||||
'MunifTanjim/nui.nvim',
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
vim.pack.add { neo_tree_spec }
|
|
||||||
|
|
||||||
require('neo-tree').setup {
|
|
||||||
-- Show file explorer by default on NeoTree open
|
|
||||||
default_file_explorer = true,
|
|
||||||
|
|
||||||
-- Components which are displayed in the neo-tree window
|
|
||||||
components = {
|
|
||||||
'file_icons', -- File icons
|
|
||||||
'filename', -- File names
|
|
||||||
'modified', -- Modified file indicators
|
|
||||||
'git_status', -- Git status (when available via gitsigns)
|
|
||||||
'group_empty', -- Empty folder markers
|
|
||||||
'buffers_indicator' -- Buffer indicator icons
|
|
||||||
},
|
|
||||||
|
|
||||||
window = {
|
|
||||||
position = 'left', -- Position: left | right | bottom | top
|
|
||||||
width = 35, -- Width of the neo-tree window
|
|
||||||
close_if_last_window = true, -- Close neo-tree if it's the only window
|
|
||||||
float = {
|
|
||||||
enabled = true, -- Enable floating windows (for file creation)
|
|
||||||
padding = 2, -- Padding around floating windows
|
|
||||||
border = 'single', -- Border style
|
|
||||||
position = '50%', -- Position: 50% center
|
|
||||||
size = {
|
|
||||||
width = '50%', -- Width percentage of floating window
|
|
||||||
height = '80%' -- Height percentage of floating window
|
|
||||||
}
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
-- Configuration for filesystem source (files, folders)
|
|
||||||
filesystem = {
|
|
||||||
hijack_netrw_behavior = "disabled", -- Don't auto-open on `nvim .`
|
|
||||||
filtered_items = {
|
|
||||||
visibility = 'all', -- Show: all | visible_filtered | filtered
|
|
||||||
hide_dotfiles = false, -- Hide files starting with .
|
|
||||||
hide_gitignored = false, -- Hide git-ignored files
|
|
||||||
always_show_path = true, -- Always show file paths in the tree view
|
|
||||||
always_show_root = true -- Always show root directory when entering it
|
|
||||||
},
|
|
||||||
|
|
||||||
default_component_config = {
|
|
||||||
indent_markers = {
|
|
||||||
enable = true,
|
|
||||||
highlight_groups = {
|
|
||||||
folder_open = function(_, item_data)
|
|
||||||
local group_name = 'NeoTreeIndentMarker'
|
|
||||||
if item_data.item.type == 'directory' then
|
|
||||||
return group_name .. '.open'
|
|
||||||
end
|
|
||||||
return group_name .. '.closed'
|
|
||||||
end,
|
|
||||||
folder_closed = function(_, item_data)
|
|
||||||
local group_name = 'NeoTreeIndentMarker'
|
|
||||||
if item_data.item.type == 'directory' then
|
|
||||||
return group_name .. '.closed'
|
|
||||||
end
|
|
||||||
return group_name .. '.open'
|
|
||||||
end,
|
|
||||||
default = 'NeoTreeIndentMarker'
|
|
||||||
},
|
|
||||||
},
|
|
||||||
icons = {
|
|
||||||
folder_open = '',
|
|
||||||
folder_closed = '',
|
|
||||||
default = '', -- empty string for non-folder items
|
|
||||||
git = {
|
|
||||||
modified = '↗︎', -- Git modified file icon
|
|
||||||
unstaged = '✗', -- Git unstaged changes
|
|
||||||
staged = '↙︎', -- Git staged changes
|
|
||||||
ignored = '↖︎' -- Git ignored file
|
|
||||||
}
|
|
||||||
},
|
|
||||||
indent_guides = true, -- Show indentation guides for tree structure
|
|
||||||
},
|
|
||||||
|
|
||||||
use_default_document_colors = false,
|
|
||||||
auto_clean_after_buffer_close = true, -- Automatically clean up after closing files
|
|
||||||
},
|
|
||||||
|
|
||||||
buffers = {
|
|
||||||
show_unloaded = true, -- Show unloaded buffers in the tree
|
|
||||||
mapped_names = true, -- Use mapped names for buffer icons/names
|
|
||||||
get_buffer_icon = function(buffer)
|
|
||||||
if vim.bo[buffer].modified then return '✹' end
|
|
||||||
if vim.bo[buffer].readonly then return '📖' end
|
|
||||||
if vim.bo[buffer].filetype == 'NERDTree' then return '' end
|
|
||||||
return ''
|
|
||||||
end,
|
|
||||||
get_buffer_name = function(buffer)
|
|
||||||
local bufname = vim.api.nvim_buf_get_name(buffer)
|
|
||||||
-- Get short path by removing prefix up to first slash
|
|
||||||
if bufname:find('/') then
|
|
||||||
return bufname:gsub('.*(%p)[^-]*-', '')
|
|
||||||
end
|
|
||||||
return bufname
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
|
|
||||||
git_status = {
|
|
||||||
use_icons_for_git_status = true,
|
|
||||||
icons = {
|
|
||||||
unstaged_changes = { symbol = '✗', color = 'red' },
|
|
||||||
staged_changes = { symbol = '↙︎', color = 'green' },
|
|
||||||
ignored_files = { symbol = '↖︎', color = 'gray' }
|
|
||||||
},
|
|
||||||
file_icons = {
|
|
||||||
modified = 'M',
|
|
||||||
added = '+',
|
|
||||||
deleted = 'D',
|
|
||||||
ignored = 'i'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
-- Add convenient mappings for neo-tree using which-key
|
|
||||||
vim.keymap.set('n', '<leader>ff', ':Neotree filesystem toggle<CR>', { desc = 'Toggle file explorer' })
|
|
||||||
vim.keymap.set('n', '<leader>fb', ':Neotree buffers toggle<CR>', { desc = 'Toggle buffer explorer' })
|
|
||||||
vim.keymap.set('n', '<leader>fF', ':Neotree float open<CR>', { desc = 'Open floating window' })
|
|
||||||
Loading…
Reference in New Issue