diff --git a/.stylua.toml b/.stylua.toml index 139e939..ef2fd00 100644 --- a/.stylua.toml +++ b/.stylua.toml @@ -2,5 +2,5 @@ column_width = 160 line_endings = "Unix" indent_type = "Spaces" indent_width = 2 -quote_style = "AutoPreferSingle" -call_parentheses = "None" +quote_style = "AutoPreferDouble" +call_parentheses = "Always" diff --git a/.tmuxp.nvim.half.json b/.tmuxp.nvim.half.json deleted file mode 100644 index bc7ab91..0000000 --- a/.tmuxp.nvim.half.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "session_name": "nvim", - "tmux_options": "-f /Users/dlond/.config/tmux/tmux.conf", - "windows": [ - { - "window_name": "editor", - "layout": "even-vertical", - "panes": [ - { "shell_command": ["nvim ."] }, - { "shell_command": [] } - ] - } - ] -} diff --git a/README.md b/README.md deleted file mode 100644 index 8b328cc..0000000 --- a/README.md +++ /dev/null @@ -1,358 +0,0 @@ -# ๐Ÿš€ Modular Neovim Configuration - -A clean, fast, and fully-featured Neovim configuration with perfect separation of concerns. Built on modern plugins with LSP, TreeSitter, and Copilot integration. Originally forked from [kickstart.nvim](https://github.com/nvim-lua/kickstart.nvim) and transformed into a maintainable modular structure. - -## โœจ Features - -### ๐ŸŽฏ Core Features -- **Modular Architecture** - Clean separation between core settings, plugin specs, and configurations -- **LSP Support** - Full language server integration for C/C++, Python, Nix, LaTeX, and more -- **Intelligent Completion** - [Blink.cmp](https://github.com/saghen/blink.cmp) with Copilot integration -- **Fuzzy Finding** - Telescope with FZF for lightning-fast file and text search -- **Git Integration** - Fugitive + Gitsigns for complete git workflow -- **Syntax Highlighting** - TreeSitter-based highlighting with automatic parser installation -- **Debugging** - Full DAP (Debug Adapter Protocol) support - -### ๐Ÿ”ง Language Support -- **C/C++** - clangd with automatic compile_commands.json detection -- **Python** - Pyright + Ruff for type checking and linting -- **Nix** - Full nixd integration -- **LaTeX** - TeXLab for document preparation -- **CMake** - CMake language server -- **Lua** - Optimized for Neovim config development - -## ๐Ÿ“ Project Structure - -``` -nvim/ -โ”œโ”€โ”€ init.lua # Minimal bootstrapper -โ”œโ”€โ”€ lua/ -โ”‚ โ”œโ”€โ”€ core/ # Core Neovim settings -โ”‚ โ”‚ โ”œโ”€โ”€ bootstrap.lua # Lazy.nvim installation -โ”‚ โ”‚ โ”œโ”€โ”€ options.lua # Editor options -โ”‚ โ”‚ โ”œโ”€โ”€ keymaps.lua # Core keybindings -โ”‚ โ”‚ โ”œโ”€โ”€ autocmds.lua # Auto commands -โ”‚ โ”‚ โ””โ”€โ”€ health.lua # Health checks -โ”‚ โ””โ”€โ”€ plugins/ -โ”‚ โ”œโ”€โ”€ spec/ # Plugin declarations -โ”‚ โ”‚ โ”œโ”€โ”€ lsp.lua # Language servers -โ”‚ โ”‚ โ”œโ”€โ”€ blink.lua # Completion -โ”‚ โ”‚ โ”œโ”€โ”€ telescope.lua # Fuzzy finder -โ”‚ โ”‚ โ”œโ”€โ”€ treesitter.lua # Syntax highlighting -โ”‚ โ”‚ โ”œโ”€โ”€ git.lua # Git integration -โ”‚ โ”‚ โ””โ”€โ”€ ... # Other plugins -โ”‚ โ””โ”€โ”€ config/ # Plugin configurations -โ”‚ โ”œโ”€โ”€ lsp/ # LSP setup -โ”‚ โ”œโ”€โ”€ blink.lua # Completion config -โ”‚ โ”œโ”€โ”€ telescope.lua # Telescope config -โ”‚ โ””โ”€โ”€ ... # Other configs -``` - -## ๐Ÿš€ Installation - -### Prerequisites - -#### System Requirements -- **Neovim** >= 0.10 -- **Git** - Version control -- **Make** - Build tool -- **C Compiler** - For native extensions -- **ripgrep** - Fast text search -- **fd** - Fast file finder - -#### Language Servers (Install via Nix/Homebrew/Package Manager) -```bash -# Example with Nix -nix-env -iA nixpkgs.clang-tools # clangd -nix-env -iA nixpkgs.pyright # Python LSP -nix-env -iA nixpkgs.ruff # Python linter -nix-env -iA nixpkgs.nixd # Nix LSP -nix-env -iA nixpkgs.texlab # LaTeX LSP -``` - -### Install Configuration - -#### Backup Existing Config -```bash -mv ~/.config/nvim ~/.config/nvim.backup -``` - -#### Clone This Repository -```bash -git clone https://github.com/yourusername/nvim.git ~/.config/nvim -``` - -#### Launch Neovim -```bash -nvim -``` - -The first launch will automatically: -1. Install lazy.nvim plugin manager -2. Download and install all plugins -3. Set up TreeSitter parsers - -### Health Check - -After installation, run `:checkhealth core` to verify: -- Neovim version -- Required executables -- LSP servers -- Formatters - -## ๐Ÿ”„ Syncing with Kickstart.nvim - -This configuration maintains compatibility with upstream kickstart.nvim while keeping all customizations in a modular structure. Here's how to sync with kickstart updates: - -### Initial Setup (One Time) -```bash -# Add kickstart as a remote -git remote add kickstart https://github.com/nvim-lua/kickstart.nvim -git fetch kickstart -``` - -### Checking for Updates -```bash -# See what changed in kickstart -git fetch kickstart -git log kickstart/master --oneline - -# Review specific changes -git diff HEAD kickstart/master -- init.lua -``` - -### Cherry-Picking Updates -```bash -# Option 1: Cherry-pick specific commits -git cherry-pick - -# Option 2: Manually review and integrate changes -git diff kickstart/master -- init.lua | less - -# Option 3: Check for specific feature updates (e.g., telescope) -git diff kickstart/master -- init.lua | grep -A5 -B5 telescope -``` - -### Update Workflow -1. **Review Changes**: Check kickstart's commit history for interesting updates -2. **Test Locally**: Apply changes in a test branch first -3. **Adapt to Modular Structure**: Move any new plugins/configs to appropriate `lua/plugins/` files -4. **Document**: Update relevant documentation for new features - -### Example: Adding a New Plugin from Kickstart -If kickstart adds a new plugin in their `init.lua`: -1. Create a new spec file: `lua/plugins/spec/newplugin.lua` -2. Add configuration to: `lua/plugins/config/newplugin.lua` (if needed) -3. Update: `lua/plugins/spec/init.lua` to import the new spec - -## โŒจ๏ธ Key Mappings - -### Leader Key -The leader key is set to ``. - -### Essential Keybindings - -#### File Navigation -| Key | Description | -|-----|-------------| -| `sf` | **S**earch **F**iles | -| `sg` | **S**earch by **G**rep | -| `sh` | **S**earch **H**elp | -| `` | Switch buffers | -| `/` | Fuzzy search in current buffer | - -#### LSP Features -| Key | Description | -|-----|-------------| -| `gd` | **G**oto **D**efinition | -| `gr` | **G**oto **R**eferences | -| `gI` | **G**oto **I**mplementation | -| `rn` | **R**e**n**ame symbol | -| `ca` | **C**ode **A**ction | -| `K` | Hover documentation | -| `f` | **F**ormat buffer | - -#### Git Operations -| Key | Description | -|-----|-------------| -| `gs` | Git status (Fugitive) | -| `gd` | Git diff | -| `gc` | Git commit | -| `gb` | Git blame | -| `]c` | Next git change | -| `[c` | Previous git change | -| `hs` | Stage hunk | -| `hr` | Reset hunk | - -#### Debugging -| Key | Description | -|-----|-------------| -| `` | Start/Continue debugging | -| `` | Step over | -| `` | Step into | -| `` | Step out | -| `db` | Toggle breakpoint | -| `` | Toggle debug UI | - -#### Window Navigation (Tmux-aware) -| Key | Description | -|-----|-------------| -| `` | Navigate left | -| `` | Navigate down | -| `` | Navigate up | -| `` | Navigate right | - -### Completion Keybindings -| Key | Description | -|-----|-------------| -| `` | Trigger completion | -| `` | Accept completion | -| `` | Cancel completion | -| `` | Next snippet placeholder | -| `` | Previous snippet placeholder | - -## ๐Ÿ”Œ Installed Plugins - -### Core -- [lazy.nvim](https://github.com/folke/lazy.nvim) - Plugin manager -- [plenary.nvim](https://github.com/nvim-lua/plenary.nvim) - Lua utilities - -### Editor Enhancement -- [mini.nvim](https://github.com/echasnovski/mini.nvim) - Collection of minimal plugins -- [Comment.nvim](https://github.com/numToStr/Comment.nvim) - Smart commenting -- [vim-sleuth](https://github.com/tpope/vim-sleuth) - Auto-detect indentation -- [nvim-autopairs](https://github.com/windwp/nvim-autopairs) - Auto-close brackets -- [indent-blankline.nvim](https://github.com/lukas-reineke/indent-blankline.nvim) - Indent guides -- [vim-illuminate](https://github.com/RRethy/vim-illuminate) - Highlight word under cursor - -### UI/Theme -- [tokyonight.nvim](https://github.com/folke/tokyonight.nvim) - Color scheme -- [which-key.nvim](https://github.com/folke/which-key.nvim) - Keybinding hints -- [todo-comments.nvim](https://github.com/folke/todo-comments.nvim) - Highlight TODO comments - -### Navigation -- [telescope.nvim](https://github.com/nvim-telescope/telescope.nvim) - Fuzzy finder -- [telescope-fzf-native.nvim](https://github.com/nvim-telescope/telescope-fzf-native.nvim) - FZF sorter -- [vim-tmux-navigator](https://github.com/christoomey/vim-tmux-navigator) - Seamless tmux navigation - -### Git -- [vim-fugitive](https://github.com/tpope/vim-fugitive) - Git commands -- [gitsigns.nvim](https://github.com/lewis6991/gitsigns.nvim) - Git gutter signs - -### LSP & Completion -- [nvim-lspconfig](https://github.com/neovim/nvim-lspconfig) - LSP configurations -- [blink.cmp](https://github.com/saghen/blink.cmp) - Completion engine -- [lazydev.nvim](https://github.com/folke/lazydev.nvim) - Lua development -- [fidget.nvim](https://github.com/j-hui/fidget.nvim) - LSP progress - -### Development -- [nvim-treesitter](https://github.com/nvim-treesitter/nvim-treesitter) - Syntax highlighting -- [nvim-treesitter-textobjects](https://github.com/nvim-treesitter/nvim-treesitter-textobjects) - Syntax-aware text objects -- [copilot.lua](https://github.com/zbirenbaum/copilot.lua) - GitHub Copilot -- [conform.nvim](https://github.com/stevearc/conform.nvim) - Formatting -- [nvim-dap](https://github.com/mfussenegger/nvim-dap) - Debug Adapter Protocol -- [nvim-dap-ui](https://github.com/rcarriga/nvim-dap-ui) - Debug UI - -## ๐Ÿ› ๏ธ Configuration - -### Customization - -All configuration files are designed to be easily customizable: - -1. **Core Settings**: Edit files in `lua/core/` - - `options.lua` - Vim options - - `keymaps.lua` - Core keybindings - -2. **Add Plugins**: Create new spec files in `lua/plugins/spec/` - ```lua - -- lua/plugins/spec/myplugin.lua - return { - 'username/plugin-name', - opts = { - -- plugin options - } - } - ``` - -3. **Complex Plugin Config**: Add config files to `lua/plugins/config/` - -### LSP Server Configuration - -LSP servers are configured in `lua/plugins/config/lsp/init.lua`. Add new servers to the `servers` table: - -```lua -servers = { - myserver = { - settings = { - -- server-specific settings - } - } -} -``` - -### Formatter Configuration - -Formatters are configured in `lua/plugins/spec/formatting.lua`: - -```lua -formatters_by_ft = { - javascript = { "prettier" }, - -- add your formatters here -} -``` - -## ๐Ÿ”ง Commands - -### Custom Commands -- `:ReloadLSP` - Restart all LSP servers - -### Health Check -- `:checkhealth core` - Run configuration health check - -### Plugin Management -- `:Lazy` - Open plugin manager UI -- `:Lazy sync` - Update all plugins -- `:Lazy profile` - Profile startup time - -## ๐Ÿ› Troubleshooting - -### First Steps -1. Run `:checkhealth core` to verify installation -2. Check `:messages` for error messages -3. Ensure all prerequisites are installed - -### Common Issues - -**Plugins not loading** -- Run `:Lazy sync` to ensure all plugins are installed -- Check for errors in `:messages` - -**LSP not working** -- Verify language servers are installed (check with `:checkhealth core`) -- Run `:LspInfo` to see active servers -- Try `:ReloadLSP` to restart servers - -**Telescope not finding files** -- Ensure `ripgrep` and `fd` are installed -- Check you're not in a git-ignored directory - -## ๐Ÿ“ License - -This configuration is based on [kickstart.nvim](https://github.com/nvim-lua/kickstart.nvim) and is available under the MIT License. - -## ๐Ÿ™ Acknowledgments - -- [kickstart.nvim](https://github.com/nvim-lua/kickstart.nvim) - Initial configuration structure -- [Neovim](https://neovim.io/) - The best text editor -- All plugin authors for their amazing work - -## ๐Ÿค Contributing - -Contributions are welcome! Feel free to: -- Report issues -- Suggest new features -- Submit pull requests - ---- - -**Happy Coding!** ๐ŸŽ‰ \ No newline at end of file diff --git a/doc/modular.txt b/doc/modular.txt deleted file mode 100644 index 9a9c421..0000000 --- a/doc/modular.txt +++ /dev/null @@ -1,222 +0,0 @@ -*modular.txt* Modular Neovim Configuration - -============================================================================== -CONTENTS *modular-contents* - - 1. Introduction ................................ |modular-intro| - 2. Quick Start ................................. |modular-quickstart| - 3. Architecture ................................ |modular-architecture| - 4. Keybindings ................................. |modular-keybindings| - 5. Commands .................................... |modular-commands| - 6. Customization ............................... |modular-customization| - 7. Troubleshooting ............................. |modular-troubleshooting| - -============================================================================== -1. INTRODUCTION *modular-intro* - -This is a modular Neovim configuration built for performance and -maintainability. Originally based on kickstart.nvim but restructured with -clean separation of concerns. - -Key features: - โ€ข Modular plugin architecture - โ€ข Full LSP support (C/C++, Python, Nix, LaTeX) - โ€ข Intelligent completion with Blink.cmp - โ€ข Git integration (Fugitive + Gitsigns) - โ€ข Debug support (DAP) - โ€ข Tmux integration - -============================================================================== -2. QUICK START *modular-quickstart* - -Prerequisites: > - - Neovim >= 0.10 - - Git, Make, C compiler - - ripgrep, fd - - Language servers (via Nix/package manager) - -Installation: >bash - # Backup existing config - mv ~/.config/nvim ~/.config/nvim.backup - - # Clone this config - git clone ~/.config/nvim - - # Start Neovim - nvim - -Health check: >vim - :checkhealth core - -============================================================================== -3. ARCHITECTURE *modular-architecture* - -Directory Structure: > - nvim/ - โ”œโ”€โ”€ init.lua # Bootstrap - โ”œโ”€โ”€ lua/ - โ”‚ โ”œโ”€โ”€ core/ # Core settings - โ”‚ โ”‚ โ”œโ”€โ”€ bootstrap.lua # Lazy.nvim - โ”‚ โ”‚ โ”œโ”€โ”€ options.lua # Vim options - โ”‚ โ”‚ โ”œโ”€โ”€ keymaps.lua # Core keymaps - โ”‚ โ”‚ โ””โ”€โ”€ health.lua # Health checks - โ”‚ โ””โ”€โ”€ plugins/ - โ”‚ โ”œโ”€โ”€ spec/ # Plugin specs - โ”‚ โ””โ”€โ”€ config/ # Plugin configs - -Loading Order: - 1. Bootstrap lazy.nvim - 2. Load core options and keymaps - 3. Load plugins via lazy.nvim - 4. Plugin configurations execute - -============================================================================== -4. KEYBINDINGS *modular-keybindings* - -Leader key: - ------------------------------------------------------------------------------- -NAVIGATION *modular-keys-navigation* - - Navigate left (window/tmux) - Navigate down - Navigate up - Navigate right - Clear search highlights - ------------------------------------------------------------------------------- -SEARCH *modular-keys-search* - - sf Search [F]iles - sg Search by [G]rep - sh Search [H]elp - sk Search [K]eymaps - sw Search current [W]ord - sd Search [D]iagnostics - / Fuzzy search in buffer - Find buffers - ------------------------------------------------------------------------------- -LSP *modular-keys-lsp* - - gd Goto Definition - gr Goto References - gI Goto Implementation - K Hover documentation - rn Rename symbol - ca Code action - f Format buffer - lr Reload LSP servers - ------------------------------------------------------------------------------- -GIT *modular-keys-git* - - gs Git status - gd Git diff - gc Git commit - gb Git blame - - ]c Next git change - [c Previous git change - hs Stage hunk - hr Reset hunk - ------------------------------------------------------------------------------- -DEBUG *modular-keys-debug* - - Start/Continue - Step over - Step into - Step out - Toggle UI - db Toggle breakpoint - ------------------------------------------------------------------------------- -COMPLETION *modular-keys-completion* - - Trigger completion - Accept - Cancel - Next snippet placeholder - -============================================================================== -5. COMMANDS *modular-commands* - -Custom Commands: - :ReloadLSP Restart all LSP servers - :checkhealth core Run configuration health check - -Plugin Commands: - :Lazy Plugin manager UI - :Lazy sync Update plugins - :Git Fugitive git status - :Telescope Open telescope - -============================================================================== -6. CUSTOMIZATION *modular-customization* - ------------------------------------------------------------------------------- -ADDING PLUGINS *modular-adding-plugins* - -Create a new spec file: >lua - -- lua/plugins/spec/myplugin.lua - return { - 'author/plugin-name', - event = 'VeryLazy', - opts = { - -- options here - } - } - -Then import it: >lua - -- lua/plugins/spec/init.lua - return { - { import = 'plugins.spec.myplugin' }, - -- other imports... - } - ------------------------------------------------------------------------------- -CONFIGURING LSP *modular-config-lsp* - -Edit `lua/plugins/config/lsp/init.lua`: >lua - local servers = { - myserver = { - settings = { - -- server settings - } - } - } - ------------------------------------------------------------------------------- -CUSTOM KEYMAPS *modular-custom-keymaps* - -Add to `lua/core/keymaps.lua`: >lua - vim.keymap.set('n', 'xx', function() - -- your function - end, { desc = 'My custom action' }) - -============================================================================== -7. TROUBLESHOOTING *modular-troubleshooting* - -Common Issues: - -LSP not working: >vim - :checkhealth core " Check if servers installed - :LspInfo " Check active servers - :ReloadLSP " Restart servers - -Plugins not loading: >vim - :Lazy sync " Update plugins - :messages " Check for errors - -Telescope issues: - โ€ข Ensure ripgrep and fd are installed - โ€ข Check you're not in git-ignored directory - -For more help: - โ€ข Run `:checkhealth core` - โ€ข Check `:messages` for errors - โ€ข See README.md for detailed documentation - -============================================================================== -vim:tw=78:ts=8:ft=help:norl: \ No newline at end of file diff --git a/doc/tags b/doc/tags deleted file mode 100644 index 38a1977..0000000 --- a/doc/tags +++ /dev/null @@ -1,18 +0,0 @@ -modular-adding-plugins modular.txt /*modular-adding-plugins* -modular-architecture modular.txt /*modular-architecture* -modular-commands modular.txt /*modular-commands* -modular-config-lsp modular.txt /*modular-config-lsp* -modular-contents modular.txt /*modular-contents* -modular-custom-keymaps modular.txt /*modular-custom-keymaps* -modular-customization modular.txt /*modular-customization* -modular-intro modular.txt /*modular-intro* -modular-keybindings modular.txt /*modular-keybindings* -modular-keys-completion modular.txt /*modular-keys-completion* -modular-keys-debug modular.txt /*modular-keys-debug* -modular-keys-git modular.txt /*modular-keys-git* -modular-keys-lsp modular.txt /*modular-keys-lsp* -modular-keys-navigation modular.txt /*modular-keys-navigation* -modular-keys-search modular.txt /*modular-keys-search* -modular-quickstart modular.txt /*modular-quickstart* -modular-troubleshooting modular.txt /*modular-troubleshooting* -modular.txt modular.txt /*modular.txt* \ No newline at end of file diff --git a/init.lua b/init.lua index 6663f3c..fcdb3b2 100644 --- a/init.lua +++ b/init.lua @@ -1,28 +1,2 @@ --- Bootstrap lazy.nvim -require 'core.bootstrap' - -require 'core.global' --- Core settings (must be before plugins) -require 'core.options' -require 'core.lsp' -require 'core.keymaps' -require 'core.autocmds' - -vim.env.DEVELOPER_DIR = '/Applications/Xcode.app/Contents/Developer' - --- Load plugins via lazy.nvim -require('lazy').setup('plugins.spec', { - change_detection = { enabled = true, notify = false }, - performance = { - rtp = { - disabled_plugins = { - 'blink.cmp', - 'gzip', - 'tarPlugin', - 'tohtml', - 'tutor', - 'zipPlugin', - }, - }, - }, -}) +require("core") +require("plugins") diff --git a/lazy-lock.json b/lazy-lock.json deleted file mode 100644 index 75fe211..0000000 --- a/lazy-lock.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" }, - "blink.cmp": { "branch": "main", "commit": "78336bc89ee5365633bcf754d93df01678b5c08f" }, -<<<<<<< Updated upstream - "cmake-tools.nvim": { "branch": "master", "commit": "e100f40b117381dadf42a34b0718f8e4350715b2" }, - "conform.nvim": { "branch": "master", "commit": "086a40dc7ed8242c03be9f47fbcee68699cc2395" }, - "friendly-snippets": { "branch": "main", "commit": "6cd7280adead7f586db6fccbd15d2cac7e2188b9" }, - "gitsigns.nvim": { "branch": "main", "commit": "8d82c240f190fc33723d48c308ccc1ed8baad69d" }, -======= - "blink.download": { "branch": "main", "commit": "b68335357e9fcc2b20445acfcee48034376d64b5" }, - "blink.pairs": { "branch": "main", "commit": "4e43012356d33a26f69eae475f746fbe9f325f44" }, - "conform.nvim": { "branch": "master", "commit": "086a40dc7ed8242c03be9f47fbcee68699cc2395" }, - "copilot.lua": { "branch": "master", "commit": "3123983d00ae6859f8bc987d14ebb524bb41b618" }, - "fidget.nvim": { "branch": "main", "commit": "3f5475949679953af6d78654db29b944fa826e6a" }, - "gitsigns.nvim": { "branch": "main", "commit": "4ed47e8c4c66c921dc1d6643977e0526e1f44396" }, ->>>>>>> Stashed changes - "harpoon": { "branch": "harpoon2", "commit": "87b1a3506211538f460786c23f98ec63ad9af4e5" }, - "image.nvim": { "branch": "master", "commit": "da2be65c153ba15a14a342b05591652a6df70d58" }, - "indent-blankline.nvim": { "branch": "master", "commit": "d28a3f70721c79e3c5f6693057ae929f3d9c0a03" }, - "jupytext.vim": { "branch": "master", "commit": "f15aff4515eb6a09afa0d7f41eb23be53c1e2e14" }, - "lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" }, -<<<<<<< Updated upstream - "leetcode.nvim": { "branch": "master", "commit": "fdd3f91800b3983e27bc9fcfb99cfa7293d7f11a" }, - "mini.nvim": { "branch": "main", "commit": "2431902e78b76f435542d1e606f08475360068ca" }, - "molten-nvim": { "branch": "main", "commit": "a286aa914d9a154bc359131aab788b5a077a5a99" }, - "nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" }, - "nvim-conan": { "branch": "main", "commit": "7d011809660832d8402c62fbee191757b5093a75" }, - "nvim-dap": { "branch": "master", "commit": "45a69eba683a2c448dd9ecfc4de89511f0646b5f" }, - "nvim-dap-ui": { "branch": "master", "commit": "1a66cabaa4a4da0be107d5eda6d57242f0fe7e49" }, - "nvim-dap-virtual-text": { "branch": "master", "commit": "fbdb48c2ed45f4a8293d0d483f7730d24467ccb6" }, - "nvim-lint": { "branch": "master", "commit": "4b03656c09c1561f89b6aa0665c15d292ba9499d" }, - "nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" }, - "nvim-treesitter": { "branch": "main", "commit": "4916d6592ede8c07973490d9322f187e07dfefac" }, - "nvim-treesitter-textobjects": { "branch": "main", "commit": "851e865342e5a4cb1ae23d31caf6e991e1c99f1e" }, - "nvim-web-devicons": { "branch": "master", "commit": "95b7a002d5dba1a42eb58f5fac5c565a485eefd0" }, - "oil.nvim": { "branch": "master", "commit": "0fcc83805ad11cf714a949c98c605ed717e0b83e" }, - "overseer.nvim": { "branch": "master", "commit": "f818eefff81f4b12fb7cf236f1b6c16768a2fcbc" }, -======= - "lazydev.nvim": { "branch": "main", "commit": "e28ce52fc7ff79fcb76f0e79ee6fb6182fca90b9" }, - "leetcode.nvim": { "branch": "master", "commit": "fdd3f91800b3983e27bc9fcfb99cfa7293d7f11a" }, - "mini.nvim": { "branch": "main", "commit": "402ee6c6ec8ea44b22330446c8fb4e615fd3953e" }, - "molten-nvim": { "branch": "main", "commit": "a286aa914d9a154bc359131aab788b5a077a5a99" }, - "nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" }, - "nvim-dap": { "branch": "master", "commit": "4f5deb110d9ff8994d96c21df95e2271d11214f9" }, - "nvim-dap-ui": { "branch": "master", "commit": "d9770a55188bb34c2bdce7d90a6151181beb6966" }, - "nvim-dap-virtual-text": { "branch": "master", "commit": "fbdb48c2ed45f4a8293d0d483f7730d24467ccb6" }, - "nvim-lint": { "branch": "master", "commit": "4b03656c09c1561f89b6aa0665c15d292ba9499d" }, - "nvim-lspconfig": { "branch": "master", "commit": "e5c61b02f33b5c6538be25b2696b33b4cc91e667" }, - "nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" }, - "nvim-treesitter": { "branch": "main", "commit": "4916d6592ede8c07973490d9322f187e07dfefac" }, - "nvim-treesitter-textobjects": { "branch": "main", "commit": "93d60a475f0b08a8eceb99255863977d3a25f310" }, - "nvim-web-devicons": { "branch": "master", "commit": "40e9d5a6cc3db11b309e39593fc7ac03bb844e38" }, - "oil.nvim": { "branch": "master", "commit": "0fcc83805ad11cf714a949c98c605ed717e0b83e" }, ->>>>>>> Stashed changes - "plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" }, - "telescope-fzf-native.nvim": { "branch": "main", "commit": "6fea601bd2b694c6f2ae08a6c6fab14930c60e2c" }, - "telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" }, - "telescope.nvim": { "branch": "0.1.x", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" }, - "todo-comments.nvim": { "branch": "main", "commit": "31e3c38ce9b29781e4422fc0322eb0a21f4e8668" }, - "tokyonight.nvim": { "branch": "main", "commit": "cdc07ac78467a233fd62c493de29a17e0cf2b2b6" }, - "vim-fugitive": { "branch": "master", "commit": "3b753cf8c6a4dcde6edee8827d464ba9b8c4a6f0" }, - "vim-illuminate": { "branch": "master", "commit": "0d1e93684da00ab7c057410fecfc24f434698898" }, - "vim-ocaml": { "branch": "master", "commit": "ee14abbe433dcf5b85863e19900dea60e090b87d" }, - "vim-sleuth": { "branch": "master", "commit": "be69bff86754b1aa5adcbb527d7fcd1635a84080" }, - "vim-slime": { "branch": "main", "commit": "2cfdc3b24e7ebaa64f5a1a04b00555600c622b79" }, - "vim-tmux-navigator": { "branch": "master", "commit": "e41c431a0c7b7388ae7ba341f01a0d217eb3a432" }, - "which-key.nvim": { "branch": "main", "commit": "3aab2147e74890957785941f0c1ad87d0a44c15a" } -} diff --git a/lsp/basedpyright.lua b/lsp/basedpyright.lua deleted file mode 100644 index 49b145c..0000000 --- a/lsp/basedpyright.lua +++ /dev/null @@ -1,23 +0,0 @@ -return { - cmd = { 'basedpyright-langserver', '--stdio' }, - filetypes = { 'python' }, - root_markers = { - 'pyproject.toml', - 'pyrightconfig.json', - '.git', - }, - settings = { - basedpyright = { - analysis = { - typeCheckingMode = 'standard', - autoSearchPaths = true, - diagnosticMode = 'openFilesOnly', - diagnosticSeverityOverrides = { - reportUnusedImport = 'none', - reportDuplicateImport = 'none', - reportUnusedVariable = 'none', - }, - }, - }, - }, -} diff --git a/lsp/clangd.lua b/lsp/clangd.lua deleted file mode 100644 index 4c0f244..0000000 --- a/lsp/clangd.lua +++ /dev/null @@ -1,95 +0,0 @@ -local function switch_source_header(bufnr, client) - local method_name = 'textDocument/switchSourceHeader' - ---@diagnostic disable-next-line:param-type-mismatch - if not client or not client:supports_method(method_name) then - return vim.notify(('method %s is not supported by any servers active on the current buffer'):format(method_name)) - end - local params = vim.lsp.util.make_text_document_params(bufnr) - ---@diagnostic disable-next-line:param-type-mismatch - client:request(method_name, params, function(err, result) - if err then - error(tostring(err)) - end - if not result then - vim.notify 'corresponding file cannot be determined' - return - end - vim.cmd.edit(vim.uri_to_fname(result)) - end, bufnr) -end - -local function symbol_info(bufnr, client) - local method_name = 'textDocument/symbolInfo' - ---@diagnostic disable-next-line:param-type-mismatch - if not client or not client:supports_method(method_name) then - return vim.notify('Clangd client not found', vim.log.levels.ERROR) - end - local win = vim.api.nvim_get_current_win() - local params = vim.lsp.util.make_position_params(win, client.offset_encoding) - ---@diagnostic disable-next-line:param-type-mismatch - client:request(method_name, params, function(err, res) - if err or #res == 0 then - -- Clangd always returns an error, there is no reason to parse it - return - end - local container = string.format('container: %s', res[1].containerName) ---@type string - local name = string.format('name: %s', res[1].name) ---@type string - vim.lsp.util.open_floating_preview({ name, container }, '', { - height = 2, - width = math.max(string.len(name), string.len(container)), - focusable = false, - focus = false, - title = 'Symbol Info', - }) - end, bufnr) -end - ----@class ClangdInitializeResult: lsp.InitializeResult ----@field offsetEncoding? string - -return { - cmd = { 'clangd' }, - filetypes = { 'c', 'cpp', 'objc', 'objcpp', 'cuda' }, - root_markers = { - '.clangd', - '.clang-tidy', - '.clang-format', - 'compile_commands.json', - 'compile_flags.txt', - 'configure.ac', -- AutoTools - '.git', - }, - get_language_id = function(_, ftype) - local t = { objc = 'objective-c', objcpp = 'objective-cpp', cuda = 'cuda-cpp' } - return t[ftype] or ftype - end, - capabilities = { - textDocument = { - completion = { - editsNearCursor = true, - }, - }, - offsetEncoding = { 'utf-8', 'utf-16' }, - }, - ---@param init_result ClangdInitializeResult - on_init = function(client, init_result) - if init_result.offsetEncoding then - client.offset_encoding = init_result.offsetEncoding - end - end, - on_new_config = function(new_config, new_cwd) - local status, cmake = pcall(require, 'cmake-tools') - if status then - cmake.clangd_on_new_config(new_config) - end - end, - on_attach = function(client, bufnr) - vim.api.nvim_buf_create_user_command(bufnr, 'LspClangdSwitchSourceHeader', function() - switch_source_header(bufnr, client) - end, { desc = 'Switch between source/header' }) - - vim.api.nvim_buf_create_user_command(bufnr, 'LspClangdShowSymbolInfo', function() - symbol_info(bufnr, client) - end, { desc = 'Show symbol info' }) - end, -} diff --git a/lsp/cmake.lua b/lsp/cmake.lua deleted file mode 100644 index 3255edd..0000000 --- a/lsp/cmake.lua +++ /dev/null @@ -1,8 +0,0 @@ -return { - cmd = { 'cmake-language-server' }, - filetypes = { 'cmake' }, - root_markers = { 'CMakePresets.json', 'CTestConfig.cmake', '.git', 'build', 'cmake' }, - init_options = { - buildDirectory = 'build', - }, -} diff --git a/lsp/lua_ls.lua b/lsp/lua_ls.lua deleted file mode 100644 index 6ebb4c0..0000000 --- a/lsp/lua_ls.lua +++ /dev/null @@ -1,15 +0,0 @@ -return { - cmd = { 'lua-language-server' }, - filetypes = { 'lua' }, - root_markers = { { '.luarc.json', '.luarc.jsonc' }, '.git' }, - settings = { - Lua = { - runtime = { version = 'LuaJIT' }, - diagnostics = { globals = { 'vim' } }, - workspace = { - checkThirdParty = false, - }, - telemetry = { enable = false }, - }, - }, -} diff --git a/lsp/ruff.lua b/lsp/ruff.lua deleted file mode 100644 index d2a1bba..0000000 --- a/lsp/ruff.lua +++ /dev/null @@ -1,18 +0,0 @@ -return { - cmd = { 'ruff', 'server' }, - filetypes = { 'python' }, - root_markers = { 'pyproject.toml', 'ruff.toml', '.ruff.toml', '.git' }, - settings = { - configurationPreference = 'filesystemFirst', - lineLength = 100, - editor = { - -- Let conform handle all format on saves - formatOnSave = false, - }, - lint = { - enable = true, - select = { 'E', 'F', 'I', 'B', 'UP' }, - extendSelect = { 'W' }, - }, - }, -} diff --git a/lua/core/autocmds.lua b/lua/core/autocmds.lua index 214da1a..e908717 100644 --- a/lua/core/autocmds.lua +++ b/lua/core/autocmds.lua @@ -1,36 +1,8 @@ --- [[ Basic Autocommands ]] --- See `:help lua-guide-autocommands` - --- Highlight when yanking (copying) text --- Try it with `yap` in normal mode --- See `:help vim.hl.on_yank()` -vim.api.nvim_create_autocmd('TextYankPost', { - desc = 'Highlight when yanking (copying) text', - group = vim.api.nvim_create_augroup('highlight-yank', { clear = true }), +vim.api.nvim_create_autocmd("TextYankPost", { + desc = "Highlight when yanking (copying) text", + group = vim.api.nvim_create_augroup("highlight-yank", { clear = true }), callback = function() vim.hl.on_yank() end, }) -local lsp_augroup = vim.api.nvim_create_augroup('UserLspConfig', { clear = true }) - -vim.api.nvim_create_autocmd('LspAttach', { - group = lsp_augroup, - callback = function(args) - local client = vim.lsp.get_client_by_id(args.data.client_id) - if not client then - return - end - - -- 1. CodeLens - if client:supports_method(vim.lsp.protocol.Methods.textDocument_codeLens) then - vim.lsp.codelens.enable(true, { bufnr = args.buf }) - end - - -- 2. Capability Overrides - if client.name == 'ruff' then - client.server_capabilities.hoverProvider = false - client.server_capabilities.definitionProvider = false - end - end, -}) diff --git a/lua/core/bootstrap.lua b/lua/core/bootstrap.lua deleted file mode 100644 index e21b1f4..0000000 --- a/lua/core/bootstrap.lua +++ /dev/null @@ -1,13 +0,0 @@ --- Lazy.nvim installation -local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim' -if not (vim.uv or vim.loop).fs_stat(lazypath) then - vim.fn.system { - 'git', - 'clone', - '--filter=blob:none', - 'https://github.com/folke/lazy.nvim.git', - '--branch=stable', - lazypath, - } -end -vim.opt.rtp:prepend(lazypath) \ No newline at end of file diff --git a/lua/core/global.lua b/lua/core/global.lua index cba3ede..a7308cc 100644 --- a/lua/core/global.lua +++ b/lua/core/global.lua @@ -1,5 +1,5 @@ -- Set as the leader key -- See `:help mapleader` -- NOTE: Must happen before plugins are loaded (otherwise wrong leader will be used) -vim.g.mapleader = ' ' -vim.g.maplocalleader = ' ' +vim.g.mapleader = " " +vim.g.maplocalleader = " " diff --git a/lua/core/init.lua b/lua/core/init.lua new file mode 100644 index 0000000..b197d55 --- /dev/null +++ b/lua/core/init.lua @@ -0,0 +1,5 @@ +require("core.global") +require("core.options") +require("core.keymaps") +require("core.autocmds") +require("core.lsp") diff --git a/lua/core/keymaps.lua b/lua/core/keymaps.lua index eb3d5a7..9568491 100644 --- a/lua/core/keymaps.lua +++ b/lua/core/keymaps.lua @@ -2,70 +2,64 @@ -- See `:help vim.keymap.set()` -- Clear search highlights with Escape in normal mode -vim.keymap.set('n', '', 'nohlsearch') +-- vim.keymap.set("n", "", [[nohlsearch]]) -- Exit terminal mode with double Escape -vim.keymap.set('t', '', '', { desc = 'Exit terminal mode' }) - --- NOTE: Window navigation is handled by nvim-tmux-navigator plugin --- which provides seamless navigation between vim splits and tmux panes +vim.keymap.set("t", "", [[]], { desc = "Exit terminal mode" }) +vim.keymap.set("n", "cx", [[:.lua]], { desc = "Execute current line" }) -- Buffer management keymaps -vim.keymap.set('n', 'bb', 'Telescope buffers', { desc = '[B]rowse [B]uffers' }) -vim.keymap.set('n', '[b', 'bprevious', { desc = 'Previous buffer' }) -vim.keymap.set('n', ']b', 'bnext', { desc = 'Next buffer' }) -vim.keymap.set('n', 'bd', 'bdelete', { desc = '[B]uffer [D]elete' }) -vim.keymap.set('n', 'ba', '%bd|e#', { desc = '[B]uffers close [A]ll but current' }) -vim.keymap.set('n', 'bn', 'enew', { desc = '[B]uffer [N]ew' }) +-- vim.keymap.set("n", "bb", "Telescope buffers", { desc = "[B]rowse [B]uffers" }) +-- vim.keymap.set("n", "[b", "bprevious", { desc = "Previous buffer" }) +-- vim.keymap.set("n", "]b", "bnext", { desc = "Next buffer" }) +-- vim.keymap.set("n", "bd", "bdelete", { desc = "[B]uffer [D]elete" }) +-- vim.keymap.set("n", "ba", "%bd|e#", { desc = "[B]uffers close [A]ll but current" }) +-- vim.keymap.set("n", "bn", "enew", { desc = "[B]uffer [N]ew" }) -- Quick buffer switching with numbers -for i = 1, 9 do - vim.keymap.set('n', '' .. i, 'buffer ' .. i .. '', { desc = 'Switch to buffer ' .. i }) -end +-- for i = 1, 9 do +-- vim.keymap.set("n", "" .. i, "buffer " .. i .. "", { desc = "Switch to buffer " .. i }) +-- end -- Window management keymaps -vim.keymap.set('n', 'ws', 'split', { desc = '[W]indow [S]plit horizontal' }) -vim.keymap.set('n', 'wv', 'vsplit', { desc = '[W]indow [V]ertical split' }) -vim.keymap.set('n', 'wc', 'close', { desc = '[W]indow [C]lose' }) -vim.keymap.set('n', 'wo', 'only', { desc = '[W]indow [O]nly (close others)' }) -vim.keymap.set('n', 'ww', 'w', { desc = '[W]indow cycle' }) -vim.keymap.set('n', 'w=', '=', { desc = '[W]indow balance sizes' }) +vim.keymap.set("n", "ws", "split", { desc = "[W]indow [S]plit horizontal" }) +vim.keymap.set("n", "wv", "vsplit", { desc = "[W]indow [V]ertical split" }) +vim.keymap.set("n", "wc", "close", { desc = "[W]indow [C]lose" }) +vim.keymap.set("n", "wo", "only", { desc = "[W]indow [O]nly (close others)" }) +vim.keymap.set("n", "ww", "w", { desc = "[W]indow cycle" }) +vim.keymap.set("n", "w=", "=", { desc = "[W]indow balance sizes" }) -- Window resizing with arrow keys -vim.keymap.set('n', '', 'resize +2', { desc = 'Increase window height' }) -vim.keymap.set('n', '', 'resize -2', { desc = 'Decrease window height' }) -vim.keymap.set('n', '', 'vertical resize -2', { desc = 'Decrease window width' }) -vim.keymap.set('n', '', 'vertical resize +2', { desc = 'Increase window width' }) +vim.keymap.set("n", "", "resize +2", { desc = "Increase window height" }) +vim.keymap.set("n", "", "resize -2", { desc = "Decrease window height" }) +vim.keymap.set("n", "", "vertical resize -2", { desc = "Decrease window width" }) +vim.keymap.set("n", "", "vertical resize +2", { desc = "Increase window width" }) -- Editing/Navigation -vim.keymap.set('n', 'S', ':%s//', { desc = '[S]ubstitute current word' }) -vim.keymap.set('v', 'J', ":m '>+1gv=gv") -vim.keymap.set('v', 'K', ":m '<-2gv=gv") +-- vim.keymap.set("n", "S", ":%s//", { desc = "[S]ubstitute current word" }) -- Floating terminal -local float_term = require('core.float_term') - -vim.keymap.set('n', 'tf', function() float_term.open() end, { desc = '[T]erminal [F]loat' }) -vim.keymap.set('n', 'tx', function() float_term.reset() end, { desc = '[T]erminal kill/reset' }) -vim.keymap.set('n', 'tr', function() - vim.ui.input({ prompt = 'Run: ' }, function(input) - if input and input ~= '' then - float_term.open(input) - end - end) -end, { desc = '[T]erminal [R]un command' }) +-- local float_term = require('core.float_term') +-- +-- vim.keymap.set('n', 'tf', function() float_term.open() end, { desc = '[T]erminal [F]loat' }) +-- vim.keymap.set('n', 'tx', function() float_term.reset() end, { desc = '[T]erminal kill/reset' }) +-- vim.keymap.set('n', 'tr', function() +-- vim.ui.input({ prompt = 'Run: ' }, function(input) +-- if input and input ~= '' then +-- float_term.open(input) +-- end +-- end) +-- end, { desc = '[T]erminal [R]un command' }) -- Code runner (auto-detects backend: cpp, python, etc.) -local code = require('core.code') -require('core.cpp_build') -- registers the cpp backend -require('core.python_run') -- registers the python backend - -vim.keymap.set('n', 'cc', function() code.go() end, { desc = '[C]ode [C]onfigure & run' }) -vim.keymap.set('n', 'cb', function() code.build() end, { desc = '[C]ode [B]uild' }) -vim.keymap.set('n', 'cr', function() code.run() end, { desc = '[C]ode [R]un' }) -vim.keymap.set('n', 'ct', function() code.test() end, { desc = '[C]ode [T]est' }) -vim.keymap.set('n', 'cs', function() code.status() end, { desc = '[C]ode [S]tatus' }) -vim.keymap.set('n', 'cx', function() code.reset() end, { desc = '[C]ode reset' }) - --- Standard practice for Lua modules that don't need to return complex data -return {} +-- local code = require('core.code') +-- require('core.cpp_build') -- registers the cpp backend +-- require('core.python_run') -- registers the python backend +-- +-- vim.keymap.set('n', 'cc', function() code.go() end, { desc = '[C]ode [C]onfigure & run' }) +-- vim.keymap.set('n', 'cb', function() code.build() end, { desc = '[C]ode [B]uild' }) +-- vim.keymap.set('n', 'cr', function() code.run() end, { desc = '[C]ode [R]un' }) +-- vim.keymap.set('n', 'ct', function() code.test() end, { desc = '[C]ode [T]est' }) +-- vim.keymap.set('n', 'cs', function() code.status() end, { desc = '[C]ode [S]tatus' }) +-- vim.keymap.set('n', 'cx', function() code.reset() end, { desc = '[C]ode reset' }) +-- diff --git a/lua/core/lsp.lua b/lua/core/lsp.lua index 87f63b9..ff583a9 100644 --- a/lua/core/lsp.lua +++ b/lua/core/lsp.lua @@ -1,12 +1,111 @@ -vim.lsp.enable 'basedpyright' -vim.lsp.enable 'lua_ls' -vim.lsp.enable 'ruff' -vim.lsp.enable 'clangd' -vim.lsp.enable 'cmake' - --- TODO enable diagnostics -vim.diagnostic.config { +vim.pack.add({ + { src = "https://github.com/neovim/nvim-lspconfig" }, +}) + +vim.lsp.config("lua_ls", { + settings = { + Lua = { + runtime = { version = "LuaJIT" }, + diagnostics = { globals = { "vim" } }, + workspace = { + checkThirdParty = false, + library = { + vim.env.VIMRUNTIME, + }, + }, + }, + }, +}) + +local py_base = { + capabilities = { + offsetEncoding = { "utf-16" }, + general = { + positionEncodings = { "utf-16" }, + }, + }, +} + +vim.lsp.config( + "basedpyright", + vim.tbl_deep_extend("force", py_base, { + settings = { + basedpyright = { + disableOrganizeImports = true, + analysis = { + typeCheckingMode = "standard", + diagnosticSeverityOverrides = { + reportUnusedImport = "none", + reportUnusedVariable = "none", + reportUndefinedVariable = "none", + }, + }, + }, + }, + on_init = function(client) + client.server_capabilities.documentFormattingProvider = false + client.server_capabilities.documentRangeFormattingProvider = false + end, + }) +) + +vim.lsp.config( + "ruff", + vim.tbl_deep_extend("force", py_base, { + on_init = function(client) + client.server_capabilities.hoverProvider = false + client.server_capabilities.renameProvider = false + client.server_capabilities.referencesProvider = false + client.server_capabilities.documentSymbolProvider = false + client.server_capabilities.definitionProvider = false + end, + }) +) + +vim.lsp.enable("lua_ls") +vim.lsp.enable("basedpyright") +vim.lsp.enable("ruff") +vim.lsp.enable("clangd") +vim.lsp.enable("cmake") +vim.lsp.enable("nixd") + +vim.diagnostic.config({ + virtual_text = false, virtual_lines = { current_line = true, }, -} + severity_sort = true, +}) + +vim.api.nvim_create_autocmd("LspAttach", { + group = vim.api.nvim_create_augroup("UserLspConfig", { clear = true }), + callback = function(ev) + local client = vim.lsp.get_client_by_id(ev.data.client_id) + local opts = { buffer = ev.buf } + + if client and client:supports_method(vim.lsp.protocol.Methods.textDocument_completion) then + vim.lsp.completion.enable(true, client.id, ev.buf, { autotrigger = true }) + vim.keymap.set("i", "", function() + vim.lsp.completion.get() + end, opts) + end + + if client and client:supports_method(vim.lsp.protocol.Methods.textDocument_codeLens) then + vim.lsp.codelens.enable(true, { bufnr = ev.buf }) + vim.keymap.set("n", "cl", vim.lsp.codelens.run, opts) + end + + vim.keymap.set("n", "ld", function() MiniExtra.pickers.lsp({ scope = 'definition' }) end, opts) + vim.keymap.set("n", "lr", function() MiniExtra.pickers.lsp({ scope = 'references' }) end, opts) + vim.keymap.set("n", "li", function() MiniExtra.pickers.lsp({ scope = 'implementation' }) end, opts) + vim.keymap.set("n", "lt", function() MiniExtra.pickers.lsp({ scope = 'type_definition' }) end, opts) + vim.keymap.set("n", "ls", function() MiniExtra.pickers.lsp({ scope = 'document_symbol' }) end, opts) + -- Diagnostic picker (Extra's version is often more feature-rich) + vim.keymap.set("n", "dd", function() MiniExtra.pickers.diagnostic({ scope = 'all' }) end, opts) + + vim.keymap.set("n", "rn", vim.lsp.buf.rename, opts) + vim.keymap.set({ "n", "v" }, "ca", vim.lsp.buf.code_action, opts) + vim.keymap.set("n", "K", vim.lsp.buf.hover, opts) + end, +}) + diff --git a/lua/core/options.lua b/lua/core/options.lua index c85b8f5..754003b 100644 --- a/lua/core/options.lua +++ b/lua/core/options.lua @@ -1,27 +1,30 @@ -- Load Nix-controlled settings if available -pcall(require, 'nix-settings') +pcall(require, "nix-settings") + +vim.g.python3_host_prog = "/Users/dlond/.local/share/python/base/.venv/bin/python" +vim.g.loaded_perl_provider = 0 +vim.g.loaded_ruby_provider = 0 -- Set based on your font installation vim.g.have_nerd_font = true --- [[ Essential Options from Kickstart ]] --- These MUST be set since we're not loading kickstart's defaults - -- Line numbers vim.opt.number = true vim.opt.relativenumber = true -- Mouse and interaction -vim.opt.mouse = 'a' -- Enable mouse mode +vim.opt.mouse = "a" -- Enable mouse mode vim.opt.showmode = false -- Don't show mode since we have a statusline -- Clipboard - sync with system clipboard -vim.opt.clipboard = 'unnamedplus' +vim.opt.clipboard = "unnamedplus" -- Indentation settings -vim.opt.breakindent = true -- Enable break indent -vim.opt.smartindent = true -vim.opt.autoindent = true +-- vim.opt.breakindent = true -- Enable break indent +-- vim.opt.smartindent = true +-- vim.opt.autoindent = true + +-- Tabstops vim.opt.expandtab = true vim.opt.tabstop = 2 vim.opt.shiftwidth = 2 @@ -33,10 +36,9 @@ vim.opt.undofile = true -- Search settings vim.opt.ignorecase = true -- Case insensitive searching vim.opt.smartcase = true -- Unless capital in search -vim.opt.hlsearch = true -- Highlight search results -- Keep signcolumn on by default -vim.opt.signcolumn = 'yes' +vim.opt.signcolumn = "yes" -- Decrease update time vim.opt.updatetime = 250 @@ -48,10 +50,10 @@ vim.opt.splitbelow = true -- Sets how neovim will display certain whitespace characters vim.opt.list = true -vim.opt.listchars = { tab = 'ยป ', trail = 'ยท', nbsp = 'โฃ' } +vim.opt.listchars = { tab = "ยป ", trail = "ยท", nbsp = "โฃ" } -- Preview substitutions live -vim.opt.inccommand = 'split' +vim.opt.inccommand = "split" -- Show which line your cursor is on vim.opt.cursorline = true @@ -60,4 +62,7 @@ vim.opt.cursorline = true vim.opt.scrolloff = 10 -- Set the default boarder for all floating windows -vim.opt.winborder = 'rounded' +vim.opt.winborder = "rounded" + +vim.opt.complete = "o,.,w,b,u" +vim.opt.completeopt = "menu,menuone,noinsert,fuzzy,popup" diff --git a/lua/plugins/config/blink-cmp.lua b/lua/plugins/config/blink-cmp.lua deleted file mode 100644 index 8822da3..0000000 --- a/lua/plugins/config/blink-cmp.lua +++ /dev/null @@ -1,28 +0,0 @@ -local M = {} - -function M.setup() - require('blink.cmp').setup { - -- All presets have the following mappings: - -- C-space: Open menu or open docs if already open - -- C-n/C-p or Up/Down: Select next/previous item - -- C-e: Hide menu - -- C-k: Toggle signature help (if signature.enabled = true) - -- - -- See :h blink-cmp-config-keymap for defining your own keymap - keymap = { preset = 'default' }, - - appearance = { - nerd_font_variant = 'mono', - }, - - completion = { documentation = { auto_show = false } }, - - sources = { - default = { 'lsp', 'path', 'snippets', 'buffer' }, - }, - - fuzzy = { implementation = 'prefer_rust_with_warning' }, - } -end - -return M diff --git a/lua/plugins/config/cmake-tools.lua b/lua/plugins/config/cmake-tools.lua deleted file mode 100644 index 19a2d5d..0000000 --- a/lua/plugins/config/cmake-tools.lua +++ /dev/null @@ -1,152 +0,0 @@ -local M = {} - -function M.setup() - local osys = require 'cmake-tools.osys' - require('cmake-tools'):setup { - cmake_command = 'cmake', -- this is used to specify cmake command path - ctest_command = 'ctest', -- this is used to specify ctest command path - ctest_show_labels = false, -- also show labels in the test picker - cmake_use_preset = true, - cmake_regenerate_on_save = true, -- auto generate when save CMakeLists.txt - cmake_generate_options = { '-DCMAKE_EXPORT_COMPILE_COMMANDS=1' }, -- this will be passed when invoke `CMakeGenerate` - cmake_build_options = {}, -- this will be passed when invoke `CMakeBuild` - -- support macro expansion: - -- ${kit} - -- ${kitGenerator} - -- ${variant:xx} - cmake_build_directory = function() - if osys.iswin32 then - return 'out\\${variant:buildType}' - end - return 'out/${variant:buildType}' - end, -- this is used to specify generate directory for cmake, allows macro expansion, can be a string or a function returning the string, relative to cwd. - cmake_compile_commands_options = { - action = 'none', -- available options: soft_link, copy, lsp, none - -- soft_link: this will automatically make a soft link from compile commands file to target - -- copy: this will automatically copy compile commands file to target - -- lsp: this will automatically set compile commands file location using lsp - -- none: this will make this option ignored - target = vim.loop.cwd, -- path or function returning path to directory, this is used only if action == "soft_link" or action == "copy" - }, - cmake_kits_path = nil, -- this is used to specify global cmake kits path, see CMakeKits for detailed usage - cmake_variants_message = { - short = { show = true }, -- whether to show short message - long = { show = true, max_length = 40 }, -- whether to show long message - }, - cmake_dap_configuration = { -- debug settings for cmake - name = 'cpp', - type = 'codelldb', - request = 'launch', - stopOnEntry = false, - runInTerminal = true, - console = 'integratedTerminal', - }, - cmake_executor = { -- executor to use - name = 'quickfix', -- name of the executor - opts = {}, -- the options the executor will get, possible values depend on the executor type. See `default_opts` for possible values. - default_opts = { -- a list of default and possible values for executors - quickfix = { - show = 'always', -- "always", "only_on_error" - position = 'belowright', -- "vertical", "horizontal", "leftabove", "aboveleft", "rightbelow", "belowright", "topleft", "botright", use `:h vertical` for example to see help on them - size = 10, - encoding = 'utf-8', -- if encoding is not "utf-8", it will be converted to "utf-8" using `vim.fn.iconv` - auto_close_when_success = true, -- typically, you can use it with the "always" option; it will auto-close the quickfix buffer if the execution is successful. - }, - toggleterm = { - direction = 'float', -- 'vertical' | 'horizontal' | 'tab' | 'float' - close_on_exit = false, -- whether close the terminal when exit - auto_scroll = true, -- whether auto scroll to the bottom - singleton = true, -- single instance, autocloses the opened one, if present - }, - overseer = { - new_task_opts = { - strategy = { - 'toggleterm', - direction = 'horizontal', - auto_scroll = true, - quit_on_exit = 'success', - }, - }, -- options to pass into the `overseer.new_task` command - on_new_task = function(task) - require('overseer').open { enter = false, direction = 'right' } - end, -- a function that gets overseer.Task when it is created, before calling `task:start` - }, - terminal = { - name = 'Main Terminal', - prefix_name = '[CMakeTools]: ', -- This must be included and must be unique, otherwise the terminals will not work. Do not use a simple spacebar " ", or any generic name - split_direction = 'horizontal', -- "horizontal", "vertical" - split_size = 11, - - -- Window handling - single_terminal_per_instance = true, -- Single viewport, multiple windows - single_terminal_per_tab = true, -- Single viewport per tab - keep_terminal_static_location = true, -- Static location of the viewport if avialable - auto_resize = true, -- Resize the terminal if it already exists - - -- Running Tasks - start_insert = false, -- If you want to enter terminal with :startinsert upon using :CMakeRun - focus = false, -- Focus on terminal when cmake task is launched. - do_not_add_newline = false, -- Do not hit enter on the command inserted when using :CMakeRun, allowing a chance to review or modify the command before hitting enter. - }, -- terminal executor uses the values in cmake_terminal - }, - }, - cmake_runner = { -- runner to use - name = 'terminal', -- name of the runner - opts = {}, -- the options the runner will get, possible values depend on the runner type. See `default_opts` for possible values. - default_opts = { -- a list of default and possible values for runners - quickfix = { - show = 'always', -- "always", "only_on_error" - position = 'belowright', -- "bottom", "top" - size = 10, - encoding = 'utf-8', - auto_close_when_success = true, -- typically, you can use it with the "always" option; it will auto-close the quickfix buffer if the execution is successful. - }, - toggleterm = { - direction = 'float', -- 'vertical' | 'horizontal' | 'tab' | 'float' - close_on_exit = false, -- whether close the terminal when exit - auto_scroll = true, -- whether auto scroll to the bottom - singleton = true, -- single instance, autocloses the opened one, if present - }, - overseer = { - new_task_opts = { - strategy = { - 'toggleterm', - direction = 'horizontal', - autos_croll = true, - quit_on_exit = 'success', - }, - }, -- options to pass into the `overseer.new_task` command - on_new_task = function(task) end, -- a function that gets overseer.Task when it is created, before calling `task:start` - }, - terminal = { - name = 'Main Terminal', - prefix_name = '[CMakeTools]: ', -- This must be included and must be unique, otherwise the terminals will not work. Do not use a simple spacebar " ", or any generic name - split_direction = 'horizontal', -- "horizontal", "vertical" - split_size = 11, - - -- Window handling - single_terminal_per_instance = true, -- Single viewport, multiple windows - single_terminal_per_tab = true, -- Single viewport per tab - keep_terminal_static_location = true, -- Static location of the viewport if avialable - auto_resize = true, -- Resize the terminal if it already exists - - -- Running Tasks - start_insert = false, -- If you want to enter terminal with :startinsert upon using :CMakeRun - focus = false, -- Focus on terminal when cmake task is launched. - do_not_add_newline = false, -- Do not hit enter on the command inserted when using :CMakeRun, allowing a chance to review or modify the command before hitting enter. - use_shell_alias = false, -- Hide the verbose command wrapper by using a shell alias, showing only the program's output (currently not supported on Windows) - }, - }, - }, - cmake_notifications = { - runner = { enabled = true }, - executor = { enabled = true }, - spinner = { 'โ ‹', 'โ ™', 'โ น', 'โ ธ', 'โ ผ', 'โ ด', 'โ ฆ', 'โ ง', 'โ ‡', 'โ ' }, -- icons used for progress display - refresh_rate_ms = 100, -- how often to iterate icons - }, - cmake_virtual_text_support = true, -- Show the target related to current file using virtual text (at right corner) - cmake_use_scratch_buffer = false, -- A buffer that shows what cmake-tools has done - } -end - -return M diff --git a/lua/plugins/config/conan.lua b/lua/plugins/config/conan.lua deleted file mode 100644 index bac25fe..0000000 --- a/lua/plugins/config/conan.lua +++ /dev/null @@ -1,7 +0,0 @@ -local M = {} - -function M.setup() - require('lua.plugins.spec.nvim-conan').setup() -end - -return M diff --git a/lua/plugins/config/crates-nvim.lua b/lua/plugins/config/crates-nvim.lua deleted file mode 100644 index 9d56ec5..0000000 --- a/lua/plugins/config/crates-nvim.lua +++ /dev/null @@ -1,7 +0,0 @@ -local M = {} - -function M.setup() - require('crates').setup() -end - -return M diff --git a/lua/plugins/config/debug/adapters.lua b/lua/plugins/config/debug/adapters.lua deleted file mode 100644 index 8ea6a74..0000000 --- a/lua/plugins/config/debug/adapters.lua +++ /dev/null @@ -1,156 +0,0 @@ --- Debug Adapters Configuration -local M = {} - --- Helper function to find Python executable --- In Nix environments, use whatever Python is in PATH -local function get_python_path() - -- Use the Python from current environment (Nix or system) - if vim.fn.executable 'python3' == 1 then - return vim.fn.exepath 'python3' - elseif vim.fn.executable 'python' == 1 then - return vim.fn.exepath 'python' - else - -- Fallback to system Python - return '/usr/bin/python3' - end -end - -function M.setup() - local dap = require 'dap' - - -- Setup all language-specific adapters - M.setup_python(dap) - M.setup_cpp(dap) - - -- Add more adapters as needed - -- M.setup_rust(dap) - -- M.setup_go(dap) - -- M.setup_javascript(dap) -end - --- Python debugger configuration -function M.setup_python(dap) - dap.adapters.python = { - type = 'executable', - command = vim.fn.exepath 'python3' ~= '' and vim.fn.exepath 'python3' or 'python', - args = { '-m', 'debugpy.adapter' }, - } - - dap.configurations.python = { - { - type = 'python', - request = 'launch', - name = 'Launch file', - program = '${file}', - pythonPath = get_python_path, - }, - { - type = 'python', - request = 'launch', - name = 'Launch file with arguments', - program = '${file}', - args = function() - local args_string = vim.fn.input 'Arguments: ' - return vim.split(args_string, ' ') - end, - pythonPath = get_python_path, - }, - { - type = 'python', - request = 'attach', - name = 'Attach to running process', - processId = require('dap.utils').pick_process, - pythonPath = get_python_path, - }, - } -end - -local function suggest_build_dir() - local cwd = vim.fn.getcwd() - local build_dir = vim.fn.resolve(cwd .. '/compile_commands.json'):match '(.+)/compile_commands.json' - local suggestion = build_dir and build_dir or cwd - return suggestion .. '/' -end - --- C/C++/Rust debugger configuration (using lldb-dap) -function M.setup_cpp(dap) - dap.adapters.lldb = { - type = 'executable', - command = vim.fn.exepath 'lldb-dap', - name = 'lldb', - } - - -- C++ configuration - dap.configurations.cpp = { - { - name = 'Launch', - type = 'lldb', - request = 'launch', - program = function() - return vim.fn.input('Path to executable: ', suggest_build_dir(), 'file') - end, - cwd = '${workspaceFolder}', - stopOnEntry = false, - args = {}, - runInTerminal = false, - -- sourceInitFile = true, - }, - { - name = 'Launch with arguments', - type = 'lldb', - request = 'launch', - program = function() - return vim.fn.input('Path to executable: ', suggest_build_dir(), 'file') - end, - cwd = '${workspaceFolder}', - stopOnEntry = false, - args = function() - local args_string = vim.fn.input 'Arguments: ' - return vim.split(args_string, ' ') - end, - runInTerminal = false, - -- sourceInitFile = true, - }, - { - name = 'Attach to process', - type = 'lldb', - request = 'attach', - pid = require('dap.utils').pick_process, - args = {}, - }, - } - - -- Share C++ configuration with C and Rust - dap.configurations.c = dap.configurations.cpp - dap.configurations.rust = dap.configurations.cpp -end - --- Example: Go debugger configuration (commented out) --- function M.setup_go(dap) --- dap.adapters.delve = { --- type = 'server', --- port = '${port}', --- executable = { --- command = 'dlv', --- args = { 'dap', '-l', '127.0.0.1:${port}' }, --- }, --- } --- --- dap.configurations.go = { --- { --- type = 'delve', --- name = 'Debug', --- request = 'launch', --- program = '${file}', --- }, --- { --- type = 'delve', --- name = 'Debug test', --- request = 'launch', --- mode = 'test', --- program = '${file}', --- }, --- } --- end - -return M diff --git a/lua/plugins/config/debug/init.lua b/lua/plugins/config/debug/init.lua deleted file mode 100644 index c9a1fdf..0000000 --- a/lua/plugins/config/debug/init.lua +++ /dev/null @@ -1,39 +0,0 @@ --- Debug Configuration (DAP) -local M = {} - -function M.setup() - local dap = require 'dap' - local dapui = require 'dapui' - - -- Setup DAP UI with icons and controls - dapui.setup { - icons = { expanded = 'โ–พ', collapsed = 'โ–ธ', current_frame = '*' }, - controls = { - icons = { - pause = 'โธ', - play = 'โ–ถ', - step_into = 'โŽ', - step_over = 'โญ', - step_out = 'โฎ', - step_back = 'b', - run_last = 'โ–ถโ–ถ', - terminate = 'โน', - disconnect = 'โ', - }, - }, - } - - -- Automatically open/close DAP UI on debug events - dap.listeners.after.event_initialized['dapui_config'] = dapui.open - dap.listeners.before.event_terminated['dapui_config'] = dapui.close - dap.listeners.before.event_exited['dapui_config'] = dapui.close - - -- Configure debug adapters for different languages - require('plugins.config.debug.adapters').setup() - - -- Setup debug keymaps - require('plugins.config.debug.keymaps').setup() -end - -return M - diff --git a/lua/plugins/config/debug/keymaps.lua b/lua/plugins/config/debug/keymaps.lua deleted file mode 100644 index b45439a..0000000 --- a/lua/plugins/config/debug/keymaps.lua +++ /dev/null @@ -1,60 +0,0 @@ --- Debug Keymaps Configuration -local M = {} - -function M.setup() - local dap = require 'dap' - local dapui = require 'dapui' - - -- Start debugging - vim.keymap.set('n', '', dap.run_last, { desc = 'Debug: Run Last' }) - - vim.keymap.set('n', '', dap.continue, { desc = 'Debug: Start/Continue' }) - - -- Toggle UI - vim.keymap.set('n', '', dapui.toggle, { desc = 'Debug: Toggle UI' }) - - -- Debugging controls - vim.keymap.set('n', '', dap.step_over, { desc = 'Debug: Step Over' }) - vim.keymap.set('n', '', dap.step_into, { desc = 'Debug: Step Into' }) - vim.keymap.set('n', '', dap.step_out, { desc = 'Debug: Step Out' }) - vim.keymap.set('n', 'dt', dap.terminate, { desc = 'Debug: Terminate Session' }) - - vim.keymap.set('n', 'de', dapui.eval, { desc = 'Debug: Eval under cursor' }) - vim.keymap.set('v', 'de', dapui.eval, { desc = 'Debug: Eval selection' }) - - -- Breakpoint management - vim.keymap.set('n', 'db', dap.toggle_breakpoint, { desc = 'Debug: Toggle Breakpoint' }) - vim.keymap.set('n', 'dB', function() - dap.set_breakpoint(vim.fn.input 'Breakpoint condition: ') - end, { desc = 'Debug: Set Conditional Breakpoint' }) - vim.keymap.set('n', 'dL', function() - dap.set_breakpoint(nil, nil, vim.fn.input 'Log point message: ') - end, { desc = 'Debug: Set Log Point' }) - - -- REPL and additional features - vim.keymap.set('n', 'dr', dap.repl.open, { desc = 'Debug: Open REPL' }) - - -- Widget-based inspections - vim.keymap.set('n', 'dh', function() - require('dap.ui.widgets').hover() - end, { desc = 'Debug: Hover Variables' }) - - vim.keymap.set('n', 'ds', function() - local widgets = require 'dap.ui.widgets' - widgets.centered_float(widgets.scopes) - end, { desc = 'Debug: View Scopes' }) - - vim.keymap.set('n', 'df', function() - local widgets = require 'dap.ui.widgets' - widgets.centered_float(widgets.frames) - end, { desc = 'Debug: View Frames' }) - - -- Create visual indicators for breakpoints - vim.fn.sign_define('DapBreakpoint', { text = '๐Ÿ”ด', texthl = 'DapBreakpoint', linehl = '', numhl = '' }) - vim.fn.sign_define('DapBreakpointCondition', { text = '๐ŸŸก', texthl = 'DapBreakpoint', linehl = '', numhl = '' }) - vim.fn.sign_define('DapBreakpointRejected', { text = 'โญ•', texthl = 'DapBreakpoint', linehl = '', numhl = '' }) - vim.fn.sign_define('DapLogPoint', { text = '๐Ÿ“', texthl = 'DapLogPoint', linehl = '', numhl = '' }) - vim.fn.sign_define('DapStopped', { text = 'โ–ถ๏ธ', texthl = 'DapStopped', linehl = 'DapStopped', numhl = 'DapStopped' }) -end - -return M diff --git a/lua/plugins/config/editor.lua b/lua/plugins/config/editor.lua deleted file mode 100644 index 90d6910..0000000 --- a/lua/plugins/config/editor.lua +++ /dev/null @@ -1,120 +0,0 @@ --- Editor Enhancement Configuration -local M = {} - -function M.setup_floaterm() - vim.keymap.set('t', '', '') - - local state = { - floating = { - buf = -1, - win = -1, - }, - } - - local function create_floating_window(opts) - opts = opts or {} - local width = opts.width or math.floor(vim.o.columns * 0.8) - local height = opts.height or math.floor(vim.o.lines * 0.8) - - -- Calculate the position to center the window - local col = math.floor((vim.o.columns - width) / 2) - local row = math.floor((vim.o.lines - height) / 2) - - -- Create a buffer - local buf = nil - if vim.api.nvim_buf_is_valid(opts.buf) then - buf = opts.buf - else - buf = vim.api.nvim_create_buf(false, true) -- No file, scratch buffer - end - - -- Define window configuration - local win_config = { - relative = 'editor', - width = width, - height = height, - col = col, - row = row, - style = 'minimal', -- No borders or extra UI elements - border = 'rounded', - } - - -- Create the floating window - local win = vim.api.nvim_open_win(buf, true, win_config) - - return { buf = buf, win = win } - end - - local toggle_terminal = function() - if not vim.api.nvim_win_is_valid(state.floating.win) then - state.floating = create_floating_window { buf = state.floating.buf } - if vim.bo[state.floating.buf].buftype ~= 'terminal' then - vim.cmd.terminal() - end - else - vim.api.nvim_win_hide(state.floating.win) - end - end - - -- Example usage: - -- Create a floating window with default dimensions - vim.api.nvim_create_user_command('Floaterm', toggle_terminal, {}) -end - -function M.setup_mini() - -- Better Around/Inside textobjects - require('mini.ai').setup { n_lines = 500 } - - -- Add/delete/replace surroundings (brackets, quotes, etc.) - require('mini.surround').setup() - - -- Simple and easy statusline - local statusline = require 'mini.statusline' - statusline.setup { use_icons = vim.g.have_nerd_font } - - -- Custom statusline location section - ---@diagnostic disable-next-line: duplicate-set-field - statusline.section_location = function() - return '%2l:%-2v' - end -end - -function M.setup_illuminate() - require('illuminate').configure { - delay = 200, - large_file_cutoff = 2000, - large_file_overrides = { - providers = { 'lsp' }, - }, - providers = { - 'lsp', - 'treesitter', - 'regex', - }, - filetypes_denylist = { - 'dirbuf', - 'dirvish', - 'fugitive', - 'alpha', - 'NvimTree', - 'lazy', - 'neogitstatus', - 'Trouble', - 'lir', - 'Outline', - 'spectre_panel', - 'toggleterm', - 'DressingSelect', - 'TelescopePrompt', - }, - under_cursor = true, - } -end - -function M.setup() - M.setup_floaterm() - M.setup_mini() - M.setup_illuminate() -end - -return M diff --git a/lua/plugins/config/git.lua b/lua/plugins/config/git.lua deleted file mode 100644 index 166cf72..0000000 --- a/lua/plugins/config/git.lua +++ /dev/null @@ -1,69 +0,0 @@ --- Git Configuration -local M = {} - -function M.setup_gitsigns() - require('gitsigns').setup({ - signs = { - add = { text = '+' }, - change = { text = '~' }, - delete = { text = '_' }, - topdelete = { text = 'โ€พ' }, - changedelete = { text = '~' }, - }, - on_attach = function(bufnr) - local gitsigns = require('gitsigns') - - local function map(mode, l, r, opts) - opts = opts or {} - opts.buffer = bufnr - vim.keymap.set(mode, l, r, opts) - end - - -- Navigation - map('n', ']c', function() - if vim.wo.diff then - vim.cmd.normal({']c', bang = true}) - else - gitsigns.nav_hunk('next') - end - end, { desc = 'Jump to next git [c]hange' }) - - map('n', '[c', function() - if vim.wo.diff then - vim.cmd.normal({'[c', bang = true}) - else - gitsigns.nav_hunk('prev') - end - end, { desc = 'Jump to previous git [c]hange' }) - - -- Actions - map('n', 'hs', gitsigns.stage_hunk, { desc = 'Git [s]tage hunk' }) - map('n', 'hr', gitsigns.reset_hunk, { desc = 'Git [r]eset hunk' }) - map('v', 'hs', function() - gitsigns.stage_hunk({vim.fn.line('.'), vim.fn.line('v')}) - end, { desc = 'Git [s]tage hunk' }) - map('v', 'hr', function() - gitsigns.reset_hunk({vim.fn.line('.'), vim.fn.line('v')}) - end, { desc = 'Git [r]eset hunk' }) - - map('n', 'hS', gitsigns.stage_buffer, { desc = 'Git [S]tage buffer' }) - map('n', 'hu', gitsigns.undo_stage_hunk, { desc = 'Git [u]ndo stage hunk' }) - map('n', 'hR', gitsigns.reset_buffer, { desc = 'Git [R]eset buffer' }) - map('n', 'hp', gitsigns.preview_hunk, { desc = 'Git [p]review hunk' }) - map('n', 'hb', gitsigns.blame_line, { desc = 'Git [b]lame line' }) - map('n', 'hd', gitsigns.diffthis, { desc = 'Git [d]iff against index' }) - map('n', 'hD', function() - gitsigns.diffthis('@') - end, { desc = 'Git [D]iff against last commit' }) - - -- Toggles - map('n', 'tb', gitsigns.toggle_current_line_blame, { desc = '[T]oggle git show [b]lame line' }) - map('n', 'tD', gitsigns.toggle_deleted, { desc = '[T]oggle git show [D]eleted' }) - - -- Text object - map({'o', 'x'}, 'ih', ':Gitsigns select_hunk', { desc = 'Select git hunk' }) - end, - }) -end - -return M \ No newline at end of file diff --git a/lua/plugins/config/harpoon.lua b/lua/plugins/config/harpoon.lua deleted file mode 100644 index ddc78ad..0000000 --- a/lua/plugins/config/harpoon.lua +++ /dev/null @@ -1,72 +0,0 @@ -local M = {} - -function M.setup() - local harpoon = require 'harpoon' - harpoon:setup { - settings = { - save_on_toggle = false, - sync_on_ui_close = false, - key = function() - return vim.loop.cwd() - end, - }, - } - - -- Add current file to list - vim.keymap.set('n', 'ma', function() - harpoon:list():add() - vim.notify('Added to Harpoon', vim.log.levels.INFO) - end, { desc = 'Harpoon [A]dd file' }) - - -- Remove current file from harpoon - vim.keymap.set('n', 'md', function() - harpoon:list():remove() - vim.notify('Removed from Harpoon', vim.log.levels.INFO) - end, { desc = 'Harpoon [D]elete file' }) - - -- Toggle quick menu - vim.keymap.set('n', 'mi', function() - harpoon.ui:toggle_quick_menu(harpoon:list()) - end, { desc = 'Toggle Harpoon [M]enu' }) - - -- Navigate between harpoon files - vim.keymap.set('n', '[m', function() - harpoon:list():prev() - end, { desc = 'Harpoon previous file' }) - - vim.keymap.set('n', ']m', function() - harpoon:list():next() - end, { desc = 'Harpoon next file' }) - - -- Show harpoon files in Telescope - local conf = require('telescope.config').values - local function toggle_telescope(harpoon_files) - local file_paths = {} - for _, item in ipairs(harpoon_files.items) do - table.insert(file_paths, item.value) - end - - require('telescope.pickers') - .new({}, { - prompt_title = 'Harpoon', - finder = require('telescope.finders').new_table { - results = file_paths, - }, - previewer = conf.file_previewer {}, - sorter = conf.generic_sorter {}, - }) - :find() - end - - vim.keymap.set('n', 'mt', function() - toggle_telescope(harpoon:list()) - end, { desc = 'Harpoon [T]elescope' }) - - -- Clear all marks - vim.keymap.set('n', 'mc', function() - harpoon:list():clear() - vim.notify('Cleared all Harpoon marks', vim.log.levels.INFO) - end, { desc = 'Harpoon [C]lear all' }) -end - -return M diff --git a/lua/plugins/config/image.lua b/lua/plugins/config/image.lua deleted file mode 100644 index 807a5e5..0000000 --- a/lua/plugins/config/image.lua +++ /dev/null @@ -1,47 +0,0 @@ -local M = {} - -function M.setup() - local image = require 'image' - image:setup { - backend = 'kitty', - processor = 'magick_cli', - integrations = { - markdown = { - enabled = true, - clear_in_insert_mode = false, - download_remote_images = true, - only_render_image_at_cursor = false, - only_render_image_at_cursor_mode = 'popup', - floating_windows = false, - filetypes = { 'markdown', 'vimwiki' }, - }, - neorg = { - enabled = true, - filetypes = { 'norg' }, - }, - typst = { - enabled = true, - filetypes = { 'typst' }, - }, - html = { - enabled = false, - }, - css = { - enabled = false, - }, - }, - max_width = 100, - max_height = 12, - max_width_window_percentage = math.huge, - max_height_window_percentage = math.huge, - scale_factor = 1.0, - window_overlap_clear_enabled = true, - -- window_overlap_clear_ft_ignore = { 'cmp_menu', 'cmp_docs', 'snacks_notif', 'scrollview', 'scrollview_sign' }, - window_overlap_clear_ft_ignore = { 'cmp_menu', 'cmp_docs', '' }, - editor_only_render_when_focused = false, - tmux_show_only_in_active_window = false, - hijack_file_patterns = { '*.png', '*.jpg', '*.jpeg', '*.gif', '*.webp', '*.avif' }, - } -end - -return M diff --git a/lua/plugins/config/jupytext.lua b/lua/plugins/config/jupytext.lua deleted file mode 100644 index 9687ece..0000000 --- a/lua/plugins/config/jupytext.lua +++ /dev/null @@ -1,145 +0,0 @@ --- Jupytext configuration -local M = {} - -function M.setup() - -- Basic settings - vim.g.jupytext_fmt = 'py:percent' - vim.g.jupytext_command = 'jupytext' - - -- Create user commands - local function create_commands() - vim.api.nvim_create_user_command('JupytextSync', function() - vim.cmd('!jupytext --sync %') - vim.notify("Notebook synced", vim.log.levels.INFO) - end, { desc = "Sync current file with its notebook pair" }) - - vim.api.nvim_create_user_command('JupytextPair', function() - vim.cmd('!jupytext --set-formats ipynb,py:percent %') - vim.notify("Notebook paired with .py file", vim.log.levels.INFO) - end, { desc = "Pair notebook with Python file" }) - - vim.api.nvim_create_user_command('JupytextConvert', function(opts) - local format = opts.args ~= "" and opts.args or "py:percent" - vim.cmd('!jupytext --to ' .. format .. ' %') - vim.notify("Converted to " .. format, vim.log.levels.INFO) - end, { - nargs = '?', - desc = "Convert notebook to format (default: py:percent)", - complete = function() - return { 'py:percent', 'md', 'py:light', 'py:sphinx', 'jl:percent', 'r:percent' } - end - }) - end - - -- Setup auto-sync for paired files - local function setup_autosync() - local augroup = vim.api.nvim_create_augroup("JupytextSync", { clear = true }) - - vim.api.nvim_create_autocmd("BufWritePost", { - group = augroup, - pattern = { "*.py", "*.ipynb", "*.md", "*.jl", "*.r" }, - callback = function() - local file = vim.fn.expand('%:p') - local bufnr = vim.api.nvim_get_current_buf() - - -- Check if file has jupytext pairing metadata - local first_lines = vim.api.nvim_buf_get_lines(bufnr, 0, 15, false) - local has_pairing = false - local saw_jupytext = false - - for _, line in ipairs(first_lines) do - if line:match("jupytext") then - saw_jupytext = true - end - if saw_jupytext and line:match("formats:") then - has_pairing = true - break - end - end - - if has_pairing then - -- Run sync in background - vim.fn.jobstart({'jupytext', '--sync', file}, { - on_exit = function(_, exit_code) - if exit_code == 0 then - vim.schedule(function() - vim.notify("Jupytext: Synced with notebook", vim.log.levels.INFO) - end) - end - end - }) - end - end, - desc = "Auto-sync Jupytext paired files" - }) - end - - -- Setup keymaps - local function setup_keymaps() - -- Only set these in relevant filetypes - vim.api.nvim_create_autocmd("FileType", { - pattern = { "python", "markdown", "julia", "r" }, - callback = function() - local opts = { buffer = true, silent = true } - vim.keymap.set("n", "js", ":JupytextSync", - vim.tbl_extend("force", opts, { desc = "Sync with notebook" })) - vim.keymap.set("n", "jp", ":JupytextPair", - vim.tbl_extend("force", opts, { desc = "Pair with notebook" })) - vim.keymap.set("n", "jc", ":JupytextConvert ", - vim.tbl_extend("force", opts, { desc = "Convert to format" })) - end - }) - end - - -- Integration with Molten - local function setup_molten_integration() - -- When opening .ipynb files, offer to convert - vim.api.nvim_create_autocmd({"BufRead", "BufNewFile"}, { - pattern = "*.ipynb", - callback = function() - local file = vim.fn.expand('%:p') - local py_file = file:gsub('%.ipynb$', '.py') - - -- Check if .py version exists - if vim.fn.filereadable(py_file) == 1 then - -- Close the current buffer and open the .py version - vim.cmd('buffer #') -- Go to alternate buffer - vim.cmd('bdelete! #') -- Delete the ipynb buffer - vim.cmd('edit ' .. py_file) - vim.notify("Opened paired .py file instead of .ipynb", vim.log.levels.INFO) - else - -- Offer to convert - vim.schedule(function() - vim.ui.select( - { "Convert to .py", "Keep as JSON" }, - { prompt = "Convert notebook to Python?" }, - function(choice) - if choice == "Convert to .py" then - local result = vim.fn.system('jupytext --to py:percent "' .. file .. '"') - if vim.v.shell_error == 0 then - vim.cmd('edit! ' .. py_file) - vim.notify("Converted and opened as .py", vim.log.levels.INFO) - else - vim.notify("Failed to convert: " .. result, vim.log.levels.ERROR) - end - end - end - ) - end) - end - end, - desc = "Handle .ipynb files with Jupytext" - }) - end - - -- Initialize all components - create_commands() - setup_autosync() - setup_keymaps() - setup_molten_integration() -end - --- Run setup -M.setup() - -return M diff --git a/lua/plugins/config/leetcode.lua b/lua/plugins/config/leetcode.lua deleted file mode 100644 index 1dfe077..0000000 --- a/lua/plugins/config/leetcode.lua +++ /dev/null @@ -1,97 +0,0 @@ --- LeetCode configuration -local M = {} - -M.setup = function() - require('leetcode').setup { - lang = 'python3', -- Default to Python for initial solving - - -- Alternative languages - alternate = { - 'cpp', - 'python3', - }, - - storage = { - home = vim.fn.stdpath 'data' .. '/leetcode', - cache = vim.fn.stdpath 'cache' .. '/leetcode', - }, - - -- Auto-disable Copilot in LeetCode buffers - hooks = { - ['enter'] = { - function() - -- Disable Copilot when entering LeetCode problems - vim.cmd 'Copilot disable' - vim.notify('Copilot disabled for LeetCode practice', vim.log.levels.INFO) - end, - }, - ['question_leave'] = { - function() - -- Re-enable Copilot when leaving LeetCode - vim.cmd 'Copilot enable' - end, - }, - }, - - injector = { - ['python3'] = { - before = [[ -# No external libraries -# Focus on clean, efficient solutions - ]], - }, - ['cpp'] = { - before = [[ -#include -using namespace std; - -// C++ practice -// Focus on low-latency patterns - ]], - }, - }, - - keys = { - toggle = { 'q', '' }, - confirm = { '' }, - reset_testcases = 'r', - use_testcase = 'U', - focus_testcases = 'H', - focus_result = 'L', - }, - } - - -- Keymaps for LeetCode - local keymap = vim.keymap.set - local opts = { noremap = true, silent = true } - - keymap('n', 'Lq', 'Leet tabs', vim.tbl_extend('force', opts, { desc = 'LeetCode tabs' })) - keymap('n', 'Lm', 'Leet menu', vim.tbl_extend('force', opts, { desc = 'LeetCode menu' })) - keymap('n', 'Lc', 'Leet console', vim.tbl_extend('force', opts, { desc = 'LeetCode console' })) - keymap('n', 'Li', 'Leet info', vim.tbl_extend('force', opts, { desc = 'LeetCode info' })) - keymap('n', 'Ll', 'Leet lang', vim.tbl_extend('force', opts, { desc = 'LeetCode language' })) - keymap('n', 'Ld', 'Leet desc', vim.tbl_extend('force', opts, { desc = 'LeetCode description' })) - keymap('n', 'Lr', 'Leet run', vim.tbl_extend('force', opts, { desc = 'LeetCode run' })) - keymap('n', 'Ls', 'Leet submit', vim.tbl_extend('force', opts, { desc = 'LeetCode submit' })) - keymap('n', 'Lt', 'Leet test', vim.tbl_extend('force', opts, { desc = 'LeetCode test' })) - keymap('n', 'Ly', 'Leet yank', vim.tbl_extend('force', opts, { desc = 'LeetCode yank' })) - keymap('n', 'Lo', 'Leet open', vim.tbl_extend('force', opts, { desc = 'LeetCode open in browser' })) - keymap('n', 'Lx', 'Leet restore', vim.tbl_extend('force', opts, { desc = 'LeetCode restore' })) - - -- Daily practice reminder - keymap('n', 'LD', function() - local problems = { - Monday = 'Dynamic Programming', - Tuesday = 'Graphs', - Wednesday = 'Math/Probability', - Thursday = 'Trees/Recursion', - Friday = 'Bit Manipulation', - Saturday = 'Jane Street Tagged', - Sunday = 'Jane Street Tagged', - } - local day = os.date '%A' - vim.notify("Today's focus: " .. problems[day], vim.log.levels.INFO) - end, vim.tbl_extend('force', opts, { desc = 'LeetCode daily focus' })) -end - -return M diff --git a/lua/plugins/config/lint.lua b/lua/plugins/config/lint.lua deleted file mode 100644 index febe3bc..0000000 --- a/lua/plugins/config/lint.lua +++ /dev/null @@ -1,20 +0,0 @@ -local M = {} - -function M.setup() - local lint = require 'lint' - - lint.linters_by_ft = { - cpp = { 'clangtidy' }, - python = { 'ruff' }, - bash = { 'shellcheck' }, - nix = { 'statix' }, - } - - vim.api.nvim_create_autocmd({ 'BufWritePost' }, { - callback = function() - lint.try_lint() - end, - }) -end - -return M diff --git a/lua/plugins/config/mini.lua b/lua/plugins/config/mini.lua new file mode 100644 index 0000000..bbd902c --- /dev/null +++ b/lua/plugins/config/mini.lua @@ -0,0 +1,98 @@ +local M = {} + +local miniclue = require("mini.clue") + +vim.keymap.set("n", "sf", [[Pick files]], { desc = "Files" }) +vim.keymap.set("n", "sb", [[Pick buffers]], { desc = "Buffers" }) +vim.keymap.set("n", "sg", [[Pick grep_live]], { desc = "Grep Live" }) +vim.keymap.set("n", "sh", [[Pick help]], { desc = "Help" }) +vim.keymap.set("n", "sk", [[Pick keymaps]], { desc = "Keymaps" }) +vim.keymap.set("n", "sr", [[Pick resume]], { desc = "Resume" }) + +M["clue"] = { + triggers = { + -- Leader triggers + { mode = { "n", "x" }, keys = "" }, + + -- `[` and `]` keys + { mode = "n", keys = "[" }, + { mode = "n", keys = "]" }, + + -- Built-in completion + { mode = "i", keys = "" }, + + -- `g` key + { mode = { "n", "x" }, keys = "g" }, + + -- Marks + { mode = { "n", "x" }, keys = "'" }, + { mode = { "n", "x" }, keys = "`" }, + + -- Registers + { mode = { "n", "x" }, keys = '"' }, + { mode = { "i", "c" }, keys = "" }, + + -- Window commands + { mode = "n", keys = "" }, + + -- `z` key + { mode = { "n", "x" }, keys = "z" }, + }, + + clues = { + -- Enhance this by adding descriptions for mapping groups + { mode = "n", keys = "l", desc = "+LSP" }, + { mode = "n", keys = "s", desc = "+Search" }, + + miniclue.gen_clues.square_brackets(), + miniclue.gen_clues.builtin_completion(), + miniclue.gen_clues.g(), + miniclue.gen_clues.marks(), + miniclue.gen_clues.registers(), + miniclue.gen_clues.windows(), + miniclue.gen_clues.z(), + }, + window = { + delay = 0, + config = { + anchor = "SE", + width = "auto", + row = "auto", + col = "auto", + }, + scroll_down = "", + scroll_up = "mi', ':MoltenInit', { desc = 'Molten Init', silent = true }) - keymap('n', 'ml', ':MoltenEvaluateLine', { desc = 'Evaluate Line', silent = true }) - keymap('n', 'mr', ':MoltenReevaluateCell', { desc = 'Re-evaluate Cell', silent = true }) - keymap('v', 'mv', ':MoltenEvaluateVisualgv', { desc = 'Evaluate Visual', silent = true }) - - -- Additional useful keymaps - keymap('n', 'md', ':MoltenDelete', { desc = 'Delete Cell', silent = true }) - keymap('n', 'mh', ':MoltenHideOutput', { desc = 'Hide Output', silent = true }) - keymap('n', 'mo', ':noautocmd MoltenEnterOutput', { desc = 'Enter Output', silent = true }) - - -- Better cell execution that always works - keymap('n', 'mc', function() - -- Always use the operator approach for consistency - -- This finds cell boundaries based on # %% markers - vim.cmd 'MoltenEvaluateOperator' - - -- Send 'ip' (inner paragraph) which respects the cell markers - local keys = vim.api.nvim_replace_termcodes('ip', true, false, true) - vim.api.nvim_feedkeys(keys, 'n', false) - end, { desc = 'Run Cell', silent = true }) - - -- Alternative: Run and move to next cell - keymap('n', 'mn', function() - vim.cmd 'MoltenEvaluateOperator' - local keys = vim.api.nvim_replace_termcodes('ip', true, false, true) - vim.api.nvim_feedkeys(keys, 'n', false) - -- Move to next cell - vim.fn.search('^# %%', 'W') - end, { desc = 'Run Cell and Next', silent = true }) - - -- Cell navigation - keymap('n', ']c', ':MoltenNext', { desc = 'Next Cell', silent = true }) - keymap('n', '[c', ':MoltenPrev', { desc = 'Previous Cell', silent = true }) -end - --- Setup autocommands -local function setup_autocmds() - local augroup = vim.api.nvim_create_augroup('MoltenConfig', { clear = true }) - - -- Auto-initialize for Python files - vim.api.nvim_create_autocmd('FileType', { - group = augroup, - pattern = { 'python' }, - callback = function() - vim.keymap.set('n', 'ms', function() - vim.cmd 'MoltenInit python3' - vim.notify('Molten kernel started', vim.log.levels.INFO) - end, { buffer = true, desc = 'Start Python Kernel' }) - - -- Auto-detect notebook files with cell markers - vim.schedule(function() - local lines = vim.api.nvim_buf_get_lines(0, 0, -1, false) - for _, line in ipairs(lines) do - if line:match '^# %%' then - vim.notify('Notebook detected. Use ms to start kernel', vim.log.levels.INFO) - break - end - end - end) - end, - }) - - -- Better notebook file handling - vim.api.nvim_create_autocmd('BufRead', { - group = augroup, - pattern = { '*.ipynb' }, - callback = function() - -- Consider using jupytext for better .ipynb handling - vim.notify('Notebook file detected. Use :MoltenInit to start kernel', vim.log.levels.INFO) - end, - }) -end - --- Main setup function -function M.setup() - -- Tell Molten about cell delimiters - vim.g.molten_cell_delimiter = '^# %%' - - setup_keymaps() - setup_autocmds() -end - --- Initialize -M.setup() - -return M diff --git a/lua/plugins/config/nvim-autopairs.lua b/lua/plugins/config/nvim-autopairs.lua deleted file mode 100644 index cf5b3e9..0000000 --- a/lua/plugins/config/nvim-autopairs.lua +++ /dev/null @@ -1,9 +0,0 @@ -local M = {} - -function M.config() - require('nvim-autopairs').setup { - check_ts = true, - } -end - -return M diff --git a/lua/plugins/config/nvim-conan.lua b/lua/plugins/config/nvim-conan.lua deleted file mode 100644 index 6c71106..0000000 --- a/lua/plugins/config/nvim-conan.lua +++ /dev/null @@ -1,7 +0,0 @@ -local M = {} - -function M.setup() - require('conan').setup() -end - -return M diff --git a/lua/plugins/config/ocaml.lua b/lua/plugins/config/ocaml.lua deleted file mode 100644 index 9953ce1..0000000 --- a/lua/plugins/config/ocaml.lua +++ /dev/null @@ -1,42 +0,0 @@ --- OCaml configuration --- Note: Indentation, comment strings, and other editor settings are handled by: --- - vim-sleuth (automatic indentation detection) --- - Comment.nvim (comment string detection) --- - conform.nvim (formatting via ocamlformat) --- This file only contains OCaml-specific keymaps and commands. - -local M = {} - -M.setup = function() - -- Set up OCaml-specific keymaps - local group = vim.api.nvim_create_augroup('OCamlKeymaps', { clear = true }) - - vim.api.nvim_create_autocmd('FileType', { - group = group, - pattern = { 'ocaml', 'ocaml.menhir', 'ocaml.interface', 'ocaml.ocamllex', 'reason', 'dune' }, - callback = function() - local bufnr = vim.api.nvim_get_current_buf() - local opts = { buffer = bufnr, noremap = true, silent = true } - - -- Run dune build - vim.keymap.set('n', 'ob', ':!dune build', vim.tbl_extend('force', opts, { desc = 'OCaml: Dune build' })) - - -- Run dune test - vim.keymap.set('n', 'ot', ':!dune test', vim.tbl_extend('force', opts, { desc = 'OCaml: Dune test' })) - - -- Send to REPL (requires vim-slime) - vim.keymap.set('v', 'or', 'SlimeRegionSend', vim.tbl_extend('force', opts, { desc = 'OCaml: Send to REPL' })) - vim.keymap.set('n', 'or', 'SlimeParagraphSend', vim.tbl_extend('force', opts, { desc = 'OCaml: Send paragraph to REPL' })) - - -- Jane Street Core library documentation - vim.keymap.set( - 'n', - 'od', - ':!open https://ocaml.janestreet.com/ocaml-core/latest/doc/core/index.html', - vim.tbl_extend('force', opts, { desc = 'OCaml: Open Core docs' }) - ) - end, - }) -end - -return M diff --git a/lua/plugins/config/overseer.lua b/lua/plugins/config/overseer.lua deleted file mode 100644 index f658197..0000000 --- a/lua/plugins/config/overseer.lua +++ /dev/null @@ -1,7 +0,0 @@ -local M = {} - -function M.setup() - require('overseer').setup() -end - -return M diff --git a/lua/plugins/config/rustaceanvim.lua b/lua/plugins/config/rustaceanvim.lua deleted file mode 100644 index 46ced42..0000000 --- a/lua/plugins/config/rustaceanvim.lua +++ /dev/null @@ -1,45 +0,0 @@ -local M = {} - -function M.init() - vim.g.rustaceanvim = { - tools = {}, - server = { - on_attach = function(client, bufnr) - if client.server_capabilities.inlayHintProvider then - vim.lsp.inlay_hint.enable(true, { bufnr = bufnr }) - end - - local opts = { buffer = bufnr, silent = true } - - vim.keymap.set('n', 'K', function() - vim.cmd.RustLsp { 'hover', 'actions' } - end, opts) - - vim.keymap.set('n', 'ca', function() - vim.cmd.RustLsp 'codeAction' - end, opts) - - vim.keymap.set('n', 'ee', function() - vim.cmd.RustLsp 'explainError' - end, opts) - end, - default_settings = { - ['rust-analyzer'] = { - check = { - command = 'clippy', - }, - inlayHints = { - bindingModeHints = { enable = true }, - chainingHints = { enable = true }, - closingBraceHints = { enable = true }, - parameterHints = { enable = true }, - typeHints = { enable = true }, - }, - }, - }, - }, - dap = {}, - } -end - -return M diff --git a/lua/plugins/config/telescope.lua b/lua/plugins/config/telescope.lua deleted file mode 100644 index 7799f4f..0000000 --- a/lua/plugins/config/telescope.lua +++ /dev/null @@ -1,83 +0,0 @@ --- Telescope Configuration -local M = {} - -function M.setup() - local telescope = require 'telescope' - local builtin = require 'telescope.builtin' - - telescope.setup { - defaults = { - prompt_prefix = '> ', - selection_caret = '> ', - path_display = { 'truncate' }, - sorting_strategy = 'ascending', - layout_config = { - horizontal = { - prompt_position = 'top', - preview_width = 0.55, - }, - vertical = { - mirror = false, - }, - width = 0.87, - height = 0.80, - preview_cutoff = 120, - }, - }, - pickers = { - find_files = { - -- Use rg for finding files (ensure rg is installed via Nix/Home Manager) - find_command = { 'rg', '--files', '--hidden', '-g', '!.git' }, - }, - }, - extensions = { - ['ui-select'] = { - require('telescope.themes').get_dropdown(), - }, - fzf = { - fuzzy = true, - override_generic_sorter = true, - override_file_sorter = true, - case_mode = 'smart_case', - }, - }, - } - - -- Load extensions - pcall(telescope.load_extension, 'fzf') - pcall(telescope.load_extension, 'ui-select') - - -- Setup keymaps - vim.keymap.set('n', '', builtin.find_files, { desc = '[S]earch files' }) - vim.keymap.set('n', 'sg', builtin.live_grep, { desc = '[S]earch by [G]rep' }) - 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', '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', '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)' }) - - -- Fuzzy search in current buffer - 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' }) - - -- Search in open files - 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' }) - - -- Search in neovim config - vim.keymap.set('n', 'sn', function() - builtin.find_files { cwd = vim.fn.stdpath 'config' } - end, { desc = '[S]earch [N]eovim files' }) -end - -return M diff --git a/lua/plugins/config/training.lua b/lua/plugins/config/training.lua deleted file mode 100644 index 598e61b..0000000 --- a/lua/plugins/config/training.lua +++ /dev/null @@ -1,278 +0,0 @@ -local M = {} - --- Statistics tracking -local stats = { - inefficient_moves = 0, - efficient_moves = 0, - start_time = os.time(), -} - --- Training mode state -local training_enabled = false - --- Movement key counters for spam detection -local key_counts = { h = 0, j = 0, k = 0, l = 0 } - --- Hard mode: Disable inefficient keys -local function setup_hard_mode() - -- Disable arrow keys completely - vim.keymap.set({ 'n', 'v', 'i' }, '', '', { desc = 'Use k instead!' }) - vim.keymap.set({ 'n', 'v', 'i' }, '', '', { desc = 'Use j instead!' }) - vim.keymap.set({ 'n', 'v', 'i' }, '', '', { desc = 'Use h instead!' }) - vim.keymap.set({ 'n', 'v', 'i' }, '', '', { desc = 'Use l instead!' }) - - -- Make holding j/k/h/l painful (warns after 5 repeats) - for _, key in ipairs { 'h', 'j', 'k', 'l' } do - vim.keymap.set('n', key, function() - key_counts[key] = key_counts[key] + 1 - if key_counts[key] > 5 then - vim.notify(string.format('Stop spamming %s! Use counts (5%s) or better navigation!', key, key), vim.log.levels.WARN) - key_counts[key] = 0 - end - return key - end, { expr = true }) - end - - -- Reset counter when using other movements - for _, good_move in ipairs { '', '', '}', '{', 'gg', 'G' } do - vim.keymap.set('n', good_move, function() - key_counts = { h = 0, j = 0, k = 0, l = 0 } - stats.efficient_moves = stats.efficient_moves + 1 - return good_move - end, { expr = true }) - end -end - --- Smart search helpers -local function setup_smart_search() - -- Search word under cursor - vim.keymap.set('n', '*', '*N', { desc = 'Search word under cursor' }) - - -- Search selected text - vim.keymap.set('v', '//', [[y/\V=escape(@",'/\')]], { desc = 'Search selection' }) - - -- Replace word under cursor (the smart way) - vim.keymap.set('n', 'R', function() - local word = vim.fn.expand '' - vim.ui.input({ prompt = 'Replace "' .. word .. '" with: ' }, function(replacement) - if replacement then - vim.cmd(':%s/\\<' .. word .. '\\>/' .. replacement .. '/g') - vim.notify(string.format('Replaced all instances of "%s" with "%s"', word, replacement)) - end - end) - end, { desc = 'Replace word under cursor globally' }) - - -- cgn workflow helper - vim.keymap.set('n', 'C', '*Ncgn', { desc = 'Change word under cursor (cgn workflow)' }) -end - --- Efficiency helpers -local function setup_efficiency_helpers() - -- Movement reminder - vim.keymap.set('n', 'tm', function() - local hints = { - '=== VERTICAL MOVEMENT ===', - 'gg/G - Top/bottom of file', - '50G or 50% - Go to line 50', - '{ } - Paragraph jumps', - '[[ ]] - Function/section jumps', - 'H M L - High/Middle/Low of screen', - '', - '=== HORIZONTAL MOVEMENT ===', - 'f / F - Find forward/backward', - 't / T - Till forward/backward', - '; , - Repeat f/t forward/backward', - '0 $ - Start/end of line', - '^ g_ - First/last non-blank', - '', - '=== WORD MOVEMENT ===', - 'w/W - Next word/WORD', - 'b/B - Back word/WORD', - 'e/E - End of word/WORD', - 'ge/gE - End of previous word/WORD', - '', - '=== SEARCH MOVEMENT ===', - '* # - Search word forward/backward', - 'g* g# - Search partial word', - 'n N - Next/previous match', - } - vim.notify(table.concat(hints, '\n'), vim.log.levels.INFO) - end, { desc = '[T]raining [M]ovement hints' }) - - -- Text object practice - vim.keymap.set('n', 'ti', function() - local hints = { - '=== TEXT OBJECTS ===', - 'ciw - Change inside word', - 'ci" - Change inside quotes', - 'ci( or cib - Change inside parentheses', - 'ci{ or ciB - Change inside braces', - 'cit - Change inside tags', - 'cip - Change inside paragraph', - '', - '=== VARIATIONS ===', - 'c - Change', - 'd - Delete', - 'y - Yank', - 'v - Visual select', - '', - 'i - Inside (excludes delimiters)', - 'a - Around (includes delimiters)', - } - vim.notify(table.concat(hints, '\n'), vim.log.levels.INFO) - end, { desc = '[T]ext object [I]nfo' }) -end - --- Track statistics -local function setup_statistics() - -- Track efficient movements - local efficient_patterns = { '*', '#', 'cgn', 'ciw', 'ci"', "ci'", 'cib', 'ciB', 'f', 'F', 't', 'T', '}', '{', ']]', '[[' } - - for _, pattern in ipairs(efficient_patterns) do - vim.keymap.set('n', pattern, function() - stats.efficient_moves = stats.efficient_moves + 1 - return pattern - end, { expr = true, silent = true }) - end -end - --- Visual feedback for good movements -local function setup_visual_feedback() - vim.api.nvim_create_autocmd('CursorMoved', { - group = vim.api.nvim_create_augroup('TrainingMode', { clear = true }), - callback = function() - if not training_enabled then - return - end - - local col = vim.fn.col '.' - local line = vim.fn.line '.' - - -- Check if cursor moved significantly (likely used good navigation) - if math.abs(line - (vim.b.last_line or line)) > 5 then - -- Don't notify, just track it - stats.efficient_moves = stats.efficient_moves + 1 - end - - vim.b.last_line = line - end, - }) -end - --- Disable hard mode -local function disable_hard_mode() - -- Remove hard mode restrictions - pcall(vim.keymap.del, { 'n', 'v', 'i' }, '') - pcall(vim.keymap.del, { 'n', 'v', 'i' }, '') - pcall(vim.keymap.del, { 'n', 'v', 'i' }, '') - pcall(vim.keymap.del, { 'n', 'v', 'i' }, '') - - -- Remove hjkl spam detection - for _, key in ipairs { 'h', 'j', 'k', 'l' } do - pcall(vim.keymap.del, 'n', key) - end -end - --- Main setup function -function M.setup() - -- Always setup smart search helpers (they're just helpful) - setup_smart_search() - setup_efficiency_helpers() - setup_visual_feedback() - - vim.notify('Training mode available! Press tt to toggle', vim.log.levels.INFO) -end - --- Toggle training mode -function M.toggle() - training_enabled = not training_enabled - - if training_enabled then - setup_hard_mode() - setup_statistics() - stats.start_time = os.time() -- Reset timer - vim.notify('Training mode ENABLED! ๐Ÿ’ช\nArrows disabled, hjkl spam detection on!', vim.log.levels.INFO) - else - disable_hard_mode() - vim.notify('Training mode DISABLED. Keep practicing those efficient movements!', vim.log.levels.INFO) - end -end - --- Show statistics -function M.show_stats() - local time_elapsed = os.time() - stats.start_time - local total_moves = stats.efficient_moves + stats.inefficient_moves - local efficiency = total_moves > 0 and (stats.efficient_moves / total_moves * 100) or 0 - - vim.notify( - string.format( - '๐Ÿ“Š Session Statistics:\n' .. - 'Time: %d min\n' .. - 'Efficient moves: %d\n' .. - 'Inefficient moves: %d\n' .. - 'Efficiency: %.1f%%\n\n' .. - 'Keep practicing! ๐ŸŽฏ', - time_elapsed / 60, - stats.efficient_moves, - stats.inefficient_moves, - efficiency - ), - vim.log.levels.INFO - ) -end - --- Random challenge -function M.challenge() - local challenges = { - 'Jump to line 50 without counting lines (use 50G)', - 'Find the next "function" (use /function)', - 'Change the word in quotes (use ci")', - 'Delete until the next comma (use dt,)', - 'Jump to matching bracket (use %)', - 'Select entire paragraph (use vap)', - 'Change word and repeat with . (use *cgn)', - 'Jump to next blank line (use })', - 'Delete entire function (use dap or di{)', - 'Find and change next "TODO" (use /TODOcgn)', - } - - local challenge = challenges[math.random(#challenges)] - vim.notify('๐ŸŽฎ Challenge: ' .. challenge, vim.log.levels.INFO) -end - --- Show cheatsheet -function M.cheatsheet() - local cheatsheet = [[ -=== STOP DOING === | === START DOING === -jjjjjjjj | 10j, }, -wwwww | 3w, f -manually typing search | *, viw/, sg -:%s/old/new/g | *cgn then . -:q then git | :Git (Fugitive) -arrow keys | hjkl with counts - -=== POWER MOVES === -cgn - Change next occurrence (use with *) -. - Repeat last change -* - Search word under cursor -ciw - Change inside word -f/t - Find/till character -% - Jump to matching bracket - - Half page down - - Half page up - -=== TRAINING COMMANDS === -tt - Toggle training mode -ts - Show statistics -tg - Get random challenge -tm - Movement hints -ti - Text object info -* - Search word under cursor -R - Replace word globally -C - Start cgn workflow -]] - - vim.notify(cheatsheet, vim.log.levels.INFO) -end - -return M \ No newline at end of file diff --git a/lua/plugins/config/treesitter.lua b/lua/plugins/config/treesitter.lua deleted file mode 100644 index 28e8641..0000000 --- a/lua/plugins/config/treesitter.lua +++ /dev/null @@ -1,45 +0,0 @@ -local M = {} - -function M.setup() - local treesitter = require 'nvim-treesitter' - treesitter.setup { - ensure_installed = { - 'bash', - 'c', - 'cmake', - 'cpp', - 'diff', - 'html', - 'lua', - 'luadoc', - 'make', - 'markdown', - 'markdown_inline', - 'nix', - 'python', - 'query', - 'vim', - 'vimdoc', - 'yaml', - }, - auto_install = true, - highlight = { - enable = true, - additional_vim_regex_highlighting = false, - }, - indent = { - enable = true, - }, - incremental_selection = { - enable = true, - keymaps = { - init_selection = 'gnn', - node_incremental = 'grn', - scope_incremental = 'grc', - node_decremental = 'grm', - }, - }, - } -end - -return M diff --git a/lua/plugins/config/ui.lua b/lua/plugins/config/ui.lua deleted file mode 100644 index 1e16b2c..0000000 --- a/lua/plugins/config/ui.lua +++ /dev/null @@ -1,57 +0,0 @@ --- UI Configuration -local M = {} - -function M.setup_which_key() - local wk = require 'which-key' - - wk.setup({ - 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 = '', - }, - }, - }) - - -- Document existing key chains - wk.add { - { 'c', group = '[C]ode' }, - { 'd', group = '[D]ocument/[D]ebug' }, - { 'r', group = '[R]ename' }, - { 's', group = '[S]earch' }, - { 'w', group = '[W]orkspace' }, - { 't', group = '[T]oggle' }, - { 'g', group = '[G]it' }, - { 'h', group = 'Git [H]unk', mode = { 'n', 'v' } }, - } -end - -return M \ No newline at end of file diff --git a/lua/plugins/init.lua b/lua/plugins/init.lua new file mode 100644 index 0000000..8c02e14 --- /dev/null +++ b/lua/plugins/init.lua @@ -0,0 +1,4 @@ +require("plugins.spec.colorscheme") +require("plugins.spec.treesitter") +require("plugins.spec.file-explorer") +require("plugins.spec.mini") diff --git a/lua/plugins/spec/blink-cmp.lua b/lua/plugins/spec/blink-cmp.lua deleted file mode 100644 index d4dd78a..0000000 --- a/lua/plugins/spec/blink-cmp.lua +++ /dev/null @@ -1,12 +0,0 @@ -return { - 'saghen/blink.cmp', - dependencies = { 'rafamadriz/friendly-snippets' }, - - version = '1.*', - - ---@module 'blink.cmp' - ---@type blink.cmp.Config - config = function() - require('plugins.config.blink-cmp').setup() - end, -} diff --git a/lua/plugins/spec/cmake-tools.lua b/lua/plugins/spec/cmake-tools.lua deleted file mode 100644 index 122e345..0000000 --- a/lua/plugins/spec/cmake-tools.lua +++ /dev/null @@ -1,10 +0,0 @@ -return { - 'Civitasv/cmake-tools.nvim', - dependencies = { - 'nvim-lua/plenary.nvim', - 'stevearc/overseer.nvim', - }, - config = function() - require('plugins.config.cmake-tools').setup() - end, -} diff --git a/lua/plugins/spec/colorscheme.lua b/lua/plugins/spec/colorscheme.lua new file mode 100644 index 0000000..684dee7 --- /dev/null +++ b/lua/plugins/spec/colorscheme.lua @@ -0,0 +1,2 @@ +vim.pack.add({"https://github.com/folke/tokyonight.nvim.git"}) +vim.cmd([[colorscheme tokyonight-night]]) diff --git a/lua/plugins/spec/crates-nvim.lua b/lua/plugins/spec/crates-nvim.lua deleted file mode 100644 index 936ebb3..0000000 --- a/lua/plugins/spec/crates-nvim.lua +++ /dev/null @@ -1,7 +0,0 @@ -return { - 'saecki/crates.nvim', - tag = 'stable', - config = function() - require('plugins.config.crates-nvim').setup() - end, -} diff --git a/lua/plugins/spec/debug.lua b/lua/plugins/spec/debug.lua deleted file mode 100644 index 77f6e70..0000000 --- a/lua/plugins/spec/debug.lua +++ /dev/null @@ -1,20 +0,0 @@ --- Debug Adapter Protocol (DAP) support -return { - 'mfussenegger/nvim-dap', - dependencies = { - -- DAP UI - { - 'rcarriga/nvim-dap-ui', - dependencies = { 'nvim-neotest/nvim-nio' }, - }, - - -- Virtual text for debugging - { - 'theHamsta/nvim-dap-virtual-text', - opts = {}, - }, - }, - config = function() - require('plugins.config.debug').setup() - end, -} \ No newline at end of file diff --git a/lua/plugins/spec/editor.lua b/lua/plugins/spec/editor.lua deleted file mode 100644 index c285b49..0000000 --- a/lua/plugins/spec/editor.lua +++ /dev/null @@ -1,36 +0,0 @@ --- Editor enhancement plugins -return { - -- Collection of various small independent plugins/modules - { - 'echasnovski/mini.nvim', - config = function() - require('plugins.config.editor').setup_mini() - end, - }, - - -- Highlight, edit, and navigate code - { - 'nvim-treesitter/nvim-treesitter-textobjects', - event = 'VeryLazy', - dependencies = { 'nvim-treesitter/nvim-treesitter' }, - }, - - -- Detect tabstop and shiftwidth automatically - { 'tpope/vim-sleuth' }, - - -- Comment plugin - { - 'numToStr/Comment.nvim', - event = 'VeryLazy', - opts = {}, - }, - - -- Highlight word under cursor - { - 'RRethy/vim-illuminate', - event = { 'BufReadPost', 'BufNewFile' }, - config = function() - require('plugins.config.editor').setup_illuminate() - end, - }, -} diff --git a/lua/plugins/spec/file-explorer.lua b/lua/plugins/spec/file-explorer.lua new file mode 100644 index 0000000..04da3fb --- /dev/null +++ b/lua/plugins/spec/file-explorer.lua @@ -0,0 +1,18 @@ +vim.pack.add({"https://github.com/stevearc/oil.nvim"}) + +require("oil").setup({ + delete_to_trash = true, + skip_confirm_for_simple_edits = true, + view_options = { + show_hidden = true, + }, + keymaps = { + [''] = false, + [''] = false, + [''] = false, + [''] = false, + }, +}) + +vim.keymap.set("n", "-", "Oil", { desc = "Open parent directory" }) +vim.keymap.set("n", "_", "Oil .", { desc = "Open current directory" }) diff --git a/lua/plugins/spec/formatting.lua b/lua/plugins/spec/formatting.lua deleted file mode 100644 index ce7d89a..0000000 --- a/lua/plugins/spec/formatting.lua +++ /dev/null @@ -1,48 +0,0 @@ --- Formatter configuration - -return { - -- ======================================== - -- Formatter Configuration (conform.nvim) - -- ======================================== - { - 'stevearc/conform.nvim', - event = 'BufWritePre', -- Format on save - cmd = { 'ConformInfo' }, - keys = { - { - 'f', - function() - return require('conform').format { async = true, lsp_fallback = true } - end, - desc = '[F]ormat buffer', - }, - }, - opts = { - formatters_by_ft = { - -- Core languages - lua = { 'stylua' }, - c = { 'clang_format' }, - cpp = { 'clang_format' }, - python = { 'ruff_organize_imports', 'ruff_format', 'ruff_fix' }, - nix = { 'alejandra' }, - ocaml = { 'ocamlformat' }, - rust = { 'rustfmt' }, - - -- Shell scripts - bash = { 'shfmt' }, - sh = { 'shfmt' }, - - -- Build/config files - cmake = { 'cmake_format' }, - json = { 'prettier' }, - yaml = { 'prettier' }, - markdown = { 'prettier' }, - }, - -- Configure format_on_save behavior - format_on_save = { - timeout_ms = 2000, -- Increased for ocamlformat (can be slow) - lsp_fallback = true, -- Use LSP formatting if conform formatter unavailable - }, - }, - }, -} diff --git a/lua/plugins/spec/git.lua b/lua/plugins/spec/git.lua deleted file mode 100644 index f362cdb..0000000 --- a/lua/plugins/spec/git.lua +++ /dev/null @@ -1,26 +0,0 @@ --- Git integration plugins -return { - -- Fugitive - Git integration - { - 'tpope/vim-fugitive', - cmd = { 'Git', 'G', 'Gdiff', 'Gread', 'Gwrite', 'Ggrep', 'GMove', 'GDelete', 'GBrowse', 'GRemove' }, - keys = { - { 'gs', 'Git', desc = 'Git status' }, - { 'gd', 'Gdiff', desc = 'Git diff' }, - { 'gc', 'Git commit', desc = 'Git commit' }, - { 'gb', 'Git blame', desc = 'Git blame' }, - { 'gl', 'Git log', desc = 'Git log' }, - { 'gp', 'Git push', desc = 'Git push' }, - { 'gf', 'Git fetch', desc = 'Git fetch' }, - }, - }, - - -- Gitsigns - Git gutter and hunk operations - { - 'lewis6991/gitsigns.nvim', - event = 'VeryLazy', - config = function() - require('plugins.config.git').setup_gitsigns() - end, - }, -} \ No newline at end of file diff --git a/lua/plugins/spec/harpoon.lua b/lua/plugins/spec/harpoon.lua deleted file mode 100644 index 0e0871b..0000000 --- a/lua/plugins/spec/harpoon.lua +++ /dev/null @@ -1,10 +0,0 @@ --- Harpoon - Quick file navigation -return { - 'ThePrimeagen/harpoon', - branch = 'harpoon2', - dependencies = { 'nvim-lua/plenary.nvim' }, - event = 'VeryLazy', - config = function() - require('plugins.config.harpoon').setup() - end, -} \ No newline at end of file diff --git a/lua/plugins/spec/image.lua b/lua/plugins/spec/image.lua deleted file mode 100644 index be5bf33..0000000 --- a/lua/plugins/spec/image.lua +++ /dev/null @@ -1,8 +0,0 @@ --- Render images in neovim -return { - '3rd/image.nvim', - build = false, - config = function() - require('plugins.config.image').setup() - end, -} diff --git a/lua/plugins/spec/indent-line.lua b/lua/plugins/spec/indent-line.lua deleted file mode 100644 index d594e1b..0000000 --- a/lua/plugins/spec/indent-line.lua +++ /dev/null @@ -1,33 +0,0 @@ --- Indent guides - Show vertical lines at indentation levels -return { - 'lukas-reineke/indent-blankline.nvim', - event = { 'BufReadPost', 'BufNewFile' }, - main = 'ibl', - opts = { - indent = { - char = 'โ”‚', - tab_char = 'โ”‚', - }, - scope = { - enabled = true, - show_start = true, - show_end = false, - injected_languages = false, - highlight = { 'Function', 'Label' }, - }, - exclude = { - filetypes = { - 'help', - 'alpha', - 'dashboard', - 'neo-tree', - 'Trouble', - 'lazy', - 'mason', - 'notify', - 'toggleterm', - 'lazyterm', - }, - }, - }, -} \ No newline at end of file diff --git a/lua/plugins/spec/jupyter.lua b/lua/plugins/spec/jupyter.lua deleted file mode 100644 index ab57d92..0000000 --- a/lua/plugins/spec/jupyter.lua +++ /dev/null @@ -1,34 +0,0 @@ --- Jupyter/Notebook Integration - -return { - -- Molten.nvim - Jupyter integration for Neovim - { - 'benlubas/molten-nvim', - cond = vim.fn.has 'mac' == 1, - version = '^1.0.0', - dependencies = { '3rd/image.nvim' }, - build = ':UpdateRemotePlugins', - init = function() - vim.g.molten_image_provider = 'image.nvim' - vim.g.molten_output_win_max_height = 20 - vim.g.molten_auto_open_output = false - vim.g.molten_wrap_output = true - vim.g.molten_virt_text_output = true - vim.g.molten_virt_lines_off_by_1 = true - end, - config = function() - require('plugins.config.molten').setup() - end, - }, - - -- image.nvim - Image rendering for Neovim - { - '3rd/image.nvim', - cond = vim.fn.has 'mac' == 1, - opts = { - backend = 'kitty', - integrations = {}, - max_height_window_percentage = 50, - }, - }, -} diff --git a/lua/plugins/spec/jupytext.lua b/lua/plugins/spec/jupytext.lua deleted file mode 100644 index 52d4cf3..0000000 --- a/lua/plugins/spec/jupytext.lua +++ /dev/null @@ -1,12 +0,0 @@ --- Jupytext - Jupyter notebook as plain text -return { - 'goerz/jupytext.vim', - ft = { 'ipynb', 'python', 'markdown', 'julia', 'r' }, - build = function() - -- Ensure jupytext is installed - vim.fn.system('pip install jupytext') - end, - config = function() - require('plugins.config.jupytext') - end, -} diff --git a/lua/plugins/spec/leetcode.lua b/lua/plugins/spec/leetcode.lua deleted file mode 100644 index 561a147..0000000 --- a/lua/plugins/spec/leetcode.lua +++ /dev/null @@ -1,17 +0,0 @@ --- LeetCode practice environment -return { - 'kawre/leetcode.nvim', - build = ':TSUpdate html', - dependencies = { - 'nvim-telescope/telescope.nvim', - 'nvim-lua/plenary.nvim', - 'MunifTanjim/nui.nvim', - 'nvim-treesitter/nvim-treesitter', - 'nvim-tree/nvim-web-devicons', - }, - cmd = { 'Leet' }, - config = function() - require('plugins.config.leetcode').setup() - end, -} - diff --git a/lua/plugins/spec/lint.lua b/lua/plugins/spec/lint.lua deleted file mode 100644 index 1d93357..0000000 --- a/lua/plugins/spec/lint.lua +++ /dev/null @@ -1,7 +0,0 @@ -return { - 'mfussenegger/nvim-lint', - event = { 'BufReadPost', 'BufNewFile' }, - config = function() - require('plugins.config.lint').setup() - end, -} diff --git a/lua/plugins/spec/mini.lua b/lua/plugins/spec/mini.lua new file mode 100644 index 0000000..89d9e4c --- /dev/null +++ b/lua/plugins/spec/mini.lua @@ -0,0 +1,27 @@ +vim.pack.add({ + { + src = "https://github.com/nvim-mini/mini.nvim", + version = "main", + }, +}) + +local mini_config = require("plugins.config.mini") + +require("mini.extra").setup() + +-- Text editing +require("mini.ai").setup() +require("mini.move").setup() +require("mini.operators").setup() +require("mini.surround").setup() + +-- General workflow +require("mini.bracketed").setup() +require("mini.pick").setup() +require("mini.clue").setup(mini_config["clue"]) +require("mini.diff").setup() +require("mini.git").setup() + +-- Appearance +require("mini.icons").setup() +require("mini.statusline").setup(mini_config["statusline"]) diff --git a/lua/plugins/spec/molten.lua b/lua/plugins/spec/molten.lua deleted file mode 100644 index 0abec4b..0000000 --- a/lua/plugins/spec/molten.lua +++ /dev/null @@ -1,19 +0,0 @@ --- Molten - Jupyter notebook support in Neovim -return { - 'benlubas/molten-nvim', - version = '^1.0.0', - dependencies = { '3rd/image.nvim' }, - build = ':UpdateRemotePlugins', - init = function() - -- Basic settings - vim.g.molten_image_provider = 'image.nvim' - vim.g.molten_output_win_max_height = 20 - vim.g.molten_auto_open_output = true - vim.g.molten_wrap_output = true - vim.g.molten_virt_text_output = true - end, - config = function() - -- Delegate to config file for complex setup - require('plugins.config.molten') - end, -} diff --git a/lua/plugins/spec/nvim-autopairs.lua b/lua/plugins/spec/nvim-autopairs.lua deleted file mode 100644 index 8673939..0000000 --- a/lua/plugins/spec/nvim-autopairs.lua +++ /dev/null @@ -1,7 +0,0 @@ -return { - 'windwp/nvim-autopairs', - event = 'InsertEnter', - config = function() - require('plugins.config.nvim-autopairs').config() - end, -} diff --git a/lua/plugins/spec/nvim-conan.lua b/lua/plugins/spec/nvim-conan.lua deleted file mode 100644 index 4f9eadf..0000000 --- a/lua/plugins/spec/nvim-conan.lua +++ /dev/null @@ -1,9 +0,0 @@ -return { - 'mm4cN/nvim-conan', - dependencies = { - 'nvim-telescope/telescope.nvim', - }, - config = function() - require('plugins.config.nvim-conan').setup() - end, -} diff --git a/lua/plugins/spec/nvim-tmux-navigator.lua b/lua/plugins/spec/nvim-tmux-navigator.lua deleted file mode 100644 index 653ae51..0000000 --- a/lua/plugins/spec/nvim-tmux-navigator.lua +++ /dev/null @@ -1,11 +0,0 @@ --- Tmux navigation integration -return { - 'christoomey/vim-tmux-navigator', - keys = { - { '', ':TmuxNavigateLeft', desc = 'Navigate to left tmux pane' }, - { '', ':TmuxNavigateDown', desc = 'Navigate to down tmux pane' }, - { '', ':TmuxNavigateUp', desc = 'Navigate to up tmux pane' }, - { '', ':TmuxNavigateRight', desc = 'Navigate to right tmux pane' }, - { '', ':TmuxNavigatePrevious', desc = 'Navigate to previous tmux pane' }, - }, -} \ No newline at end of file diff --git a/lua/plugins/spec/ocaml.lua b/lua/plugins/spec/ocaml.lua deleted file mode 100644 index 43c59aa..0000000 --- a/lua/plugins/spec/ocaml.lua +++ /dev/null @@ -1,25 +0,0 @@ --- OCaml development environment for Jane Street prep -local ocaml_files = { 'ocaml', 'ocaml.menhir', 'ocaml.interface', 'ocaml.ocamllex', 'reason', 'dune' } - -return { - -- OCaml syntax highlighting and indentation - { - 'ocaml/vim-ocaml', - lazy = false, -- Load immediately for filetype detection - priority = 1000, -- Load very early - config = function() - require('plugins.config.ocaml').setup() - end, - }, - - -- Interactive development (REPL integration with tmux) - { - 'jpalardy/vim-slime', - ft = ocaml_files, - config = function() - vim.g.slime_target = 'tmux' - vim.g.slime_default_config = { socket_name = 'default', target_pane = '{last}' } - vim.g.slime_dont_ask_default = 1 - end, - }, -} diff --git a/lua/plugins/spec/oil.lua b/lua/plugins/spec/oil.lua deleted file mode 100644 index 32a62b9..0000000 --- a/lua/plugins/spec/oil.lua +++ /dev/null @@ -1,26 +0,0 @@ -return { - 'stevearc/oil.nvim', - dependencies = { 'nvim-tree/nvim-web-devicons' }, - lazy = false, - keys = { - { '-', 'Oil', desc = 'Open parent directory' }, - { '-', 'Oil .', desc = 'Open current directory' }, - }, - opts = { - default_file_explorer = true, - delete_to_trash = true, - skip_confirm_for_simple_edits = true, - view_options = { - show_hidden = true, - is_hidden_file = function(name, _) - return vim.startswith(name, '.') - end, - }, - keymaps = { - [''] = false, - [''] = false, - [''] = false, - [''] = false, - }, - }, -} diff --git a/lua/plugins/spec/overseer.lua b/lua/plugins/spec/overseer.lua deleted file mode 100644 index 212eeb2..0000000 --- a/lua/plugins/spec/overseer.lua +++ /dev/null @@ -1,6 +0,0 @@ -return { - 'stevearc/overseer.nvim', - config = function() - require('plugins.config.overseer').setup() - end, -} diff --git a/lua/plugins/spec/rustaceanvim.lua b/lua/plugins/spec/rustaceanvim.lua deleted file mode 100644 index 36985e3..0000000 --- a/lua/plugins/spec/rustaceanvim.lua +++ /dev/null @@ -1,10 +0,0 @@ -return { - { - 'mrcjkb/rustaceanvim', - version = '^9', - lazy = false, - init = function() - require('plugins.config.rustaceanvim').init() - end, - }, -} diff --git a/lua/plugins/spec/telescope.lua b/lua/plugins/spec/telescope.lua deleted file mode 100644 index eba782e..0000000 --- a/lua/plugins/spec/telescope.lua +++ /dev/null @@ -1,22 +0,0 @@ --- Telescope - Fuzzy finder -return { - 'nvim-telescope/telescope.nvim', - event = 'VimEnter', - branch = '0.1.x', - 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('plugins.config.telescope').setup() - end, -} - diff --git a/lua/plugins/spec/training.lua b/lua/plugins/spec/training.lua deleted file mode 100644 index 13e4767..0000000 --- a/lua/plugins/spec/training.lua +++ /dev/null @@ -1,19 +0,0 @@ --- Neovim Training Wheels - Build better vim habits --- Load nix settings if available -pcall(require, 'nix-settings') - -return { - 'dlond/training.nvim', - enabled = vim.g.training_mode_enabled or false, -- Controlled by Nix - lazy = false, - dir = vim.fn.stdpath('config') .. '/lua/plugins/training', -- Local "plugin" - config = function() - require('plugins.config.training').setup() - end, - keys = { - { 'tt', function() require('plugins.config.training').toggle() end, desc = '[T]raining [T]oggle' }, - { 'ts', function() require('plugins.config.training').show_stats() end, desc = '[T]raining [S]tats' }, - { 'tg', function() require('plugins.config.training').challenge() end, desc = '[T]raining [G]ame' }, - { '?', function() require('plugins.config.training').cheatsheet() end, desc = 'Show efficiency cheatsheet' }, - }, -} \ No newline at end of file diff --git a/lua/plugins/spec/treesitter.lua b/lua/plugins/spec/treesitter.lua index b539097..553906a 100644 --- a/lua/plugins/spec/treesitter.lua +++ b/lua/plugins/spec/treesitter.lua @@ -1,12 +1,22 @@ --- Treesitter - Syntax highlighting and text objects -return { - 'nvim-treesitter/nvim-treesitter', - branch = 'main', - lazy = false, - build = ':TSUpdate', - -- event = { 'BufReadPost', 'BufNewFile' }, - -- main = 'nvim-treesitter.configs', - config = function() - require('plugins.config.treesitter').setup() +vim.pack.add({ + { + src="https://github.com/nvim-treesitter/nvim-treesitter", + version="main" + } +}) + +vim.api.nvim_create_autocmd("PackChanged", { + desc = "Handle nvim-tresitter updates", + group = vim.api.nvim_create_augroup("nvim-tresitter-pack-changed", { clear = true }), + callback = function(ev) + if ev.data.kind == "update" and ev.data.spec.name == "nvim-treesitter" then + vim.notify("nvim-treesitter updated, running TSUpdate", vim.log.levels.INFO) + local ok = pcall(vim.cmd, "TSUpdate") + if ok then + vim.notify("TSUpdate completed successfully", vim.log.levels.INFO) + else + vim.notify("TSUpdate failed, skipping", vim.log.levels.WARN) + end + end end, -} +}) diff --git a/lua/plugins/spec/ui.lua b/lua/plugins/spec/ui.lua deleted file mode 100644 index 479c72f..0000000 --- a/lua/plugins/spec/ui.lua +++ /dev/null @@ -1,29 +0,0 @@ --- UI and Theme plugins -return { - -- Color scheme - { - 'folke/tokyonight.nvim', - priority = 1000, - init = function() - vim.cmd.colorscheme 'tokyonight-night' - vim.cmd.hi 'Comment gui=none' - end, - }, - - -- Which-key for keybind hints - { - 'folke/which-key.nvim', - event = 'VimEnter', - config = function() - require('plugins.config.ui').setup_which_key() - end, - }, - - -- Todo comments highlighting - { - 'folke/todo-comments.nvim', - event = 'VimEnter', - dependencies = { 'nvim-lua/plenary.nvim' }, - opts = { signs = false } - }, -} \ No newline at end of file diff --git a/nvim-pack-lock.json b/nvim-pack-lock.json new file mode 100644 index 0000000..ab8ded9 --- /dev/null +++ b/nvim-pack-lock.json @@ -0,0 +1,26 @@ +{ + "plugins": { + "mini.nvim": { + "rev": "4182d64727fb4876407af65c181b85428a4a70d1", + "src": "https://github.com/nvim-mini/mini.nvim", + "version": "'main'" + }, + "nvim-lspconfig": { + "rev": "cb5bc0b2b35a6d513e3298d285db81453e791f4f", + "src": "https://github.com/neovim/nvim-lspconfig" + }, + "nvim-treesitter": { + "rev": "4916d6592ede8c07973490d9322f187e07dfefac", + "src": "https://github.com/nvim-treesitter/nvim-treesitter", + "version": "'main'" + }, + "oil.nvim": { + "rev": "0fcc83805ad11cf714a949c98c605ed717e0b83e", + "src": "https://github.com/stevearc/oil.nvim" + }, + "tokyonight.nvim": { + "rev": "cdc07ac78467a233fd62c493de29a17e0cf2b2b6", + "src": "https://github.com/folke/tokyonight.nvim.git" + } + } +}