From deee1c38356f582c19ad25a1f51561c7257f9840 Mon Sep 17 00:00:00 2001 From: Harivansh Rathi Date: Fri, 20 Feb 2026 22:38:08 -0500 Subject: [PATCH] config --- README.md | 66 --------------- doc/config.txt | 215 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 215 insertions(+), 66 deletions(-) delete mode 100644 README.md create mode 100644 doc/config.txt diff --git a/README.md b/README.md deleted file mode 100644 index 7f015e4..0000000 --- a/README.md +++ /dev/null @@ -1,66 +0,0 @@ -# nvim - -## Installation - -**Default** - lightweight, no LSP, no completion: -```bash -curl -fsSL https://raw.githubusercontent.com/harivansh-afk/nvim/main/install.sh | bash -``` - -**Full install** - includes LSP + Supermaven: -```bash -curl -fsSL https://raw.githubusercontent.com/harivansh-afk/nvim/main/install.sh | bash -s -- --bells-and-whistles -``` - -Other options: -```bash ---skip-nvim # Config only (skip nvim install) ---skip-config # Nvim only (skip config install) ---no-path # Don't modify shell rc files -``` - -## Repo tree - -```text -. -├── init.lua -├── install.sh -├── lazy-lock.json -├── lua -│ ├── chadrc.lua -│ └── plugins -│ ├── arrow.lua -│ ├── autopairs.lua -│ ├── comment.lua -│ ├── dashboard.lua -│ ├── flash.lua -│ ├── git.lua -│ ├── gitsigns.lua -│ ├── gutentags.lua -│ ├── lsp.lua -│ ├── nvchad.lua -│ ├── telescope.lua -│ ├── treesitter.lua -│ └── which-key.lua -└── nvim_cheatsheet.md -``` - -## Plugins - -- `folke/lazy.nvim`: plugin manager. -- `nvchad/base46`: colors/theme engine. -- `nvchad/ui`: statusline/tabline/UI pieces. -- `nvim-telescope/telescope.nvim`: fuzzy find + grep. -- `nvim-treesitter/nvim-treesitter`: better syntax highlight/indent. -- `neovim/nvim-lspconfig` + `williamboman/mason.nvim`: LSP + install servers. -- `stevearc/oil.nvim`: file explorer. -- `nvimdev/dashboard-nvim`: startup dashboard. -- `folke/which-key.nvim`: keybind hint popup. -- `numToStr/Comment.nvim`: quick commenting. -- `windwp/nvim-autopairs`: auto-close brackets/quotes. -- `folke/flash.nvim`: fast motions/jumps. -- `lewis6991/gitsigns.nvim`: git hunks in-buffer. -- `NeogitOrg/neogit` + `sindrets/diffview.nvim`: git UI + diffs/history. -- `ludovicchabant/vim-gutentags`: ctags-based fallback navigation. -- `supermaven-inc/supermaven-nvim`: inline AI suggestions. -- `otavioschwanck/arrow.nvim`: quick file marks/jumps. diff --git a/doc/config.txt b/doc/config.txt new file mode 100644 index 0000000..d1d0037 --- /dev/null +++ b/doc/config.txt @@ -0,0 +1,215 @@ +*config.txt* hari's nvim configuration + +CONTENTS *config-contents* + + 1. Overview .............. |config-overview| + 2. Installation .......... |config-install| + 3. Structure ............. |config-structure| + 4. Plugins ............... |config-plugins| + 5. Keymaps ............... |config-keymaps| + 6. LSP ................... |config-lsp| + +============================================================================== +1. OVERVIEW *config-overview* + +Neovim config built on lazy.nvim. All plugins load at startup (no +lazy-loading). Gruvbox hard contrast with transparent background. + +Global helpers defined in init.lua: +>lua + map(mode, lhs, rhs, opts) -- vim.keymap.set wrapper, silent by default + bmap(mode, lhs, rhs, opts) -- same but scoped to current buffer +< + +============================================================================== +2. INSTALLATION *config-install* + +Default (no LSP, no completion): >bash + curl -fsSL https://raw.githubusercontent.com/harivansh-afk/nvim/main/install.sh | bash +< +Full install (LSP + Supermaven): >bash + curl -fsSL https://raw.githubusercontent.com/harivansh-afk/nvim/main/install.sh | bash -s -- --bells-and-whistles +< +Options: > + --skip-nvim Config only, skip nvim install + --skip-config Nvim only, skip config install + --no-path Don't modify shell rc files +< + +============================================================================== +3. STRUCTURE *config-structure* + +> + init.lua Leader, helpers, lazy bootstrap + plugin/ + options.lua Vim options + keymaps.lua Global keymaps + autocmds.lua Autocommands + lua/ + config/ + lsp.lua Shared on_attach and capabilities + lsp/ + lua_ls.lua Per-server settings + pyright.lua + rust_analyzer.lua + ts_ls.lua + plugins/ + editor.lua Autopairs, flash, surround, ufo, supermaven + fzf.lua Fzf-lua fuzzy finder + git.lua Fugitive, gitsigns, diffs.nvim + lsp.lua nvim-lspconfig + oil.lua Oil file explorer + oil-git + treesitter.lua Treesitter + textobjects + ui.lua Gruvbox, lualine, nonicons + after/ + plugin/ + lsp.lua LSP server enable loop + ftplugin/ + fugitive.lua Tab remapped to = in fugitive + go.lua Hard tabs, tabstop 4 + lua.lua Tabstop 4, shiftwidth 4 + markdown.lua Wrap, textwidth 80, conceallevel 2 + python.lua makeprg = python % + rust.lua makeprg = cargo run +< + +============================================================================== +4. PLUGINS *config-plugins* + +All plugins load at startup via `defaults = { lazy = false }`. + + Plugin Purpose ~ + ellisonleao/gruvbox.nvim Colorscheme (hard, transparent) + nvim-lualine/lualine.nvim Statusline + barrettruth/nonicons.nvim File icons + nvim-tree/nvim-web-devicons Icon provider + + ibhagwan/fzf-lua Fuzzy finder + stevearc/oil.nvim File explorer + malewicz1337/oil-git.nvim Git status in oil + + neovim/nvim-lspconfig LSP configuration + nvim-treesitter/nvim-treesitter Syntax highlighting + nvim-treesitter-textobjects Select/move by treesitter nodes + + tpope/vim-fugitive Git commands + lewis6991/gitsigns.nvim Git gutter signs + barrettruth/diffs.nvim Diff highlighting + + windwp/nvim-autopairs Auto-close brackets + kylechui/nvim-surround Surround operations + folke/flash.nvim Jump/search motions + kevinhwang91/nvim-ufo Code folding + supermaven-inc/supermaven-nvim Inline AI suggestions + +============================================================================== +5. KEYMAPS *config-keymaps* + +Leader is . + +GENERAL ~ + w Save + q Quit + t Toggle wrap + Clear search highlight + J Join lines, keep cursor + x (visual) Delete without yanking + p (visual) Paste without yanking + +BUFFERS ~ + Next buffer + Previous buffer + x Close buffer + b New buffer + +WINDOWS ~ + Navigate windows + +GIT ~ + Git status fullscreen + gg Git status fullscreen + gc Git commit + gp Git push + gl Git pull + gb Git blame + gd Vertical diff split + gr Git checkout file + gw Git add file + go Open in GitHub + ghs Stage hunk + ghr Reset hunk + ghp Preview hunk + gB Toggle line blame + ]g / [g Next/prev hunk + +FZF ~ + Find files (git-aware) + ff Files + fg Live grep + fb Buffers + fh Help tags + fr Resume last search + fo Recent files + fc Commands + fk Keymaps + f/ Search history + f: Command history + fe Config files + gq Quickfix + gl Loclist + GB Git branches + Gc Git commits + Gs Git status + Gp GitHub PRs + Gi GitHub issues + +OIL ~ + - Open oil + e Open oil + +FLASH ~ + s Flash jump + S Flash treesitter + r (operator) Remote flash + R (operator/vis) Treesitter search + +FOLDS ~ + zR Open all folds + zM Close all folds + +TREESITTER TEXTOBJECTS ~ + af/if Function outer/inner + ac/ic Class outer/inner + aa/ia Parameter outer/inner + ai/ii Conditional outer/inner + al/il Loop outer/inner + ab/ib Block outer/inner + ]f / [f Next/prev function + ]c / [c Next/prev class + ]a / [a Next/prev parameter + sn Swap parameter next + sp Swap parameter prev + +============================================================================== +6. LSP *config-lsp* + +Servers are configured in `lua/lsp/` and enabled in `after/plugin/lsp.lua`. +Adding a new server: create `lua/lsp/.lua` returning a settings table, +then add the name to the list in `after/plugin/lsp.lua`. + +Enabled servers: lua_ls, pyright, ts_ls, rust_analyzer, gopls, clangd, +bashls, jsonls, html, cssls. + +Buffer keymaps (set on LspAttach): > + gd Go to definition + gD Go to declaration + Go to definition + gi Go to implementation + gr Go to references + K Hover documentation + rn Rename symbol + ca Code action + f Format buffer +< + + vim:tw=78:ts=8:ft=help:norl: