diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..49da211 --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,156 @@ +# AGENTS.md - LazyVim Configuration Guide + +This document provides essential information for AI agents working with this LazyVim Neovim configuration. + +## Overview + +This is a LazyVim-based Neovim configuration located at `/Users/alice/.config/nvim`. LazyVim is a Neovim distribution that provides a solid foundation for modern Neovim development with lazy loading and sensible defaults. + +## Project Structure + +``` +~/.config/nvim/ +├── init.lua # Main entry point +├── lazy-lock.json # Plugin version lock file +├── lazyvim.json # LazyVim configuration +├── stylua.toml # Lua code formatter config +├── lua/ +│ ├── config/ +│ │ ├── autocmds.lua # Auto commands +│ │ ├── keymaps.lua # Key mappings +│ │ ├── lazy.lua # Lazy.nvim setup +│ │ └── options.lua # Neovim options +│ └── plugins/ +│ ├── example.lua # Example plugin configuration +│ ├── general.lua # General plugins (tmux-navigator) +│ ├── harpoon.lua # Harpoon file navigation +│ └── ui.lua # UI plugins (catppuccin theme) +``` + +## Key Configuration Details + +### LazyVim Version +- **Version**: 8 +- **Install Version**: 8 +- **Extras**: JSON, Markdown, and Python language support + +### Plugin Management +- Uses [lazy.nvim](https://github.com/folke/lazy.nvim) for plugin management +- Plugins are lazy-loaded by default for performance +- Auto-updates are enabled but notifications are disabled + +### Custom Plugins + +#### 1. **Harpoon** (`lua/plugins/harpoon.lua`) +- **Purpose**: Fast file navigation and project management +- **Key Bindings**: + - `H`: Add current file to harpoon + - `h`: Toggle harpoon quick menu + - `1-9`: Jump to harpoon file 1-9 +- **Configuration**: Auto-save on toggle, dynamic menu width + +#### 2. **Tmux Navigator** (`lua/plugins/general.lua`) +- **Purpose**: Seamless navigation between Neovim and tmux panes +- **Commands**: TmuxNavigateLeft/Down/Up/Right/Previous + +#### 3. **Catppuccin Theme** (`lua/plugins/ui.lua`) +- **Purpose**: Modern, beautiful color scheme +- **Theme**: catppuccin-frappe (default) +- **Features**: Extensive integration with LSP, treesitter, and other plugins + +## Important Files for Agents + +### Configuration Files +- `init.lua`: Entry point - just loads `config.lazy` +- `lua/config/lazy.lua`: Main lazy.nvim configuration +- `lua/config/options.lua`: Neovim options and settings +- `lua/config/keymaps.lua`: Key mappings and shortcuts +- `lua/config/autocmds.lua`: Auto commands and file type settings + +### Plugin Files +- Each file in `lua/plugins/` represents a plugin or group of related plugins +- Plugin configurations return a table with plugin specifications +- Use `lazy = true` for lazy loading, `lazy = false` for immediate loading + +## Development Guidelines for Agents + +### 1. **Adding New Plugins** +```lua +-- In lua/plugins/your-plugin.lua +return { + { + "author/plugin-name", + version = "*", -- or specific version + lazy = true, -- or false for immediate loading + opts = { + -- plugin options + }, + keys = { + -- key mappings + }, + }, +} +``` + +### 2. **Modifying Existing Plugins** +- Edit the corresponding file in `lua/plugins/` +- Use `opts` table to override default options +- Use `keys` table to add custom key mappings + +### 3. **Key Mapping Conventions** +- Leader key is typically `` (usually space) +- Use descriptive `desc` fields for all key mappings +- Group related mappings in the same plugin file + +### 4. **LazyVim Integration** +- LazyVim provides many built-in plugins and configurations +- Use `LazyVim/LazyVim` import to access core functionality +- Override LazyVim defaults in your plugin files + +## Common Tasks for Agents + +### Adding Language Support +1. Check if LazyVim already provides the language support +2. If not, add language-specific plugins to `lua/plugins/` +3. Configure LSP, treesitter, and other language tools + +### Customizing UI +1. Modify `lua/plugins/ui.lua` for theme changes +2. Add statusline, bufferline, or other UI plugins +3. Configure colorscheme in the LazyVim options + +### Adding Key Mappings +1. Add global mappings to `lua/config/keymaps.lua` +2. Add plugin-specific mappings in the plugin file +3. Use `vim.keymap.set()` for modern key mapping + +### Performance Optimization +1. Ensure plugins are properly lazy-loaded +2. Use `lazy = true` for non-essential plugins +3. Configure `cmd`, `event`, or `ft` triggers for lazy loading + +## Troubleshooting + +### Plugin Issues +- Check `lazy-lock.json` for version conflicts +- Use `:Lazy` to manage plugins interactively +- Check `:checkhealth` for system issues + +### Configuration Issues +- Validate Lua syntax with `:luafile %` +- Check for circular dependencies in plugin imports +- Use `:LazyVim profile` for performance analysis + +## Resources + +- [LazyVim Documentation](https://lazyvim.github.io/) +- [lazy.nvim Documentation](https://github.com/folke/lazy.nvim) +- [Neovim Lua Guide](https://neovim.io/doc/user/lua-guide.html) + +## Notes for AI Agents + +- This configuration is optimized for modern Neovim development +- Always test changes in a safe environment before applying +- Respect the existing code style and structure +- Use descriptive commit messages when making changes +- Consider performance implications of new plugins \ No newline at end of file diff --git a/lazy-lock.json b/lazy-lock.json index 9c0ec86..bfb2740 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,17 +1,26 @@ { - "LazyVim": { "branch": "main", "commit": "e8a1d8b6286f82d75e5830de5ea93bd7622cec8c" }, + "LazyVim": { "branch": "main", "commit": "a65d5d530d372b39a468dfbb2ce633f344770c5c" }, + "LuaSnip": { "branch": "master", "commit": "ccf25a5452b8697a823de3e5ecda63ed3d723b79" }, "SchemaStore.nvim": { "branch": "main", "commit": "960a5cf992c033170499ccc7003df59734ed40a8" }, - "blink.cmp": { "branch": "main", "commit": "327fff91fe6af358e990be7be1ec8b78037d2138" }, "bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" }, "catppuccin": { "branch": "main", "commit": "af58927c55c9f3272c940ff02b3cee94a1249f26" }, + "cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" }, + "cmp-emoji": { "branch": "main", "commit": "e8398e2adf512a03bb4e1728ca017ffeac670a9f" }, + "cmp-git": { "branch": "main", "commit": "b24309c386c9666c549a1abaedd4956541676d06" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "bd5a7d6db125d4654b50eeae9f5217f24bb22fd3" }, + "cmp-path": { "branch": "main", "commit": "c642487086dbd9a93160e1679a1327be111cbc25" }, "conform.nvim": { "branch": "master", "commit": "235dd79731c1dc51ec04abb4045cbc54727a172a" }, + "executor.nvim": { "branch": "main", "commit": "56dfbe6f7fbf4a6ba7e5934df2d95810e0235f64" }, "flash.nvim": { "branch": "main", "commit": "3be9bf7e85550045ec576379a0c45aac144d0438" }, "friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" }, + "gh.nvim": { "branch": "main", "commit": "6f367b2ab8f9d4a0a23df2b703a3f91137618387" }, "gitsigns.nvim": { "branch": "main", "commit": "20ad4419564d6e22b189f6738116b38871082332" }, "grug-far.nvim": { "branch": "main", "commit": "3e72397465f774b01aa38e4fe8e6eecf23d766d9" }, "harpoon": { "branch": "harpoon2", "commit": "ed1f853847ffd04b2b61c314865665e1dadf22c7" }, + "helm-ls.nvim": { "branch": "main", "commit": "f36ecbd3e7b0b2ac8358a9d6a3213888e29943db" }, "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, "lazydev.nvim": { "branch": "main", "commit": "e28ce52fc7ff79fcb76f0e79ee6fb6182fca90b9" }, + "litee.nvim": { "branch": "main", "commit": "4efaf373322d9e71eaff31164abb393417cc6f6a" }, "lualine.nvim": { "branch": "master", "commit": "3946f0122255bc377d14a59b27b609fb3ab25768" }, "markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "2304ff65ecc8cb2afc2484de3e2ed9a407edf0b9" }, @@ -21,15 +30,19 @@ "mini.pairs": { "branch": "main", "commit": "b9aada8c0e59f2b938e98fbf4eae0799eba96ad9" }, "noice.nvim": { "branch": "main", "commit": "c86aea584d98be7ee1167ce4d4ef946fbd7f3ae0" }, "nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" }, + "nvim-cmp": { "branch": "main", "commit": "a7bcf1d88069fc67c9ace8a62ba480b8fe879025" }, "nvim-lint": { "branch": "master", "commit": "9da1fb942dd0668d5182f9c8dee801b9c190e2bb" }, "nvim-lspconfig": { "branch": "master", "commit": "e5c61b02f33b5c6538be25b2696b33b4cc91e667" }, - "nvim-treesitter": { "branch": "main", "commit": "71bf1665f804d46f7e4b24ad7ffc11f6ea5b271a" }, + "nvim-snippets": { "branch": "main", "commit": "56b4052f71220144689caaa2e5b66222ba5661eb" }, + "nvim-treesitter": { "branch": "main", "commit": "30c466ad571b8b99fd06e3df8b2336e3ae63a53a" }, "nvim-treesitter-textobjects": { "branch": "main", "commit": "1b2d85d3de6114c4bcea89ffb2cd1ce9e3a19931" }, "nvim-ts-autotag": { "branch": "main", "commit": "c4ca798ab95b316a768d51eaaaee48f64a4a46bc" }, "persistence.nvim": { "branch": "main", "commit": "51eef57272742b773468949f6bd0503ec3f83874" }, "plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" }, + "project.nvim": { "branch": "main", "commit": "8c6bad7d22eef1b71144b401c9f74ed01526a4fb" }, "render-markdown.nvim": { "branch": "main", "commit": "475d3ad8cae486b0df6fc6050cf5b5ea1de42db8" }, - "snacks.nvim": { "branch": "main", "commit": "cb0df7318886aa5ad11eafcb753d3bfba3e1ecbb" }, + "snacks.nvim": { "branch": "main", "commit": "2aee35d0591f80b4a186e0ad3c600cd05c3f2a4d" }, + "tailwindcss-colorizer-cmp.nvim": { "branch": "main", "commit": "3d3cd95e4a4135c250faf83dd5ed61b8e5502b86" }, "todo-comments.nvim": { "branch": "main", "commit": "19d461ddd543e938eb22505fb03fa878800270b6" }, "tokyonight.nvim": { "branch": "main", "commit": "e63c42a42b11cd6225f009dd949b9ee0fccc15ef" }, "trouble.nvim": { "branch": "main", "commit": "c098362fe603d3922095e7db595961e020bdf2d0" }, diff --git a/lazyvim.json b/lazyvim.json index c738bec..caa066c 100644 --- a/lazyvim.json +++ b/lazyvim.json @@ -1,8 +1,17 @@ { "extras": [ + "lazyvim.plugins.extras.coding.nvim-cmp", + "lazyvim.plugins.extras.lang.docker", + "lazyvim.plugins.extras.lang.git", + "lazyvim.plugins.extras.lang.helm", "lazyvim.plugins.extras.lang.json", "lazyvim.plugins.extras.lang.markdown", - "lazyvim.plugins.extras.lang.python" + "lazyvim.plugins.extras.lang.python", + "lazyvim.plugins.extras.lang.typescript", + "lazyvim.plugins.extras.lang.yaml", + "lazyvim.plugins.extras.util.gh", + "lazyvim.plugins.extras.util.gitui", + "lazyvim.plugins.extras.util.project" ], "install_version": 8, "news": { diff --git a/lua/plugins/general.lua b/lua/plugins/general.lua index cd3d721..24b0562 100644 --- a/lua/plugins/general.lua +++ b/lua/plugins/general.lua @@ -10,4 +10,100 @@ return { "TmuxNavigatePrevious", }, }, + { + "google/executor.nvim", + dependencies = { + "MunifTanjim/nui.nvim", + }, + lazy = true, + cmd = { + "ExecutorRun", + "ExecutorToggleDetail", + "ExecutorSetCommand", + }, + config = function(_, opts) + require("executor").setup(opts) + end, + opts = { + use_split = false, + }, + keys = { + { + "trr", + ":ExecutorRun", + desc = "Run task in background", + }, + { + "tro", + ":ExecutorRun", + desc = "Run one-off task in background", + }, + { + "trs", + ":ExecutorSetCommand", + desc = "Set background command to run", + }, + { + "tll", + ":ExecutorToggleDetail", + desc = "Show last task details", + }, + { "t", desc = "+tasks" }, + { "tr", desc = "+run task" }, + { "tl", desc = "+last task" }, + }, + }, + -- Use for completion and snippets (supertab) + -- first: disable default and behavior in LuaSnip + { + "L3MON4D3/LuaSnip", + keys = function() + return {} + end, + }, + -- then: setup supertab in cmp + { + "hrsh7th/nvim-cmp", + dependencies = { + "hrsh7th/cmp-emoji", + }, + lazy = false, + ---@class opts cmp.ConfigSchema + opts = function(_, opts) + local has_words_before = function() + unpack = unpack or table.unpack + local line, col = unpack(vim.api.nvim_win_get_cursor(0)) + return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil + end + + local luasnip = require("luasnip") + local cmp = require("cmp") + + opts.mapping = vim.tbl_extend("force", opts.mapping, { + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + -- You could replace select_next_item() with confirm({ select = true }) to get VS Code autocompletion behavior + cmp.select_next_item() + -- You could replace the expand_or_jumpable() calls with expand_or_locally_jumpable() + -- they way you will only jump inside the snippet region + elseif luasnip.expand_or_jumpable() then + luasnip.expand_or_jump() + elseif has_words_before() then + cmp.complete() + else + fallback() + end + end, { "i", "s" }), + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_prev_item() + elseif luasnip.jumpable(-1) then + luasnip.jump(-1) + else + fallback() + end + end, { "i", "s" }), + }) + end, + }, } diff --git a/lua/plugins/ui.lua b/lua/plugins/ui.lua index 98d15be..8879a57 100644 --- a/lua/plugins/ui.lua +++ b/lua/plugins/ui.lua @@ -1,60 +1,62 @@ return { { - "catppuccin/nvim", - lazy = true, - name = "catppuccin", + "folke/tokyonight.nvim", opts = { - lsp_styles = { - underlines = { - errors = { "undercurl" }, - hints = { "undercurl" }, - warnings = { "undercurl" }, - information = { "undercurl" }, - }, - }, - integrations = { - aerial = true, - alpha = true, - cmp = true, - dashboard = true, - flash = true, - fzf = true, - grug_far = true, - gitsigns = true, - headlines = true, - illuminate = true, - indent_blankline = { enabled = true }, - leap = true, - lsp_trouble = true, - mason = true, - mini = true, - navic = { enabled = true, custom_bg = "lualine" }, - neotest = true, - neotree = true, - noice = true, - notify = true, - snacks = true, - telescope = true, - treesitter_context = true, - which_key = true, - }, - }, - specs = { - { - "akinsho/bufferline.nvim", - optional = true, - opts = function(_, opts) - if (vim.g.colors_name or ""):find("catppuccin") then - opts.highlights = require("catppuccin.special.bufferline").get_theme() - end - end, + transparent = true, + styles = { + sidebars = "transparent", + floats = "transparent", }, }, }, { - "LazyVim/LazyVim", + "snacks.nvim", opts = { - colorscheme = "catppuccin-frappe", + dashboard = { + preset = { + pick = function(cmd, opts) + return LazyVim.pick(cmd, opts)() + end, + header = [[ + + ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄ + █░▄▄▀█▀▄▄▀█░▄▄░█▄░▄█▀▄▀██░▄░██░██░█░▄▄█░▄▄░█ + █░▀▀▄█░██░█░▀▄░██░██░█▀█░▀▀░▀█░██░█▄▄▀███▄██ + █▄█▄▄██▄▄██░▀▀░██▄███▄█████░███▄▄▄█▄▄▄█░▀▀░█ + ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀ + + ⣴⣶⣤⡤⠦⣤⣀⣤⠆ ⣈⣭⣿⣶⣿⣦⣼⣆ + ⠉⠻⢿⣿⠿⣿⣿⣶⣦⠤⠄⡠⢾⣿⣿⡿⠋⠉⠉⠻⣿⣿⡛⣦ + ⠈⢿⣿⣟⠦ ⣾⣿⣿⣷ ⠻⠿⢿⣿⣧⣄ + ⣸⣿⣿⢧ ⢻⠻⣿⣿⣷⣄⣀⠄⠢⣀⡀⠈⠙⠿⠄ + ⢠⣿⣿⣿⠈ ⣻⣿⣿⣿⣿⣿⣿⣿⣛⣳⣤⣀⣀ + ⢠⣧⣶⣥⡤⢄ ⣸⣿⣿⠘ ⢀⣴⣿⣿⡿⠛⣿⣿⣧⠈⢿⠿⠟⠛⠻⠿⠄ + ⣰⣿⣿⠛⠻⣿⣿⡦⢹⣿⣷ ⢊⣿⣿⡏ ⢸⣿⣿⡇ ⢀⣠⣄⣾⠄ + ⣠⣿⠿⠛ ⢀⣿⣿⣷⠘⢿⣿⣦⡀ ⢸⢿⣿⣿⣄ ⣸⣿⣿⡇⣪⣿⡿⠿⣿⣷⡄ + ⠙⠃ ⣼⣿⡟ ⠈⠻⣿⣿⣦⣌⡇⠻⣿⣿⣷⣿⣿⣿ ⣿⣿⡇ ⠛⠻⢷⣄ + ⢻⣿⣿⣄ ⠈⠻⣿⣿⣿⣷⣿⣿⣿⣿⣿⡟ ⠫⢿⣿⡆ + ⠻⣿⣿⣿⣿⣶⣶⣾⣿⣿⣿⣿⣿⣿⣿⣿⡟⢀⣀⣤⣾⡿⠃ + ▄▄▄ . ▌ ▐·▪ ▄▄▌ ▄▄▌ ▐ ▄▌▪ ▄▄▄▄▄ ▄ .▄ ▄• ▄▌▄▄▄▄▄ + ▀▄.▀·▪█·█▌██ ██• ██· █▌▐███ •██ ██▪▐█ ▄█▀▄ █▪██▌•██ + ▐▀▀▪▄▐█▐█•▐█·██ ▪ ██▪▐█▐▐▌▐█· ▐█.▪██▀▀█▐█▌.▐▌█▌▐█▌ ▐█.▪ + ▐█▄▄▌ ███ ▐█▌▐█▌ ▄ ▐█▌██▐█▌▐█▌ ▐█▌·██▌▐▀▐█▌.▐▌▐█▄█▌ ▐█▌· + ▀▀▀ . ▀ ▀▀▀.▀▀▀ ▀▀▀▀ ▀▪▀▀▀ ▀▀▀ ▀▀▀ · ▀█▄▀▪ ▀▀▀ ▀▀▀ + ]], + -- stylua: ignore + ---@type snacks.dashboard.Item[] + keys = { + { icon = " ", key = "f", desc = "Find File", action = ":lua Snacks.dashboard.pick('files')" }, + { icon = " ", key = "n", desc = "New File", action = ":ene | startinsert" }, + { icon = " ", key = "g", desc = "Find Text", action = ":lua Snacks.dashboard.pick('live_grep')" }, + { icon = " ", key = "r", desc = "Recent Files", action = ":lua Snacks.dashboard.pick('oldfiles')" }, + { icon = " ", key = "c", desc = "Config", action = ":lua Snacks.dashboard.pick('files', {cwd = vim.fn.stdpath('config')})" }, + { icon = " ", key = "s", desc = "Restore Session", section = "session" }, + { icon = " ", key = "x", desc = "Lazy Extras", action = ":LazyExtras" }, + { icon = "󰒲 ", key = "l", desc = "Lazy", action = ":Lazy" }, + { icon = " ", key = "q", desc = "Quit", action = ":qa" }, + }, + }, + }, }, }, }