From c8e56a1859c1444eae9ccb9b7e1798b5f1b676a0 Mon Sep 17 00:00:00 2001 From: Bryan Ramos Date: Mon, 9 Mar 2026 00:36:55 -0400 Subject: [PATCH] Add README and sync mason_ensure_installed with NixOS extraPackages --- README.md | 62 +++++++++++++++++++++++++++++++++++++++++++++ lua/plugins/lsp.lua | 7 ++++- 2 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..9e6fd93 --- /dev/null +++ b/README.md @@ -0,0 +1,62 @@ +# Neovim Configuration + +Portable Neovim configuration using lazy.nvim and native LSP (Neovim 0.11+). + +## Installation + +### Standalone (any system) +```bash +git clone git@github.com:itme-brain/nvim.git ~/.config/nvim +``` + +### As part of NixOS config +```bash +git clone --recurse-submodules git@github.com:itme-brain/nixos.git +``` + +## Features + +- **Native LSP** (`vim.lsp.config`) - no manual server list needed +- **Smart LSP picker** (`css`) - auto-detects installed servers for current filetype +- **Portable** - works on NixOS (LSPs via extraPackages) or any system (LSPs via Mason) +- **Mason** - auto-disabled on NixOS, auto-installs essentials elsewhere + +## LSP Setup + +On NixOS, LSPs come from: +- `neovim.extraPackages` (global essentials) +- Project `devShell` (project-specific) + +On other systems, Mason installs: `lua_ls`, `bashls`, `jsonls` + +The smart picker (`css`) scans all lspconfig servers and shows only those with binaries installed. + +## Key Bindings + +| Key | Action | +|-----|--------| +| `css` | Start LSP (smart picker) | +| `csx` | Stop LSP | +| `csr` | Restart LSP | +| `cf` | Format code | +| `ca` | Code action | +| `cr` | Rename symbol | +| `gd` | Go to definition | +| `gr` | Find references | +| `e` | Toggle file explorer | +| `bd` | Delete buffer | +| `/` | Live grep | +| `ff` | Find files | + +## Plugins + +- **lazy.nvim** - plugin manager +- **nvim-lspconfig** - LSP configurations +- **nvim-cmp** - completion +- **telescope.nvim** - fuzzy finder +- **nvim-treesitter** - syntax highlighting +- **neo-tree.nvim** - file explorer +- **gitsigns.nvim** - git integration +- **lualine.nvim** - statusline +- **bufferline.nvim** - buffer tabs +- **which-key.nvim** - keybinding hints diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua index be26786..ee96ed4 100644 --- a/lua/plugins/lsp.lua +++ b/lua/plugins/lsp.lua @@ -8,9 +8,14 @@ local is_nixos = vim.fn.filereadable("/etc/NIXOS") == 1 -- On NixOS, install these via extraPackages or per-project devShells local mason_ensure_installed = { "lua_ls", -- Neovim config - "nil_ls", -- Nix + "nil_ls", -- Nix (nixd not available in Mason) "bashls", -- Shell scripts "jsonls", -- JSON configs + "html", -- HTML + "cssls", -- CSS + "marksman", -- Markdown + "taplo", -- TOML + "yamlls", -- YAML } return {