diff --git a/README.md b/README.md index b2621099..05403371 100644 --- a/README.md +++ b/README.md @@ -1,52 +1,72 @@ # Neovim Development Environment -A highly opinionated, single-file Neovim configuration built for performance, transparency, and a terminal-native workflow. +A single-file Neovim configuration forked from Kickstart.nvim, tuned for infrastructure and backend development. ## Philosophy -This configuration is intentionally streamlined. It avoids the bloat of heavy distributions in favor of a clear, maintainable `init.lua` that acts as its own documentation. - -* **Built for Infrastructure & Backend:** Tuned specifically for a DevOps engineering workflow, with deep integrations for Go, Terraform, Bicep, and bash scripting. -* **Terminal-Native:** Optimized for fast, keyboard-driven navigation. No unnecessary GUI abstractions. -* **Radical Transparency:** Every line of code is meant to be understood. The configuration is a foundation, ready to be scaled or refactored as tooling requirements evolve. +- **Built for DevOps:** Deep integrations for Go, Terraform/HCL, Bicep, PowerShell, Ansible, Jinja, and Bash. +- **vim.pack native:** Uses Neovim 0.12+'s built-in `vim.pack` plugin manager — no external plugin manager needed. +- **Terminal-native:** Keyboard-driven. No GUI fluff. +- **Modular:** Each plugin lives in its own file under `lua/kickstart/plugins/`. Enable or disable by commenting a single `require` in Section 10 of `init.lua`. ## Prerequisites -This setup expects a modern Unix environment. It is primarily developed and tested on Arch Linux. - -Ensure you have the following system dependencies installed so tools like Telescope and Treesitter compile correctly: - +Arch Linux: ```bash sudo pacman -S --needed neovim gcc make git ripgrep fd tree-sitter-cli unzip xclip ``` +Optional but recommended: +```bash +sudo pacman -S --needed shellcheck golangci-lint # for linting +``` + ## Installation -**1. Prepare the Environment** -Back up any existing configuration and clear the local share directory to avoid plugin conflicts. ```bash +# Backup existing config mv ~/.config/nvim ~/.config/nvim.bak rm -rf ~/.local/share/nvim + +# Clone and bootstrap +git clone https://github.com//nvim.git ~/.config/nvim +nvim # Plugins auto-install on first run ``` -**2. Clone the Repository** -```bash -git clone https://github.com/YOUR_GITHUB_USERNAME/kickstart.nvim.git ~/.config/nvim -``` +## Core Stack -**3. Bootstrap** -Launch Neovim. The package manager will automatically pull and compile all plugins on the first run. -```bash -nvim -``` +| Category | Tooling | +|---|---| +| **LSP** | gopls, terraformls, ansiblels, jinja_lsp, powershell_es, pyright, bicep-lsp, lua_ls | +| **Autocomplete** | blink.cmp + LuaSnip | +| **Fuzzy Finder** | Telescope.nvim (ripgrep + fd + fzf-native) | +| **Parsing** | Treesitter (auto-installs parsers on demand) | +| **Formatting** | conform.nvim — autoformat on save for go, hcl, ps1, lua; external hclfmt for HCL | +| **Linting** | nvim-lint — shellcheck (bash/sh/zsh), golangci-lint (Go), markdownlint (markdown) | +| **Git** | gitsigns.nvim — hunk staging, blame, diff, text objects | +| **File Tree** | neo-tree.nvim — toggle with `ff` | +| **Debug** | nvim-dap + dap-ui + dap-go (commented out by default) | -## Core Stack & Integrations +## Custom Keymaps -* **LSP & Linting:** Native Neovim LSP setup configured for `gopls`, `terraform-ls`, and `bicep-lsp`. -* **Fuzzy Finding:** Telescope.nvim powered by `ripgrep` and `fd` for instant project-wide navigation. -* **Parsing:** Treesitter for high-performance syntax highlighting and structural code manipulation. +| Key | Action | +|---|---| +| `` | Save file (insert + normal mode) | +| `` / `` | Scroll up/down | +| `` | Navigate splits | +| `ff` | Toggle neo-tree file explorer | +| `fb` | Toggle neo-tree buffer explorer | +| `sf` | Telescope find files | +| `sg` | Telescope live grep | +| `f` | Format buffer | +| `hs` | Stage git hunk | +| `hr` | Reset git hunk | +| `tb` | Toggle git blame | -## Management & Updates +## Management -* **Inspect State:** Run `:lua vim.pack.update(nil, { offline = true })` -* **Apply Updates:** Run `:lua vim.pack.update()` (`:write` to apply, `:quit` to cancel) +- **Check plugin status:** `:lua vim.pack.update(nil, { offline = true })` +- **Update plugins:** `:lua vim.pack.update()` (`:write` to apply, `:quit` to cancel) +- **Health check:** `:checkhealth kickstart` +- **Add a plugin:** Create `lua/kickstart/plugins/.lua`, add `require 'kickstart.plugins.'` in init.lua Section 10 +- **Disable a plugin:** Comment its `require` in init.lua Section 10 diff --git a/lua/kickstart/plugins/lint.lua b/lua/kickstart/plugins/lint.lua index d6305445..f1aa1c10 100644 --- a/lua/kickstart/plugins/lint.lua +++ b/lua/kickstart/plugins/lint.lua @@ -1,53 +1,26 @@ --- Linting +-- Linting: static analysis that catches logic bugs, unused vars, security issues. +-- Different from formatting: linting finds problems; formatting fixes appearance. +-- Runs on BufEnter, BufWritePost, and InsertLeave for modifiable buffers. +local gh = require('kickstart.util').gh -vim.pack.add { 'https://github.com/mfussenegger/nvim-lint' } +vim.pack.add { gh 'mfussenegger/nvim-lint' } local lint = require 'lint' + lint.linters_by_ft = { - markdown = { 'markdownlint' }, -- Make sure to install `markdownlint` via mason / npm + markdown = { 'markdownlint' }, + sh = { 'shellcheck' }, + bash = { 'shellcheck' }, + zsh = { 'shellcheck' }, + go = { 'golangcilint' }, } --- To allow other plugins to add linters to require('lint').linters_by_ft, --- instead set linters_by_ft like this: --- lint.linters_by_ft = lint.linters_by_ft or {} --- lint.linters_by_ft['markdown'] = { 'markdownlint' } --- --- However, note that this will enable a set of default linters, --- which will cause errors unless these tools are available: --- { --- clojure = { "clj-kondo" }, --- dockerfile = { "hadolint" }, --- inko = { "inko" }, --- janet = { "janet" }, --- json = { "jsonlint" }, --- markdown = { "vale" }, --- rst = { "vale" }, --- ruby = { "ruby" }, --- terraform = { "tflint" }, --- text = { "vale" } --- } --- --- You can disable the default linters by setting their filetypes to nil: --- lint.linters_by_ft['clojure'] = nil --- lint.linters_by_ft['dockerfile'] = nil --- lint.linters_by_ft['inko'] = nil --- lint.linters_by_ft['janet'] = nil --- lint.linters_by_ft['json'] = nil --- lint.linters_by_ft['markdown'] = nil --- lint.linters_by_ft['rst'] = nil --- lint.linters_by_ft['ruby'] = nil --- lint.linters_by_ft['terraform'] = nil --- lint.linters_by_ft['text'] = nil - --- Create autocommand which carries out the actual linting --- on the specified events. local lint_augroup = vim.api.nvim_create_augroup('lint', { clear = true }) vim.api.nvim_create_autocmd({ 'BufEnter', 'BufWritePost', 'InsertLeave' }, { group = lint_augroup, callback = function() - -- Only run the linter in buffers that you can modify in order to - -- avoid superfluous noise, notably within the handy LSP pop-ups that - -- describe the hovered symbol using Markdown. - if vim.bo.modifiable then lint.try_lint() end + if vim.bo.modifiable then + lint.try_lint() + end end, }) diff --git a/lua/kickstart/plugins/neo-tree.lua b/lua/kickstart/plugins/neo-tree.lua index 439fcba1..aa8415d4 100644 --- a/lua/kickstart/plugins/neo-tree.lua +++ b/lua/kickstart/plugins/neo-tree.lua @@ -44,6 +44,7 @@ require('neo-tree').setup { -- 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 .