diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..dd84ea7 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,38 @@ +--- +name: Bug report +about: Create a report to help us improve +title: '' +labels: '' +assignees: '' + +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Steps to reproduce the behavior: +1. Go to '...' +2. Click on '....' +3. Scroll down to '....' +4. See error + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Screenshots** +If applicable, add screenshots to help explain your problem. + +**Desktop (please complete the following information):** + - OS: [e.g. iOS] + - Browser [e.g. chrome, safari] + - Version [e.g. 22] + +**Smartphone (please complete the following information):** + - Device: [e.g. iPhone6] + - OS: [e.g. iOS8.1] + - Browser [e.g. stock browser, safari] + - Version [e.g. 22] + +**Additional context** +Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..bbcbbe7 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,20 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: '' +labels: '' +assignees: '' + +--- + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. diff --git a/.gitignore b/.gitignore index e43b0f9..ee313bd 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,16 @@ +# macOS .DS_Store + +# Local, machine-specific overrides (identity, extra plugins) โ€” not tracked +lua/local.lua +local.lua + +# Wallpaper-derived palette, regenerated by sketchybar/theme/generate.sh โ€” +# machine-specific, not meaningful to anyone else who clones this repo. +# colors/wallpaper.lua falls back to colors_generated_fallback.lua when +# this is absent, so nvim still works fine without it. +lua/colors_generated.lua + +# Runtime junk if ever generated in-tree +*.log +tags diff --git a/.luarc.json b/.luarc.json new file mode 100644 index 0000000..e924e43 --- /dev/null +++ b/.luarc.json @@ -0,0 +1,5 @@ +{ + "diagnostics.disable": [ + "undefined-field" + ] +} \ No newline at end of file diff --git "a/Icon\r" "b/Icon\r" deleted file mode 100644 index e69de29..0000000 diff --git a/README.md b/README.md index 942706a..30f19e2 100644 --- a/README.md +++ b/README.md @@ -1,615 +1,235 @@ -# Neovim Configuration +
-This repository contains my Neovim setup, optimized for development with rich features like LSP support, auto-completion, Git integration, file exploration, and more. The configuration leverages `lazy.nvim` for efficient plugin management and `mason.nvim` for managing language servers. Below is an overview of the features, plugin list, installation instructions, and specific plugin configurations. + +Nvim-config Banner -## Features + +Typing SVG -1. **Plugin Management** +
- - **Lazy Loading and Performance**: Uses `lazy.nvim` to efficiently load plugins only when required, speeding up startup time and optimizing resource usage. + -2. **LSP and Autocompletion** +[![Neovim](https://img.shields.io/badge/Neovim-0.11+-57A143?style=for-the-badge&logo=neovim&logoColor=white&labelColor=0D1117)](https://neovim.io) +[![Lua](https://img.shields.io/badge/Lua-5.1+-2C2D72?style=for-the-badge&logo=lua&logoColor=white&labelColor=0D1117)](https://www.lua.org) +[![lazy.nvim](https://img.shields.io/badge/lazy.nvim-plugin_manager-7AA2F7?style=for-the-badge&labelColor=0D1117)](https://github.com/folke/lazy.nvim) +[![License](https://img.shields.io/badge/License-MIT-FF69B4?style=for-the-badge&labelColor=0D1117)](./LICENSE) - - **LSP Support**: Powered by `mason.nvim` and `nvim-lspconfig`, providing autocompletion, diagnostics, and jump-to-definition for multiple programming languages. - - **Autocompletion with Snippets**: `nvim-cmp` offers intelligent autocompletion, integrated with `LuaSnip` and sources like buffer, path, and LSP. - - **AI Code Suggestions**: `copilot.vim` and `ChatGPT.nvim` provide AI-driven autocompletion and code suggestions. +
-3. **Code Navigation and Search** + + - - **Fuzzy Finder**: `telescope.nvim` enables quick file, buffer, and symbol searching, with additional media file search via `telescope-media-files.nvim`. - - **File Explorer**: `nvim-tree.lua` provides a navigable file tree with icons for files and folders. - - **Semantic Highlighting**: `semantic-highlight.vim` adds semantic code highlighting, enhancing code readability and structure understanding. - - **Tag Navigation**: `tagbar` plugin offers a sidebar for navigating functions, classes, and other tags in your code. + +
+ Documentation -4. **Git Integration** +| | | | +| ------------------------------------------- | ------------------------------------------------ | ------------------------------------------- | +| ๐Ÿš€ [**Features**](docs/FEATURES.md) | โŒจ๏ธ [**Key Mappings**](docs/KEYMAPS.md) | ๐Ÿงฉ [**Plugin Reference**](docs/PLUGINS.md) | +| ๐Ÿ“ฆ [**Requirements**](docs/REQUIREMENTS.md) | ๐Ÿ› ๏ธ [**Install Guide (per-OS)**](docs/INSTALL.md) | ๐Ÿ—๏ธ [**Architecture**](docs/ARCHITECTURE.md) | - - **Git Blame**: `git-blame.nvim` displays blame information inline, showing who last modified each line. - - **Git Diff and Review**: `diffview.nvim` provides a visual diff of changes and review capabilities within Neovim. - - **Conflict Management**: `git-conflict.nvim` helps manage and resolve Git merge conflicts directly in Neovim. - - **LazyGit Integration**: `lazygit.nvim` provides an interface to use LazyGit directly within Neovim. +
-5. **Editing and Productivity Enhancements** + + - - **Commenting**: `Comment.nvim` allows easy toggling of comments in code. - - **Auto-Save**: `auto-save.nvim` automatically saves files when they are modified. - - **Auto Pairs**: `nvim-autopairs` automatically closes brackets and quotes as you type. - - **Indentation Guides**: `indent-blankline.nvim` shows indentation levels for better code structure visualization. - - **Todo Management**: `todo-comments.nvim` highlights and organizes TODO comments for easy tracking of tasks. - - **Session Management**: `impatient.nvim` caches plugins for faster startup times. + +
+ What is this +
-6. **UI and Aesthetic Customization** +
- - **Status Line**: `lualine.nvim` provides a customizable and minimal status line. - - **Icons**: `nvim-web-devicons` adds file-type icons, enhancing the look of Neovim's interface. - - **Color Schemes**: Includes themes like `onedark.nvim`, `sonokai`, and `2077.nvim` for aesthetic customization. - - **Dashboard**: `dashboard-nvim` provides a start screen with quick access to frequently used files and sessions. - - **Notifications**: `nvim-notify` manages pop-up notifications with customizable visuals. +A single Neovim config that stays fast across **28 language servers** without turning into config soup. One central file โ€” [`lua/lsp/servers.lua`](lua/lsp/servers.lua) โ€” declares every server and its settings; Mason installs the binaries; native `vim.lsp.config`/`vim.lsp.enable` wires them up, with no `nvim-lspconfig` server tables duplicating that work. Formatting, Treesitter parsers, and colorschemes follow the same one-file-per-concern pattern. Full breakdown in [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md). -7. **Terminal Integration** + + - - **Toggleable Terminal**: `toggleterm.nvim` adds a terminal inside Neovim that can be toggled on and off with a keybind. + +
+ Tech Stack +
-8. **Specialized Language Support** +
- - **LaTeX Support**: `vimtex` provides rich LaTeX support for compiling and navigating LaTeX projects. - - **Matlab Support**: `vim-matlab` offers Matlab language support, including syntax highlighting and file structure navigation. - - **JavaScript JSX Enhancements**: `vim-jsx-pretty` improves JSX syntax highlighting for JavaScript projects. +
-9. **Other Utilities** - - **Snippet Management**: `vim-vsnip` manages code snippets for quick insertion. - - **Media File Search**: `telescope-media-files.nvim` allows searching within media files. - - **Which Key**: `which-key.nvim` shows possible keybindings, improving discoverability of shortcuts. +### Core -## Installation + + -### Prerequisites - -#### Neovim - -Ensure you have **Neovim v0.5+** installed. You can install or update Neovim with the following commands based on your system: - -- **macOS (Homebrew)** - ```bash - brew install neovim - ``` -- **Ubuntu (APT)** - ```bash - sudo apt update - sudo apt install neovim - ``` -- **Windows** - - Download the latest release from the [Neovim GitHub Releases](https://github.com/neovim/neovim/releases) page. - - Extract the contents and add the `nvim` executable to your system path. - -#### Package Managers (for Dependencies) - -- **Homebrew (macOS and Linux)**: Recommended for managing dependencies and installations. - - - Install Homebrew if you havenโ€™t already: - ```bash - /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" - ``` - -- **APT (Ubuntu/Debian)** - - For Ubuntu and Debian users, most packages can be installed via APT. - -#### Additional Dependencies - -These dependencies are needed for certain features and languages supported by your Neovim setup: - -- **Java**: Required for Java development and some plugins that rely on Java runtime. - - - **macOS**: - ```bash - brew install java - ``` - - **Ubuntu**: - ```bash - sudo apt install default-jdk - ``` - - **Windows**: - - Download and install Java from [Oracleโ€™s website](https://www.oracle.com/java/technologies/javase-downloads.html) or [AdoptOpenJDK](https://adoptopenjdk.net/). - -- **Python**: Required for Python development and some plugins. - - - **macOS**: - ```bash - brew install python - ``` - - **Ubuntu**: - ```bash - sudo apt install python3 - ``` - - **Windows**: - - Download from [python.org](https://www.python.org/downloads/) and install it. - -- **SQL**: Required for SQLite database support. - - - **macOS**: - ```bash - brew install sqlite - ``` - - **Ubuntu**: - ```bash - sudo apt install sqlite3 - ``` - - **Windows**: - - Download the latest version from [sqlite.org](https://www.sqlite.org/download.html) and add it to your system path. - -- **PHP**: Required for PHP development. - - - **macOS**: - ```bash - brew install php - ``` - - **Ubuntu**: - ```bash - sudo apt install php - ``` - - **Windows**: - - Download from [php.net](https://www.php.net/downloads) and install it. - -- **Go**: Required for Go development. - - - **macOS**: - ```bash - brew install go - ``` - - **Ubuntu**: - ```bash - sudo apt install golang - ``` - - **Windows**: - - Download from [golang.org](https://golang.org/dl/). - -- **Rust**: Required for Rust development. - - - **macOS**: - ```bash - brew install rust - ``` - - **Ubuntu**: - ```bash - sudo apt install rustc - ``` - - **Windows**: - - Download and install Rust from [rust-lang.org](https://www.rust-lang.org/). - -- **Ruby**: Required for Ruby development and some plugins. - - - **macOS**: - ```bash - brew install ruby - ``` - - **Ubuntu**: - ```bash - sudo apt install ruby-full - ``` - - **Windows**: - - Download from [ruby-lang.org](https://www.ruby-lang.org/en/downloads/) and install it. - -- **Haskell**: Required for Haskell development. - - - **macOS**: - ```bash - brew install ghc cabal-install - ``` - - **Ubuntu**: - ```bash - sudo apt install ghc cabal-install - ``` - - **Windows**: - - Download from [haskell.org](https://www.haskell.org/platform/windows.html) and install it. - -- **Node.js & npm**: Required for JavaScript, TypeScript development, and many language servers. - - - **macOS**: - ```bash - brew install node - ``` - - **Ubuntu**: - ```bash - sudo apt install nodejs npm - ``` - - **Windows**: - - Download from [nodejs.org](https://nodejs.org/). - -- **LaTeX** (for `vimtex` and `latexindent` formatting): Required for LaTeX development. - - - **macOS**: - ```bash - brew install --cask mactex - ``` - - **Ubuntu**: - ```bash - sudo apt install texlive-full - ``` - - **Windows**: - - Install MiKTeX from [miktex.org](https://miktex.org/). - -- **Perl**: Required for Perl development. - - - **macOS**: - ```bash - brew install perl - ``` - - **Ubuntu**: - ```bash - sudo apt install perl - ``` - -- **Kotlin**: Required for Kotlin development. - - - **macOS**: - ```bash - brew install kotlin - ``` - - **Ubuntu**: - ```bash - sudo apt install kotlin - ``` - -- **Docker**: Required for Docker-related development. - - - **macOS**: - ```bash - brew install --cask docker - ``` - - **Ubuntu**: - ```bash - sudo apt install docker.io - ``` - - **Windows**: - - Install Docker Desktop from [docker.com](https://www.docker.com/products/docker-desktop). - -- **Git**: Necessary for version control and Git-related plugins. - - - **macOS**: - ```bash - brew install git - ``` - - **Ubuntu**: - ```bash - sudo apt install git - ``` - - **Windows**: - - Download from [git-scm.com](https://git-scm.com/download/win). - -- **LazyGit**: For a more visual Git experience within Neovim. - - - **macOS**: - ```bash - brew install lazygit - ``` - - **Ubuntu**: - ```bash - sudo add-apt-repository ppa:lazygit-team/release - sudo apt update - sudo apt install lazygit - ``` - - **Windows**: - - Download from [LazyGit Releases](https://github.com/jesseduffield/lazygit/releases). - -- **Ripgrep**: Required by Telescope for live grep functionality. - - **macOS**: - ```bash - brew install ripgrep - ``` - - **Ubuntu**: - ```bash - sudo apt install ripgrep - ``` - - **Windows**: - - Download from [Ripgrep GitHub Releases](https://github.com/BurntSushi/ripgrep/releases). - -### Language Support Requirements - -The following additional language server binaries are required for `mason.nvim` to provide support for specific programming languages. Run these commands as needed to install servers or formatters for each language. - -- **Python** - - ```bash - # Install python3 and pip if not installed - sudo apt install python3 python3-pip # Ubuntu - brew install python # macOS - - # Install Python language server - pip install 'python-lsp-server[all]' - ``` - -- **JavaScript/TypeScript** - - ```bash - npm install -g typescript typescript-language-server - ``` - -- **Go** - - ```bash - go install golang.org/x/tools/gopls@latest - ``` - -- **Rust** - - ```bash - # Install rust-analyzer - brew install rust-analyzer # macOS - sudo apt install rust-analyzer # Ubuntu - ``` - -- **LaTeX (if using `vimtex`)** - - Youโ€™ll need a LaTeX distribution installed: - - **macOS**: - ```bash - brew install --cask mactex - ``` - - **Ubuntu**: - ```bash - sudo apt install texlive-full - ``` - - **Windows**: - - Install MiKTeX from [miktex.org](https://miktex.org/). - -### Installing the Configuration - -1. **Clone the Repository** - - ```bash - git clone https://github.com/NoamFav/Nvim-config ~/.config/nvim - ``` - -2. **Open Neovim and Install Plugins** - Open Neovim and use `lazy.nvim` to install plugins: - - ```vim - :Lazy install - ``` - -3. **Verify Language Server Installation** - Run `:Mason` in Neovim to open Masonโ€™s interface. Install or update any required language servers from within Mason's menu. +
---- +### Plugin & LSP Layer -## Plugin List - -| Plugin | Description | -| ---------------------------- | ------------------------------------------------------ | -| `2077.nvim` | Cyberpunk-themed colorscheme for Neovim | -| `auto-save.nvim` | Automatically saves files when changes are detected | -| `ChatGPT.nvim` | ChatGPT integration for code suggestions and AI help | -| `cmp-buffer` | Source for buffer words in autocompletion | -| `cmp-cmdline` | Source for Neovim command-line completion | -| `cmp-nvim-lsp` | Provides LSP completion source for `nvim-cmp` | -| `cmp-path` | File path source for autocompletion | -| `cmp-vsnip` | Snippet support for `nvim-cmp` with `vim-vsnip` | -| `Comment.nvim` | Plugin for easy commenting in code | -| `copilot.vim` | GitHub Copilot integration for AI-driven suggestions | -| `dashboard-nvim` | Customizable start screen dashboard | -| `diffview.nvim` | Git diff viewer for comparing file changes | -| `git-blame.nvim` | Shows Git blame info inline | -| `git-conflict.nvim` | Helps manage and resolve Git merge conflicts | -| `gitsigns.nvim` | Shows Git changes in the sign column | -| `harpoon` | Mark and easily switch between files | -| `impatient.nvim` | Speeds up Neovim startup by caching Lua modules | -| `indent-blankline.nvim` | Adds indentation guides for better code readability | -| `lazy.nvim` | Plugin manager for lazy loading plugins | -| `lazygit.nvim` | Integration of LazyGit in Neovim | -| `lualine.nvim` | Highly customizable status line | -| `LuaSnip` | Snippet engine for Neovim | -| `nui.nvim` | UI component library for Neovim | -| `nvim-autopairs` | Automatically closes pairs like parentheses and braces | -| `nvim-cmp` | Completion engine with support for multiple sources | -| `nvim-notify` | Popup notification manager | -| `nvim-tree.lua` | File explorer with icons for file types | -| `nvim-treesitter` | Syntax highlighting and parsing with Treesitter | -| `nvim-ts-rainbow` | Rainbow parentheses and brackets in Treesitter | -| `nvim-web-devicons` | Adds icons to Neovim plugins | -| `onedark.nvim` | OneDark colorscheme for Neovim | -| `plenary.nvim` | Lua utility functions used by other plugins | -| `popup.nvim` | Popup API for Neovim plugins | -| `semantic-highlight.vim` | Provides semantic highlighting based on Treesitter | -| `sonokai` | Colorscheme inspired by Monokai | -| `tagbar` | Displays tags in a side panel for code navigation | -| `telescope-media-files.nvim` | Media files extension for Telescope | -| `telescope.nvim` | Fuzzy finder and search tool | -| `todo-comments.nvim` | Highlight TODO comments in code | -| `toggleterm.nvim` | Easily toggle between terminal windows | -| `trouble.nvim` | Pretty diagnostics and quickfix list | -| `vim-gradle` | Syntax highlighting and support for Gradle files | -| `vim-jsx-pretty` | Improved JSX/React syntax highlighting | -| `vim-matlab` | MATLAB support for syntax and indentation | -| `vim-vsnip` | Lightweight snippet plugin for Vim | -| `vimtex` | LaTeX support with syntax highlighting and compilation | -| `which-key.nvim` | Displays possible keybindings on a key press | -| `formatter.nvim` | Plugin for formatting code using external formatters | -| `lspsaga.nvim` | Light-weight UI for LSP features | -| `mason.nvim` | Manages external language servers and tools | -| `mason-lspconfig.nvim` | Integrates Mason with Neovim's LSP client | -| `mason-tool-installer.nvim` | Installs additional tools via Mason | -| `nvim-code-action-menu` | A code action menu for Neovim LSP | -| `nvim-lspconfig` | Configurations for built-in LSP client | - -For a complete list githubs, see the [Plugins Section](#full-plugin-list). + + + + ---- +
-## Key Mappings - -Key mappings are specified in `keymaps.vim` to streamline the workflow. Notable mappings include: - -### General Key Mappings - -- **`bn`**: Move to the next buffer. -- **`bp`**: Move to the previous buffer. -- **`bd`**: Delete the current buffer. -- **`tn`**: Move to the next tab. -- **`tp`**: Move to the previous tab. -- **`to`**: Open a new tab. -- **`tc`**: Close the current tab. -- **`pd`**: Page Down. -- **`pu`**: Page Up. -- **`ff`**: Find files using Telescope. -- **`fe`**: Open Telescope file browser. -- **`fd`**: Open diagnostics using Telescope. -- **`gf`**: Find Git files with Telescope. -- **`gs`**: Grep the current word with Telescope. -- **``**: Toggle the NvimTree file explorer. -- **`r`**: Refresh NvimTree. -- **`n`**: Find the current file in NvimTree. -- **``**: Toggle the terminal using ToggleTerm. -- **`tt`**: Toggle Tagbar view. -- **`tf`**: Toggle focus on Tagbar. - -### Git Mappings - -- **`lg`**: Open LazyGit directly. -- **`qf`**: Show quickfix list with code actions. -- **`xQ`**: Toggle the quickfix list in Trouble. - -### Diagnostic and LSP Key Mappings - -- **`dn`**: Go to the next diagnostic message. -- **`dp`**: Go to the previous diagnostic message. -- **`df`**: Format the current buffer. -- **`rn`**: Rename symbol using LSP Saga. -- **`K`**: Show hover documentation with LSP. -- **`ca`**: Open the code action menu. -- **`cl`**: Toggle LSP diagnostics on the right side using Trouble. -- **`xx`**: Toggle diagnostics view on the right. -- **`xX`**: Toggle diagnostics for the current buffer in Trouble. -- **`cs`**: Toggle symbols in Trouble. -- **`cc`**: Close Trouble diagnostics. - -### Maven Shortcuts - -- **`mm`**: Run `mvn clean install`. -- **`mp`**: Run `mvn clean package`. -- **`mc`**: Run `mvn clean`. -- **`mt`**: Run `mvn test`. -- **`me`**: Run `mvn exec:exec`. -- **`mf`**: Run JavaFX with `mvn javafx:run`. -- **`mj`**: Generate Javadoc with `mvn javadoc:javadoc`. - -### Copilot Key Mappings - -- **``**: Accept Copilot suggestion in insert mode. -- **``**: Dismiss Copilot suggestion in insert mode. - -### Telescope Mappings for Navigation - -- **`fb`**: Find buffers. -- **`fh`**: Find help tags. -- **`fg`**: Live grep for text. - -### Code Actions - -- **`ca`**: Open the code action menu with `CodeActionMenu`. -- **`qf`**: Quick fix options. -- **`rm`**: Run MATLAB script (Linux/Unix-specific setup). - -### AI-related Mappings (ChatGPT and Copilot) - -- **`ai`**: Open ChatGPT window. -- **`ac`**: Complete code with ChatGPT. -- **`ae`**: Edit with instruction in ChatGPT. - -### Buffer and Tab Navigation - -- **`bn`**: Move to the next buffer. -- **`bp`**: Move to the previous buffer. -- **`bd`**: Delete the current buffer. -- **`tn`**: Move to the next tab. -- **`tp`**: Move to the previous tab. -- **`to`**: Open a new tab. -- **`tc`**: Close the current tab. - -### Miscellaneous - -- **`s`**: Toggle semantic highlighting. -- **``**: Toggle focus on NvimTree file explorer. -- **`t`**: Toggle Tagbar focus. -- **`xx`**: Toggle diagnostics view using Trouble. - -Refer to `keymaps.vim` for additional custom mappings. +### UI & Navigation ---- + + + + + +
+ +### Languages + + + +
+ + + + + +
+ Features +
+ +
+ + + + + + +
+ +#### ๐Ÿ” Finding Things + +- **Smart picker** โ€” `Snacks.picker` for files, grep, buffers, git, LSP symbols, diagnostics, and more +- **Harpoon** โ€” pin & jump between 4 files instantly +- **Dashboard** โ€” recent files, projects, live git status + +#### ๐Ÿง  LSP & Completion + +- **28 language servers**, native `vim.lsp.config`, zero `nvim-lspconfig` boilerplate +- **blink.cmp** โ€” LSP + path + snippets + buffer + emoji + dictionary sources +- **Trouble** โ€” pinned diagnostics/symbols panes, follow-cursor +- **Lspsaga** โ€” hover docs, rename, code action menu + + + +======= + +#### ๐ŸŒ Git & Tools + +- **LazyGit**, Diffview, Gitsigns, git-blame, git-conflict โ€” all wired through Snacks/native keymaps +- **Toggleterm** โ€” floating terminal, one keystroke away +- **42 School** โ€” header stamping + Norm linting + `c_formatter_42` + +#### ๐Ÿ“š Language Extras + +- **Jupyter notebooks** โ€” Molten + image.nvim (Kitty graphics protocol) +- **LaTeX** โ€” VimTeX + latexmk, live compile +- **Go** โ€” go.nvim: run/test/coverage/struct-tags/`iferr`, all layered over `gopls` +- **C/C++** โ€” clangd inlay hints + AST view + parameter highlighting + +
+ +
+ +Full write-up, with the reasoning behind each pick, in **[docs/FEATURES.md](docs/FEATURES.md)**. + +
+ + + -## File Structure and Configuration Details + +
+ Quickstart +
-- **`init.lua`**: Main configuration file, loads plugins and settings. -- **`lua/` Directory**: Contains individual configuration files for plugins and other settings. +
-### Key Files and Their Configurations: +**Option A โ€” scripted** (macOS/Linux). Backs up any existing config, installs core deps + a Nerd Font, optionally installs language runtimes (prompted interactively, or pass `-l go,rust,python`, or `-l all`), fetches OmniSharp if you picked `dotnet`, clones, and launches: -- **`git.lua`**: Configures Git-related plugins such as `git-blame.nvim` and `diffview.nvim` for version control. -- **`gpt.lua`**: Settings for AI-based autocompletion with `copilot.vim`. -- **`latex.lua`**: Sets up LaTeX support, likely with `vimtex` for typesetting. -- **`lualine.lua`**: Customizes the Neovim statusline using `lualine.nvim`. -- **`mason.lua`**: Configures `mason.nvim` to manage LSP servers and additional tools. -- **`notifications.lua`**: Manages notifications using `nvim-notify`. -- **`nvim-cmp.lua`**: Sets up `nvim-cmp` for autocompletion with buffer, LSP, and snippet sources. -- **`nvim-tree.lua`**: Configures the file explorer (`nvim-tree.lua`). -- **`telescope.lua`**: Configures `telescope.nvim` for file and buffer search, along with live grep functionality. +```bash +curl -fsSL https://raw.githubusercontent.com/NoamFav/Nvim-config/main/scripts/install.sh | bash -s -- -l go,rust,python +# or just `... | bash` to be prompted for languages, or add -y to skip every prompt +``` + +See `scripts/install.sh --help` (or the top of the file) for every flag. + +**Option B โ€” manual**: + +```bash +# Core requirements (macOS/Homebrew shown โ€” see docs/INSTALL.md for Linux/Windows) +brew install neovim git ripgrep fd lazygit tree-sitter universal-ctags + +# Backup existing config +mv ~/.config/nvim ~/.config/nvim.bak +mv ~/.local/share/nvim ~/.local/share/nvim.bak --- -## Full Plugin List - -- [2077.nvim](https://github.com/hemangsk/2077.nvim) -- [auto-save.nvim](https://github.com/Pocco81/auto-save.nvim) -- [ChatGPT.nvim](https://github.com/jackMort/ChatGPT.nvim) -- [cmp-buffer](https://github.com/hrsh7th/cmp-buffer) -- [cmp-cmdline](https://github.com/hrsh7th/cmp-cmdline) -- [cmp-nvim-lsp](https://github.com/hrsh7th/cmp-nvim-lsp) -- [cmp-path](https://github.com/hrsh7th/cmp-path) -- [cmp-vsnip](https://github.com/hrsh7th/cmp-vsnip) -- [Comment.nvim](https://github.com/numToStr/Comment.nvim) -- [copilot.vim](https://github.com/github/copilot.vim) -- [dashboard-nvim](https://github.com/glepnir/dashboard-nvim) -- [diffview.nvim](https://github.com/sindrets/diffview.nvim) -- [git-blame.nvim](https://github.com/f-person/git-blame.nvim) -- [git-conflict.nvim](https://github.com/akinsho/git-conflict.nvim) -- [gitsigns.nvim](https://github.com/lewis6991/gitsigns.nvim) -- [harpoon](https://github.com/ThePrimeagen/harpoon) -- [impatient.nvim](https://github.com/lewis6991/impatient.nvim) -- [indent-blankline.nvim](https://github.com/lukas-reineke/indent-blankline.nvim) -- [lazy.nvim](https://github.com/folke/lazy.nvim) -- [lazygit.nvim](https://github.com/kdheepak/lazygit.nvim) -- [lualine.nvim](https://github.com/nvim-lualine/lualine.nvim) -- [LuaSnip](https://github.com/L3MON4D3/LuaSnip) -- [nui.nvim](https://github.com/MunifTanjim/nui.nvim) -- [nvim-autopairs](https://github.com/windwp/nvim-autopairs) -- [nvim-cmp](https://github.com/hrsh7th/nvim-cmp) -- [nvim-notify](https://github.com/rcarriga/nvim-notify) -- [nvim-tree.lua](https://github.com/nvim-tree/nvim-tree.lua) -- [nvim-treesitter](https://github.com/nvim-treesitter/nvim-treesitter) -- [nvim-ts-rainbow](https://github.com/p00f/nvim-ts-rainbow) -- [nvim-web-devicons](https://github.com/nvim-tree/nvim-web-devicons) -- [onedark.nvim](https://github.com/navarasu/onedark.nvim) -- [plenary.nvim](https://github.com/nvim-lua/plenary.nvim) -- [popup.nvim](https://github.com/nvim-lua/popup.nvim) -- [semantic-highlight.vim](https://github.com/thiagoalessio/semantic-highlight.vim) -- [sonokai](https://github.com/sainnhe/sonokai) -- [tagbar](https://github.com/preservim/tagbar) -- [telescope-media-files.nvim](https://github.com/nvim-telescope/telescope-media-files.nvim) -- [telescope.nvim](https://github.com/nvim-telescope/telescope.nvim) -- [todo-comments.nvim](https://github.com/folke/todo-comments.nvim) -- [toggleterm.nvim](https://github.com/akinsho/toggleterm.nvim) -- [trouble.nvim](https://github.com/folke/trouble.nvim) -- [vim-gradle](https://github.com/tfnico/vim-gradle) -- [vim-jsx-pretty](https://github.com/MaxMEllon/vim-jsx-pretty) -- [vim-matlab](https://github.com/swlkr/vim-matlab) -- [vim-vsnip](https://github.com/hrsh7th/vim-vsnip) -- [vimtex](https://github.com/lervag/vimtex) -- [which-key.nvim](https://github.com/folke/which-key.nvim) -- [formatter.nvim](https://github.com/mhartington/formatter.nvim) -- [lspsaga.nvim](https://github.com/glepnir/lspsaga.nvim) -- [mason-lspconfig.nvim](https://github.com/williamboman/mason-lspconfig.nvim) -- [mason-tool-installer.nvim](https://github.com/WhoIsSethDaniel/mason-tool-installer.nvim) -- [mason.nvim](https://github.com/williamboman/mason.nvim) -- [nvim-code-action-menu](https://github.com/weilbith/nvim-code-action-menu) -- [nvim-lspconfig](https://github.com/neovim/nvim-lspconfig) - -## License - -This configuration is licensed under the MIT License. See the LICENSE file for more details. +## Installation + +# Create the backup/swap/undo dirs lua/core/options.lua expects +mkdir -p ~/.logs/nvim/backup ~/.logs/nvim/swap ~/.logs/nvim/undo + +# Launch โ€” lazy.nvim bootstraps itself, installs plugins, +# then Mason auto-installs LSP servers + formatters +nvim +``` + +> [!TIP] +> Run `:Mason` after first launch to confirm every server installed cleanly, and `:checkhealth` to catch any missing system dependency. + +> [!NOTE] +> Only need a couple of languages? Don't install every runtime in [docs/REQUIREMENTS.md](docs/REQUIREMENTS.md) โ€” Mason only installs servers/formatters, not compilers/SDKs, so add those as you actually need them. + +> [!WARNING] > [scripts/install.sh](scripts/install.sh) covers macOS (Homebrew), Ubuntu/Debian (apt), Fedora (dnf), and Arch (pacman) โ€” no Windows/WSL path. Language runtimes it can't install cleanly (e.g. Dart/Terraform on apt, most AUR-only packages on Arch) print a warning with a link instead of silently skipping. Piping any script into `bash` runs arbitrary code with your permissions โ€” read it first if that matters to you: [scripts/install.sh](scripts/install.sh). + + + + + + + + +
+ Colorschemes +
+ +
+ +
+ +Switch with `uC` โ€” all configured transparent by default. + + + + + + + + +
+ + + + + +
+ +Footer typing + +
+ +MIT โ€” see [LICENSE](LICENSE) + +Made with โ™ฅ by [NoamFav](https://github.com/NoamFav) + + + +
diff --git a/_config.yml b/_config.yml new file mode 100644 index 0000000..2f70016 --- /dev/null +++ b/_config.yml @@ -0,0 +1,29 @@ +title: Nvim-config +description: "A batteries-included Neovim configuration โ€” 28 LSP servers, blink.cmp, Treesitter, Snacks, and more." +theme: jekyll-theme-midnight +show_downloads: false + +plugins: + - jekyll-relative-links + - jekyll-readme-index + +relative_links: + enabled: true + collections: false + +# GitHub.com's own renderer parses Markdown inside raw HTML blocks (the +#
/ wrappers used for centering/layout throughout these docs). +# kramdown does not do this by default, which is why badges/tables/links +# inside those blocks were showing up as literal text โ€” this makes kramdown +# match GitHub's behavior. +kramdown: + parse_block_html: true + +exclude: + - lua + - init.lua + - lazy-lock.json + - .claude + - .github + - .gitignore + - .DS_Store diff --git a/colors/wallpaper.lua b/colors/wallpaper.lua new file mode 100644 index 0000000..7276ac8 --- /dev/null +++ b/colors/wallpaper.lua @@ -0,0 +1,355 @@ +-- "wallpaper" colorscheme: driven by nvim/lua/colors_generated.lua, which is +-- regenerated by sketchybar/theme/generate.sh whenever the desktop wallpaper +-- changes. This file is the static logic; only colors_generated.lua changes. +-- +-- colors_generated.lua is gitignored (machine-specific) -- init.lua only +-- activates "wallpaper" when that file exists (falls back to the real +-- tokyonight-night otherwise), so it's safe to assume it's here. +-- +-- Palette is shaped like tokyonight.nvim's (see :h tokyonight) on purpose โ€” +-- lualine.lua reads the same field names, just from a different module. + +vim.cmd("highlight clear") +if vim.fn.exists("syntax_on") == 1 then + vim.cmd("syntax reset") +end +vim.o.termguicolors = true +vim.o.background = "dark" +vim.g.colors_name = "wallpaper" + +local c = require("colors_generated") + +---@param group string +---@param opts vim.api.keyset.highlight +local function hi(group, opts) + vim.api.nvim_set_hl(0, group, opts) +end + +-- โ”€โ”€ Base UI โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ + +hi("Normal", { fg = c.fg, bg = c.none }) +hi("NormalNC", { fg = c.fg, bg = c.none }) +hi("NormalFloat", { fg = c.fg_float, bg = c.bg_float }) +hi("FloatBorder", { fg = c.border_highlight, bg = c.bg_float }) +hi("FloatTitle", { fg = c.blue1, bg = c.bg_float, bold = true }) +hi("Cursor", { fg = c.bg, bg = c.fg }) +hi("CursorLine", { bg = c.bg_highlight }) +hi("CursorLineNr", { fg = c.blue1, bold = true }) +hi("CursorColumn", { bg = c.bg_highlight }) +hi("ColorColumn", { bg = c.bg_highlight }) +hi("LineNr", { fg = c.fg_gutter }) +hi("LineNrAbove", { fg = c.fg_gutter }) +hi("LineNrBelow", { fg = c.fg_gutter }) +hi("SignColumn", { fg = c.fg_gutter, bg = c.none }) +hi("FoldColumn", { fg = c.fg_gutter, bg = c.none }) +hi("Folded", { fg = c.blue, bg = c.bg_highlight }) +hi("Visual", { bg = c.bg_visual }) +hi("VisualNOS", { bg = c.bg_visual }) +hi("Search", { fg = c.bg, bg = c.blue2 }) +hi("IncSearch", { fg = c.bg, bg = c.orange }) +hi("CurSearch", { fg = c.bg, bg = c.orange }) +hi("MatchParen", { fg = c.blue1, bold = true }) +hi("Pmenu", { fg = c.fg, bg = c.bg_popup }) +hi("PmenuSel", { fg = c.bg, bg = c.blue1, bold = true }) +hi("PmenuSbar", { bg = c.bg_highlight }) +hi("PmenuThumb", { bg = c.fg_gutter }) +hi("WildMenu", { fg = c.bg, bg = c.blue1 }) +hi("StatusLine", { fg = c.fg_dark, bg = c.none }) +hi("StatusLineNC", { fg = c.fg_gutter, bg = c.none }) +hi("WinBar", { fg = c.fg_dark, bg = c.none }) +hi("WinBarNC", { fg = c.fg_gutter, bg = c.none }) +hi("WinSeparator", { fg = c.bg_highlight }) +hi("TabLine", { fg = c.fg_gutter, bg = c.none }) +hi("TabLineFill", { bg = c.none }) +hi("TabLineSel", { fg = c.blue1, bg = c.none, bold = true }) +hi("NonText", { fg = c.fg_gutter }) +hi("Whitespace", { fg = c.fg_gutter }) +hi("SpecialKey", { fg = c.fg_gutter }) +hi("EndOfBuffer", { fg = c.bg }) +hi("Conceal", { fg = c.dark3 }) +hi("Directory", { fg = c.blue1 }) +hi("Title", { fg = c.blue1, bold = true }) +hi("ModeMsg", { fg = c.fg_dark, bold = true }) +hi("MsgArea", { fg = c.fg_dark }) +hi("MoreMsg", { fg = c.blue1 }) +hi("Question", { fg = c.blue1 }) +hi("ErrorMsg", { fg = c.error }) +hi("WarningMsg", { fg = c.warning }) +hi("QuickFixLine", { bg = c.bg_highlight, bold = true }) +hi("SpellBad", { sp = c.error, undercurl = true }) +hi("SpellCap", { sp = c.warning, undercurl = true }) +hi("SpellLocal", { sp = c.info, undercurl = true }) +hi("SpellRare", { sp = c.hint, undercurl = true }) + +-- โ”€โ”€ Legacy syntax groups โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ + +hi("Comment", { fg = c.comment, italic = true }) +hi("Constant", { fg = c.orange }) +hi("String", { fg = c.green }) +hi("Character", { fg = c.green }) +hi("Number", { fg = c.orange }) +hi("Boolean", { fg = c.orange }) +hi("Float", { fg = c.orange }) +hi("Identifier", { fg = c.fg }) +hi("Function", { fg = c.blue }) +hi("Statement", { fg = c.magenta, italic = true }) +hi("Conditional", { fg = c.magenta, italic = true }) +hi("Repeat", { fg = c.magenta, italic = true }) +hi("Label", { fg = c.blue1 }) +hi("Operator", { fg = c.blue5 }) +hi("Keyword", { fg = c.magenta, italic = true }) +hi("Exception", { fg = c.magenta, italic = true }) +hi("PreProc", { fg = c.blue1 }) +hi("Include", { fg = c.blue1 }) +hi("Define", { fg = c.blue1 }) +hi("Macro", { fg = c.blue1 }) +hi("Type", { fg = c.blue5 }) +hi("StorageClass", { fg = c.blue5 }) +hi("Structure", { fg = c.blue5 }) +hi("Typedef", { fg = c.blue5 }) +hi("Special", { fg = c.blue1 }) +hi("SpecialChar", { fg = c.blue1 }) +hi("Tag", { fg = c.blue1 }) +hi("Delimiter", { fg = c.blue5 }) +hi("SpecialComment", { fg = c.comment, bold = true }) +hi("Underlined", { fg = c.blue, underline = true }) +hi("Ignore", { fg = c.comment }) +hi("Todo", { fg = c.bg, bg = c.blue1, bold = true }) +hi("Error", { fg = c.error, bold = true }) + +-- โ”€โ”€ Treesitter (@-captures) โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ + +hi("@variable", { fg = c.fg }) +hi("@variable.builtin", { fg = c.blue1, italic = true }) +hi("@variable.parameter", { fg = c.fg_dark }) +hi("@variable.member", { fg = c.fg_dark }) +hi("@constant", { fg = c.orange }) +hi("@constant.builtin", { fg = c.orange, italic = true }) +hi("@constant.macro", { fg = c.blue1 }) +hi("@module", { fg = c.blue5 }) +hi("@label", { fg = c.blue1 }) +hi("@string", { fg = c.green }) +hi("@string.escape", { fg = c.magenta }) +hi("@string.special", { fg = c.blue1 }) +hi("@string.regexp", { fg = c.blue2 }) +hi("@character", { fg = c.green }) +hi("@character.special", { fg = c.blue1 }) +hi("@number", { fg = c.orange }) +hi("@boolean", { fg = c.orange }) +hi("@float", { fg = c.orange }) +hi("@function", { fg = c.blue }) +hi("@function.builtin", { fg = c.blue1, italic = true }) +hi("@function.macro", { fg = c.blue }) +hi("@function.method", { fg = c.blue }) +hi("@constructor", { fg = c.blue5 }) +hi("@operator", { fg = c.blue5 }) +hi("@keyword", { fg = c.magenta, italic = true }) +hi("@keyword.function", { fg = c.magenta, italic = true }) +hi("@keyword.return", { fg = c.magenta, italic = true }) +hi("@keyword.operator", { fg = c.magenta, italic = true }) +hi("@keyword.import", { fg = c.blue1 }) +hi("@conditional", { fg = c.magenta, italic = true }) +hi("@repeat", { fg = c.magenta, italic = true }) +hi("@exception", { fg = c.magenta, italic = true }) +hi("@punctuation.delimiter", { fg = c.blue5 }) +hi("@punctuation.bracket", { fg = c.fg_dark }) +hi("@punctuation.special", { fg = c.blue1 }) +hi("@comment", { fg = c.comment, italic = true }) +hi("@comment.documentation", { fg = c.comment, italic = true }) +hi("@tag", { fg = c.blue1 }) +hi("@tag.attribute", { fg = c.blue5 }) +hi("@tag.delimiter", { fg = c.blue5 }) +hi("@type", { fg = c.blue5 }) +hi("@type.builtin", { fg = c.blue5, italic = true }) +hi("@attribute", { fg = c.blue1 }) +hi("@property", { fg = c.fg_dark }) +hi("@markup.strong", { bold = true }) +hi("@markup.italic", { italic = true }) +hi("@markup.strikethrough", { strikethrough = true }) +hi("@markup.underline", { underline = true }) +hi("@markup.heading", { fg = c.blue1, bold = true }) +hi("@markup.link", { fg = c.blue }) +hi("@markup.link.url", { fg = c.green, underline = true }) +hi("@markup.raw", { fg = c.green }) +hi("@markup.list", { fg = c.blue5 }) +hi("@diff.plus", { fg = c.git.add }) +hi("@diff.minus", { fg = c.git.delete }) +hi("@diff.delta", { fg = c.git.change }) + +-- โ”€โ”€ LSP semantic tokens (fall back to @-captures above when unset) โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ + +-- Left empty/linked to their treesitter equivalents on purpose: semantic +-- tokens render above regular treesitter captures, so a real color here +-- would paint over (and hide) core.rainbow_var's per-identifier extmarks. +hi("@lsp.type.parameter", { link = "@variable.parameter" }) +hi("@lsp.type.property", { link = "@property" }) +hi("@lsp.type.variable", {}) +hi("@lsp.mod.readonly", { italic = true }) +hi("@lsp.typemod.variable.defaultLibrary", { fg = c.blue1, italic = true }) + +-- โ”€โ”€ Diagnostics โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ + +hi("DiagnosticError", { fg = c.error }) +hi("DiagnosticWarn", { fg = c.warning }) +hi("DiagnosticInfo", { fg = c.info }) +hi("DiagnosticHint", { fg = c.hint }) +hi("DiagnosticOk", { fg = c.green }) +hi("DiagnosticUnderlineError", { sp = c.error, undercurl = true }) +hi("DiagnosticUnderlineWarn", { sp = c.warning, undercurl = true }) +hi("DiagnosticUnderlineInfo", { sp = c.info, undercurl = true }) +hi("DiagnosticUnderlineHint", { sp = c.hint, undercurl = true }) +hi("DiagnosticVirtualTextError", { fg = c.error, bg = c.none }) +hi("DiagnosticVirtualTextWarn", { fg = c.warning, bg = c.none }) +hi("DiagnosticVirtualTextInfo", { fg = c.info, bg = c.none }) +hi("DiagnosticVirtualTextHint", { fg = c.hint, bg = c.none }) +hi("DiagnosticFloatingError", { fg = c.error }) +hi("DiagnosticFloatingWarn", { fg = c.warning }) +hi("DiagnosticFloatingInfo", { fg = c.info }) +hi("DiagnosticFloatingHint", { fg = c.hint }) +hi("DiagnosticSignError", { fg = c.error }) +hi("DiagnosticSignWarn", { fg = c.warning }) +hi("DiagnosticSignInfo", { fg = c.info }) +hi("DiagnosticSignHint", { fg = c.hint }) +hi("LspInlayHint", { fg = c.comment, bg = c.none, italic = true }) +hi("LspReferenceText", { bg = c.bg_highlight }) +hi("LspReferenceRead", { bg = c.bg_highlight }) +hi("LspReferenceWrite", { bg = c.bg_highlight }) +hi("LspCodeLens", { fg = c.comment }) +hi("LspSignatureActiveParameter", { fg = c.orange, bold = true }) + +-- โ”€โ”€ Diffs / GitSigns โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ + +hi("DiffAdd", { bg = c.diff.add }) +hi("DiffChange", { bg = c.diff.change }) +hi("DiffDelete", { bg = c.diff.delete }) +hi("DiffText", { bg = c.diff.text }) +hi("diffAdded", { fg = c.git.add }) +hi("diffRemoved", { fg = c.git.delete }) +hi("diffChanged", { fg = c.git.change }) + +hi("GitSignsAdd", { fg = c.git.add }) +hi("GitSignsChange", { fg = c.git.change }) +hi("GitSignsDelete", { fg = c.git.delete }) +hi("GitSignsAddNr", { fg = c.git.add }) +hi("GitSignsChangeNr", { fg = c.git.change }) +hi("GitSignsDeleteNr", { fg = c.git.delete }) +hi("GitSignsAddLn", { bg = c.diff.add }) +hi("GitSignsChangeLn", { bg = c.diff.change }) +hi("GitSignsDeleteLn", { bg = c.diff.delete }) +hi("GitSignsCurrentLineBlame", { fg = c.comment, italic = true }) + +-- โ”€โ”€ Telescope โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ + +hi("TelescopeNormal", { fg = c.fg, bg = c.bg_float }) +hi("TelescopeBorder", { fg = c.border_highlight, bg = c.bg_float }) +hi("TelescopePromptNormal", { fg = c.fg, bg = c.bg_float }) +hi("TelescopePromptBorder", { fg = c.orange, bg = c.bg_float }) +hi("TelescopePromptTitle", { fg = c.orange, bg = c.bg_float }) +hi("TelescopeResultsComment", { fg = c.dark3 }) +hi("TelescopeSelection", { fg = c.fg, bg = c.bg_highlight, bold = true }) +hi("TelescopeMatching", { fg = c.orange, bold = true }) +hi("TelescopeMultiSelection", { fg = c.magenta }) + +-- โ”€โ”€ which-key โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ + +hi("WhichKey", { fg = c.blue1, bold = true }) +hi("WhichKeyGroup", { fg = c.blue }) +hi("WhichKeyDesc", { fg = c.magenta }) +hi("WhichKeySeparator", { fg = c.comment }) +hi("WhichKeyNormal", { bg = c.bg_sidebar }) +hi("WhichKeyBorder", { fg = c.border_highlight, bg = c.bg_float }) +hi("WhichKeyTitle", { fg = c.blue1, bg = c.bg_float, bold = true }) +hi("WhichKeyValue", { fg = c.dark5 }) + +-- โ”€โ”€ Trouble โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ + +hi("TroubleNormal", { fg = c.fg, bg = c.none }) +hi("TroubleNormalNC", { fg = c.fg_dark, bg = c.none }) +hi("TroubleText", { fg = c.fg_dark }) +hi("TroubleCount", { fg = c.blue1, bold = true }) +hi("TroubleIndent", { fg = c.fg_gutter }) +hi("TroubleSource", { fg = c.comment }) +hi("TroubleCode", { fg = c.comment }) +hi("TroubleFilename", { fg = c.blue }) +hi("TroubleDirectory", { fg = c.fg_dark }) +hi("TroublePos", { fg = c.comment }) + +-- โ”€โ”€ blink.cmp โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ + +hi("BlinkCmpMenu", { fg = c.fg, bg = c.bg_float }) +hi("BlinkCmpMenuBorder", { fg = c.border_highlight, bg = c.bg_float }) +hi("BlinkCmpMenuSelection", { fg = c.fg, bg = c.bg_highlight, bold = true }) +hi("BlinkCmpLabel", { fg = c.fg, bg = c.none }) +hi("BlinkCmpLabelDeprecated", { fg = c.fg_gutter, bg = c.none, strikethrough = true }) +hi("BlinkCmpLabelMatch", { fg = c.blue1, bg = c.none }) +hi("BlinkCmpLabelDetail", { fg = c.comment }) +hi("BlinkCmpLabelDescription", { fg = c.comment }) +hi("BlinkCmpKind", { fg = c.fg_dark, bg = c.none }) +hi("BlinkCmpDoc", { fg = c.fg, bg = c.bg_float }) +hi("BlinkCmpDocBorder", { fg = c.border_highlight, bg = c.bg_float }) +hi("BlinkCmpDocSeparator", { fg = c.comment }) +hi("BlinkCmpSignatureHelp", { fg = c.fg, bg = c.bg_float }) +hi("BlinkCmpSignatureHelpBorder", { fg = c.border_highlight, bg = c.bg_float }) +hi("BlinkCmpSignatureHelpActiveParameter", { fg = c.orange, bold = true }) +hi("BlinkCmpSource", { fg = c.comment }) +hi("BlinkCmpGhostText", { fg = c.terminal_black }) + +-- โ”€โ”€ snacks.nvim (dashboard/notifier/indent) โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ + +hi("SnacksDashboardHeader", { fg = c.blue1 }) +hi("SnacksDashboardFooter", { fg = c.comment }) +hi("SnacksDashboardSpecial", { fg = c.orange, bold = true }) +hi("SnacksDashboardIcon", { fg = c.blue }) +hi("SnacksDashboardDesc", { fg = c.fg }) +hi("SnacksDashboardKey", { fg = c.orange }) +hi("SnacksNotifierInfo", { fg = c.info }) +hi("SnacksNotifierWarn", { fg = c.warning }) +hi("SnacksNotifierError", { fg = c.error }) +hi("SnacksIndent", { fg = c.fg_gutter }) +hi("SnacksIndentScope", { fg = c.blue1 }) +hi("SnacksPickerInputBorder", { fg = c.orange, bg = c.bg_float }) +hi("SnacksPickerInputTitle", { fg = c.orange, bg = c.bg_float }) +hi("SnacksPickerBoxTitle", { fg = c.orange, bg = c.bg_float }) +hi("SnacksPickerMatch", { fg = c.orange, bold = true }) +hi("SnacksPickerSelected", { fg = c.magenta2 }) + +-- โ”€โ”€ fidget.nvim (LSP progress) โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ + +-- fidget.nvim's LSP progress display links to the standard Title group +-- (group_style = "Title" by default), no fidget-specific groups needed. + +-- โ”€โ”€ todo-comments โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ + +hi("TodoBgTODO", { fg = c.bg, bg = c.blue1, bold = true }) +hi("TodoBgFIX", { fg = c.bg, bg = c.error, bold = true }) +hi("TodoBgWARN", { fg = c.bg, bg = c.warning, bold = true }) +hi("TodoBgNOTE", { fg = c.bg, bg = c.hint, bold = true }) +hi("TodoFgTODO", { fg = c.blue1 }) +hi("TodoFgFIX", { fg = c.error }) +hi("TodoFgWARN", { fg = c.warning }) +hi("TodoFgNOTE", { fg = c.hint }) + +-- โ”€โ”€ rainbow-delimiters โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ + +for i, color in ipairs(c.rainbow) do + hi("RainbowDelimiter" .. i, { fg = color }) +end + +-- โ”€โ”€ terminal colors (:terminal buffers) โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ + +vim.g.terminal_color_0 = c.terminal.black +vim.g.terminal_color_1 = c.terminal.red +vim.g.terminal_color_2 = c.terminal.green +vim.g.terminal_color_3 = c.terminal.yellow +vim.g.terminal_color_4 = c.terminal.blue +vim.g.terminal_color_5 = c.terminal.magenta +vim.g.terminal_color_6 = c.terminal.cyan +vim.g.terminal_color_7 = c.terminal.white +vim.g.terminal_color_8 = c.terminal.black_bright +vim.g.terminal_color_9 = c.terminal.red_bright +vim.g.terminal_color_10 = c.terminal.green_bright +vim.g.terminal_color_11 = c.terminal.yellow_bright +vim.g.terminal_color_12 = c.terminal.blue_bright +vim.g.terminal_color_13 = c.terminal.magenta_bright +vim.g.terminal_color_14 = c.terminal.cyan_bright +vim.g.terminal_color_15 = c.terminal.white_bright diff --git a/docs/ARCHITECTURE.md b/docs/ARCHITECTURE.md new file mode 100644 index 0000000..89832d2 --- /dev/null +++ b/docs/ARCHITECTURE.md @@ -0,0 +1,96 @@ +--- +title: Architecture +--- + +# Architecture + +How this config is put together, for anyone extending it. For _what it does_ see [Features](FEATURES.md); for _what's installed_ see [Plugin Reference](PLUGINS.md). + +โ† Back to [README](../README.md) + +--- + +## Table of Contents + +- [Design Philosophy](#design-philosophy) +- [The LSP Pipeline](#the-lsp-pipeline) +- [Load Order](#load-order) +- [Project Layout](#project-layout) + +--- + +## Design Philosophy + +One file per concern, imported once. The clearest example is LSP: [`lua/lsp/servers.lua`](../lua/lsp/servers.lua) is the **single source of truth** for which servers exist and how they're configured โ€” nothing else in the repo defines a server. That file exports two functions: + +- `get_server_list()` โ€” a flat list of server names, consumed by `mason-lspconfig` as its `ensure_installed` list +- `setup_server_configs()` โ€” per-server `vim.lsp.config(...)` calls (root markers, settings, custom `cmd`), called once from [`lua/plugins/lsp/mason.lua`](../lua/plugins/lsp/mason.lua) + +This is deliberately **not** `nvim-lspconfig`-style โ€” that plugin is only present for its `capabilities`/`on_attach` wildcard (`vim.lsp.config("*", ...)`); it doesn't own any server definitions here. Neovim 0.11's native `vim.lsp.config`/`vim.lsp.enable` does that job instead, so there's exactly one place to look when a server misbehaves. + +The same one-file-per-concern pattern repeats elsewhere: + +- **Formatters** โ€” [`lua/plugins/lsp/formatters.lua`](../lua/plugins/lsp/formatters.lua) is the single filetype โ†’ formatter-exe mapping (used by both `mason-tool-installer`'s `ensure_installed` and `formatter.nvim`'s dispatch table) +- **Colorschemes** โ€” [`lua/plugins/ui/colorschemes.lua`](../lua/plugins/ui/colorschemes.lua) declares every scheme; only Tokyo Night is `lazy = false` (the default), the rest load on-demand when picked via `uC` +- **Semantic-token styling** โ€” [`lua/core/semantic_tokens.lua`](../lua/core/semantic_tokens.lua) is one styling pass that applies to _any_ LSP emitting standard `@lsp.type.*`/`@lsp.mod.*` tokens, re-applied on every `ColorScheme` event so it survives switching themes + +## The LSP Pipeline + +``` + lua/lsp/servers.lua โ”€โ”€declaresโ”€โ”€โ–บ server list + settings + โ”‚ + โ”œโ”€โ”€โ–บ mason-lspconfig (ensure_installed, auto-install on first launch) + โ”‚ + โ””โ”€โ”€โ–บ vim.lsp.enable() (native, per-server, scheduled after mason-lspconfig.setup()) + + Servers outside this loop โ€” OmniSharp, sourcekit, dartls, metals โ€” are + configured in servers.lua but deliberately excluded from get_server_list(), + so Mason never tries (and fails) to install them. Install their binaries + yourself; see docs/REQUIREMENTS.md. +``` + +Formatting follows a parallel but separate path: `mason-tool-installer` installs the formatter binaries, `formatter.nvim` dispatches to them per filetype, and `none-ls.nvim` runs a couple of linters (`flake8`) as LSP diagnostics rather than as formatters. Three different plugins, one job split cleanly by phase (install / format / lint) rather than one plugin doing all three. + +## Load Order + +``` +init.lua + โ”œโ”€ bootstrap lazy.nvim (git clone if not present) + โ”œโ”€ set before any plugin loads + โ”œโ”€ require("core.options") โ€” vim.opt settings + โ”œโ”€ require("core.keymaps") โ€” non-plugin-owned keymaps + โ”œโ”€ require("core.autocmds") โ€” autocommands + โ”œโ”€ require("core.diagnostics") โ€” vim.diagnostic.config + โ”œโ”€ require("core.semantic_tokens").setup() + โ””โ”€ require("lazy").setup("plugins") โ€” lazy-loads everything in lua/plugins/ +``` + +`lua/plugins/init.lua` is the entry lazy.nvim actually loads; it declares a handful of standalone plugins directly, then `{ import = "plugins." }`s every subfolder (`ui`, `editor`, `coding`, `lsp`, `tools`, `lang`) so each group's files are free to add/remove plugins without touching this list. + +## Project Layout + +``` +~/.config/nvim/ +โ”œโ”€โ”€ init.lua Bootstraps lazy.nvim, loads core/*, starts lazy.setup("plugins") +โ””โ”€โ”€ lua/ + โ”œโ”€โ”€ core/ + โ”‚ โ”œโ”€โ”€ options.lua vim.opt settings, backup/swap/undo dirs, 42 login vars + โ”‚ โ”œโ”€โ”€ keymaps.lua Non-plugin-owned keymaps (windows, buffers, tabs, Maven, CMake, MATLABโ€ฆ) + โ”‚ โ”œโ”€โ”€ autocmds.lua Autocommands + โ”‚ โ”œโ”€โ”€ diagnostics.lua Diagnostic sign/virtual-text config + โ”‚ โ”œโ”€โ”€ norminette.lua Async norminette diagnostics on save for .c/.h (hand-rolled, no plugin) + โ”‚ โ”œโ”€โ”€ rainbow_var.lua Per-variable consistent-color highlighting via treesitter + โ”‚ โ””โ”€โ”€ semantic_tokens.lua Cross-language @lsp.* highlight styling + โ”œโ”€โ”€ lsp/ + โ”‚ โ””โ”€โ”€ servers.lua get_server_list() (Mason ensure_installed) + setup_server_configs() + โ””โ”€โ”€ plugins/ + โ”œโ”€โ”€ init.lua Misc single-file plugins + imports every group below + โ”œโ”€โ”€ coding/ blink.cmp, snippets + โ”œโ”€โ”€ editor/ treesitter, harpoon, autopairs, autosave, commentโ€ฆ + โ”œโ”€โ”€ lang/ Per-language extras (go, java, c, web, latex, matlab, jupyter) + โ”œโ”€โ”€ lsp/ mason, formatters, 42-header.nvim + โ”œโ”€โ”€ tools/ git, terminal, trouble, which-key + โ””โ”€โ”€ ui/ colorschemes, lualine, snacks, devicons, fidgetโ€ฆ +``` + +See [Plugin Reference](PLUGINS.md#full-dependency-graph-mermaid) for a diagram of how these groups depend on each other. diff --git a/docs/FEATURES.md b/docs/FEATURES.md new file mode 100644 index 0000000..ee8b0ce --- /dev/null +++ b/docs/FEATURES.md @@ -0,0 +1,81 @@ +--- +title: Features +--- + +# Features + +A tour of what this config actually does, day-to-day. For the plugin behind each feature, see [Plugin Reference](PLUGINS.md); for the exact keys, see [Key Mappings](KEYMAPS.md). + +โ† Back to [README](../README.md) + +--- + +## Table of Contents + +- [Finding Things](#finding-things) +- [LSP & Completion](#lsp--completion) +- [Git & Version Control](#git--version-control) +- [Editing Quality-of-Life](#editing-quality-of-life) +- [Language-Specific Tooling](#language-specific-tooling) +- [Notebooks & Documents](#notebooks--documents) +- [Appearance](#appearance) + +--- + +## Finding Things + +Everything search-related goes through [`snacks.nvim`](https://github.com/folke/snacks.nvim)'s picker โ€” one fuzzy-finder UI for files, buffers, grep, git objects, LSP symbols, diagnostics, help pages, and more, instead of juggling separate plugins with separate keybindings. + +- **Smart find** (``) picks between recent files and a full file search depending on context +- **Live grep** (`/`) and **grep word/selection** (`sw`) โ€” backed by ripgrep +- **File explorer** (`e`) and a **dashboard** on startup showing recent files, projects, and live `git status` +- **Harpoon** (`a` to pin, `1`-`4` to jump) for the 3-4 files you bounce between constantly while working a task โ€” faster than any fuzzy search for files you already know you want + +## LSP & Completion + +28 language servers, wired through Neovim 0.11's **native** `vim.lsp.config`/`vim.lsp.enable` โ€” no `nvim-lspconfig` server-definition tables duplicating what's already in [`lua/lsp/servers.lua`](../lua/lsp/servers.lua). + +- **blink.cmp** completion โ€” LSP, path, snippets, buffer text, emoji, and a personal dictionary, all fuzzy-scored together and updating on every keystroke +- **Lspsaga** โ€” a nicer floating UI for hover docs (`K`) and rename (`rn`) than the LSP defaults +- **Trouble** โ€” pinnable, auto-refreshing panes for diagnostics, LSP symbols, and references, so you can leave a diagnostics list open in a split while you fix things instead of re-triggering a picker each time +- **Cross-language semantic-token styling** ([`lua/core/semantic_tokens.lua`](../lua/core/semantic_tokens.lua)) โ€” one styling pass (readonly = italic, deprecated = strikethrough, stdlib = italic, โ€ฆ) applied consistently across every server that emits standard semantic tokens, instead of relying on each colorscheme's per-language guesses +- **fidget.nvim** โ€” LSP progress spinners in the corner instead of blocking the command line, plus it takes over `vim.notify` for a consistent notification history (`n`) + +## Git & Version Control + +- **LazyGit** (`gg`) for anything beyond a quick stage/commit โ€” full TUI, no context switch to a terminal +- **Gitsigns** โ€” hunk markers in the sign column as you edit +- **git-blame.nvim** โ€” inline virtual-text blame for the current line +- **Diffview** โ€” proper side-by-side diffs and file history (`:DiffviewOpen`) +- **git-conflict.nvim** โ€” highlights merge conflict markers and gives keymaps to pick a side without hand-editing `<<<<<<<` blocks + +## Editing Quality-of-Life + +- **Treesitter** โ€” syntax highlighting, indentation, and folding all driven by real parse trees instead of regex +- **treesitter-context** โ€” a sticky header pinned to the top of the window showing which function/loop/if you're scrolled into (`uk` to toggle) +- **rainbow-delimiters** โ€” nested brackets get distinct colors per depth +- **hlargs** โ€” function parameters get one consistent color across every supported language, independent of the LSP's own semantic-token choices +- **auto-save.nvim** โ€” saves on `InsertLeave`/`TextChanged`/`BufLeave` so "did I save that" stops being a question +- **nvim-autopairs**, **Comment.nvim** (`gcc`/`gc`/`gbc`/`gb`) โ€” the usual editing conveniences + +## Language-Specific Tooling + +Beyond the LSP server itself, a few languages get dedicated tooling layered on top (all in [`lua/plugins/lang/`](../lua/plugins/lang/) โ€” see [Plugin Reference](PLUGINS.md#language-extras-pluginslang) for the full list): + +- **Go** โ€” [go.nvim](https://github.com/ray-x/go.nvim) adds `:GoRun`, `:GoTest*`, a coverage overlay, struct-tag editing, `:GoIfErr`, `:GoFillStruct`, `:GoImpl` โ€” all without touching `gopls` itself, which stays owned by `servers.lua` +- **Rust** โ€” [rustaceanvim](https://github.com/mrcjkb/rustaceanvim) owns `rust_analyzer` outright (clippy-on-save, `:RustLsp` runnables/debuggables/hover actions) instead of going through `servers.lua` like every other server +- **C/C++** โ€” [clangd_extensions.nvim](https://github.com/p00f/clangd_extensions.nvim) adds inlay hints and an AST viewer on top of `clangd` +- **Web** โ€” Tailwind class previews ([tailwind-tools.nvim](https://github.com/luckasRanarison/tailwind-tools.nvim)) and JSX/TSX highlighting +- **42 School** โ€” automatic header stamping (``) and live Norm linting on `.c`/`.h` save, plus a `cf` shortcut to run `c_formatter_42` + +## Notebooks & Documents + +- **Jupyter notebooks** โ€” [Molten](https://github.com/benlubas/molten-nvim) runs cells against a real kernel and renders plots inline via [image.nvim](https://github.com/3rd/image.nvim)'s Kitty-graphics-protocol backend, directly in the buffer โ€” no browser tab +- **LaTeX** โ€” [VimTeX](https://github.com/lervag/vimtex) compiles on save via `latexmk` and can open your PDF viewer synced to the cursor position +- **Markdown** โ€” [markview.nvim](https://github.com/OXY2Dev/markview.nvim) renders headings/tables/checkboxes live in-buffer; [glow.nvim](https://github.com/ellisonleao/glow.nvim) (`:Glow`) for a full rendered preview when you want one + +## Appearance + +- **5 colorschemes** (Tokyo Night default, Catppuccin, Cyberdream, OneDark, Sonokai, plus the author's own [2077.nvim](https://github.com/NoamFav/2077.nvim)), switchable live with `uC` โ€” see [README ยง Colorschemes](../README.md#colorschemes) +- All configured **transparent** by default +- **lualine** statusline/tabline that reads its theme from whichever colorscheme is active, rather than needing its own separate theme config diff --git a/docs/INSTALL.md b/docs/INSTALL.md new file mode 100644 index 0000000..a74c07c --- /dev/null +++ b/docs/INSTALL.md @@ -0,0 +1,223 @@ +--- +title: Installation Guide +--- + +# Installation Guide + +Platform-specific setup for this config. For *why* each dependency is needed, see [Requirements](REQUIREMENTS.md) โ€” this doc is just the install commands, per OS. + +โ† Back to [README](../README.md) ยท See also [Requirements](REQUIREMENTS.md) ยท [Plugin Reference](PLUGINS.md) + +--- + +> [!TIP] +> macOS/Linux: [scripts/install.sh](../scripts/install.sh) automates the backup/clone/prep-dirs steps, the *core* installs below, a Nerd Font, and (if you opt in) language runtimes + OmniSharp, for Homebrew, apt, dnf, and pacman: +> ```bash +> curl -fsSL https://raw.githubusercontent.com/NoamFav/Nvim-config/main/scripts/install.sh | bash -s -- -l go,rust,python +> # or `| bash` alone to be prompted, or add -y to skip all prompts; --help lists every flag +> ``` +> Everything past this point is what that script automates, spelled out per OS โ€” read on if you're on Windows, want to understand what it's doing, or it doesn't cover your setup. + +## Table of Contents + +- [Minimum requirements](#minimum-requirements) +- [macOS](#macos) +- [Ubuntu / Debian](#ubuntu--debian) +- [Fedora](#fedora) +- [Arch Linux](#arch-linux) +- [Windows](#windows) +- [Clone & first launch (all platforms)](#clone--first-launch-all-platforms) +- [Language runtimes](#language-runtimes-by-package-manager) +- [Verifying the install](#verifying-the-install) +- [Troubleshooting](#troubleshooting) + +--- + +## Minimum requirements + +Regardless of OS, you need on `$PATH` before first launch: + +- Neovim `>= 0.11.0` +- Git `>= 2.19.0` +- ripgrep, fd, lazygit +- tree-sitter CLI + a C compiler (`cc`/`gcc`/`clang`) โ€” `nvim-treesitter` compiles parsers with these +- Universal Ctags โ€” required by `tagbar` +- A [Nerd Font](https://www.nerdfonts.com/), set as your terminal's font +- A true-color terminal (Kitty, WezTerm, Ghostty, iTerm2, Windows Terminal, Alacrittyโ€ฆ) + +Everything else (language runtimes, LSP servers, formatters) is either installed by Mason automatically or listed per-language in the [Requirements](REQUIREMENTS.md#language-runtimes) table โ€” install only what you actually code in. + +--- + +## macOS + +```bash +# Homebrew: https://brew.sh +brew install neovim git ripgrep fd lazygit tree-sitter universal-ctags + +# Nerd Font (pick one, or use `brew search nerd-font` for more) +brew install --cask font-jetbrains-mono-nerd-font + +# A GPU-accelerated, true-color terminal with image support (recommended) +brew install --cask kitty +``` + +> [!NOTE] +> Swift (`sourcekit-lsp`) is macOS-only and ships with Xcode Command Line Tools: `xcode-select --install`. + +--- + +## Ubuntu / Debian + +The distro's `neovim` package is often too old for `>= 0.11`. Use the [Neovim PPA](https://github.com/neovim/neovim/wiki/Installing-Neovim#ubuntu) (Ubuntu) or the official AppImage (Debian/either): + +```bash +# Ubuntu โ€” PPA has current stable releases +sudo add-apt-repository ppa:neovim-ppa/unstable +sudo apt update +sudo apt install neovim + +# Debian/Ubuntu fallback โ€” AppImage (always current) +curl -LO https://github.com/neovim/neovim/releases/latest/download/nvim-linux-x86_64.appimage +chmod u+x nvim-linux-x86_64.appimage +sudo mv nvim-linux-x86_64.appimage /usr/local/bin/nvim + +# Everything else +sudo apt install git ripgrep fd-find universal-ctags build-essential curl unzip + +# lazygit isn't in apt โ€” install the release binary +LAZYGIT_VERSION=$(curl -s "https://api.github.com/repos/jesseduffield/lazygit/releases/latest" | grep -Po '"tag_name": "v\K[^"]*') +curl -Lo lazygit.tar.gz "https://github.com/jesseduffield/lazygit/releases/latest/download/lazygit_${LAZYGIT_VERSION}_Linux_x86_64.tar.gz" +tar xf lazygit.tar.gz lazygit +sudo install lazygit /usr/local/bin + +# tree-sitter CLI isn't in apt either โ€” via npm or cargo +npm install -g tree-sitter-cli +# or: cargo install tree-sitter-cli +``` + +> [!NOTE] +> On Debian/Ubuntu the `fd` binary is packaged as `fd-find` and installs as `fdfind`. Either alias it (`alias fd=fdfind`) or symlink `~/.local/bin/fd -> $(which fdfind)`. + +Nerd Font: download from [nerdfonts.com](https://www.nerdfonts.com/font-downloads), unzip into `~/.local/share/fonts`, then `fc-cache -fv`. + +--- + +## Fedora + +```bash +sudo dnf install neovim git ripgrep fd-find lazygit ctags gcc make curl unzip + +# tree-sitter CLI +npm install -g tree-sitter-cli +# or: cargo install tree-sitter-cli +``` + +Nerd Font: download from [nerdfonts.com](https://www.nerdfonts.com/font-downloads), unzip into `~/.local/share/fonts`, then `fc-cache -fv`. + +--- + +## Arch Linux + +Everything needed is in `extra`/AUR: + +```bash +sudo pacman -S neovim git ripgrep fd lazygit tree-sitter tree-sitter-cli ctags base-devel + +# Nerd Fonts are packaged individually, e.g.: +sudo pacman -S ttf-jetbrains-mono-nerd +``` + +--- + +## Windows + +Native Windows works, but several plugins here (`molten-nvim`'s Python build steps, `c_formatter_42`, shell-based Maven/CMake keymaps) assume a POSIX shell. **WSL2 with an Ubuntu distro is recommended** โ€” follow the [Ubuntu / Debian](#ubuntu--debian) steps inside WSL. If you want native Windows: + +```powershell +# winget +winget install Neovim.Neovim +winget install Git.Git +winget install BurntSushi.ripgrep.MSVC +winget install sharkdp.fd +winget install JesseDuffield.lazygit +winget install universal-ctags.ctags + +# tree-sitter CLI +npm install -g tree-sitter-cli + +# Nerd Font +winget install DEVCOM.JetBrainsMonoNerdFont +``` + +You'll also need the [Visual Studio Build Tools](https://visualstudio.microsoft.com/visual-cpp-build-tools/) (C++ workload) so `nvim-treesitter` and any `:MasonInstall` builds have a C compiler. + +> [!TIP] +> Windows Terminal supports true color and Nerd Font glyphs out of the box, but not the Kitty graphics protocol โ€” Jupyter/Molten inline images won't render. Use WSL2 + a Linux-native Kitty/WezTerm if you need that. + +--- + +## Clone & first launch (all platforms) + +```bash +# Backup any existing config +mv ~/.config/nvim ~/.config/nvim.bak +mv ~/.local/share/nvim ~/.local/share/nvim.bak + +# Clone +git clone https://github.com/NoamFav/Nvim-config ~/.config/nvim + +# Directories lua/core/options.lua expects for backup/swap/undo files +mkdir -p ~/.logs/nvim/backup ~/.logs/nvim/swap ~/.logs/nvim/undo + +# Launch โ€” lazy.nvim bootstraps itself, installs plugins, +# then Mason auto-installs LSP servers + formatters +nvim +``` + +--- + +## Language runtimes by package manager + +Only install what you actually need โ€” see the [Requirements](REQUIREMENTS.md#language-runtimes) table for which plugin/server needs each one. + +| Language | macOS (brew) | Ubuntu/Debian (apt) | Fedora (dnf) | Arch (pacman) | +|---|---|---|---|---| +| Go | `brew install go` | `apt install golang-go` | `dnf install golang` | `pacman -S go` | +| Rust | `brew install rustup` | via [rustup.rs](https://rustup.rs) | via [rustup.rs](https://rustup.rs) | `pacman -S rustup` | +| Python | `brew install python` | `apt install python3 python3-pip` | `dnf install python3 python3-pip` | `pacman -S python python-pip` | +| Node.js | `brew install node` | via [nodesource](https://github.com/nodesource/distributions) or `nvm` | `dnf install nodejs` | `pacman -S nodejs npm` | +| Java (JDK) | `brew install openjdk` | `apt install openjdk-21-jdk` | `dnf install java-21-openjdk` | `pacman -S jdk-openjdk` | +| Maven | `brew install maven` | `apt install maven` | `dnf install maven` | `pacman -S maven` | +| Clang/LLVM | `xcode-select --install` | `apt install clang` | `dnf install clang` | `pacman -S clang` | +| .NET SDK | `brew install dotnet` | via [Microsoft's apt repo](https://learn.microsoft.com/dotnet/core/install/linux) | `dnf install dotnet-sdk-8.0` | `pacman -S dotnet-sdk` | +| PHP + Composer | `brew install php composer` | `apt install php composer` | `dnf install php composer` | `pacman -S php composer` | +| Ruby | `brew install ruby` | `apt install ruby-full` | `dnf install ruby` | `pacman -S ruby` | +| Terraform | `brew install terraform` | via [HashiCorp's apt repo](https://developer.hashicorp.com/terraform/install) | `dnf install terraform` | `pacman -S terraform` | +| Dart SDK | `brew install dart-sdk` | via [dart.dev](https://dart.dev/get-dart) | via [dart.dev](https://dart.dev/get-dart) | `pacman -S dart` (AUR) | +| Arduino CLI | `brew install arduino-cli` | via [arduino.github.io/arduino-cli](https://arduino.github.io/arduino-cli/latest/installation/) | same | `pacman -S arduino-cli` (AUR) | +| TeX distribution | `brew install --cask mactex-no-gui` | `apt install texlive-full` | `dnf install texlive-scheme-full` | `pacman -S texlive-most` | + +--- + +## Verifying the install + +```vim +:checkhealth " catches missing system dependencies plugin-by-plugin +:Mason " confirm every LSP server / formatter installed cleanly +:TSUpdate " confirm treesitter parsers compiled (needs tree-sitter CLI + cc) +``` + +--- + +## Troubleshooting + +| Symptom | Fix | +|---|---| +| Boxes/question marks instead of icons | Terminal font isn't a Nerd Font, or the terminal is caching an old font list โ€” restart the terminal | +| `:TSUpdate` fails / parsers won't compile | Missing tree-sitter CLI or C compiler โ€” see [Minimum requirements](#minimum-requirements) | +| `tagbar` does nothing | Universal Ctags isn't installed, or the distro's default `ctags` (BSD/Emacs variant) shadows it โ€” check `ctags --version` mentions "Universal Ctags" | +| Jupyter cells render as text, no plots | Not running Kitty/WezTerm/Ghostty, or `image.nvim`'s Python deps aren't installed โ€” see [Requirements](REQUIREMENTS.md#jupyter-notebooks-molten--imagenvim) | +| C# / OmniSharp doesn't attach | Binary not placed at `~/.local/bin/omnisharp` โ€” see [Manual Setup: OmniSharp](REQUIREMENTS.md#manual-setup-omnisharp) | +| Swift/Dart/Scala LSP not attaching | Those servers aren't Mason-managed โ€” install `sourcekit-lsp` (Xcode CLT), the Dart SDK, or Metals manually | +| `gg` does nothing | `lazygit` isn't installed or not on `$PATH` | diff --git a/docs/KEYMAPS.md b/docs/KEYMAPS.md new file mode 100644 index 0000000..f7291b2 --- /dev/null +++ b/docs/KEYMAPS.md @@ -0,0 +1,203 @@ +--- +title: Key Mappings +--- + +# Key Mappings + +Every keymap defined in this config, grouped by what it's for. Leader key is `Space`. + +โ† Back to [README](../README.md) ยท See also [Features](FEATURES.md) ยท [Plugin Reference](PLUGINS.md) + +--- + +## Table of Contents + +- [Finding Things (Snacks picker)](#finding-things-snacks-picker) +- [Navigation](#navigation) +- [LSP](#lsp) +- [Git](#git) +- [Terminal & Build Shortcuts](#terminal--build-shortcuts) +- [Clipboard](#clipboard) +- [Editing](#editing) +- [Which-key Groups](#which-key-groups) + +--- + +## Finding Things (Snacks picker) + +Defined in [`lua/plugins/ui/snacks.lua`](../lua/plugins/ui/snacks.lua). + +| Key | Action | +|-----|--------| +| `` | Smart find files | +| `ff` | Find files | +| `fg` | Find git files | +| `fc` | Find config file (`stdpath("config")`) | +| `fb` / `,` | Buffers | +| `fr` | Recent files | +| `fp` | Projects | +| `/` / `sg` | Live grep | +| `sw` | Grep word/selection (normal + visual) | +| `sb` | Grep current buffer lines | +| `sB` | Grep open buffers | +| `e` | File explorer | +| `:` / `sc` | Command history | +| `n` | Notification history | +| `un` | Dismiss all notifications | +| `s"` | Registers | +| `s/` | Search history | +| `sa` | Autocmds | +| `sC` | Commands | +| `sd` / `sD` | Diagnostics (workspace/buffer) | +| `sh` | Help pages | +| `sH` | Highlights | +| `si` | Icons | +| `sj` | Jumps | +| `sk` | Keymaps | +| `sl` | Location list | +| `sm` | Marks | +| `sM` | Man pages | +| `sp` | Search lazy.nvim plugin specs | +| `sq` | Quickfix list | +| `sR` | Resume last picker | +| `su` | Undo history | +| `ss` / `sS` | LSP symbols (buffer/workspace) | +| `uC` | Colorschemes picker | +| `.` | Toggle scratch buffer | +| `S` | Select scratch buffer | +| `N` | Neovim news | + +--- + +## Navigation + +Defined in [`lua/core/keymaps.lua`](../lua/core/keymaps.lua) and [`lua/plugins/editor/harpoon.lua`](../lua/plugins/editor/harpoon.lua). + +| Key | Action | +|-----|--------| +| `` / `` / `` / `` | Move between windows | +| `a` | Add file to Harpoon | +| `h` | Harpoon quick menu | +| `1` โ€“ `4` | Jump to Harpoon file 1โ€“4 | +| `]]` / `[[` | Next/prev reference under cursor (Snacks words) | +| `bn` / `bp` / `bd` | Next/prev/delete buffer | +| `tn` / `tp` / `to` / `tc` | Tab next/prev/new/close | +| `pd` / `pu` | Page down/up | + +--- + +## LSP + +Defined in [`lua/core/keymaps.lua`](../lua/core/keymaps.lua), [`lua/plugins/ui/snacks.lua`](../lua/plugins/ui/snacks.lua), and [`lua/plugins/tools/trouble.lua`](../lua/plugins/tools/trouble.lua). + +| Key | Action | +|-----|--------| +| `gd` | Go to definition (Snacks picker) | +| `gD` | Go to declaration | +| `gr` | References | +| `gI` | Go to implementation | +| `gy` | Go to type definition | +| `gai` / `gao` | Incoming/outgoing calls | +| `K` | Hover docs (Lspsaga) | +| `rn` | Rename (Lspsaga) | +| `ca` | Code action menu (`nvim-code-action-menu`) | +| `qf` | Code action (native) | +| `df` | Format buffer | +| `[d` / `]d` | Prev/next diagnostic (floating) | +| `xx` | Diagnostics (Trouble, pinned split) | +| `xX` | Buffer diagnostics (Trouble) | +| `cs` | Symbols (Trouble, right split) | +| `cl` | LSP list (Trouble, bottom split) | +| `xL` / `xQ` | Location/quickfix list (Trouble) | + +--- + +## Git + +Defined in [`lua/plugins/ui/snacks.lua`](../lua/plugins/ui/snacks.lua) (gitsigns/diffview/git-conflict ship their own default mappings on top of this). + +| Key | Action | +|-----|--------| +| `gg` | LazyGit | +| `gb` | Git branches | +| `gs` | Git status | +| `gl` | Git log | +| `gL` | Git log (current line) | +| `gf` | Git log for current file | +| `gd` | Git diff (hunks) | +| `gS` | Git stash | +| `gB` | Open current line in browser (normal + visual) | + +--- + +## Terminal & Build Shortcuts + +Defined in [`lua/core/keymaps.lua`](../lua/core/keymaps.lua) and [`lua/plugins/tools/terminal.lua`](../lua/plugins/tools/terminal.lua). These all shell out โ€” see [Requirements](REQUIREMENTS.md) for the runtimes they depend on. + +| Key | Action | +|-----|--------| +| `` | Toggle floating terminal | +| `ji` | `mvn clean install` | +| `jk` | `mvn clean package` | +| `jc` | `mvn clean` | +| `jt` | `mvn test` | +| `je` | `mvn exec:exec` | +| `jf` | `mvn javafx:run` | +| `jd` | `mvn javadoc:javadoc` | +| `cc` | `cmake .` | +| `cm` | `cmake --build .` | +| `cr` | `cmake --build . --target run` | +| `ct` | `ctest` | +| `cb` | `cmr` (custom build alias) | +| `rm` | Run current file in MATLAB | +| `cf` | Format current C file with `c_formatter_42` | +| `` | Insert/update 42-header (`:Stdheader`) | + +--- + +## Clipboard + +Defined in [`lua/core/keymaps.lua`](../lua/core/keymaps.lua) โ€” yanks/pastes the system clipboard (`"+`) without setting `unnamedplus` globally. + +| Key | Action | +|-----|--------| +| `y` | Yank to system clipboard (normal + visual) | +| `Y` | Yank line to system clipboard | +| `p` | Paste from system clipboard | +| `P` | Paste before, from system clipboard | + +--- + +## Editing + +Defined in [`lua/plugins/editor/comment.lua`](../lua/plugins/editor/comment.lua) and [`lua/plugins/editor/treesitter-context.lua`](../lua/plugins/editor/treesitter-context.lua). + +| Key | Action | +|-----|--------| +| `gcc` | Toggle comment, current line | +| `gc` (normal/operator/visual) | Toggle comment, linewise | +| `gbc` | Toggle comment, current block | +| `gb` (normal/operator/visual) | Toggle comment, blockwise | +| `uk` | Toggle sticky treesitter-context header | + +--- + +## Which-key Groups + +[`lua/plugins/tools/which-key.lua`](../lua/plugins/tools/which-key.lua) labels these leader prefixes so the which-key popup shows a group name instead of a flat key list: + +| Prefix | Group | +|---|---| +| `b` | buffer | +| `c` | code | +| `d` | diagnostics | +| `f` | find | +| `g` | git | +| `j` | java/maven | +| `l` | lsp | +| `m` | make | +| `n` | notifications | +| `o` | octo/pr | +| `r` | run/rename | +| `t` | tabs/terminal | +| `x` | trouble | diff --git a/docs/PLUGINS.md b/docs/PLUGINS.md new file mode 100644 index 0000000..0bc377e --- /dev/null +++ b/docs/PLUGINS.md @@ -0,0 +1,158 @@ +--- +title: Plugin Reference +--- + +# Plugin Reference + +Every plugin installed by this config, grouped the same way [`lua/plugins/`](../lua/plugins/) is organized on disk. Each entry links to its `lua/plugins/**/*.lua` spec and its upstream repo. + +โ† Back to [README](../README.md) ยท See also [Features](FEATURES.md) ยท [Key Mappings](KEYMAPS.md) ยท [Architecture](ARCHITECTURE.md) + +--- + +## Table of Contents + +- [Root-level (`plugins/init.lua`)](#root-level-pluginsinitlua) +- [UI (`plugins/ui/`)](#ui-pluginsui) +- [Editor (`plugins/editor/`)](#editor-pluginseditor) +- [Coding (`plugins/coding/`)](#coding-pluginscoding) +- [LSP (`plugins/lsp/`)](#lsp-pluginslsp) +- [Tools (`plugins/tools/`)](#tools-pluginstools) +- [Language extras (`plugins/lang/`)](#language-extras-pluginslang) + +--- + +## Root-level ([`plugins/init.lua`](../lua/plugins/init.lua)) + +Small, self-contained plugins that don't warrant their own file. + +| Plugin | What it does | +|---|---| +| [nvim-lua/plenary.nvim](https://github.com/nvim-lua/plenary.nvim) | Lua stdlib (async, paths, jobs) โ€” dependency for Telescope-style pickers, Harpoon, Diffview, Gitsigns | +| [nvim-tree/nvim-web-devicons](https://github.com/nvim-tree/nvim-web-devicons) | Filetype icon set used by lualine, the file explorer, which-key, and more | +| [tfnico/vim-gradle](https://github.com/tfnico/vim-gradle) | Syntax highlighting for Gradle build files | +| [NoamFav/Zarya.nvim](https://github.com/NoamFav/Zarya.nvim) | Control and visualize Apple Music playback from inside Neovim | +| [weilbith/nvim-code-action-menu](https://github.com/weilbith/nvim-code-action-menu) | Floating preview menu for LSP code actions (`:CodeActionMenu`, `ca`) | +| [ellisonleao/glow.nvim](https://github.com/ellisonleao/glow.nvim) | Renders Markdown in a floating preview via `glow` (`:Glow`) | +| [OXY2DEV/markview.nvim](https://github.com/OXY2Dev/markview.nvim) | Live in-buffer Markdown rendering (headings, tables, code blocks, checkboxes) without leaving the editor | +| [folke/todo-comments.nvim](https://github.com/folke/todo-comments.nvim) | Highlights and lets you search `TODO`/`FIXME`/`HACK`/`NOTE` comments across the project | +| [preservim/tagbar](https://github.com/preservim/tagbar) | Sidebar outline of tags (functions, classes, etc.) for the current file โ€” needs [Universal Ctags](https://github.com/universal-ctags/ctags) on `$PATH` | + +--- + +## UI ([`plugins/ui/`](../lua/plugins/ui/)) + +| Plugin | What it does | +|---|---| +| [folke/tokyonight.nvim](https://github.com/folke/tokyonight.nvim) | Default colorscheme (`night` style), loaded eagerly at startup | +| [catppuccin/nvim](https://github.com/catppuccin/nvim) | Pastel colorscheme, auto-switches latte/mocha with background | +| [scottmckendry/cyberdream.nvim](https://github.com/scottmckendry/cyberdream.nvim) | High-contrast cyberpunk-styled colorscheme | +| [navarasu/onedark.nvim](https://github.com/navarasu/onedark.nvim) | Atom One Dark colorscheme port | +| [sainnhe/sonokai](https://github.com/sainnhe/sonokai) | High-contrast, vivid colorscheme | +| [NoamFav/2077.nvim](https://github.com/NoamFav/2077.nvim) | A cyberpunk-themed colorscheme | +| [folke/snacks.nvim](https://github.com/folke/snacks.nvim) | The Swiss-army-knife plugin: fuzzy picker, file explorer, dashboard, notifier, LazyGit launcher, scratch buffers, big-file handling, and more โ€” see [Key Mappings](KEYMAPS.md) for the full command surface | +| [nvim-lualine/lualine.nvim](https://github.com/nvim-lualine/lualine.nvim) | Statusline + tabline/bufferline, theme-aware | +| [j-hui/fidget.nvim](https://github.com/j-hui/fidget.nvim) | LSP progress spinners and a notification history window (also overrides `vim.notify`) | +| [nvim-tree/nvim-web-devicons](https://github.com/nvim-tree/nvim-web-devicons) | (configured again here with custom overrides, e.g. a distinct `.env` icon) | +| [echasnovski/mini.icons](https://github.com/echasnovski/mini.icons) | Secondary icon provider some plugins fall back to | +| [NvChad/nvim-colorizer.lua](https://github.com/NvChad/nvim-colorizer.lua) | Highlights color codes (`#rrggbb`, Tailwind classes, etc.) with their actual color | + +--- + +## Editor ([`plugins/editor/`](../lua/plugins/editor/)) + +| Plugin | What it does | +|---|---| +| [nvim-treesitter/nvim-treesitter](https://github.com/nvim-treesitter/nvim-treesitter) (`main` branch) | Incremental parsing for syntax highlighting, indentation, and folding; parsers installed via `:TSUpdate` | +| [nvim-treesitter/nvim-treesitter-context](https://github.com/nvim-treesitter/nvim-treesitter-context) | Sticky header showing the enclosing function/loop/if while scrolling (`uk` to toggle) | +| [HiPhish/rainbow-delimiters.nvim](https://github.com/HiPhish/rainbow-delimiters.nvim) | Color-codes matching brackets/parens by nesting depth | +| [ThePrimeagen/harpoon](https://github.com/ThePrimeagen/harpoon) (v1) | Pin up to 4 files and jump between them instantly (`a`, `1-4`) | +| [windwp/nvim-autopairs](https://github.com/windwp/nvim-autopairs) | Auto-closes brackets/quotes as you type | +| [Pocco81/auto-save.nvim](https://github.com/Pocco81/auto-save.nvim) | Saves the buffer automatically on `InsertLeave`/`TextChanged`/`BufLeave` | +| [numToStr/Comment.nvim](https://github.com/numToStr/Comment.nvim) | Toggle line/block comments (`gcc`, `gc`, `gbc`, `gb`) | + +--- + +## Coding ([`plugins/coding/`](../lua/plugins/coding/)) + +| Plugin | What it does | +|---|---| +| [saghen/blink.cmp](https://github.com/saghen/blink.cmp) | The completion engine โ€” LSP, path, snippet, buffer, emoji, and dictionary sources, all scored and merged | +| [moyiz/blink-emoji.nvim](https://github.com/moyiz/blink-emoji.nvim) | Emoji completion source for blink.cmp | +| [Kaiser-Yang/blink-cmp-dictionary](https://github.com/Kaiser-Yang/blink-cmp-dictionary) | Dictionary/word-list completion source for blink.cmp (needs `fzf`; see [Requirements](REQUIREMENTS.md#dictionary-completion-optional)) | +| [L3MON4D3/LuaSnip](https://github.com/L3MON4D3/LuaSnip) | Snippet engine that powers blink.cmp's `snippets` source | +| [rafamadriz/friendly-snippets](https://github.com/rafamadriz/friendly-snippets) | A large pre-built VS Code-style snippet collection, loaded lazily by LuaSnip | + +--- + +## LSP ([`plugins/lsp/`](../lua/plugins/lsp/)) + +| Plugin | What it does | +|---|---| +| [neovim/nvim-lspconfig](https://github.com/neovim/nvim-lspconfig) | Only used for its `capabilities`/`on_attach` wildcard config here โ€” actual server definitions live in [`lua/lsp/servers.lua`](../lua/lsp/servers.lua), not this plugin's server tables | +| [williamboman/mason.nvim](https://github.com/williamboman/mason.nvim) | Package manager for LSP servers, formatters, linters (`:Mason`) | +| [williamboman/mason-lspconfig.nvim](https://github.com/williamboman/mason-lspconfig.nvim) | Bridges Mason installs to `vim.lsp.enable()`, auto-installing everything in `lsp.servers.get_server_list()` | +| [Hoffs/omnisharp-extended-lsp.nvim](https://github.com/Hoffs/omnisharp-extended-lsp.nvim) | Better go-to-definition for OmniSharp (decompiles external assemblies instead of failing) | +| [nvimdev/lspsaga.nvim](https://github.com/nvimdev/lspsaga.nvim) | Prettier floating UI for hover docs, rename, and other LSP actions | +| [WhoIsSethDaniel/mason-tool-installer.nvim](https://github.com/WhoIsSethDaniel/mason-tool-installer.nvim) | Auto-installs the formatter binaries (`prettierd`, `black`, `stylua`, `gofumpt`, โ€ฆ) listed in [`formatters.lua`](../lua/plugins/lsp/formatters.lua) | +| [nvimtools/none-ls.nvim](https://github.com/nvimtools/none-ls.nvim) (+ [none-ls-extras.nvim](https://github.com/nvimtools/none-ls-extras.nvim)) | Runs external linters as LSP diagnostics โ€” currently just `flake8` for Python | +| [mhartington/formatter.nvim](https://github.com/mhartington/formatter.nvim) | Per-filetype formatter dispatch (`df` / format-on-save) โ€” see the full exe list in [`formatters.lua`](../lua/plugins/lsp/formatters.lua) | +| [Diogo-ss/42-header.nvim](https://github.com/Diogo-ss/42-header.nvim) | Stamps/updates the 42 School standard header comment (``, `:Stdheader`) | + +--- + +## Tools ([`plugins/tools/`](../lua/plugins/tools/)) + +| Plugin | What it does | +|---|---| +| [f-person/git-blame.nvim](https://github.com/f-person/git-blame.nvim) | Inline virtual-text blame for the current line | +| [sindrets/diffview.nvim](https://github.com/sindrets/diffview.nvim) | Side-by-side diff views and file-history browsing (`:DiffviewOpen`) | +| [lewis6991/gitsigns.nvim](https://github.com/lewis6991/gitsigns.nvim) | Git change markers in the sign column (add/change/delete hunks) | +| [akinsho/git-conflict.nvim](https://github.com/akinsho/git-conflict.nvim) | Highlights and gives keymaps for resolving merge conflicts in-buffer | +| [akinsho/toggleterm.nvim](https://github.com/akinsho/toggleterm.nvim) | Floating/managed terminal windows (``) | +| [folke/trouble.nvim](https://github.com/folke/trouble.nvim) | Persistent, pinnable list views for diagnostics, LSP references/symbols, quickfix, and loclist | +| [folke/which-key.nvim](https://github.com/folke/which-key.nvim) | Popup showing available keymaps as you type a prefix; also defines the `{b,c,d,f,g,l,m,n,t,x}` group labels | + +--- + +## Language extras ([`plugins/lang/`](../lua/plugins/lang/)) + +These sit **on top of** the LSP servers defined in [`lua/lsp/servers.lua`](../lua/lsp/servers.lua) โ€” they add tooling, not the language server itself. + +| Plugin | What it does | +|---|---| +| [ray-x/go.nvim](https://github.com/ray-x/go.nvim) (+ [guihua.lua](https://github.com/ray-x/guihua.lua)) | Go tooling: `:GoRun`, `:GoTest*`, coverage overlay, `:GoAddTag`/`:GoRmTag`, `:GoIfErr`, `:GoFillStruct`, `:GoImpl`; installs `gomodifytags`/`gotests`/`iferr`/`impl`/`dlv` on build. `gopls` itself stays owned by `servers.lua` (`lsp_cfg = false`) | +| [mrcjkb/rustaceanvim](https://github.com/mrcjkb/rustaceanvim) | Rust tooling: clippy-on-save, `:RustLsp` runnables/debuggables/hover actions. Unlike every other language here, it owns `rust_analyzer`'s startup itself โ€” `servers.lua` still lists it so mason installs/updates the binary, but `mason-lspconfig`'s auto-enable explicitly excludes it | +| [mfussenegger/nvim-jdtls](https://github.com/mfussenegger/nvim-jdtls) | Java-specific extensions on top of `jdtls` | +| [p00f/clangd_extensions.nvim](https://github.com/p00f/clangd_extensions.nvim) | C/C++ inlay hints (param names/types) and an AST viewer, built on `clangd` | +| [m-demare/hlargs.nvim](https://github.com/m-demare/hlargs.nvim) | Colors function parameters consistently across C/C++, Go, Rust, Lua, Python, JS/TS, Java, and more | +| [maxmellon/vim-jsx-pretty](https://github.com/maxmellon/vim-jsx-pretty) | JSX/TSX syntax highlighting | +| [luckasRanarison/tailwind-tools.nvim](https://github.com/luckasRanarison/tailwind-tools.nvim) | Tailwind CSS class previews/tools for HTML/CSS/JS/TS | +| [lervag/vimtex](https://github.com/lervag/vimtex) | LaTeX compilation (via `latexmk`), viewing, and navigation | +| [daeyun/vim-matlab](https://github.com/daeyun/vim-matlab) | MATLAB syntax and filetype support | +| [3rd/image.nvim](https://github.com/3rd/image.nvim) | Renders images inline in the buffer via the Kitty graphics protocol | +| [benlubas/molten-nvim](https://github.com/benlubas/molten-nvim) | Jupyter kernel integration โ€” run cells, see plots/output inline via `image.nvim` | + +--- + +## Full dependency graph (Mermaid) + +```mermaid +flowchart TD + init[init.lua] --> lazy[lazy.nvim bootstrap] + lazy --> plugins[plugins.init] + plugins --> ui[plugins.ui] + plugins --> editor[plugins.editor] + plugins --> coding[plugins.coding] + plugins --> lsp[plugins.lsp] + plugins --> tools[plugins.tools] + plugins --> lang[plugins.lang] + + lsp --> mason[mason.nvim] + mason --> servers[lsp/servers.lua server list] + servers --> vimlsp["vim.lsp.config / vim.lsp.enable"] + + lang --> servers + coding --> blink[blink.cmp] + vimlsp --> blink +``` diff --git a/docs/REQUIREMENTS.md b/docs/REQUIREMENTS.md new file mode 100644 index 0000000..007f032 --- /dev/null +++ b/docs/REQUIREMENTS.md @@ -0,0 +1,118 @@ +--- +title: Requirements +--- + +# Requirements + +What this config needs installed, and *why* โ€” organized by category. For OS-specific install commands (Homebrew/apt/dnf/pacman/winget), see [Install Guide](INSTALL.md) instead; this doc is the reference for what each dependency is for. + +โ† Back to [README](../README.md) ยท See also [Install Guide](INSTALL.md) + +--- + +## Table of Contents + +- [Core](#core) +- [Language Runtimes](#language-runtimes) +- [Jupyter Notebooks](#jupyter-notebooks-molten--imagenvim) +- [42 School Tooling](#42-school-tooling-optional) +- [Dictionary Completion](#dictionary-completion-optional) +- [Manual Setup: OmniSharp](#manual-setup-omnisharp) + +--- + +Mason (`:Mason`) auto-installs LSP servers and formatters on first launch, but each server still needs its **underlying language runtime** on `$PATH` โ€” Mason doesn't install compilers or SDKs. + +## Core + +| Requirement | Version | Why | +|---|---|---| +| [Neovim](https://neovim.io/) | `>= 0.11.0` | Native `vim.lsp.config`/`vim.lsp.enable` API | +| [Git](https://git-scm.com/) | `>= 2.19.0` | Plugin management, Gitsigns, Diffview, git-blame | +| [Nerd Font](https://www.nerdfonts.com/) | any | Icons in lualine, devicons, mini-icons, which-key, Trouble | +| Terminal with true color | โ€” | `termguicolors` is on; transparent colorschemes need support | +| [ripgrep](https://github.com/BurntSushi/ripgrep) | latest | Backs every `Snacks.picker` grep source | +| [fd](https://github.com/sharkdp/fd) | latest | Faster file discovery for `Snacks.picker.files` | +| [lazygit](https://github.com/jesseduffield/lazygit) | latest | `gg` opens `Snacks.lazygit()` | +| [tree-sitter CLI](https://github.com/tree-sitter/tree-sitter/blob/master/cli/README.md) | latest | `nvim-treesitter` (`main` branch) shells out to it for `:TSUpdate`/`.install()` | +| C compiler (`cc`/`gcc`/`clang`) | โ€” | Needed alongside the tree-sitter CLI to compile parsers | +| [Universal Ctags](https://github.com/universal-ctags/ctags) | latest | Powers the `tagbar` sidebar outline | + +## Language Runtimes + +| Language | Runtime needed | Notes | +|---|---|---| +| Go | [Go](https://go.dev/) `>= 1.21` | `gopls`, `gofumpt`, and go.nvim's `gomodifytags`/`gotests`/`iferr`/`impl`/`dlv` (built via `go install` on first launch) | +| Rust | [Rust](https://rustup.rs/) (cargo) | `rust_analyzer`, `rustfmt` | +| Python | Python `>= 3.8` + pip | `pyright`, `black`, `isort`, `flake8` (via none-ls) | +| Node.js | Node `>= 16` | `ts_ls`, `eslint`, `html`, `emmet_ls`, `tailwindcss`, `jsonls`, `svelte`, `graphql`, `prettierd` | +| Java | JDK `>= 17` + [Maven](https://maven.apache.org/) | `jdtls`, `google-java-format`; `m*` shells out to `mvn` | +| C / C++ | Clang toolchain | `clangd`, `clang-format` | +| C# | [.NET SDK](https://dotnet.microsoft.com/) (+ Mono) | OmniSharp โ€” **not Mason-managed**, see [below](#manual-setup-omnisharp) | +| Kotlin | JDK + Gradle/Maven project | `kotlin_language_server`, `ktlint` | +| PHP | PHP + [Composer](https://getcomposer.org/) | `phpactor` | +| Ruby | Ruby + Bundler | `solargraph` (gem) | +| Lua | bundled (LuaJIT via Neovim) | `lua_ls`, `stylua` | +| Bash | โ€” | `bashls`, `shfmt`, `beautysh` | +| Docker | โ€” | `dockerls`; Dockerfile formatting expects `dockerfilelint` on `$PATH` (manual, not Mason-managed) | +| Terraform | [Terraform](https://developer.hashicorp.com/terraform) CLI | `terraformls` | +| SQL | โ€” | `sqlls`, `sqlfmt` | +| XML | โ€” | `lemminx`, `xmlformatter` | +| Perl | Perl | `perlnavigator` | +| Arduino | [arduino-cli](https://arduino.github.io/arduino-cli/) | `arduino_language_server`; expects `~/.arduino15/arduino-cli.yaml`, targets `adafruit:samd:adafruit_feather_m0` โ€” edit [lua/lsp/servers.lua](../lua/lsp/servers.lua) for your board | +| Swift | Xcode command line tools | `sourcekit-lsp` via `xcrun` โ€” **macOS only**, not Mason-managed | +| Dart | [Dart SDK](https://dart.dev/get-dart) | `dartls` โ€” not Mason-managed | +| Scala | [Metals](https://scalameta.org/metals/) prerequisites (JDK, sbt/mill) | `metals` โ€” not Mason-managed | +| LaTeX | TeX distribution (e.g. [MacTeX](https://tug.org/mactex/)) incl. `latexmk` | `ltex-ls`, `latexindent`; compiled via VimTeX | +| MATLAB | MATLAB with `matlab` CLI on `$PATH` | `rm` shells out to `matlab -nojvm -nosplash -nodesktop` | + +```bash +# Example (macOS/Homebrew) โ€” pick what you actually need. See INSTALL.md for other OSes. +brew install go rustup python node openjdk maven composer terraform +``` + +> [!NOTE] +> OmniSharp, sourcekit, dartls, and metals are configured in [lua/lsp/servers.lua](../lua/lsp/servers.lua) but excluded from `M.get_server_list()`'s Mason `ensure_installed` list โ€” install their binaries yourself and put them on `$PATH`. + +## Jupyter Notebooks (Molten + image.nvim) + +| Requirement | Purpose | +|---|---| +| Kitty-graphics-protocol terminal (Kitty, WezTerm, Ghostty) | `image.nvim` is configured with `backend = "kitty"` | +| `pynvim`, `jupyter_client`, `cairosvg`, `pnglatex` (pip) | Molten kernel + LaTeX/plot rendering | +| [ImageMagick](https://imagemagick.org/) | Plot rendering | + +```bash +pip install pynvim jupyter_client cairosvg pnglatex +brew install imagemagick +``` + +## 42 School Tooling (optional) + +[lua/plugins/lsp/header42.lua](../lua/plugins/lsp/header42.lua) adds header-stamping (``); Norm checking is its own hand-rolled module, [lua/core/norminette.lua](../lua/core/norminette.lua) (`:NorminetteToggle`); `cf` shells out to a formatter. + +```bash +pip install norminette +# c_formatter_42 must be on $PATH โ€” https://github.com/42-Short/c_formatter_42 +``` + +Update `user`/`mail` in [lua/plugins/lsp/header42.lua](../lua/plugins/lsp/header42.lua) and `vim.g.user42`/`vim.g.mail42` in [lua/core/options.lua](../lua/core/options.lua) to your own login. + +## Dictionary Completion (optional) + +```bash +brew install fzf wordnet +mkdir -p ~/.config/dictionaries +cp /usr/share/dict/words ~/.config/dictionaries/words.txt +``` + +## Manual Setup: OmniSharp + +`servers.lua` expects the OmniSharp binary at `~/.local/bin/omnisharp` (not installed by Mason). [scripts/install.sh](../scripts/install.sh) fetches this automatically on macOS/Linux if you include `dotnet` in its language selection โ€” otherwise: + +```bash +mkdir -p ~/.local/bin +# Download the matching release for your OS from: +# https://github.com/OmniSharp/omnisharp-roslyn/releases +# and extract it to ~/.local/bin/omnisharp +``` diff --git a/init.lua b/init.lua index 0656e22..a68bb64 100644 --- a/init.lua +++ b/init.lua @@ -1,3 +1,4 @@ +-- Bootstrap lazy.nvim local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" if not vim.loop.fs_stat(lazypath) then vim.fn.system({ @@ -5,68 +6,55 @@ if not vim.loop.fs_stat(lazypath) then "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", - "--branch=stable", -- latest stable release + "--branch=stable", lazypath, }) end - -vim.g.mapleader = " " - vim.opt.rtp:prepend(lazypath) -require("lazy").setup("plugins") -vim.cmd("source ~/.config/nvim/keymaps.vim") - -vim.diagnostic.config({ - virtual_text = true, - update_in_insert = true, - severity_sort = true, +-- Leader keys +vim.g.mapleader = " " +vim.g.maplocalleader = " " + +vim.o.termguicolors = true + +-- Load core configuration +require("core.options") +require("core.keymaps") +require("core.autocmds") +require("core.diagnostics") +require("core.norminette").setup() +require("core.semantic_tokens").setup() +require("core.rainbow_var").setup() + +-- Setup lazy.nvim +require("lazy").setup("plugins", { + defaults = { lazy = true }, + install = { colorscheme = { "tokyonight" } }, + checker = { enabled = true }, + performance = { + rtp = { + disabled_plugins = { + "gzip", + "tarPlugin", + "tohtml", + "tutor", + "zipPlugin", + }, + }, + }, }) -vim.g.OmniSharp_server_use_mono = 0 - -local harpoon = require("harpoon") -local mark = require("harpoon.mark") -local ui = require("harpoon.ui") - --- Add a file to Harpoon's quick access list -vim.api.nvim_set_keymap( - "n", - "a", - "lua require('harpoon.mark').add_file()", - { noremap = true, silent = true } -) - --- Open Harpoon's quick access menu -vim.api.nvim_set_keymap( - "n", - "h", - "lua require('harpoon.ui').toggle_quick_menu()", - { noremap = true, silent = true } -) - --- Navigate to files by Harpoon index -vim.api.nvim_set_keymap( - "n", - "1", - "lua require('harpoon.ui').nav_file(1)", - { noremap = true, silent = true } -) -vim.api.nvim_set_keymap( - "n", - "2", - "lua require('harpoon.ui').nav_file(2)", - { noremap = true, silent = true } -) -vim.api.nvim_set_keymap( - "n", - "3", - "lua require('harpoon.ui').nav_file(3)", - { noremap = true, silent = true } -) -vim.api.nvim_set_keymap( - "n", - "4", - "lua require('harpoon.ui').nav_file(4)", - { noremap = true, silent = true } -) +-- Wallpaper-driven colorscheme (nvim/colors/wallpaper.lua, palette from +-- nvim/lua/colors_generated.lua, regenerated by sketchybar/theme/generate.sh +-- whenever the wallpaper changes). That file is gitignored (machine- +-- specific) -- on a fresh clone, or any machine that never ran sketchybar, +-- fall back to the real tokyonight-night (tokyonight.nvim is lazy=false, +-- so it's already loaded by this point). Checked after lazy.setup(), not +-- before: tokyonight-night wouldn't be resolvable yet otherwise. +local colors_generated = vim.fn.stdpath("config") .. "/lua/colors_generated.lua" +if vim.loop.fs_stat(colors_generated) then + vim.cmd.colorscheme("wallpaper") +else + vim.cmd.colorscheme("tokyonight-night") +end diff --git a/init.lua.bak b/init.lua.bak new file mode 100644 index 0000000..7454e46 --- /dev/null +++ b/init.lua.bak @@ -0,0 +1,44 @@ +-- Bootstrap lazy.nvim +local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" +if not vim.loop.fs_stat(lazypath) then + vim.fn.system({ + "git", + "clone", + "--filter=blob:none", + "https://github.com/folke/lazy.nvim.git", + "--branch=stable", + lazypath, + }) +end +vim.opt.rtp:prepend(lazypath) + +-- Leader keys +vim.g.mapleader = " " +vim.g.maplocalleader = " " + +-- Load core configuration +require("core.options") +require("core.keymaps") +require("core.autocmds") +require("core.diagnostics") +require("core.norminette").setup() +require("core.semantic_tokens").setup() +require("core.rainbow_var").setup() + +-- Setup lazy.nvim +require("lazy").setup("plugins", { + defaults = { lazy = true }, + install = { colorscheme = { "tokyonight" } }, + checker = { enabled = true }, + performance = { + rtp = { + disabled_plugins = { + "gzip", + "tarPlugin", + "tohtml", + "tutor", + "zipPlugin", + }, + }, + }, +}) diff --git a/keymaps.vim b/keymaps.vim deleted file mode 100644 index d9562fc..0000000 --- a/keymaps.vim +++ /dev/null @@ -1,125 +0,0 @@ -set termguicolors " Enable true color support -set t_ZH=[3m " Enable italics -set t_ZR=[23m " Disable italics - -let g:sonokai_style = 'andromeda' -let g:sonokai_enable_italic = 1 -let g:sonokai_better_performance = 1 - -colorscheme tokyonight-night - -let g:copilot_enabled = v:true -" Trigger completion -imap