From 085347ddaca23d39d47aa40a0ab535ab4a8970dc Mon Sep 17 00:00:00 2001 From: "saarsena@gmail.com" Date: Wed, 8 Apr 2026 06:38:52 -0400 Subject: [PATCH] woohooo --- .github/ISSUE_TEMPLATE/bug_report.md | 35 ++++ .github/pull_request_template.md | 8 + .github/workflows/stylua.yml | 21 +++ .gitignore | 8 + .stylua.toml | 6 + COMMANDS.md | 164 ++++++++++++++++++ LICENSE.md | 19 +++ README.md | 241 +++++++++++++++++++++++++++ colors/custom.lua | 155 +++++++++++++++++ doc/kickstart.txt | 24 +++ init.lua | 44 +++++ lua/config/autocmds.lua | 22 +++ lua/config/keymaps.lua | 61 +++++++ lua/config/options.lua | 34 ++++ lua/custom/claude-code.lua | 61 +++++++ lua/custom/godot_config.lua | 28 ++++ lua/custom/oil_config.lua | 209 +++++++++++++++++++++++ lua/kickstart/health.lua | 52 ++++++ lua/plugins/alpha.lua | 39 +++++ lua/plugins/autopairs.lua | 5 + lua/plugins/blink-cmp.lua | 54 ++++++ lua/plugins/bufferline.lua | 23 +++ lua/plugins/claude-code.lua | 9 + lua/plugins/codecompanion.lua | 53 ++++++ lua/plugins/comment.lua | 11 ++ lua/plugins/conform.lua | 41 +++++ lua/plugins/flash.lua | 12 ++ lua/plugins/gitsigns.lua | 12 ++ lua/plugins/godot.lua | 8 + lua/plugins/gruvbox.lua | 11 ++ lua/plugins/guess-indent.lua | 4 + lua/plugins/harpoon.lua | 17 ++ lua/plugins/indent-blankline.lua | 12 ++ lua/plugins/lsp.lua | 153 +++++++++++++++++ lua/plugins/lualine.lua | 19 +++ lua/plugins/mini.lua | 7 + lua/plugins/neoscroll.lua | 11 ++ lua/plugins/noice.lua | 24 +++ lua/plugins/oil.lua | 7 + lua/plugins/rainbow-csv.lua | 6 + lua/plugins/spectre.lua | 9 + lua/plugins/telescope.lua | 58 +++++++ lua/plugins/thesaurus.lua | 9 + lua/plugins/todo-comments.lua | 6 + lua/plugins/treesitter.lua | 36 ++++ lua/plugins/trouble.lua | 13 ++ lua/plugins/undotree.lua | 6 + lua/plugins/vim-tmux-navigator.lua | 17 ++ lua/plugins/which-key.lua | 47 ++++++ 49 files changed, 1931 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/pull_request_template.md create mode 100644 .github/workflows/stylua.yml create mode 100644 .gitignore create mode 100644 .stylua.toml create mode 100644 COMMANDS.md create mode 100644 LICENSE.md create mode 100644 README.md create mode 100644 colors/custom.lua create mode 100644 doc/kickstart.txt create mode 100644 init.lua create mode 100644 lua/config/autocmds.lua create mode 100644 lua/config/keymaps.lua create mode 100644 lua/config/options.lua create mode 100644 lua/custom/claude-code.lua create mode 100644 lua/custom/godot_config.lua create mode 100644 lua/custom/oil_config.lua create mode 100644 lua/kickstart/health.lua create mode 100644 lua/plugins/alpha.lua create mode 100644 lua/plugins/autopairs.lua create mode 100644 lua/plugins/blink-cmp.lua create mode 100644 lua/plugins/bufferline.lua create mode 100644 lua/plugins/claude-code.lua create mode 100644 lua/plugins/codecompanion.lua create mode 100644 lua/plugins/comment.lua create mode 100644 lua/plugins/conform.lua create mode 100644 lua/plugins/flash.lua create mode 100644 lua/plugins/gitsigns.lua create mode 100644 lua/plugins/godot.lua create mode 100644 lua/plugins/gruvbox.lua create mode 100644 lua/plugins/guess-indent.lua create mode 100644 lua/plugins/harpoon.lua create mode 100644 lua/plugins/indent-blankline.lua create mode 100644 lua/plugins/lsp.lua create mode 100644 lua/plugins/lualine.lua create mode 100644 lua/plugins/mini.lua create mode 100644 lua/plugins/neoscroll.lua create mode 100644 lua/plugins/noice.lua create mode 100644 lua/plugins/oil.lua create mode 100644 lua/plugins/rainbow-csv.lua create mode 100644 lua/plugins/spectre.lua create mode 100644 lua/plugins/telescope.lua create mode 100644 lua/plugins/thesaurus.lua create mode 100644 lua/plugins/todo-comments.lua create mode 100644 lua/plugins/treesitter.lua create mode 100644 lua/plugins/trouble.lua create mode 100644 lua/plugins/undotree.lua create mode 100644 lua/plugins/vim-tmux-navigator.lua create mode 100644 lua/plugins/which-key.lua diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..0510461 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,35 @@ +--- +name: Bug report +about: Create a report to help us improve +title: '' +labels: '' +assignees: '' + +--- + + + +## Before Reporting an Issue +- I have read the kickstart.nvim README.md. +- I have read the appropriate plugin's documentation. +- I have searched that this issue has not been reported before. + +- [ ] **By checking this, I confirm that the above steps are completed. I understand leaving this unchecked will result in this report being closed immediately.** + +## Describe the bug + + +## To Reproduce + +1. ... + +## Desktop + +- OS: +- Terminal: + +## Neovim Version + + +``` +``` diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..26c6bc1 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,8 @@ +*************************************************************************** +**NOTE** +Please verify that the `base repository` above has the intended destination! +Github by default opens Pull Requests against the parent of a forked repository. +If this is your personal fork and you didn't intend to open a PR for contribution +to the original project then adjust the `base repository` accordingly. +************************************************************************** + diff --git a/.github/workflows/stylua.yml b/.github/workflows/stylua.yml new file mode 100644 index 0000000..5c129ef --- /dev/null +++ b/.github/workflows/stylua.yml @@ -0,0 +1,21 @@ +# Check Lua Formatting +name: Check Lua Formatting +on: pull_request_target + +jobs: + stylua-check: + if: github.repository == 'nvim-lua/kickstart.nvim' + name: Stylua Check + runs-on: ubuntu-latest + steps: + - name: Checkout Code + uses: actions/checkout@v2 + with: + ref: ${{ github.event.pull_request.head.sha }} + - name: Stylua Check + uses: JohnnyMorganz/stylua-action@v3 + with: + token: ${{ secrets.GITHUB_TOKEN }} + version: latest + args: --check . + diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d65d268 --- /dev/null +++ b/.gitignore @@ -0,0 +1,8 @@ +tags +test.sh +.luarc.json +nvim +CLAUDE.md +spell/ +lazy-lock.json +.claude/ diff --git a/.stylua.toml b/.stylua.toml new file mode 100644 index 0000000..77e5d9c --- /dev/null +++ b/.stylua.toml @@ -0,0 +1,6 @@ +column_width = 160 +line_endings = "Unix" +indent_type = "Spaces" +indent_width = 2 +quote_style = "AutoPreferSingle" +call_parentheses = "None" diff --git a/COMMANDS.md b/COMMANDS.md new file mode 100644 index 0000000..bc7e2c6 --- /dev/null +++ b/COMMANDS.md @@ -0,0 +1,164 @@ +# Neovim Key Bindings Reference + +Leader key: `` + +## General + +| Key | Mode | Description | +|-----|------|-------------| +| `` | Normal | Clear search highlights | +| `q` | Normal | Open diagnostic quickfix list | +| `-` | Normal | Open Oil.nvim file explorer | + +## Window Navigation + +| Key | Mode | Description | +|-----|------|-------------| +| `` | Normal | Move focus to the left window | +| `` | Normal | Move focus to the right window | +| `` | Normal | Move focus to the lower window | +| `` | Normal | Move focus to the upper window | + +## Terminal + +| Key | Mode | Description | +|-----|------|-------------| +| `` | Terminal | Exit terminal mode | + +**Note:** There's no built-in keymap to open a terminal. Use these commands: +- `:terminal` - Open terminal in current window +- `:split \| terminal` - Open terminal in horizontal split +- `:vsplit \| terminal` - Open terminal in vertical split + +## Toggle Commands + +| Key | Mode | Description | +|-----|------|-------------| +| `ts` | Normal | Toggle spell check | +| `tw` | Normal | Toggle word wrap | +| `tc` | Normal | Toggle colorcolumn (80 chars) | +| `tt` | Normal | Toggle textwidth auto-wrap | +| `th` | Normal | Toggle LSP inlay hints (when supported) | + +## Column Settings + +| Key | Mode | Description | +|-----|------|-------------| +| `cc` | Normal | Set colorcolumn width (prompts for value) | + +## Text Editing + +| Key | Mode | Description | +|-----|------|-------------| +| `` | Normal | Toggle comment on current line | +| `` | Visual | Toggle comment on selected lines | +| `f` | Normal/Visual | Format buffer/selection | +| `z/` | Normal | Find synonyms for word under cursor (thesaurus) | + +## Search (Telescope) + +| Key | Mode | Description | +|-----|------|-------------| +| `sf` | Normal | Search files | +| `sg` | Normal | Search by grep (live grep) | +| `sw` | Normal | Search current word | +| `sh` | Normal | Search help documentation | +| `sk` | Normal | Search keymaps | +| `ss` | Normal | Search select Telescope pickers | +| `sd` | Normal | Search diagnostics | +| `sr` | Normal | Resume last search | +| `s.` | Normal | Search recent files | +| `sn` | Normal | Search Neovim config files | +| `s/` | Normal | Search in open files | +| `/` | Normal | Fuzzy search in current buffer | +| `` | Normal | Find existing buffers | + +## LSP (Language Server Protocol) + +These keymaps are only available when an LSP is attached to the buffer. + +| Key | Mode | Description | +|-----|------|-------------| +| `grn` | Normal | Rename symbol | +| `gra` | Normal/Visual | Code action | +| `grr` | Normal | Find references | +| `grd` | Normal | Go to definition | +| `grD` | Normal | Go to declaration | +| `gri` | Normal | Go to implementation | +| `grt` | Normal | Go to type definition | +| `gO` | Normal | Document symbols | +| `gW` | Normal | Workspace symbols | + +**LSP Navigation Tip:** After jumping to a definition with `grd`, press `` to jump back. + +## AI Assistants + +### Claude Code +| Key | Mode | Description | +|-----|------|-------------| +| `` | Normal/Terminal | Toggle Claude Code terminal | +| `cC` | Normal | Continue last conversation | +| `cV` | Normal | Verbose mode | + +### GitHub Copilot +| Key | Mode | Description | +|-----|------|-------------| +| `` | Insert | Accept Copilot suggestion | + +**Commands:** +- `:CopilotChat` - Open Copilot chat +- `:CopilotChatModels` - View available models + +## Godot Integration + +**Commands:** +- `:GodotDebug` - Start debugging +- `:GodotBreakAtCursor` - Set breakpoint at cursor +- `:GodotStep` - Step through debugger +- `:GodotQuit` - Quit debugger +- `:GodotContinue` - Continue execution + +## Plugin Management + +**Commands:** +- `:Lazy` - Open lazy.nvim UI +- `:Lazy update` - Update all plugins +- `:Lazy sync` - Install missing and update existing plugins +- `:Lazy clean` - Remove unused plugins + +## LSP & Tools Management + +**Commands:** +- `:Mason` - Open Mason UI to manage LSP servers +- `:checkhealth` - Run health checks +- `:checkhealth lsp` - Check LSP configuration + +## Autocompletion (Blink.cmp) + +In insert mode during completion: + +| Key | Description | +|-----|-------------| +| `` | Accept completion (default preset) | +| `` / `` | Move to next/previous snippet field | +| `` | Open menu or toggle documentation | +| `` / `` | Select next/previous item | +| `` / `` | Select next/previous item | +| `` | Hide menu | +| `` | Toggle signature help | + +## Useful Neovim Commands + +| Command | Description | +|---------|-------------| +| `:Tutor` | Interactive Neovim tutorial | +| `:help` | Open help documentation | +| `:ConformInfo` | View formatting configuration | +| `:Thesaurus` | Manual thesaurus lookup | + +## Tips + +1. Press `` and wait briefly to see all available leader key combinations (via which-key) +2. In Telescope search, press `` (insert mode) or `?` (normal mode) to see available keymaps +3. The colorscheme is Catppuccin Macchiato (change at init.lua:1043) +4. Format-on-save is enabled by default (except for C/C++) diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..9dccfa4 --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,19 @@ +MIT License + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..a7cec34 --- /dev/null +++ b/README.md @@ -0,0 +1,241 @@ +# kickstart.nvim + +## Introduction + +A starting point for Neovim that is: + +* Small +* Single-file +* Completely Documented + +**NOT** a Neovim distribution, but instead a starting point for your configuration. + +## Installation + +### Install Neovim + +Kickstart.nvim targets *only* the latest +['stable'](https://github.com/neovim/neovim/releases/tag/stable) and latest +['nightly'](https://github.com/neovim/neovim/releases/tag/nightly) of Neovim. +If you are experiencing issues, please make sure you have the latest versions. + +### Install External Dependencies + +External Requirements: +- Basic utils: `git`, `make`, `unzip`, C Compiler (`gcc`) +- [ripgrep](https://github.com/BurntSushi/ripgrep#installation), + [fd-find](https://github.com/sharkdp/fd#installation) +- Clipboard tool (xclip/xsel/win32yank or other depending on the platform) +- A [Nerd Font](https://www.nerdfonts.com/): optional, provides various icons + - if you have it set `vim.g.have_nerd_font` in `init.lua` to true +- Emoji fonts (Ubuntu only, and only if you want emoji!) `sudo apt install fonts-noto-color-emoji` +- Language Setup: + - If you want to write Typescript, you need `npm` + - If you want to write Golang, you will need `go` + - etc. + +> [!NOTE] +> See [Install Recipes](#Install-Recipes) for additional Windows and Linux specific notes +> and quick install snippets + +### Install Kickstart + +> [!NOTE] +> [Backup](#FAQ) your previous configuration (if any exists) + +Neovim's configurations are located under the following paths, depending on your OS: + +| OS | PATH | +| :- | :--- | +| Linux, MacOS | `$XDG_CONFIG_HOME/nvim`, `~/.config/nvim` | +| Windows (cmd)| `%localappdata%\nvim\` | +| Windows (powershell)| `$env:LOCALAPPDATA\nvim\` | + +#### Recommended Step + +[Fork](https://docs.github.com/en/get-started/quickstart/fork-a-repo) this repo +so that you have your own copy that you can modify, then install by cloning the +fork to your machine using one of the commands below, depending on your OS. + +> [!NOTE] +> Your fork's URL will be something like this: +> `https://github.com//kickstart.nvim.git` + +You likely want to remove `lazy-lock.json` from your fork's `.gitignore` file +too - it's ignored in the kickstart repo to make maintenance easier, but it's +[recommended to track it in version control](https://lazy.folke.io/usage/lockfile). + +#### Clone kickstart.nvim + +> [!NOTE] +> If following the recommended step above (i.e., forking the repo), replace +> `nvim-lua` with `` in the commands below + +
Linux and Mac + +```sh +git clone https://github.com/nvim-lua/kickstart.nvim.git "${XDG_CONFIG_HOME:-$HOME/.config}"/nvim +``` + +
+ +
Windows + +If you're using `cmd.exe`: + +``` +git clone https://github.com/nvim-lua/kickstart.nvim.git "%localappdata%\nvim" +``` + +If you're using `powershell.exe` + +``` +git clone https://github.com/nvim-lua/kickstart.nvim.git "${env:LOCALAPPDATA}\nvim" +``` + +
+ +### Post Installation + +Start Neovim + +```sh +nvim +``` + +That's it! Lazy will install all the plugins you have. Use `:Lazy` to view +the current plugin status. Hit `q` to close the window. + +#### Read The Friendly Documentation + +Read through the `init.lua` file in your configuration folder for more +information about extending and exploring Neovim. That also includes +examples of adding popularly requested plugins. + +> [!NOTE] +> For more information about a particular plugin check its repository's documentation. + + +### Getting Started + +[The Only Video You Need to Get Started with Neovim](https://youtu.be/m8C0Cq9Uv9o) + +### FAQ + +* What should I do if I already have a pre-existing Neovim configuration? + * You should back it up and then delete all associated files. + * This includes your existing init.lua and the Neovim files in `~/.local` + which can be deleted with `rm -rf ~/.local/share/nvim/` +* Can I keep my existing configuration in parallel to kickstart? + * Yes! You can use [NVIM_APPNAME](https://neovim.io/doc/user/starting.html#%24NVIM_APPNAME)`=nvim-NAME` + to maintain multiple configurations. For example, you can install the kickstart + configuration in `~/.config/nvim-kickstart` and create an alias: + ``` + alias nvim-kickstart='NVIM_APPNAME="nvim-kickstart" nvim' + ``` + When you run Neovim using `nvim-kickstart` alias it will use the alternative + config directory and the matching local directory + `~/.local/share/nvim-kickstart`. You can apply this approach to any Neovim + distribution that you would like to try out. +* What if I want to "uninstall" this configuration: + * See [lazy.nvim uninstall](https://lazy.folke.io/usage#-uninstalling) information +* Why is the kickstart `init.lua` a single file? Wouldn't it make sense to split it into multiple files? + * The main purpose of kickstart is to serve as a teaching tool and a reference + configuration that someone can easily use to `git clone` as a basis for their own. + As you progress in learning Neovim and Lua, you might consider splitting `init.lua` + into smaller parts. A fork of kickstart that does this while maintaining the + same functionality is available here: + * [kickstart-modular.nvim](https://github.com/dam9000/kickstart-modular.nvim) + * Discussions on this topic can be found here: + * [Restructure the configuration](https://github.com/nvim-lua/kickstart.nvim/issues/218) + * [Reorganize init.lua into a multi-file setup](https://github.com/nvim-lua/kickstart.nvim/pull/473) + +### Install Recipes + +Below you can find OS specific install instructions for Neovim and dependencies. + +After installing all the dependencies continue with the [Install Kickstart](#Install-Kickstart) step. + +#### Windows Installation + +
Windows with Microsoft C++ Build Tools and CMake +Installation may require installing build tools and updating the run command for `telescope-fzf-native` + +See `telescope-fzf-native` documentation for [more details](https://github.com/nvim-telescope/telescope-fzf-native.nvim#installation) + +This requires: + +- Install CMake and the Microsoft C++ Build Tools on Windows + +```lua +{'nvim-telescope/telescope-fzf-native.nvim', build = 'cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build' } +``` +
+
Windows with gcc/make using chocolatey +Alternatively, one can install gcc and make which don't require changing the config, +the easiest way is to use choco: + +1. install [chocolatey](https://chocolatey.org/install) +either follow the instructions on the page or use winget, +run in cmd as **admin**: +``` +winget install --accept-source-agreements chocolatey.chocolatey +``` + +2. install all requirements using choco, exit the previous cmd and +open a new one so that choco path is set, and run in cmd as **admin**: +``` +choco install -y neovim git ripgrep wget fd unzip gzip mingw make +``` +
+
WSL (Windows Subsystem for Linux) + +``` +wsl --install +wsl +sudo add-apt-repository ppa:neovim-ppa/unstable -y +sudo apt update +sudo apt install make gcc ripgrep unzip git xclip neovim +``` +
+ +#### Linux Install +
Ubuntu Install Steps + +``` +sudo add-apt-repository ppa:neovim-ppa/unstable -y +sudo apt update +sudo apt install make gcc ripgrep unzip git xclip neovim +``` +
+
Debian Install Steps + +``` +sudo apt update +sudo apt install make gcc ripgrep unzip git xclip curl + +# Now we install nvim +curl -LO https://github.com/neovim/neovim/releases/latest/download/nvim-linux-x86_64.tar.gz +sudo rm -rf /opt/nvim-linux-x86_64 +sudo mkdir -p /opt/nvim-linux-x86_64 +sudo chmod a+rX /opt/nvim-linux-x86_64 +sudo tar -C /opt -xzf nvim-linux-x86_64.tar.gz + +# make it available in /usr/local/bin, distro installs to /usr/bin +sudo ln -sf /opt/nvim-linux-x86_64/bin/nvim /usr/local/bin/ +``` +
+
Fedora Install Steps + +``` +sudo dnf install -y gcc make git ripgrep fd-find unzip neovim +``` +
+ +
Arch Install Steps + +``` +sudo pacman -S --noconfirm --needed gcc make git ripgrep fd unzip neovim +``` +
+ diff --git a/colors/custom.lua b/colors/custom.lua new file mode 100644 index 0000000..2590b98 --- /dev/null +++ b/colors/custom.lua @@ -0,0 +1,155 @@ +local colors = { + bg = '#050505', + fg = '#c5c8c6', + + normal = { + black = '#282a2e', + red = '#a54242', + green = '#8c9440', + yellow = '#de935f', + blue = '#5f819d', + magenta = '#85678f', + cyan = '#5e8d87', + white = '#707880', + }, + bright = { + black = '#373b41', + red = '#cc6666', + green = '#b5bd68', + yellow = '#f0c674', + blue = '#81a2be', + magenta = '#b294bb', + cyan = '#8abeb7', + white = '#c5c8c6', + }, +} + +vim.cmd 'hi clear' +if vim.fn.exists 'syntax_on' then + vim.cmd 'syntax reset' +end +vim.o.termguicolors = true +vim.g.colors_name = 'custom' + +-- Terminal colors +vim.g.terminal_color_0 = colors.normal.black +vim.g.terminal_color_1 = colors.normal.red +vim.g.terminal_color_2 = colors.normal.green +vim.g.terminal_color_3 = colors.normal.yellow +vim.g.terminal_color_4 = colors.normal.blue +vim.g.terminal_color_5 = colors.normal.magenta +vim.g.terminal_color_6 = colors.normal.cyan +vim.g.terminal_color_7 = colors.normal.white +vim.g.terminal_color_8 = colors.bright.black +vim.g.terminal_color_9 = colors.bright.red +vim.g.terminal_color_10 = colors.bright.green +vim.g.terminal_color_11 = colors.bright.yellow +vim.g.terminal_color_12 = colors.bright.blue +vim.g.terminal_color_13 = colors.bright.magenta +vim.g.terminal_color_14 = colors.bright.cyan +vim.g.terminal_color_15 = colors.bright.white + +local set_hl = function(group, opts) + vim.api.nvim_set_hl(0, group, opts) +end + +-- Syntax Highlights +set_hl('Normal', { fg = colors.fg, bg = colors.bg }) +set_hl('NonText', { fg = colors.normal.black }) +set_hl('Comment', { fg = colors.normal.white, italic = true }) +set_hl('Constant', { fg = colors.normal.yellow }) +set_hl('String', { fg = colors.normal.green }) +set_hl('Character', { fg = colors.normal.green }) +set_hl('Number', { fg = colors.normal.yellow }) +set_hl('Boolean', { fg = colors.normal.yellow }) +set_hl('Float', { fg = colors.normal.yellow }) +set_hl('Identifier', { fg = colors.normal.red }) +set_hl('Function', { fg = colors.normal.blue }) +set_hl('Statement', { fg = colors.normal.magenta }) +set_hl('Conditional', { fg = colors.normal.magenta }) +set_hl('Repeat', { fg = colors.normal.magenta }) +set_hl('Label', { fg = colors.normal.magenta }) +set_hl('Operator', { fg = colors.fg }) +set_hl('Keyword', { fg = colors.normal.magenta }) +set_hl('Exception', { fg = colors.normal.magenta }) +set_hl('PreProc', { fg = colors.normal.magenta }) +set_hl('Include', { fg = colors.normal.magenta }) +set_hl('Define', { fg = colors.normal.magenta }) +set_hl('Macro', { fg = colors.normal.magenta }) +set_hl('PreCondit', { fg = colors.normal.magenta }) +set_hl('Type', { fg = colors.normal.yellow }) +set_hl('StorageClass', { fg = colors.normal.yellow }) +set_hl('Structure', { fg = colors.normal.yellow }) +set_hl('Typedef', { fg = colors.normal.yellow }) +set_hl('Special', { fg = colors.normal.red }) +set_hl('SpecialChar', { fg = colors.normal.red }) +set_hl('Tag', { fg = colors.normal.red }) +set_hl('Delimiter', { fg = colors.fg }) +set_hl('SpecialComment', { fg = colors.normal.white }) +set_hl('Debug', { fg = colors.normal.red }) +set_hl('Underlined', { fg = colors.normal.blue, underline = true }) +set_hl('Ignore', { fg = colors.bg }) +set_hl('Error', { fg = colors.normal.red, bold = true }) +set_hl('Todo', { fg = colors.normal.yellow, bold = true }) + +-- UI Highlights +set_hl('ColorColumn', { bg = colors.normal.black }) +set_hl('Cursor', { fg = colors.bg, bg = colors.fg }) +set_hl('CursorLine', { bg = colors.normal.black }) +set_hl('CursorLineNr', { fg = colors.normal.yellow, bold = true }) +set_hl('Directory', { fg = colors.normal.blue }) +set_hl('DiffAdd', { fg = colors.normal.green, bg = colors.normal.black }) +set_hl('DiffChange', { fg = colors.normal.yellow, bg = colors.normal.black }) +set_hl('DiffDelete', { fg = colors.normal.red, bg = colors.normal.black }) +set_hl('DiffText', { fg = colors.normal.blue, bg = colors.normal.black }) +set_hl('ErrorMsg', { fg = colors.normal.red }) +set_hl('VertSplit', { fg = colors.bright.black }) +set_hl('Folded', { fg = colors.normal.white, bg = colors.normal.black }) +set_hl('FoldColumn', { fg = colors.normal.white, bg = colors.normal.black }) +set_hl('SignColumn', { fg = colors.normal.white, bg = colors.bg }) +set_hl('IncSearch', { fg = colors.bg, bg = colors.normal.yellow }) +set_hl('LineNr', { fg = colors.bright.black }) +set_hl('MatchParen', { bg = colors.bright.black, bold = true }) +set_hl('Pmenu', { fg = colors.fg, bg = colors.normal.black }) +set_hl('PmenuSel', { fg = colors.bg, bg = colors.normal.blue }) +set_hl('PmenuSbar', { bg = colors.normal.black }) +set_hl('PmenuThumb', { bg = colors.normal.white }) +set_hl('Question', { fg = colors.normal.green }) +set_hl('Search', { fg = colors.bg, bg = colors.normal.yellow }) +set_hl('SpecialKey', { fg = colors.bright.black }) +set_hl('SpellBad', { sp = colors.normal.red, underline = true }) +set_hl('SpellCap', { sp = colors.normal.blue, underline = true }) +set_hl('SpellLocal', { sp = colors.normal.magenta, underline = true }) +set_hl('SpellRare', { sp = colors.normal.cyan, underline = true }) +set_hl('StatusLine', { fg = colors.fg, bg = colors.normal.black }) +set_hl('StatusLineNC', { fg = colors.normal.white, bg = colors.normal.black }) +set_hl('TabLine', { fg = colors.normal.white, bg = colors.normal.black }) +set_hl('TabLineFill', { fg = colors.normal.white, bg = colors.normal.black }) +set_hl('TabLineSel', { fg = colors.normal.green, bg = colors.normal.black }) +set_hl('Title', { fg = colors.normal.blue }) +set_hl('Visual', { bg = colors.bright.black }) +set_hl('VisualNOS', { bg = colors.bright.black }) +set_hl('WarningMsg', { fg = colors.normal.red }) +set_hl('WildMenu', { fg = colors.bg, bg = colors.normal.blue }) + +-- Diagnostic Highlights (likely needed for LSP) +set_hl('DiagnosticError', { fg = colors.normal.red }) +set_hl('DiagnosticWarn', { fg = colors.normal.yellow }) +set_hl('DiagnosticInfo', { fg = colors.normal.blue }) +set_hl('DiagnosticHint', { fg = colors.normal.cyan }) +set_hl('DiagnosticUnderlineError', { sp = colors.normal.red, underline = true }) +set_hl('DiagnosticUnderlineWarn', { sp = colors.normal.yellow, underline = true }) +set_hl('DiagnosticUnderlineInfo', { sp = colors.normal.blue, underline = true }) +set_hl('DiagnosticUnderlineHint', { sp = colors.normal.cyan, underline = true }) + +-- GitSigns (if installed) +set_hl('GitSignsAdd', { fg = colors.normal.green }) +set_hl('GitSignsChange', { fg = colors.normal.yellow }) +set_hl('GitSignsDelete', { fg = colors.normal.red }) + +-- Telescope (if installed) +set_hl('TelescopeBorder', { fg = colors.bright.black }) +set_hl('TelescopePromptBorder', { fg = colors.bright.black }) +set_hl('TelescopeResultsBorder', { fg = colors.bright.black }) +set_hl('TelescopePreviewBorder', { fg = colors.bright.black }) +set_hl('TelescopeSelection', { bg = colors.normal.black, bold = true }) diff --git a/doc/kickstart.txt b/doc/kickstart.txt new file mode 100644 index 0000000..b12a7d5 --- /dev/null +++ b/doc/kickstart.txt @@ -0,0 +1,24 @@ +================================================================================ +INTRODUCTION *kickstart.nvim* + +Kickstart.nvim is a project to help you get started on your neovim journey. + + *kickstart-is-not* +It is not: +- Complete framework for every plugin under the sun +- Place to add every plugin that could ever be useful + + *kickstart-is* +It is: +- Somewhere that has a good start for the most common "IDE" type features: + - autocompletion + - goto-definition + - find references + - fuzzy finding + - and hinting at what more can be done :) +- A place to _kickstart_ your journey. + - You should fork this project and use/modify it so that it matches your + style and preferences. If you don't want to do that, there are probably + other projects that would fit much better for you (and that's great!)! + + vim:tw=78:ts=8:ft=help:norl: diff --git a/init.lua b/init.lua new file mode 100644 index 0000000..cb5e2dd --- /dev/null +++ b/init.lua @@ -0,0 +1,44 @@ +-- Set as the leader key (must happen before plugins load) +vim.g.mapleader = ' ' +vim.g.maplocalleader = ' ' + +-- Set to true if you have a Nerd Font installed +vim.g.have_nerd_font = true + +-- Load core configuration +require 'config.options' +require 'config.keymaps' +require 'config.autocmds' + +-- [[ Install `lazy.nvim` plugin manager ]] +local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim' +if not (vim.uv or vim.loop).fs_stat(lazypath) then + local lazyrepo = 'https://github.com/folke/lazy.nvim.git' + local out = vim.fn.system { 'git', 'clone', '--filter=blob:none', '--branch=stable', lazyrepo, lazypath } + if vim.v.shell_error ~= 0 then + error('Error cloning lazy.nvim:\n' .. out) + end +end +vim.opt.rtp:prepend(lazypath) + +-- [[ Configure and install plugins ]] +-- All plugin specs are auto-loaded from lua/plugins/*.lua +require('lazy').setup('plugins', { + ui = { + icons = vim.g.have_nerd_font and {} or { + cmd = 'โŒ˜', + config = '๐Ÿ› ', + event = '๐Ÿ“…', + ft = '๐Ÿ“‚', + init = 'โš™', + keys = '๐Ÿ—', + plugin = '๐Ÿ”Œ', + runtime = '๐Ÿ’ป', + require = '๐ŸŒ™', + source = '๐Ÿ“„', + start = '๐Ÿš€', + task = '๐Ÿ“Œ', + lazy = '๐Ÿ’ค ', + }, + }, +}) diff --git a/lua/config/autocmds.lua b/lua/config/autocmds.lua new file mode 100644 index 0000000..ffbee95 --- /dev/null +++ b/lua/config/autocmds.lua @@ -0,0 +1,22 @@ +-- [[ Autocommands ]] +-- See `:help lua-guide-autocommands` + +-- Highlight when yanking (copying) text +vim.api.nvim_create_autocmd('TextYankPost', { + desc = 'Highlight when yanking (copying) text', + group = vim.api.nvim_create_augroup('kickstart-highlight-yank', { clear = true }), + callback = function() + vim.hl.on_yank() + end, +}) + +-- Set indent for C/C++ to 2 spaces +vim.api.nvim_create_autocmd('FileType', { + pattern = { 'c', 'cpp' }, + callback = function() + vim.bo.tabstop = 2 + vim.bo.shiftwidth = 2 + vim.bo.softtabstop = 2 + vim.bo.expandtab = true + end, +}) diff --git a/lua/config/keymaps.lua b/lua/config/keymaps.lua new file mode 100644 index 0000000..a22c72f --- /dev/null +++ b/lua/config/keymaps.lua @@ -0,0 +1,61 @@ +-- [[ Basic Keymaps ]] +-- See `:help vim.keymap.set()` + +-- Clear highlights on search when pressing in normal mode +vim.keymap.set('n', '', 'nohlsearch') + +-- Diagnostic keymaps +vim.keymap.set('n', 'q', vim.diagnostic.setloclist, { desc = 'Open diagnostic [Q]uickfix list' }) + +-- Toggle spell check +vim.keymap.set('n', 'ts', function() + vim.o.spell = not vim.o.spell + print(vim.o.spell and 'Spell check enabled' or 'Spell check disabled') +end, { desc = '[T]oggle [S]pell check' }) + +-- Toggle word wrap +vim.keymap.set('n', 'tw', function() + vim.o.wrap = not vim.o.wrap + vim.cmd 'redraw' + print(vim.o.wrap and 'Wrap enabled' or 'Wrap disabled') +end, { desc = '[T]oggle [W]rap' }) + +-- Toggle colorcolumn +vim.keymap.set('n', 'tc', function() + if vim.wo.colorcolumn == '' then + vim.wo.colorcolumn = '80' + else + vim.wo.colorcolumn = '' + end +end, { desc = '[T]oggle [C]olorcolumn' }) + +-- Set colorcolumn to a specific value +vim.keymap.set('n', 'cc', function() + local col = vim.fn.input 'Set colorcolumn to: ' + if col ~= '' then + vim.wo.colorcolumn = col + vim.bo.textwidth = tonumber(col) or 80 + end +end, { desc = 'Set [C]olor[c]olumn width' }) + +-- Toggle textwidth auto-wrapping +vim.keymap.set('n', 'tt', function() + if vim.bo.textwidth == 0 then + local cc = vim.wo.colorcolumn + local width = tonumber(cc) or 80 + vim.bo.textwidth = width + print('Textwidth enabled (' .. width .. ')') + else + vim.bo.textwidth = 0 + print 'Textwidth disabled' + end +end, { desc = '[T]oggle [T]extwidth auto-wrap' }) + +-- Exit terminal mode +vim.keymap.set('t', '', '', { desc = 'Exit terminal mode' }) + +-- Window navigation +vim.keymap.set('n', '', '', { desc = 'Move focus to the left window' }) +vim.keymap.set('n', '', '', { desc = 'Move focus to the right window' }) +vim.keymap.set('n', '', '', { desc = 'Move focus to the lower window' }) +vim.keymap.set('n', '', '', { desc = 'Move focus to the upper window' }) diff --git a/lua/config/options.lua b/lua/config/options.lua new file mode 100644 index 0000000..3715d08 --- /dev/null +++ b/lua/config/options.lua @@ -0,0 +1,34 @@ +-- [[ Setting options ]] +-- See `:help vim.o` + +vim.o.number = true +vim.o.relativenumber = true +vim.o.mouse = 'a' +vim.o.showmode = false +vim.o.completeopt = 'menuone,noinsert,noselect' + +vim.schedule(function() + vim.o.clipboard = 'unnamedplus' +end) + +vim.o.breakindent = true +vim.o.wrap = true +vim.o.linebreak = true +vim.o.undofile = true +vim.o.ignorecase = true +vim.o.smartcase = true +vim.o.signcolumn = 'yes' +vim.o.updatetime = 250 +vim.o.timeoutlen = 300 +vim.o.splitright = true +vim.o.splitbelow = true +vim.opt.cmdheight = 0 + +vim.o.list = true +vim.opt.listchars = { tab = 'ยป ', trail = 'ยท', nbsp = 'โฃ' } + +vim.o.inccommand = 'split' +vim.o.cursorline = true +vim.o.scrolloff = 10 +vim.o.confirm = true +vim.opt.termguicolors = true diff --git a/lua/custom/claude-code.lua b/lua/custom/claude-code.lua new file mode 100644 index 0000000..db54d09 --- /dev/null +++ b/lua/custom/claude-code.lua @@ -0,0 +1,61 @@ +require('claude-code').setup { + -- Terminal window settings + window = { + split_ratio = 0.3, -- Percentage of screen for the terminal window (height for horizontal, width for vertical splits) + position = 'botright', -- Position of the window: "botright", "topleft", "vertical", "float", etc. + enter_insert = true, -- Whether to enter insert mode when opening Claude Code + hide_numbers = true, -- Hide line numbers in the terminal window + hide_signcolumn = true, -- Hide the sign column in the terminal window + + -- Floating window configuration (only applies when position = "float") + float = { + width = '80%', -- Width: number of columns or percentage string + height = '80%', -- Height: number of rows or percentage string + row = 'center', -- Row position: number, "center", or percentage string + col = 'center', -- Column position: number, "center", or percentage string + relative = 'editor', -- Relative to: "editor" or "cursor" + border = 'rounded', -- Border style: "none", "single", "double", "rounded", "solid", "shadow" + }, + }, + -- File refresh settings + refresh = { + enable = true, -- Enable file change detection + updatetime = 100, -- updatetime when Claude Code is active (milliseconds) + timer_interval = 1000, -- How often to check for file changes (milliseconds) + show_notifications = true, -- Show notification when files are reloaded + }, + -- Git project settings + git = { + use_git_root = true, -- Set CWD to git root when opening Claude Code (if in git project) + }, + -- Shell-specific settings + shell = { + separator = '&&', -- Command separator used in shell commands + pushd_cmd = 'pushd', -- Command to push directory onto stack (e.g., 'pushd' for bash/zsh, 'enter' for nushell) + popd_cmd = 'popd', -- Command to pop directory from stack (e.g., 'popd' for bash/zsh, 'exit' for nushell) + }, + -- Command settings + command = 'claude', -- Command used to launch Claude Code + -- Command variants + command_variants = { + -- Conversation management + continue = '--continue', -- Resume the most recent conversation + resume = '--resume', -- Display an interactive conversation picker + + -- Output options + verbose = '--verbose', -- Enable verbose logging with full turn-by-turn output + }, + -- Keymaps + keymaps = { + toggle = { + normal = '', -- Normal mode keymap for toggling Claude Code, false to disable + terminal = '', -- Terminal mode keymap for toggling Claude Code, false to disable + variants = { + continue = 'cC', -- Normal mode keymap for Claude Code with continue flag + verbose = 'cV', -- Normal mode keymap for Claude Code with verbose flag + }, + }, + window_navigation = true, -- Enable window navigation keymaps () + scrolling = true, -- Enable scrolling keymaps () for page up/down + }, +} diff --git a/lua/custom/godot_config.lua b/lua/custom/godot_config.lua new file mode 100644 index 0000000..cdef018 --- /dev/null +++ b/lua/custom/godot_config.lua @@ -0,0 +1,28 @@ +local godot = require 'godot' + +godot.setup { + bin = 'C:\\Program Files\\godot\\Godot_v4.5.1-stable_win64.exe', + dap = { + host = '127.0.0.1', + port = 6006, + }, + gui = { + console_config = { + anchor = 'SW', + border = 'double', + col = 1, + height = 10, + relative = 'editor', + row = 99999, + style = 'minimal', + width = 99999, + }, + }, + expose_commands = true, +} + +require('godot_lsp_setup').setup { + lsp_opts = { + cmd = { 'nc', '-w', '3', '127.0.0.1', '6005' }, + }, +} diff --git a/lua/custom/oil_config.lua b/lua/custom/oil_config.lua new file mode 100644 index 0000000..9227ba6 --- /dev/null +++ b/lua/custom/oil_config.lua @@ -0,0 +1,209 @@ +-- lua/custom/oil_config.lua +local oil = require 'oil' + +oil.setup { + + -- Oil will take over directory buffers (e.g. `vim .` or `:e src/`) + -- Set to false if you want some other plugin (e.g. netrw) to open when you edit directories. + default_file_explorer = true, + -- Id is automatically added at the beginning, and name at the end + -- See :help oil-columns + columns = { + 'icon', + -- "permissions", + -- "size", + -- "mtime", + }, + -- Buffer-local options to use for oil buffers + buf_options = { + buflisted = false, + bufhidden = 'hide', + }, + -- Window-local options to use for oil buffers + win_options = { + wrap = false, + signcolumn = 'no', + cursorcolumn = false, + foldcolumn = '0', + spell = false, + list = false, + conceallevel = 3, + concealcursor = 'nvic', + }, + -- Send deleted files to the trash instead of permanently deleting them (:help oil-trash) + delete_to_trash = false, + -- Skip the confirmation popup for simple operations (:help oil.skip_confirm_for_simple_edits) + skip_confirm_for_simple_edits = false, + -- Selecting a new/moved/renamed file or directory will prompt you to save changes first + -- (:help prompt_save_on_select_new_entry) + prompt_save_on_select_new_entry = true, + -- Oil will automatically delete hidden buffers after this delay + -- You can set the delay to false to disable cleanup entirely + -- Note that the cleanup process only starts when none of the oil buffers are currently displayed + cleanup_delay_ms = 2000, + lsp_file_methods = { + -- Enable or disable LSP file operations + enabled = true, + -- Time to wait for LSP file operations to complete before skipping + timeout_ms = 1000, + -- Set to true to autosave buffers that are updated with LSP willRenameFiles + -- Set to "unmodified" to only save unmodified buffers + autosave_changes = false, + }, + -- Constrain the cursor to the editable parts of the oil buffer + -- Set to `false` to disable, or "name" to keep it on the file names + constrain_cursor = 'editable', + -- Set to true to watch the filesystem for changes and reload oil + watch_for_changes = false, + -- Keymaps in oil buffer. Can be any value that `vim.keymap.set` accepts OR a table of keymap + -- options with a `callback` (e.g. { callback = function() ... end, desc = "", mode = "n" }) + -- Additionally, if it is a string that matches "actions.", + -- it will use the mapping at require("oil.actions"). + -- Set to `false` to remove a keymap + -- See :help oil-actions for a list of all available actions + + keymaps = { + ['g?'] = { 'actions.show_help', mode = 'n' }, + [''] = 'actions.select', + [''] = { 'actions.select', opts = { vertical = true } }, + [''] = { 'actions.select', opts = { horizontal = true } }, + [''] = { 'actions.select', opts = { tab = true } }, + [''] = 'actions.preview', + [''] = { 'actions.close', mode = 'n' }, + [''] = 'actions.refresh', + [''] = { 'actions.parent', mode = 'n' }, + [''] = { 'actions.open_cwd', mode = 'n' }, + ['`'] = { 'actions.cd', mode = 'n' }, + ['~'] = { 'actions.cd', opts = { scope = 'tab' }, mode = 'n' }, + ['gs'] = { 'actions.change_sort', mode = 'n' }, + ['gx'] = 'actions.open_external', + ['g.'] = { 'actions.toggle_hidden', mode = 'n' }, + ['g\\'] = { 'actions.toggle_trash', mode = 'n' }, + }, + -- Set to false to disable all of the above keymaps + use_default_keymaps = true, + view_options = { + -- Show files and directories that start with "." + show_hidden = true, + -- This function defines what is considered a "hidden" file + is_hidden_file = function(name, bufnr) + local m = name:match '^%.' + return m ~= nil + end, + -- This function defines what will never be shown, even when `show_hidden` is set + is_always_hidden = function(name, bufnr) + return false + end, + -- Sort file names with numbers in a more intuitive order for humans. + -- Can be "fast", true, or false. "fast" will turn it off for large directories. + natural_order = 'fast', + -- Sort file and directory names case insensitive + case_insensitive = false, + sort = { + -- sort order can be "asc" or "desc" + -- see :help oil-columns to see which columns are sortable + { 'type', 'asc' }, + { 'name', 'asc' }, + }, + -- Customize the highlight group for the file name + highlight_filename = function(entry, is_hidden, is_link_target, is_link_orphan) + return nil + end, + }, + -- Extra arguments to pass to SCP when moving/copying files over SSH + extra_scp_args = {}, + -- EXPERIMENTAL support for performing file operations with git + git = { + -- Return true to automatically git add/mv/rm files + add = function(path) + return false + end, + mv = function(src_path, dest_path) + return false + end, + rm = function(path) + return false + end, + }, + -- Configuration for the floating window in oil.open_float + float = { + -- Padding around the floating window + padding = 2, + -- max_width and max_height can be integers or a float between 0 and 1 (e.g. 0.4 for 40%) + max_width = 0, + max_height = 0, + border = nil, + win_options = { + winblend = 0, + }, + -- optionally override the oil buffers window title with custom function: fun(winid: integer): string + get_win_title = nil, + -- preview_split: Split direction: "auto", "left", "right", "above", "below". + preview_split = 'auto', + -- This is the config that will be passed to nvim_open_win. + -- Change values here to customize the layout + override = function(conf) + return conf + end, + }, + -- Configuration for the file preview window + preview_win = { + -- Whether the preview window is automatically updated when the cursor is moved + update_on_cursor_moved = true, + -- How to open the preview window "load"|"scratch"|"fast_scratch" + preview_method = 'fast_scratch', + -- A function that returns true to disable preview on a file e.g. to avoid lag + disable_preview = function(filename) + return false + end, + -- Window-local options to use for preview window buffers + win_options = {}, + }, + -- Configuration for the floating action confirmation window + confirmation = { + -- Width dimensions can be integers or a float between 0 and 1 (e.g. 0.4 for 40%) + -- min_width and max_width can be a single value or a list of mixed integer/float types. + -- max_width = {100, 0.8} means "the lesser of 100 columns or 80% of total" + max_width = 0.9, + -- min_width = {40, 0.4} means "the greater of 40 columns or 40% of total" + min_width = { 40, 0.4 }, + -- optionally define an integer/float for the exact width of the preview window + width = nil, + -- Height dimensions can be integers or a float between 0 and 1 (e.g. 0.4 for 40%) + -- min_height and max_height can be a single value or a list of mixed integer/float types. + -- max_height = {80, 0.9} means "the lesser of 80 columns or 90% of total" + max_height = 0.9, + -- min_height = {5, 0.1} means "the greater of 5 columns or 10% of total" + min_height = { 5, 0.1 }, + -- optionally define an integer/float for the exact height of the preview window + height = nil, + border = nil, + win_options = { + winblend = 0, + }, + }, + -- Configuration for the floating progress window + progress = { + max_width = 0.9, + min_width = { 40, 0.4 }, + width = nil, + max_height = { 10, 0.9 }, + min_height = { 5, 0.1 }, + height = nil, + border = nil, + minimized_border = 'none', + win_options = { + winblend = 0, + }, + }, + -- Configuration for the floating SSH window + ssh = { + border = nil, + }, + -- Configuration for the floating keymaps help window + keymaps_help = { + border = nil, + }, +} + +vim.keymap.set('n', '-', oil.open, { noremap = true }) diff --git a/lua/kickstart/health.lua b/lua/kickstart/health.lua new file mode 100644 index 0000000..ed1fde8 --- /dev/null +++ b/lua/kickstart/health.lua @@ -0,0 +1,52 @@ +--[[ +-- +-- This file is not required for your own configuration, +-- but helps people determine if their system is setup correctly. +-- +--]] + +local check_version = function() + local verstr = tostring(vim.version()) + if not vim.version.ge then + vim.health.error(string.format("Neovim out of date: '%s'. Upgrade to latest stable or nightly", verstr)) + return + end + + if vim.version.ge(vim.version(), '0.10-dev') then + vim.health.ok(string.format("Neovim version is: '%s'", verstr)) + else + vim.health.error(string.format("Neovim out of date: '%s'. Upgrade to latest stable or nightly", verstr)) + end +end + +local check_external_reqs = function() + -- Basic utils: `git`, `make`, `unzip` + for _, exe in ipairs { 'git', 'make', 'unzip', 'rg' } do + local is_executable = vim.fn.executable(exe) == 1 + if is_executable then + vim.health.ok(string.format("Found executable: '%s'", exe)) + else + vim.health.warn(string.format("Could not find executable: '%s'", exe)) + end + end + + return true +end + +return { + check = function() + vim.health.start 'kickstart.nvim' + + vim.health.info [[NOTE: Not every warning is a 'must-fix' in `:checkhealth` + + Fix only warnings for plugins and languages you intend to use. + Mason will give warnings for languages that are not installed. + You do not need to install, unless you want to use those languages!]] + + local uv = vim.uv or vim.loop + vim.health.info('System Information: ' .. vim.inspect(uv.os_uname())) + + check_version() + check_external_reqs() + end, +} diff --git a/lua/plugins/alpha.lua b/lua/plugins/alpha.lua new file mode 100644 index 0000000..a5345e3 --- /dev/null +++ b/lua/plugins/alpha.lua @@ -0,0 +1,39 @@ +return { + 'goolord/alpha-nvim', + dependencies = { 'nvim-tree/nvim-web-devicons' }, + event = 'VimEnter', + config = function() + local alpha = require 'alpha' + local dashboard = require 'alpha.themes.dashboard' + + dashboard.section.header.val = { + ' ', + ' โ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ•—', + ' โ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ•โ•โ•โ–ˆโ–ˆโ•”โ•โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ•‘', + ' โ–ˆโ–ˆโ•”โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ–ˆโ–ˆโ–ˆโ–ˆโ•”โ–ˆโ–ˆโ•‘', + ' โ–ˆโ–ˆโ•‘โ•šโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ• โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ•šโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘โ•šโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ•‘', + ' โ–ˆโ–ˆโ•‘ โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ• โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ• โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘ โ•šโ•โ• โ–ˆโ–ˆโ•‘', + ' โ•šโ•โ• โ•šโ•โ•โ•โ•โ•šโ•โ•โ•โ•โ•โ•โ• โ•šโ•โ•โ•โ•โ•โ• โ•šโ•โ•โ•โ• โ•šโ•โ•โ•šโ•โ• โ•šโ•โ•', + ' ', + } + + dashboard.section.buttons.val = { + dashboard.button('f', ' Find file', 'Telescope find_files'), + dashboard.button('r', ' Recent files', 'Telescope oldfiles'), + dashboard.button('g', ' Grep text', 'Telescope live_grep'), + dashboard.button('c', ' Configuration', 'e $MYVIMRC'), + dashboard.button('l', '๓ฐ’ฒ Lazy', 'Lazy'), + dashboard.button('q', ' Quit', 'qa'), + } + + alpha.setup(dashboard.opts) + + -- Disable folding on alpha buffer + vim.api.nvim_create_autocmd('FileType', { + pattern = 'alpha', + callback = function() + vim.opt_local.foldenable = false + end, + }) + end, +} diff --git a/lua/plugins/autopairs.lua b/lua/plugins/autopairs.lua new file mode 100644 index 0000000..912cf07 --- /dev/null +++ b/lua/plugins/autopairs.lua @@ -0,0 +1,5 @@ +return { + 'windwp/nvim-autopairs', + event = 'InsertEnter', + opts = {}, +} diff --git a/lua/plugins/blink-cmp.lua b/lua/plugins/blink-cmp.lua new file mode 100644 index 0000000..d674bdf --- /dev/null +++ b/lua/plugins/blink-cmp.lua @@ -0,0 +1,54 @@ +return { + 'saghen/blink.cmp', + event = 'VimEnter', + version = '1.*', + dependencies = { + { + 'L3MON4D3/LuaSnip', + version = '2.*', + build = (function() + if vim.fn.has 'win32' == 1 or vim.fn.executable 'make' == 0 then + return + end + return 'make install_jsregexp' + end)(), + opts = {}, + }, + 'folke/lazydev.nvim', + }, + --- @module 'blink.cmp' + --- @type blink.cmp.Config + opts = { + keymap = { + preset = 'default', + [''] = { 'select_and_accept', 'fallback' }, + [''] = { 'cancel', 'fallback' }, + }, + appearance = { + nerd_font_variant = 'mono', + }, + completion = { + menu = { auto_show = true }, + ghost_text = { + enabled = true, + show_without_selection = true, + show_with_menu = true, + }, + documentation = { auto_show = true, auto_show_delay_ms = 500 }, + }, + sources = { + default = { 'lsp', 'path', 'snippets', 'lazydev', 'codecompanion' }, + providers = { + lazydev = { module = 'lazydev.integrations.blink', score_offset = 100 }, + codecompanion = { + name = 'codecompanion', + module = 'codecompanion.providers.completion.blink', + enabled = true, + }, + }, + }, + snippets = { preset = 'luasnip' }, + fuzzy = { implementation = 'lua' }, + signature = { enabled = true }, + }, +} diff --git a/lua/plugins/bufferline.lua b/lua/plugins/bufferline.lua new file mode 100644 index 0000000..c24af30 --- /dev/null +++ b/lua/plugins/bufferline.lua @@ -0,0 +1,23 @@ +return { + 'akinsho/bufferline.nvim', + version = '*', + dependencies = { 'nvim-tree/nvim-web-devicons' }, + event = 'VimEnter', + opts = { + options = { + diagnostics = 'nvim_lsp', + offsets = { + { filetype = 'undotree', text = 'Undo Tree', highlight = 'Directory', separator = true }, + }, + show_buffer_close_icons = false, + show_close_icon = false, + separator_style = 'slant', + }, + }, + keys = { + { '', 'BufferLineCyclePrev', desc = 'Prev Buffer' }, + { '', 'BufferLineCycleNext', desc = 'Next Buffer' }, + { 'bd', 'bdelete', desc = '[B]uffer [D]elete' }, + { 'bp', 'BufferLineTogglePin', desc = '[B]uffer [P]in' }, + }, +} diff --git a/lua/plugins/claude-code.lua b/lua/plugins/claude-code.lua new file mode 100644 index 0000000..8e9595b --- /dev/null +++ b/lua/plugins/claude-code.lua @@ -0,0 +1,9 @@ +return { + 'greggh/claude-code.nvim', + dependencies = { + 'nvim-lua/plenary.nvim', + }, + config = function() + require 'custom.claude-code' + end, +} diff --git a/lua/plugins/codecompanion.lua b/lua/plugins/codecompanion.lua new file mode 100644 index 0000000..1185b0b --- /dev/null +++ b/lua/plugins/codecompanion.lua @@ -0,0 +1,53 @@ +return { + 'olimorris/codecompanion.nvim', + dependencies = { + 'nvim-lua/plenary.nvim', + 'nvim-treesitter/nvim-treesitter', + 'saghen/blink.cmp', + }, + cmd = { 'CodeCompanion', 'CodeCompanionChat', 'CodeCompanionActions' }, + keys = { + { 'a', 'CodeCompanionActions', mode = { 'n', 'v' }, desc = 'CodeCompanion Actions' }, + { 'ac', 'CodeCompanionChat Toggle', mode = { 'n', 'v' }, desc = 'CodeCompanion Chat' }, + { 'ga', 'CodeCompanionChat Add', mode = 'v', desc = 'Add to CodeCompanion Chat' }, + }, + opts = { + log_level = 'DEBUG', + adapters = { + local_model = function() + return require('codecompanion.adapters').extend('openai_compatible', { + env = { + url = 'http://localhost:8000/api/v1/chat/completions', + api_key = 'dummy-key', + }, + schema = { + model = { default = '' }, + temperature = { default = 0.3 }, + }, + }) + end, + mistral = function() + return require('codecompanion.adapters').extend('mistral', { + url = 'https://codestral.mistral.ai/v1/chat/completions', + env = { + api_key = 'cmd:echo $MISTRAL_API_KEY', + }, + schema = { + model = { default = 'codestral-latest' }, + }, + }) + end, + ollama = function() + return require('codecompanion.adapters').extend('ollama', { + schema = { + model = { default = 'qwen2.5-coder:latest' }, + }, + }) + end, + }, + strategies = { + chat = { adapter = 'anthropic' }, + inline = { adapter = 'anthropic' }, + }, + }, +} diff --git a/lua/plugins/comment.lua b/lua/plugins/comment.lua new file mode 100644 index 0000000..73f6621 --- /dev/null +++ b/lua/plugins/comment.lua @@ -0,0 +1,11 @@ +return { + 'numToStr/Comment.nvim', + event = 'VimEnter', + config = function() + require('Comment').setup() + vim.keymap.set('n', '', '(comment_toggle_linewise_current)', { desc = 'Toggle comment' }) + vim.keymap.set('n', '', '(comment_toggle_linewise_current)', { desc = 'Toggle comment' }) + vim.keymap.set('v', '', '(comment_toggle_linewise_visual)', { desc = 'Toggle comment' }) + vim.keymap.set('v', '', '(comment_toggle_linewise_visual)', { desc = 'Toggle comment' }) + end, +} diff --git a/lua/plugins/conform.lua b/lua/plugins/conform.lua new file mode 100644 index 0000000..a5d554b --- /dev/null +++ b/lua/plugins/conform.lua @@ -0,0 +1,41 @@ +return { + 'stevearc/conform.nvim', + event = { 'BufWritePre' }, + cmd = { 'ConformInfo' }, + keys = { + { + 'f', + function() + require('conform').format { async = true, lsp_format = 'fallback' } + end, + mode = '', + desc = '[F]ormat buffer', + }, + }, + opts = { + notify_on_error = false, + format_on_save = function(bufnr) + -- Skip special buffers (e.g. CodeCompanion chat, terminals) + if vim.bo[bufnr].buftype ~= '' then + return nil + end + local disable_filetypes = {} + if disable_filetypes[vim.bo[bufnr].filetype] then + return nil + end + return { timeout_ms = 500, lsp_format = 'fallback' } + end, + formatters_by_ft = { + lua = { 'stylua' }, + c = { 'clang-format' }, + cpp = { 'clang-format' }, + python = { 'isort', 'black' }, + go = { 'goimports', 'gofmt' }, + java = { 'google-java-format' }, + html = { 'prettier' }, + css = { 'prettier' }, + markdown = { 'prettier' }, + toml = { 'taplo' }, + }, + }, +} diff --git a/lua/plugins/flash.lua b/lua/plugins/flash.lua new file mode 100644 index 0000000..f5e55e5 --- /dev/null +++ b/lua/plugins/flash.lua @@ -0,0 +1,12 @@ +return { + 'folke/flash.nvim', + event = 'VeryLazy', + ---@type Flash.Config + opts = {}, + keys = { + { 's', mode = { 'n', 'x', 'o' }, function() require('flash').jump() end, desc = 'Flash' }, + { 'S', mode = { 'n', 'x', 'o' }, function() require('flash').treesitter() end, desc = 'Flash Treesitter' }, + { 'r', mode = 'o', function() require('flash').remote() end, desc = 'Remote Flash' }, + { 'R', mode = { 'o', 'x' }, function() require('flash').treesitter_search() end, desc = 'Treesitter Search' }, + }, +} diff --git a/lua/plugins/gitsigns.lua b/lua/plugins/gitsigns.lua new file mode 100644 index 0000000..57d772a --- /dev/null +++ b/lua/plugins/gitsigns.lua @@ -0,0 +1,12 @@ +return { + 'lewis6991/gitsigns.nvim', + opts = { + signs = { + add = { text = '+' }, + change = { text = '~' }, + delete = { text = '_' }, + topdelete = { text = 'โ€พ' }, + changedelete = { text = '~' }, + }, + }, +} diff --git a/lua/plugins/godot.lua b/lua/plugins/godot.lua new file mode 100644 index 0000000..e45e38c --- /dev/null +++ b/lua/plugins/godot.lua @@ -0,0 +1,8 @@ +return { + 'lommix/godot.nvim', + lazy = true, + cmd = { 'GodotDebug', 'GodotBreakAtCursor', 'GodotStep', 'GodotQuit', 'GodotContinue' }, + config = function() + require 'custom.godot_config' + end, +} diff --git a/lua/plugins/gruvbox.lua b/lua/plugins/gruvbox.lua new file mode 100644 index 0000000..841b5ff --- /dev/null +++ b/lua/plugins/gruvbox.lua @@ -0,0 +1,11 @@ +return { + 'ellisonleao/gruvbox.nvim', + priority = 1000, + config = function() + require('gruvbox').setup { + contrast = 'hard', + transparent_mode = false, + } + vim.cmd.colorscheme 'gruvbox' + end, +} diff --git a/lua/plugins/guess-indent.lua b/lua/plugins/guess-indent.lua new file mode 100644 index 0000000..5658b99 --- /dev/null +++ b/lua/plugins/guess-indent.lua @@ -0,0 +1,4 @@ +return { + 'NMAC427/guess-indent.nvim', + opts = {}, +} diff --git a/lua/plugins/harpoon.lua b/lua/plugins/harpoon.lua new file mode 100644 index 0000000..622ed80 --- /dev/null +++ b/lua/plugins/harpoon.lua @@ -0,0 +1,17 @@ +return { + 'ThePrimeagen/harpoon', + branch = 'harpoon2', + dependencies = { 'nvim-lua/plenary.nvim' }, + config = function() + local harpoon = require 'harpoon' + harpoon:setup() + + vim.keymap.set('n', 'ha', function() harpoon:list():add() end, { desc = '[H]arpoon [A]dd' }) + vim.keymap.set('n', 'hh', function() harpoon.ui:toggle_quick_menu(harpoon:list()) end, { desc = '[H]arpoon Menu' }) + + vim.keymap.set('n', '1', function() harpoon:list():select(1) end, { desc = 'Harpoon File 1' }) + vim.keymap.set('n', '2', function() harpoon:list():select(2) end, { desc = 'Harpoon File 2' }) + vim.keymap.set('n', '3', function() harpoon:list():select(3) end, { desc = 'Harpoon File 3' }) + vim.keymap.set('n', '4', function() harpoon:list():select(4) end, { desc = 'Harpoon File 4' }) + end, +} diff --git a/lua/plugins/indent-blankline.lua b/lua/plugins/indent-blankline.lua new file mode 100644 index 0000000..3928888 --- /dev/null +++ b/lua/plugins/indent-blankline.lua @@ -0,0 +1,12 @@ +return { + 'lukas-reineke/indent-blankline.nvim', + main = 'ibl', + event = { 'BufReadPost', 'BufNewFile' }, + opts = { + indent = { char = 'โ”‚' }, + scope = { enabled = true, show_start = true }, + exclude = { + filetypes = { 'help', 'alpha', 'dashboard', 'lazy', 'mason', 'oil' }, + }, + }, +} diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua new file mode 100644 index 0000000..f1acf0a --- /dev/null +++ b/lua/plugins/lsp.lua @@ -0,0 +1,153 @@ +return { + { + 'folke/lazydev.nvim', + ft = 'lua', + opts = { + library = { + { path = '${3rd}/luv/library', words = { 'vim%.uv' } }, + }, + }, + }, + { + 'neovim/nvim-lspconfig', + dependencies = { + { 'mason-org/mason.nvim', opts = {} }, + 'mason-org/mason-lspconfig.nvim', + 'WhoIsSethDaniel/mason-tool-installer.nvim', + { 'j-hui/fidget.nvim', opts = {} }, + 'saghen/blink.cmp', + }, + config = function() + vim.api.nvim_create_autocmd('LspAttach', { + group = vim.api.nvim_create_augroup('kickstart-lsp-attach', { clear = true }), + callback = function(event) + local map = function(keys, func, desc, mode) + mode = mode or 'n' + vim.keymap.set(mode, keys, func, { buffer = event.buf, desc = 'LSP: ' .. desc }) + end + + map('grn', vim.lsp.buf.rename, '[R]e[n]ame') + map('gra', vim.lsp.buf.code_action, '[G]oto Code [A]ction', { 'n', 'x' }) + map('grr', require('telescope.builtin').lsp_references, '[G]oto [R]eferences') + map('gri', require('telescope.builtin').lsp_implementations, '[G]oto [I]mplementation') + map('grd', require('telescope.builtin').lsp_definitions, '[G]oto [D]efinition') + map('grD', vim.lsp.buf.declaration, '[G]oto [D]eclaration') + map('gO', require('telescope.builtin').lsp_document_symbols, 'Open Document Symbols') + map('gW', require('telescope.builtin').lsp_dynamic_workspace_symbols, 'Open Workspace Symbols') + map('grt', require('telescope.builtin').lsp_type_definitions, '[G]oto [T]ype Definition') + + local client = vim.lsp.get_client_by_id(event.data.client_id) + + ---@param c vim.lsp.Client + ---@param method vim.lsp.protocol.Method + ---@param bufnr? integer + ---@return boolean + local function client_supports_method(c, method, bufnr) + if vim.fn.has 'nvim-0.11' == 1 then + return c:supports_method(method, bufnr) + else + return c.supports_method(method, { bufnr = bufnr }) + end + end + + if client and client_supports_method(client, vim.lsp.protocol.Methods.textDocument_documentHighlight, event.buf) then + local highlight_augroup = vim.api.nvim_create_augroup('kickstart-lsp-highlight', { clear = false }) + vim.api.nvim_create_autocmd({ 'CursorHold', 'CursorHoldI' }, { + buffer = event.buf, + group = highlight_augroup, + callback = vim.lsp.buf.document_highlight, + }) + vim.api.nvim_create_autocmd({ 'CursorMoved', 'CursorMovedI' }, { + buffer = event.buf, + group = highlight_augroup, + callback = vim.lsp.buf.clear_references, + }) + vim.api.nvim_create_autocmd('LspDetach', { + group = vim.api.nvim_create_augroup('kickstart-lsp-detach', { clear = true }), + callback = function(event2) + vim.lsp.buf.clear_references() + vim.api.nvim_clear_autocmds { group = 'kickstart-lsp-highlight', buffer = event2.buf } + end, + }) + end + + if client and client_supports_method(client, vim.lsp.protocol.Methods.textDocument_inlayHint, event.buf) then + map('th', function() + vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled { bufnr = event.buf }) + end, '[T]oggle Inlay [H]ints') + end + end, + }) + + vim.diagnostic.config { + severity_sort = true, + float = { border = 'rounded', source = 'if_many' }, + underline = { severity = vim.diagnostic.severity.ERROR }, + signs = vim.g.have_nerd_font and { + text = { + [vim.diagnostic.severity.ERROR] = '๓ฐ…š ', + [vim.diagnostic.severity.WARN] = '๓ฐ€ช ', + [vim.diagnostic.severity.INFO] = '๓ฐ‹ฝ ', + [vim.diagnostic.severity.HINT] = '๓ฐŒถ ', + }, + } or {}, + virtual_text = { + source = 'if_many', + spacing = 2, + }, + } + + local capabilities = require('blink.cmp').get_lsp_capabilities() + + local servers = { + clangd = { + cmd = { 'clangd', '--background-index', '--clang-tidy' }, + filetypes = { 'c', 'cpp', 'objc', 'objcpp', 'cuda' }, + }, + gopls = {}, + pyright = {}, + jdtls = {}, + html = {}, + cssls = {}, + lua_ls = { + settings = { + Lua = { + completion = { callSnippet = 'Replace' }, + }, + }, + }, + } + + local ensure_installed = vim.tbl_keys(servers or {}) + vim.list_extend(ensure_installed, { + 'stylua', + 'clang-format', + 'isort', + 'black', + 'goimports', + 'prettier', + 'taplo', + }) + require('mason-tool-installer').setup { ensure_installed = ensure_installed } + + require('mason-lspconfig').setup { + ensure_installed = {}, + automatic_installation = false, + handlers = { + function(server_name) + local server = servers[server_name] or {} + server.capabilities = vim.tbl_deep_extend('force', {}, capabilities, server.capabilities or {}) + require('lspconfig')[server_name].setup(server) + end, + }, + } + + -- Godot LSP (not managed by Mason) + vim.lsp.config.gdscript = { + cmd = { 'ncat', '127.0.0.1', '6005' }, + name = 'godot', + root_markers = { 'project.godot', '.godot' }, + } + end, + }, +} diff --git a/lua/plugins/lualine.lua b/lua/plugins/lualine.lua new file mode 100644 index 0000000..2a8e0e0 --- /dev/null +++ b/lua/plugins/lualine.lua @@ -0,0 +1,19 @@ +return { + 'nvim-lualine/lualine.nvim', + dependencies = { 'nvim-tree/nvim-web-devicons' }, + opts = { + options = { + theme = 'gruvbox', + component_separators = { left = '', right = '' }, + section_separators = { left = '', right = '' }, + }, + sections = { + lualine_a = { 'mode' }, + lualine_b = { 'branch', 'diff', 'diagnostics' }, + lualine_c = { { 'filename', path = 1 } }, + lualine_x = { 'encoding', 'fileformat', 'filetype' }, + lualine_y = { 'progress' }, + lualine_z = { 'location' }, + }, + }, +} diff --git a/lua/plugins/mini.lua b/lua/plugins/mini.lua new file mode 100644 index 0000000..ea4e2cf --- /dev/null +++ b/lua/plugins/mini.lua @@ -0,0 +1,7 @@ +return { + 'echasnovski/mini.nvim', + config = function() + require('mini.ai').setup { n_lines = 500 } + require('mini.surround').setup() + end, +} diff --git a/lua/plugins/neoscroll.lua b/lua/plugins/neoscroll.lua new file mode 100644 index 0000000..6ca58fa --- /dev/null +++ b/lua/plugins/neoscroll.lua @@ -0,0 +1,11 @@ +return { + 'karb94/neoscroll.nvim', + event = { 'BufReadPost', 'BufNewFile' }, + opts = { + mappings = { '', '', '', '', 'zt', 'zz', 'zb' }, + hide_cursor = true, + stop_eof = true, + respect_scrolloff = false, + cursor_scrolls_alone = true, + }, +} diff --git a/lua/plugins/noice.lua b/lua/plugins/noice.lua new file mode 100644 index 0000000..09070a4 --- /dev/null +++ b/lua/plugins/noice.lua @@ -0,0 +1,24 @@ +return { + 'folke/noice.nvim', + event = 'VeryLazy', + dependencies = { + 'MunifTanjim/nui.nvim', + 'rcarriga/nvim-notify', + }, + opts = { + lsp = { + override = { + ['vim.lsp.util.convert_input_to_markdown_lines'] = true, + ['vim.lsp.util.stylize_markdown'] = true, + ['cmp.entry.get_documentation'] = true, + }, + }, + presets = { + bottom_search = true, + command_palette = true, + long_message_to_split = true, + inc_rename = false, + lsp_doc_border = true, + }, + }, +} diff --git a/lua/plugins/oil.lua b/lua/plugins/oil.lua new file mode 100644 index 0000000..ea90e7b --- /dev/null +++ b/lua/plugins/oil.lua @@ -0,0 +1,7 @@ +return { + 'stevearc/oil.nvim', + dependencies = { 'nvim-tree/nvim-web-devicons' }, + config = function() + require 'custom.oil_config' + end, +} diff --git a/lua/plugins/rainbow-csv.lua b/lua/plugins/rainbow-csv.lua new file mode 100644 index 0000000..05f2093 --- /dev/null +++ b/lua/plugins/rainbow-csv.lua @@ -0,0 +1,6 @@ +return { + 'cameron-wags/rainbow_csv.nvim', + config = true, + ft = { 'csv', 'tsv', 'csv_semicolon', 'csv_whitespace', 'csv_pipe', 'rfc_csv', 'rfc_semicolon' }, + cmd = { 'RainbowDelim', 'RainbowDelimSimple', 'RainbowDelimQuoted', 'RainbowMultiDelim' }, +} diff --git a/lua/plugins/spectre.lua b/lua/plugins/spectre.lua new file mode 100644 index 0000000..64a0f05 --- /dev/null +++ b/lua/plugins/spectre.lua @@ -0,0 +1,9 @@ +return { + 'nvim-pack/nvim-spectre', + dependencies = { 'nvim-lua/plenary.nvim' }, + cmd = 'Spectre', + keys = { + { 'sr', function() require('spectre').open() end, desc = '[S]earch & [R]eplace (Spectre)' }, + { 'srw', function() require('spectre').open_visual { select_word = true } end, desc = '[S]pectre current [W]ord' }, + }, +} diff --git a/lua/plugins/telescope.lua b/lua/plugins/telescope.lua new file mode 100644 index 0000000..eaf7561 --- /dev/null +++ b/lua/plugins/telescope.lua @@ -0,0 +1,58 @@ +return { + 'nvim-telescope/telescope.nvim', + event = 'VimEnter', + dependencies = { + 'nvim-lua/plenary.nvim', + { + 'nvim-telescope/telescope-fzf-native.nvim', + build = 'make', + cond = function() + return vim.fn.executable 'make' == 1 + end, + }, + { 'nvim-telescope/telescope-ui-select.nvim' }, + { 'nvim-tree/nvim-web-devicons', enabled = vim.g.have_nerd_font }, + }, + config = function() + require('telescope').setup { + extensions = { + ['ui-select'] = { + require('telescope.themes').get_dropdown(), + }, + }, + } + + pcall(require('telescope').load_extension, 'fzf') + pcall(require('telescope').load_extension, 'ui-select') + + local builtin = require 'telescope.builtin' + vim.keymap.set('n', 'sh', builtin.help_tags, { desc = '[S]earch [H]elp' }) + vim.keymap.set('n', 'sk', builtin.keymaps, { desc = '[S]earch [K]eymaps' }) + vim.keymap.set('n', 'sf', builtin.find_files, { desc = '[S]earch [F]iles' }) + vim.keymap.set('n', 'ss', builtin.builtin, { desc = '[S]earch [S]elect Telescope' }) + vim.keymap.set('n', 'sw', builtin.grep_string, { desc = '[S]earch current [W]ord' }) + vim.keymap.set('n', 'sg', builtin.live_grep, { desc = '[S]earch by [G]rep' }) + vim.keymap.set('n', 'sd', builtin.diagnostics, { desc = '[S]earch [D]iagnostics' }) + vim.keymap.set('n', 'sR', builtin.resume, { desc = '[S]earch [R]esume' }) + vim.keymap.set('n', 's.', builtin.oldfiles, { desc = '[S]earch Recent Files ("." for repeat)' }) + vim.keymap.set('n', '', builtin.buffers, { desc = '[ ] Find existing buffers' }) + + vim.keymap.set('n', '/', function() + builtin.current_buffer_fuzzy_find(require('telescope.themes').get_dropdown { + winblend = 10, + previewer = false, + }) + end, { desc = '[/] Fuzzily search in current buffer' }) + + vim.keymap.set('n', 's/', function() + builtin.live_grep { + grep_open_files = true, + prompt_title = 'Live Grep in Open Files', + } + end, { desc = '[S]earch [/] in Open Files' }) + + vim.keymap.set('n', 'sn', function() + builtin.find_files { cwd = vim.fn.stdpath 'config' } + end, { desc = '[S]earch [N]eovim files' }) + end, +} diff --git a/lua/plugins/thesaurus.lua b/lua/plugins/thesaurus.lua new file mode 100644 index 0000000..6a1a968 --- /dev/null +++ b/lua/plugins/thesaurus.lua @@ -0,0 +1,9 @@ +return { + 'Ron89/thesaurus_query.vim', + cmd = { 'Thesaurus', 'ThesaurusQueryReplaceCurrentWord' }, + init = function() + vim.g.tq_enabled_backends = { 'datamuse_com', 'openoffice_en' } + vim.g.tq_use_vim_autocomplete = 0 + vim.keymap.set('n', 'z/', 'ThesaurusQueryReplaceCurrentWord', { desc = 'Find synonyms (thesaurus)' }) + end, +} diff --git a/lua/plugins/todo-comments.lua b/lua/plugins/todo-comments.lua new file mode 100644 index 0000000..efa2bd2 --- /dev/null +++ b/lua/plugins/todo-comments.lua @@ -0,0 +1,6 @@ +return { + 'folke/todo-comments.nvim', + event = 'VimEnter', + dependencies = { 'nvim-lua/plenary.nvim' }, + opts = { signs = false }, +} diff --git a/lua/plugins/treesitter.lua b/lua/plugins/treesitter.lua new file mode 100644 index 0000000..f84321d --- /dev/null +++ b/lua/plugins/treesitter.lua @@ -0,0 +1,36 @@ +return { + 'nvim-treesitter/nvim-treesitter', + build = ':TSUpdate', + main = 'nvim-treesitter.configs', + opts = { + ensure_installed = { + 'bash', + 'c', + 'cpp', + 'css', + 'diff', + 'go', + 'html', + 'java', + 'javascript', + 'json', + 'lua', + 'luadoc', + 'markdown', + 'markdown_inline', + 'python', + 'query', + 'toml', + 'typescript', + 'vim', + 'vimdoc', + 'yaml', + }, + auto_install = true, + highlight = { + enable = true, + additional_vim_regex_highlighting = { 'ruby' }, + }, + indent = { enable = true, disable = { 'ruby' } }, + }, +} diff --git a/lua/plugins/trouble.lua b/lua/plugins/trouble.lua new file mode 100644 index 0000000..ad11045 --- /dev/null +++ b/lua/plugins/trouble.lua @@ -0,0 +1,13 @@ +return { + 'folke/trouble.nvim', + dependencies = { 'nvim-tree/nvim-web-devicons' }, + cmd = 'Trouble', + opts = {}, + keys = { + { 'xx', 'Trouble diagnostics toggle', desc = 'Diagnostics (Trouble)' }, + { 'xd', 'Trouble diagnostics toggle filter.buf=0', desc = 'Buffer Diagnostics (Trouble)' }, + { 'xs', 'Trouble symbols toggle focus=false', desc = 'Symbols (Trouble)' }, + { 'xl', 'Trouble lsp toggle focus=false win.position=right', desc = 'LSP Definitions / References (Trouble)' }, + { 'xq', 'Trouble qflist toggle', desc = 'Quickfix List (Trouble)' }, + }, +} diff --git a/lua/plugins/undotree.lua b/lua/plugins/undotree.lua new file mode 100644 index 0000000..3e37d59 --- /dev/null +++ b/lua/plugins/undotree.lua @@ -0,0 +1,6 @@ +return { + 'mbbill/undotree', + keys = { + { 'u', 'UndotreeToggle', desc = '[U]ndotree Toggle' }, + }, +} diff --git a/lua/plugins/vim-tmux-navigator.lua b/lua/plugins/vim-tmux-navigator.lua new file mode 100644 index 0000000..934643c --- /dev/null +++ b/lua/plugins/vim-tmux-navigator.lua @@ -0,0 +1,17 @@ +return { + 'christoomey/vim-tmux-navigator', + cmd = { + 'TmuxNavigateLeft', + 'TmuxNavigateDown', + 'TmuxNavigateUp', + 'TmuxNavigateRight', + 'TmuxNavigatePrevious', + }, + keys = { + { '', 'TmuxNavigateLeft' }, + { '', 'TmuxNavigateDown' }, + { '', 'TmuxNavigateUp' }, + { '', 'TmuxNavigateRight' }, + { '', 'TmuxNavigatePrevious' }, + }, +} diff --git a/lua/plugins/which-key.lua b/lua/plugins/which-key.lua new file mode 100644 index 0000000..c162710 --- /dev/null +++ b/lua/plugins/which-key.lua @@ -0,0 +1,47 @@ +return { + 'folke/which-key.nvim', + event = 'VimEnter', + opts = { + delay = 0, + icons = { + mappings = vim.g.have_nerd_font, + keys = vim.g.have_nerd_font and {} or { + Up = ' ', + Down = ' ', + Left = ' ', + Right = ' ', + C = ' ', + M = ' ', + D = ' ', + S = ' ', + CR = ' ', + Esc = ' ', + ScrollWheelDown = ' ', + ScrollWheelUp = ' ', + NL = ' ', + BS = ' ', + Space = ' ', + Tab = ' ', + F1 = '', + F2 = '', + F3 = '', + F4 = '', + F5 = '', + F6 = '', + F7 = '', + F8 = '', + F9 = '', + F10 = '', + F11 = '', + F12 = '', + }, + }, + spec = { + { 's', group = '[S]earch' }, + { 't', group = '[T]oggle' }, + { 'h', group = 'Git [H]unk / [H]arpoon', mode = { 'n', 'v' } }, + { 'x', group = 'Trouble' }, + { 'b', group = '[B]uffer' }, + }, + }, +}