diff --git a/.gitignore b/.gitignore index 005b535b606..8a192cab54d 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,3 @@ test.sh nvim spell/ -lazy-lock.json diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 00000000000..005953aa4f6 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,84 @@ +# CLAUDE.md + +This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. + +## Overview + +This is a Neovim configuration based on kickstart.nvim, a minimal starting point for Neovim configuration. The codebase is primarily single-file (init.lua) with modular plugin extensions. + +## Commands + +### Formatting and Linting +- **Format Lua code**: Use stylua via Mason tool installer (automatically configured) +- **Lint files**: Configured through nvim-lint plugin with markdownlint for markdown files +- **Check formatting**: GitHub Actions workflow runs stylua formatting checks + +### Development Workflow +- **Start Neovim**: `nvim` +- **Plugin management**: `:Lazy` (view plugin status, updates, etc.) +- **Health check**: `:checkhealth` (verify external dependencies) +- **Mason management**: `:Mason` (manage LSP servers, formatters, linters) + +### Key External Dependencies +- `git`, `make`, `unzip`, C Compiler (`gcc`) +- `ripgrep` (for Telescope search functionality) +- Clipboard tool (xclip/xsel/win32yank) +- Optional: Nerd Font (set `vim.g.have_nerd_font = true` in init.lua) + +## Architecture + +### File Structure +``` +init.lua # Main configuration file (single-file approach) +lua/ +├── kickstart/ # Kickstart.nvim optional plugins +│ ├── health.lua # Health check functionality +│ └── plugins/ # Modular plugin configurations +│ ├── autopairs.lua +│ ├── debug.lua +│ ├── gitsigns.lua +│ ├── indent_line.lua +│ ├── lint.lua +│ └── neo-tree.lua +└── custom/ # User custom plugins and configurations + └── plugins/ + ├── init.lua # Custom plugin loader (sets relativenumber) + ├── dap.lua # Debug adapter protocol + ├── hardtime.lua + └── codium.lua # Codeium AI completion +``` + +### Plugin Management +- **Plugin manager**: lazy.nvim +- **LSP management**: Mason + mason-lspconfig + mason-tool-installer +- **Automatic installation**: Tools specified in `ensure_installed` table are auto-installed via Mason + +### Core Plugin Categories +1. **LSP & Completion**: nvim-lspconfig, nvim-cmp, mason ecosystem +2. **Fuzzy Finding**: Telescope with fzf-native extension +3. **Syntax**: nvim-treesitter with auto-update +4. **Formatting**: conform.nvim with stylua for Lua +5. **Git**: gitsigns for git integration +6. **UI**: which-key, neo-tree (file explorer) +7. **Debugging**: nvim-dap with UI extensions + +### Configuration Philosophy +- Single init.lua file keeps configuration simple and readable +- Modular plugins in separate files for organization +- Lazy loading for performance +- Format-on-save enabled with LSP fallback +- Automatic tool installation via Mason + +### Custom Extensions +- Relative line numbers enabled by default +- Codeium AI completion integration +- Additional debugging capabilities with nvim-dap +- Hard time plugin for Vim training + +## Development Notes + +- The configuration follows kickstart.nvim principles: readable, documented, and minimal +- LSP servers and tools are automatically installed via Mason +- Format-on-save is configured with LSP fallback for unsupported file types +- Plugin lazy-loading is used extensively for performance +- Custom plugins should be added to `lua/custom/plugins/` directory \ No newline at end of file diff --git a/README.md b/README.md index 4113950550d..d52da40c2b8 100644 --- a/README.md +++ b/README.md @@ -57,6 +57,7 @@ Neovim's configurations are located under the following paths, depending on your 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` diff --git a/init.lua b/init.lua index b98ffc6198a..61c583557f7 100644 --- a/init.lua +++ b/init.lua @@ -137,6 +137,7 @@ vim.o.updatetime = 250 -- Decrease mapped sequence wait time vim.o.timeoutlen = 300 + -- Configure how new splits should be opened vim.o.splitright = true vim.o.splitbelow = true @@ -585,6 +586,19 @@ require('lazy').setup({ end end + -- This function resolves a difference between neovim nightly (version 0.11) and stable (version 0.10) + ---@param client vim.lsp.Client + ---@param method vim.lsp.protocol.Method + ---@param bufnr? integer some lsp support methods only in specific files + ---@return boolean + local function client_supports_method(client, method, bufnr) + if vim.fn.has 'nvim-0.11' == 1 then + return client:supports_method(method, bufnr) + else + return client.supports_method(method, { bufnr = bufnr }) + end + end + -- The following two autocommands are used to highlight references of the -- word under your cursor when your cursor rests there for a little while. -- See `:help CursorHold` for information about when this is executed @@ -881,20 +895,19 @@ require('lazy').setup({ -- change the command in the config to whatever the name of that colorscheme is. -- -- If you want to see what colorschemes are already installed, you can use `:Telescope colorscheme`. - 'folke/tokyonight.nvim', + 'loctvl842/monokai-pro.nvim', priority = 1000, -- Make sure to load this before all the other start plugins. config = function() ---@diagnostic disable-next-line: missing-fields - require('tokyonight').setup { - styles = { - comments = { italic = false }, -- Disable italics in comments - }, - } -- Load the colorscheme here. -- Like many other themes, this one has different styles, and you could load -- any other, such as 'tokyonight-storm', 'tokyonight-moon', or 'tokyonight-day'. - vim.cmd.colorscheme 'tokyonight-night' + + vim.cmd.colorscheme 'monokai-pro' + + -- You can configure highlights by doing something like: + vim.cmd.hi 'Comment gui=none' end, }, @@ -973,9 +986,9 @@ require('lazy').setup({ -- Here are some example plugins that I've included in the Kickstart repository. -- Uncomment any of the lines below to enable them (you will need to restart nvim). -- - -- require 'kickstart.plugins.debug', - -- require 'kickstart.plugins.indent_line', - -- require 'kickstart.plugins.lint', + require 'kickstart.plugins.debug', + require 'kickstart.plugins.indent_line', + require 'kickstart.plugins.lint', -- require 'kickstart.plugins.autopairs', -- require 'kickstart.plugins.neo-tree', -- require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps @@ -984,12 +997,15 @@ require('lazy').setup({ -- This is the easiest way to modularize your config. -- -- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going. - -- { import = 'custom.plugins' }, + + -- For additional information, see `:help lazy.nvim-lazy.nvim-structuring-your-plugins` + { import = 'custom.plugins' }, -- -- For additional information with loading, sourcing and examples see `:help lazy.nvim-🔌-plugin-spec` -- Or use telescope! -- In normal mode type `sh` then write `lazy.nvim-plugin` -- you can continue same window with `sr` which resumes last telescope search + -- For additional information, see `:help lazy.nvim-lazy.nvim-structuring-your-plugins` }, { ui = { -- If you are using a Nerd Font: set icons to an empty table which will use the diff --git a/lazy-lock.json b/lazy-lock.json new file mode 100644 index 00000000000..f4f0279415b --- /dev/null +++ b/lazy-lock.json @@ -0,0 +1,37 @@ +{ + "LuaSnip": { "branch": "master", "commit": "21f74f7ba8c49f95f9d7c8293b147c2901dd2d3a" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "bd5a7d6db125d4654b50eeae9f5217f24bb22fd3" }, + "cmp-nvim-lsp-signature-help": { "branch": "main", "commit": "031e6ba70b0ad5eee49fd2120ff7a2e325b17fa7" }, + "cmp-path": { "branch": "main", "commit": "c642487086dbd9a93160e1679a1327be111cbc25" }, + "cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" }, + "codeium.vim": { "branch": "main", "commit": "a8d47ec54fe82df920b2545559f767003e8a7f8d" }, + "conform.nvim": { "branch": "master", "commit": "b4aab989db276993ea5dcb78872be494ce546521" }, + "fidget.nvim": { "branch": "main", "commit": "4d5858bd4c471c895060e1b9f3575f1551184dc5" }, + "gitsigns.nvim": { "branch": "main", "commit": "6e3c66548035e50db7bd8e360a29aec6620c3641" }, + "hardtime.nvim": { "branch": "main", "commit": "6d7664d5bdfaea44c5f50b29f5239fab7b00c273" }, + "indent-blankline.nvim": { "branch": "master", "commit": "005b56001b2cb30bfa61b7986bc50657816ba4ba" }, + "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, + "lazydev.nvim": { "branch": "main", "commit": "2367a6c0a01eb9edb0464731cc0fb61ed9ab9d2c" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "5e085efe67fccb13372d54331d849219662a7e93" }, + "mason-nvim-dap.nvim": { "branch": "main", "commit": "86389a3dd687cfaa647b6f44731e492970034baa" }, + "mason-tool-installer.nvim": { "branch": "main", "commit": "517ef5994ef9d6b738322664d5fdd948f0fdeb46" }, + "mason.nvim": { "branch": "main", "commit": "7dc4facca9702f95353d5a1f87daf23d78e31c2a" }, + "mini.nvim": { "branch": "main", "commit": "6bf9eccaf2a5395b254bc031f9812cf163ca4187" }, + "monokai-pro.nvim": { "branch": "master", "commit": "1ac671f6da720cba967d28d25c2f16b8b4e18808" }, + "nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" }, + "nvim-cmp": { "branch": "main", "commit": "b5311ab3ed9c846b585c0c15b7559be131ec4be9" }, + "nvim-dap": { "branch": "master", "commit": "7523676a4be17644587aa47e4d42f6f7646d4727" }, + "nvim-dap-go": { "branch": "main", "commit": "b4421153ead5d726603b02743ea40cf26a51ed5f" }, + "nvim-dap-ui": { "branch": "master", "commit": "cf91d5e2d07c72903d052f5207511bf7ecdb7122" }, + "nvim-lint": { "branch": "master", "commit": "f126af5345c7472e9a0cdbe1d1a29209be72c4c4" }, + "nvim-lspconfig": { "branch": "master", "commit": "c8b90ae5cbe21d547b342b05c9266dcb8ca0de8f" }, + "nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" }, + "nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" }, + "plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" }, + "telescope-fzf-native.nvim": { "branch": "main", "commit": "1f08ed60cafc8f6168b72b80be2b2ea149813e55" }, + "telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" }, + "telescope.nvim": { "branch": "0.1.x", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" }, + "todo-comments.nvim": { "branch": "main", "commit": "304a8d204ee787d2544d8bc23cd38d2f929e7cc5" }, + "vim-sleuth": { "branch": "master", "commit": "be69bff86754b1aa5adcbb527d7fcd1635a84080" }, + "which-key.nvim": { "branch": "main", "commit": "370ec46f710e058c9c1646273e6b225acf47cbed" } +} diff --git a/lua/custom/plugins/codium.lua b/lua/custom/plugins/codium.lua new file mode 100644 index 00000000000..ea020ab404d --- /dev/null +++ b/lua/custom/plugins/codium.lua @@ -0,0 +1,4 @@ +return { + 'Exafunction/codeium.vim', + event = 'BufEnter', +} diff --git a/lua/custom/plugins/hardtime.lua b/lua/custom/plugins/hardtime.lua new file mode 100644 index 00000000000..d13d04bf9d8 --- /dev/null +++ b/lua/custom/plugins/hardtime.lua @@ -0,0 +1,5 @@ +return { + 'm4xshen/hardtime.nvim', + dependencies = { 'MunifTanjim/nui.nvim', 'nvim-lua/plenary.nvim' }, + opts = {}, +} diff --git a/lua/custom/plugins/init.lua b/lua/custom/plugins/init.lua index be0eb9d8d7a..7a35cd5e0e8 100644 --- a/lua/custom/plugins/init.lua +++ b/lua/custom/plugins/init.lua @@ -2,4 +2,5 @@ -- I promise not to create any merge conflicts in this directory :) -- -- See the kickstart.nvim README for more information +vim.wo.relativenumber = true return {} diff --git a/lua/kickstart/plugins/autopairs.lua b/lua/kickstart/plugins/autopairs.lua index 386d392e7ad..87a7e5ffa2e 100644 --- a/lua/kickstart/plugins/autopairs.lua +++ b/lua/kickstart/plugins/autopairs.lua @@ -4,5 +4,13 @@ return { 'windwp/nvim-autopairs', event = 'InsertEnter', - opts = {}, + -- Optional dependency + dependencies = { 'hrsh7th/nvim-cmp' }, + config = function() + require('nvim-autopairs').setup {} + -- If you want to automatically add `(` after selecting a function or method + local cmp_autopairs = require 'nvim-autopairs.completion.cmp' + local cmp = require 'cmp' + cmp.event:on('confirm_done', cmp_autopairs.on_confirm_done()) + end, }