From dc86d0eafc6913e28da69c981e0453052e811093 Mon Sep 17 00:00:00 2001 From: Carlos Gutierrez Date: Sun, 1 Feb 2026 15:47:39 -0500 Subject: [PATCH] Move NvimTree file explorer to left side - Change side from 'right' to 'left' in nvim-tree.lua - Update edgy.nvim config to place NvimTree in left panel --- KEYMAPS.md | 503 ++++++++++++++++++ PLUGINS.md | 209 ++++++++ README.md | 465 +++++++++------- ftplugin/java.lua | 59 +- lua/cargdev/core/compatibility.lua | 13 +- lua/cargdev/core/dashboard_config.lua | 34 +- lua/cargdev/core/keymaps/README.md | 140 +++-- lua/cargdev/core/keymaps/database.lua | 25 +- lua/cargdev/core/keymaps/gitconflict.lua | 10 - lua/cargdev/core/keymaps/personal.lua | 2 +- lua/cargdev/plugins/alpha.lua | 50 -- lua/cargdev/plugins/colorful-winsep.lua | 43 ++ lua/cargdev/plugins/crates.lua | 73 +++ lua/cargdev/plugins/dadbod.lua | 35 +- lua/cargdev/plugins/dap.lua | 3 +- lua/cargdev/plugins/dial.lua | 120 +++++ lua/cargdev/plugins/diffview.lua | 82 +++ lua/cargdev/plugins/dropbar.lua | 137 +++++ lua/cargdev/plugins/edgy.lua | 40 ++ lua/cargdev/plugins/flash.lua | 54 ++ lua/cargdev/plugins/fzf-lua.lua | 39 -- lua/cargdev/plugins/git-blame.lua | 24 + lua/cargdev/plugins/gitConflicts.lua | 13 - lua/cargdev/plugins/grug-far.lua | 55 ++ lua/cargdev/plugins/hardtime.lua | 50 ++ lua/cargdev/plugins/harpoon.lua | 33 ++ lua/cargdev/plugins/hlchunk.lua | 50 ++ lua/cargdev/plugins/inc-rename.lua | 23 + lua/cargdev/plugins/kulala.lua | 25 + lua/cargdev/plugins/lsp/lspconfig.lua | 34 +- lua/cargdev/plugins/lspsaga.lua | 176 ++++++ lua/cargdev/plugins/marks.lua | 19 + lua/cargdev/plugins/mini-animate.lua | 33 ++ lua/cargdev/plugins/modicator.lua | 23 + lua/cargdev/plugins/navbuddy.lua | 67 +++ lua/cargdev/plugins/neogit.lua | 84 +++ lua/cargdev/plugins/nvim-highlight-colors.lua | 21 + lua/cargdev/plugins/nvim-jdtls.lua | 6 +- lua/cargdev/plugins/nvim-lightbulb.lua | 54 ++ lua/cargdev/plugins/nvim-tree.lua | 1 + lua/cargdev/plugins/nvim-ts-autotag.lua | 16 + lua/cargdev/plugins/octo.lua | 69 +++ lua/cargdev/plugins/outline.lua | 129 +++++ lua/cargdev/plugins/overseer.lua | 227 ++++++++ lua/cargdev/plugins/package-info.lua | 30 ++ lua/cargdev/plugins/persistence.lua | 15 + lua/cargdev/plugins/portal.lua | 25 + lua/cargdev/plugins/precognition.lua | 31 ++ lua/cargdev/plugins/reactive.lua | 88 +++ lua/cargdev/plugins/regexplainer.lua | 39 ++ lua/cargdev/plugins/render-markdown.lua | 154 ++++++ lua/cargdev/plugins/satellite.lua | 57 ++ lua/cargdev/plugins/screenkey.lua | 66 +++ lua/cargdev/plugins/snacks.lua | 25 +- lua/cargdev/plugins/ssr.lua | 28 + lua/cargdev/plugins/telescope.lua | 2 +- .../plugins/tiny-inline-diagnostic.lua | 59 ++ lua/cargdev/plugins/treesj.lua | 18 + lua/cargdev/plugins/ts-comments.lua | 5 + lua/cargdev/plugins/twilight.lua | 24 + lua/cargdev/plugins/undotree.lua | 24 + lua/cargdev/plugins/venv-selector.lua | 55 ++ lua/cargdev/plugins/vim-visual-multi.lua | 37 ++ lua/cargdev/plugins/yanky.lua | 45 ++ lua/cargdev/plugins/zen-mode.lua | 55 ++ 65 files changed, 3778 insertions(+), 472 deletions(-) create mode 100644 KEYMAPS.md create mode 100644 PLUGINS.md delete mode 100644 lua/cargdev/core/keymaps/gitconflict.lua delete mode 100644 lua/cargdev/plugins/alpha.lua create mode 100644 lua/cargdev/plugins/colorful-winsep.lua create mode 100644 lua/cargdev/plugins/crates.lua create mode 100644 lua/cargdev/plugins/dial.lua create mode 100644 lua/cargdev/plugins/diffview.lua create mode 100644 lua/cargdev/plugins/dropbar.lua create mode 100644 lua/cargdev/plugins/edgy.lua create mode 100644 lua/cargdev/plugins/flash.lua delete mode 100644 lua/cargdev/plugins/fzf-lua.lua create mode 100644 lua/cargdev/plugins/git-blame.lua delete mode 100644 lua/cargdev/plugins/gitConflicts.lua create mode 100644 lua/cargdev/plugins/grug-far.lua create mode 100644 lua/cargdev/plugins/hardtime.lua create mode 100644 lua/cargdev/plugins/harpoon.lua create mode 100644 lua/cargdev/plugins/hlchunk.lua create mode 100644 lua/cargdev/plugins/inc-rename.lua create mode 100644 lua/cargdev/plugins/kulala.lua create mode 100644 lua/cargdev/plugins/lspsaga.lua create mode 100644 lua/cargdev/plugins/marks.lua create mode 100644 lua/cargdev/plugins/mini-animate.lua create mode 100644 lua/cargdev/plugins/modicator.lua create mode 100644 lua/cargdev/plugins/navbuddy.lua create mode 100644 lua/cargdev/plugins/neogit.lua create mode 100644 lua/cargdev/plugins/nvim-highlight-colors.lua create mode 100644 lua/cargdev/plugins/nvim-lightbulb.lua create mode 100644 lua/cargdev/plugins/nvim-ts-autotag.lua create mode 100644 lua/cargdev/plugins/octo.lua create mode 100644 lua/cargdev/plugins/outline.lua create mode 100644 lua/cargdev/plugins/overseer.lua create mode 100644 lua/cargdev/plugins/package-info.lua create mode 100644 lua/cargdev/plugins/persistence.lua create mode 100644 lua/cargdev/plugins/portal.lua create mode 100644 lua/cargdev/plugins/precognition.lua create mode 100644 lua/cargdev/plugins/reactive.lua create mode 100644 lua/cargdev/plugins/regexplainer.lua create mode 100644 lua/cargdev/plugins/render-markdown.lua create mode 100644 lua/cargdev/plugins/satellite.lua create mode 100644 lua/cargdev/plugins/screenkey.lua create mode 100644 lua/cargdev/plugins/ssr.lua create mode 100644 lua/cargdev/plugins/tiny-inline-diagnostic.lua create mode 100644 lua/cargdev/plugins/treesj.lua create mode 100644 lua/cargdev/plugins/ts-comments.lua create mode 100644 lua/cargdev/plugins/twilight.lua create mode 100644 lua/cargdev/plugins/undotree.lua create mode 100644 lua/cargdev/plugins/venv-selector.lua create mode 100644 lua/cargdev/plugins/vim-visual-multi.lua create mode 100644 lua/cargdev/plugins/yanky.lua create mode 100644 lua/cargdev/plugins/zen-mode.lua diff --git a/KEYMAPS.md b/KEYMAPS.md new file mode 100644 index 0000000..8fcb982 --- /dev/null +++ b/KEYMAPS.md @@ -0,0 +1,503 @@ +# Complete Keymaps Reference + +**Leader Key: ``** + +## Table of Contents +- [Navigation](#navigation) +- [File Management](#file-management) +- [Editing](#editing) +- [LSP & Code Intelligence](#lsp--code-intelligence) +- [Git](#git) +- [Debugging](#debugging) +- [Search & Replace](#search--replace) +- [Tasks & HTTP](#tasks--http) +- [UI & Productivity](#ui--productivity) +- [Language Specific](#language-specific) +- [Window Management](#window-management) + +--- + +## Navigation + +### Flash (Jump Anywhere) +| Key | Mode | Action | +|-----|------|--------| +| `s` | n, x, o | Flash jump (type chars to jump) | +| `S` | n, x, o | Flash treesitter select | +| `r` | o | Remote flash | +| `R` | o, x | Treesitter search | +| `` | c | Toggle flash in search | + +### Harpoon (Quick File Marks) +| Key | Action | +|-----|--------| +| `ha` | Add current file to harpoon | +| `hh` | Open harpoon menu | +| `1` | Jump to harpoon file 1 | +| `2` | Jump to harpoon file 2 | +| `3` | Jump to harpoon file 3 | +| `4` | Jump to harpoon file 4 | +| `5` | Jump to harpoon file 5 | +| `hp` | Previous harpoon file | +| `hn` | Next harpoon file | + +### Portal (Jumplist Navigation) +| Key | Action | +|-----|--------| +| `pj` | Portal jumplist backward | +| `pk` | Portal jumplist forward | +| `pc` | Portal changelist backward | +| `pq` | Portal quickfix backward | + +### Navbuddy (Code Structure) +| Key | Action | +|-----|--------| +| `nb` | Open Navbuddy | + +Inside Navbuddy: +- `h/j/k/l` - Navigate +- `` - Select +- `0` - Go to root +- `q` - Close + +### Telescope +| Key | Action | +|-----|--------| +| `ff` | Find files | +| `fs` | Live grep (search text) | +| `fg` | Git files | +| `fF` | Find all files | +| `fr` | Recent files | + +--- + +## File Management + +### File Explorer (nvim-tree) +| Key | Action | +|-----|--------| +| `e` | Toggle file explorer | +| `ee` | Toggle file explorer | +| `nt` | Find current file in tree | +| `ec` | Collapse file explorer | +| `er` | Refresh file explorer | + +Inside nvim-tree: +- `o` - Open file +- `s` - Open in vertical split +- `i` - Open in horizontal split +- `a` - Create new file +- `r` - Rename +- `d` - Delete +- `x` - Cut +- `y` - Copy +- `p` - Paste +- `u` - Go up one directory + +### Buffers +| Key | Action | +|-----|--------| +| `` | Next buffer | +| `` | Previous buffer | +| `bd` | Close buffer | +| `bD` | Force close buffer | + +--- + +## Editing + +### Multi-Cursor (vim-visual-multi) +| Key | Action | +|-----|--------| +| `` | Select word under cursor / Add next occurrence | +| `` | Add cursor below | +| `` | Add cursor above | +| `` | Select all occurrences | +| `` | Skip current match | +| `` | Remove current cursor | +| `` | Exit multi-cursor | + +### Yanky (Yank Ring) +| Key | Mode | Action | +|-----|------|--------| +| `y` | n, x | Yank | +| `p` | n, x | Put after | +| `P` | n, x | Put before | +| `` | n | Previous yank in ring | +| `` | n | Next yank in ring | +| `yh` | n | Open yank history | +| `]p` | n | Put indented after | +| `[p` | n | Put indented before | + +### Treesj (Split/Join) +| Key | Action | +|-----|--------| +| `tj` | Toggle split/join | +| `ts` | Split code block | +| `tJ` | Join code block | + +### Dial (Smart Increment) +| Key | Mode | Action | +|-----|------|--------| +| `` | n, v | Increment | +| `` | n, v | Decrement | +| `g` | n, v | Increment (sequence) | +| `g` | n, v | Decrement (sequence) | + +Works on: numbers, booleans, dates, CSS units, HTTP methods, operators, and more! + +### Surround +| Key | Action | +|-----|--------| +| `ys{motion}{char}` | Add surround | +| `ds{char}` | Delete surround | +| `cs{old}{new}` | Change surround | + +Examples: +- `ysiw"` - Surround word with quotes +- `ds"` - Delete surrounding quotes +- `cs"'` - Change " to ' + +### Comments +| Key | Mode | Action | +|-----|------|--------| +| `gcc` | n | Toggle line comment | +| `gc` | v | Toggle comment selection | +| `gbc` | n | Toggle block comment | +| `/` | n, v | Toggle comment | + +### Substitute +| Key | Action | +|-----|--------| +| `sub` | Substitute with motion | +| `sl` | Substitute line | +| `S` | Substitute to end of line | + +### Undo Tree +| Key | Action | +|-----|--------| +| `tu` | Toggle undo tree | + +--- + +## LSP & Code Intelligence + +### LSP Saga +| Key | Action | +|-----|--------| +| `K` | Hover documentation | +| `gd` | Peek definition | +| `gD` | Go to definition | +| `gt` | Peek type definition | +| `gT` | Go to type definition | +| `gh` | LSP finder (refs + impl) | +| `gr` | Rename | +| `gR` | Rename (project-wide) | +| `ca` | Code actions | +| `sl` | Show line diagnostics | +| `sc` | Show cursor diagnostics | +| `sb` | Show buffer diagnostics | +| `[d` | Previous diagnostic | +| `]d` | Next diagnostic | +| `ci` | Incoming calls | +| `co` | Outgoing calls | +| `so` | Toggle LSP outline | + +### Inc-Rename (Live Preview) +| Key | Action | +|-----|--------| +| `rn` | Rename with live preview | + +### Outline +| Key | Action | +|-----|--------| +| `cs` | Toggle symbol outline | + +### Formatting +| Key | Action | +|-----|--------| +| `f` | Format buffer | +| `mm` | Format with conform | + +### Regexplainer +| Key | Action | +|-----|--------| +| `rx` | Toggle regex explanation | + +--- + +## Git + +### LazyGit +| Key | Action | +|-----|--------| +| `gg` | Open LazyGit | + +### Neogit +| Key | Action | +|-----|--------| +| `gn` | Open Neogit | +| `gnc` | Neogit commit | +| `gnp` | Neogit push | +| `gnl` | Neogit pull | +| `gnb` | Neogit branch | + +### Diffview +| Key | Action | +|-----|--------| +| `gd` | Open diffview | +| `gD` | Close diffview | +| `gh` | File history (current file) | +| `gH` | File history (repo) | + +### Git Blame +| Key | Action | +|-----|--------| +| `gB` | Toggle git blame | +| `gbc` | Copy commit SHA | +| `gbo` | Open commit URL | +| `gbf` | Open file URL | + +### Octo (GitHub) +| Key | Action | +|-----|--------| +| `oi` | List issues | +| `oI` | Create issue | +| `op` | List PRs | +| `oP` | Create PR | +| `or` | List repos | +| `os` | Search issues/PRs | +| `oa` | Octo actions | + +### Gitsigns +| Key | Action | +|-----|--------| +| `]c` | Next hunk | +| `[c` | Previous hunk | +| `hs` | Stage hunk | +| `hr` | Reset hunk | +| `hp` | Preview hunk | + +--- + +## Debugging + +### DAP (Debug Adapter Protocol) +| Key | Action | +|-----|--------| +| `db` | Toggle breakpoint | +| `dcc` | Start/Continue debugging | +| `di` | Step into | +| `do` | Step over | +| `dO` | Step out | +| `dr` | Toggle REPL | +| `dl` | Run last debug config | +| `du` | Toggle DAP UI | +| `dt` | Float element | +| `dco` | DAP commands | +| `dcf` | List DAP configs | +| `dcb` | List breakpoints | + +### Java Debugging +| Key | Action | +|-----|--------| +| `jd` | Debug class | +| `jt` | Test class | +| `jn` | Test nearest method | +| `jr` | Run Java file | + +--- + +## Search & Replace + +### Grug-Far (Project-Wide) +| Key | Mode | Action | +|-----|------|--------| +| `sr` | n | Open search & replace | +| `sR` | n | Search current word | +| `sR` | v | Search selection | + +Inside Grug-Far: +- `r` - Replace +- `R` - Replace all +- `` - Go to location +- `q` - Close + +### SSR (Structural Search/Replace) +| Key | Mode | Action | +|-----|------|--------| +| `sR` | n, x | Structural search/replace | + +--- + +## Tasks & HTTP + +### Overseer (Task Runner) +| Key | Action | +|-----|--------| +| `or` | Run task | +| `ot` | Toggle task list | +| `oa` | Task action | +| `oq` | Quick action | +| `ob` | Build | +| `oc` | Run shell command | + +### Kulala (HTTP Client) +| Key | Action | +|-----|--------| +| `kr` | Run HTTP request | +| `ka` | Run all requests | +| `kp` | Previous request | +| `kn` | Next request | +| `ki` | Inspect request | +| `kt` | Toggle headers/body | +| `kc` | Copy as cURL | +| `ke` | Set environment | + +--- + +## UI & Productivity + +### Zen Mode & Focus +| Key | Action | +|-----|--------| +| `zz` | Toggle Zen mode | +| `zt` | Toggle Twilight (dim code) | + +### Session +| Key | Action | +|-----|--------| +| `qs` | Restore session | +| `ql` | Restore last session | +| `qd` | Don't save session | + +### Learning Vim +| Key | Action | +|-----|--------| +| `ht` | Toggle Hardtime | +| `vp` | Toggle Precognition hints | +| `vP` | Peek Precognition | + +### Screenkey (Demo Mode) +| Key | Action | +|-----|--------| +| `sk` | Toggle Screenkey | + +### Trouble (Diagnostics) +| Key | Action | +|-----|--------| +| `xx` | Toggle Trouble | +| `xw` | Workspace diagnostics | +| `xd` | Document diagnostics | +| `xl` | Location list | +| `xq` | Quickfix list | +| `xt` | Open TODOs in Trouble | + +### Todo Comments +| Key | Action | +|-----|--------| +| `]t` | Next TODO | +| `[t` | Previous TODO | + +--- + +## Language Specific + +### Python +| Key | Action | +|-----|--------| +| `vs` | Select Python venv | +| `vc` | Select cached venv | + +### JavaScript/TypeScript (package.json) +| Key | Action | +|-----|--------| +| `ns` | Show package versions | +| `nh` | Hide package info | +| `nu` | Update package | +| `nd` | Delete package | +| `ni` | Install package | +| `nc` | Change version | + +### Rust (Cargo.toml) +| Key | Action | +|-----|--------| +| `ct` | Toggle crates | +| `cr` | Reload crates | +| `cv` | Show versions popup | +| `cf` | Show features popup | +| `cd` | Show dependencies | +| `cu` | Update crate | +| `cU` | Upgrade crate | + +### LeetCode +| Key | Action | +|-----|--------| +| `lr` | Run code | +| `ls` | Submit code | +| `ld` | Daily challenge | +| `ll` | List problems | +| `lc` | Open console | +| `lh` | Show hints | + +--- + +## Window Management + +### Splits +| Key | Action | +|-----|--------| +| `sv` | Split vertical | +| `sh` | Split horizontal | +| `se` | Equal splits | +| `sx` | Close split | +| `sm` | Maximize split | + +### Navigation +| Key | Action | +|-----|--------| +| `` | Move to left window | +| `` | Move to down window | +| `` | Move to up window | +| `` | Move to right window | + +### Resize +| Key | Action | +|-----|--------| +| `` | Increase height | +| `` | Decrease height | +| `` | Decrease width | +| `` | Increase width | + +--- + +## General + +| Key | Action | +|-----|--------| +| `jj` | Exit insert mode | +| `nh` | Clear search highlights | +| `w` | Save file | +| `q` | Close file | +| `Q` | Quit all | +| `xa` | Save and close all | + +--- + +## Commands + +| Command | Description | +|---------|-------------| +| `:Lazy` | Plugin manager | +| `:Mason` | LSP server manager | +| `:Navbuddy` | Code navigation | +| `:Outline` | Symbol outline | +| `:Neogit` | Git interface | +| `:DiffviewOpen` | Diff view | +| `:GrugFar` | Search & replace | +| `:Octo` | GitHub | +| `:OverseerRun` | Run tasks | +| `:ZenMode` | Zen mode | +| `:Hardtime toggle` | Toggle hardtime | +| `:Screenkey` | Show keypresses | +| `:TSJToggle` | Toggle split/join | diff --git a/PLUGINS.md b/PLUGINS.md new file mode 100644 index 0000000..0b1320f --- /dev/null +++ b/PLUGINS.md @@ -0,0 +1,209 @@ +# Plugins Reference + +Complete list of all plugins in this configuration. + +## Navigation & Search + +| Plugin | Description | +|--------|-------------| +| `nvim-telescope/telescope.nvim` | Fuzzy finder for files, text, buffers | +| `folke/flash.nvim` | Jump anywhere with minimal keystrokes | +| `ThePrimeagen/harpoon` | Quick file marks and navigation | +| `cbochs/portal.nvim` | Navigate jumplist/changelist with preview | +| `SmiteshP/nvim-navbuddy` | Code structure navigation popup | +| `SmiteshP/nvim-navic` | Breadcrumb provider for navbuddy | + +## File Management + +| Plugin | Description | +|--------|-------------| +| `nvim-tree/nvim-tree.lua` | File explorer sidebar | +| `nvim-tree/nvim-web-devicons` | File icons | + +## Git + +| Plugin | Description | +|--------|-------------| +| `kdheepak/lazygit.nvim` | LazyGit integration | +| `NeogitOrg/neogit` | Magit-like git interface | +| `sindrets/diffview.nvim` | Side-by-side diff viewer | +| `lewis6991/gitsigns.nvim` | Git signs in gutter | +| `f-person/git-blame.nvim` | Inline git blame | +| `pwntester/octo.nvim` | GitHub issues/PRs in Neovim | + +## LSP & Code Intelligence + +| Plugin | Description | +|--------|-------------| +| `neovim/nvim-lspconfig` | LSP configuration | +| `williamboman/mason.nvim` | LSP server installer | +| `williamboman/mason-lspconfig.nvim` | Mason + lspconfig bridge | +| `nvimdev/lspsaga.nvim` | Pretty LSP UI | +| `hrsh7th/nvim-cmp` | Completion engine | +| `hrsh7th/cmp-nvim-lsp` | LSP completion source | +| `hrsh7th/cmp-buffer` | Buffer completion source | +| `hrsh7th/cmp-path` | Path completion source | +| `hedyhli/outline.nvim` | Symbol outline sidebar | +| `smjonas/inc-rename.nvim` | Live rename preview | +| `kosayoda/nvim-lightbulb` | Code action indicator | +| `rachartier/tiny-inline-diagnostic.nvim` | Pretty inline diagnostics | +| `folke/trouble.nvim` | Diagnostics list | +| `pmizio/typescript-tools.nvim` | Enhanced TypeScript support | + +## Treesitter + +| Plugin | Description | +|--------|-------------| +| `nvim-treesitter/nvim-treesitter` | Syntax highlighting | +| `nvim-treesitter/nvim-treesitter-context` | Sticky function headers | +| `nvim-treesitter/nvim-treesitter-textobjects` | Text objects | +| `folke/ts-comments.nvim` | Better comments for embedded languages | +| `windwp/nvim-ts-autotag` | Auto close/rename HTML tags | + +## Editing + +| Plugin | Description | +|--------|-------------| +| `mg979/vim-visual-multi` | Multi-cursor editing | +| `gbprod/yanky.nvim` | Yank ring with history | +| `Wansmer/treesj` | Split/join code blocks | +| `monaqa/dial.nvim` | Smart increment/decrement | +| `kylechui/nvim-surround` | Surround text objects | +| `windwp/nvim-autopairs` | Auto close brackets | +| `numToStr/Comment.nvim` | Commenting | +| `folke/todo-comments.nvim` | Highlight TODOs | +| `gbprod/substitute.nvim` | Substitute operator | +| `mbbill/undotree` | Visual undo history | +| `chentoast/marks.nvim` | Better marks | +| `kevinhwang91/nvim-ufo` | Better folding | + +## Search & Replace + +| Plugin | Description | +|--------|-------------| +| `MagicDuck/grug-far.nvim` | Project-wide search & replace | +| `cshuaimin/ssr.nvim` | Structural search/replace | + +## Debugging + +| Plugin | Description | +|--------|-------------| +| `mfussenegger/nvim-dap` | Debug Adapter Protocol | +| `rcarriga/nvim-dap-ui` | Debug UI | +| `nvim-neotest/nvim-nio` | Async IO for dap-ui | +| `theHamsta/nvim-dap-virtual-text` | Virtual text for debugging | +| `mfussenegger/nvim-dap-python` | Python debugging | +| `jay-babu/mason-nvim-dap.nvim` | Mason + DAP bridge | +| `Weissle/persistent-breakpoints.nvim` | Save breakpoints | + +## Tasks & HTTP + +| Plugin | Description | +|--------|-------------| +| `stevearc/overseer.nvim` | Task runner | +| `mistweaverco/kulala.nvim` | HTTP client | + +## UI & Theme + +| Plugin | Description | +|--------|-------------| +| `CarGDev/cargdev-cyberpunk` | Custom cyberpunk theme | +| `folke/snacks.nvim` | Dashboard, notifier, picker, terminal | +| `folke/noice.nvim` | UI for messages, cmdline, popups | +| `nvim-lualine/lualine.nvim` | Statusline | +| `akinsho/bufferline.nvim` | Buffer tabs | +| `Bekaboo/dropbar.nvim` | VS Code-like breadcrumbs | +| `lewis6991/satellite.nvim` | Scrollbar with markers | +| `folke/which-key.nvim` | Keybinding hints | +| `stevearc/dressing.nvim` | Better vim.ui | +| `rcarriga/nvim-notify` | Notification manager | +| `j-hui/fidget.nvim` | LSP progress | +| `folke/edgy.nvim` | Window layout management | + +## Eye Candy + +| Plugin | Description | +|--------|-------------| +| `echasnovski/mini.animate` | Smooth animations | +| `rasulomaroff/reactive.nvim` | Mode-based colors | +| `mawkler/modicator.nvim` | Line number mode colors | +| `shellRaining/hlchunk.nvim` | Scope highlighting | +| `nvim-zh/colorful-winsep.nvim` | Colorful window separators | +| `brenoprata10/nvim-highlight-colors` | Color preview | +| `lukas-reineke/indent-blankline.nvim` | Indent guides | +| `xiyaowong/transparent.nvim` | Transparent background | + +## Productivity + +| Plugin | Description | +|--------|-------------| +| `folke/zen-mode.nvim` | Distraction-free mode | +| `folke/twilight.nvim` | Dim inactive code | +| `folke/persistence.nvim` | Session management | +| `rmagatti/auto-session` | Auto session restore | +| `m4xshen/hardtime.nvim` | Vim motion training | +| `tris203/precognition.nvim` | Vim motion hints | +| `NStefan002/screenkey.nvim` | Show keypresses | +| `bennypowers/nvim-regexplainer` | Regex explanation | + +## Language Specific + +| Plugin | Description | +|--------|-------------| +| `linux-cultist/venv-selector.nvim` | Python venv selector | +| `vuki656/package-info.nvim` | NPM package versions | +| `saecki/crates.nvim` | Rust crate versions | +| `mfussenegger/nvim-jdtls` | Java LSP + debugging | +| `akinsho/flutter-tools.nvim` | Flutter development | +| `lervag/vimtex` | LaTeX support | + +## Database + +| Plugin | Description | +|--------|-------------| +| `kristijanhusak/vim-dadbod-ui` | Database UI | +| `tpope/vim-dadbod` | Database interaction | +| `kristijanhusak/vim-dadbod-completion` | DB completion | + +## Testing + +| Plugin | Description | +|--------|-------------| +| `nvim-neotest/neotest` | Test runner framework | +| `nvim-neotest/neotest-jest` | Jest adapter | +| `nvim-neotest/neotest-python` | Python test adapter | + +## AI & Copilot + +| Plugin | Description | +|--------|-------------| +| `zbirenbaum/copilot.lua` | GitHub Copilot | +| `zbirenbaum/copilot-cmp` | Copilot completion source | + +## Misc + +| Plugin | Description | +|--------|-------------| +| `wakatime/vim-wakatime` | Coding time tracking | +| `kawre/leetcode.nvim` | LeetCode integration | +| `christoomey/vim-tmux-navigator` | Tmux integration | +| `szw/vim-maximizer` | Window maximizer | +| `nvim-lua/plenary.nvim` | Lua utilities | +| `MunifTanjim/nui.nvim` | UI components | +| `kkharji/sqlite.lua` | SQLite for plugins | + +--- + +## Plugin Count: 80+ + +## Installation + +All plugins are managed by [lazy.nvim](https://github.com/folke/lazy.nvim) and auto-install on first run. + +```vim +:Lazy " Open plugin manager +:Lazy sync " Sync plugins +:Lazy update " Update plugins +:Lazy clean " Remove unused plugins +:Lazy profile " Check plugin load times +``` diff --git a/README.md b/README.md index a969fab..8e35cdf 100644 --- a/README.md +++ b/README.md @@ -1,248 +1,339 @@ -# Neovim Configuration +# CargDev Neovim Configuration -A modern, fast, and well-organized Neovim configuration built with Lua. +A modern, feature-rich Neovim configuration with 80+ plugins, optimized for full-stack development. + +``` + ██████╗ █████╗ ██████╗ ██████╗ ██████╗ ███████╗██╗ ██╗ + █╔════╝██╔══██╗██╔══██╗██╔════╝ ██╔══██╗██╔════╝██║ ██║ + █║ ███████║██████╔╝██║ ███╗██║ ██║█████╗ ██║ ██║ + █║ ██╔══██║██╔══██╗██║ ██║██║ ██║██╔══╝ ╚██╗ ██╔╝ + ██████╗██║ ██║██║ ██║╚██████╔╝██████╔╝███████╗ ╚████╔╝ + ╚═════╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚══════╝ ╚═══╝ + + ███╗ ██╗███████╗ ██████╗ ██╗ ██╗██╗███╗ ███╗ + ████╗ ██║██╔════╝██╔═══██╗██║ ██║██║████╗ ████║ + ██╔██╗ ██║█████╗ ██║ ██║██║ ██║██║██╔████╔██║ + ██║╚██╗██║██╔══╝ ██║ ██║╚██╗ ██╔╝██║██║╚██╔╝██║ + ██║ ╚████║███████╗╚██████╔╝ ╚████╔╝ ██║██║ ╚═╝ ██║ + ╚═╝ ╚═══╝╚══════╝ ╚═════╝ ╚═══╝ ╚═╝╚═╝ ╚═╝ +``` + +## Features + +- **VS Code-like UI** with file explorer on right, breadcrumbs, symbol outline +- **80+ plugins** carefully configured and optimized +- **Full LSP support** for TypeScript, Python, Java, Go, Lua, and more +- **Debugging** with DAP for Node.js/NestJS, Python, Java +- **Git integration** with LazyGit, Neogit, Diffview, Octo (GitHub PRs) +- **AI assistance** with GitHub Copilot +- **HTTP client** for API testing +- **Task runner** for build/run tasks +- **Multi-cursor** editing like VS Code ## Requirements -- **Neovim**: 0.9+ (0.10+ recommended) -- **Git**: For plugin management -- **Node.js**: For LSP servers and tooling -- **ripgrep** (`rg`): For fast file searching -- **Python 3**: With `pynvim` package for Python support +```bash +# Required +brew install neovim ripgrep fd node python3 -### Optional Dependencies - -- **Pandoc**: For HTML to Markdown conversion -- **Prettier**: For code formatting -- **Stylua**: For Lua formatting +# Optional but recommended +brew install lazygit jq +pip3 install pynvim +npm install -g neovim +``` ## Installation ```bash -# Backup existing config (if any) +# Backup existing config mv ~/.config/nvim ~/.config/nvim.bak # Clone this configuration git clone ~/.config/nvim -# Start Neovim (plugins will auto-install) +# Start Neovim (plugins auto-install) nvim ``` -## Structure - -``` -~/.config/nvim/ -├── init.lua # Entry point -├── lua/cargdev/ -│ ├── core/ -│ │ ├── init.lua # Core initialization -│ │ ├── options.lua # Neovim options -│ │ ├── keymaps/ # Keymap modules -│ │ │ ├── init.lua # Keymap loader -│ │ │ ├── general.lua # General keymaps -│ │ │ ├── personal.lua # Personal workflow keymaps -│ │ │ ├── plugins.lua # Plugin-specific keymaps -│ │ │ ├── window.lua # Window management -│ │ │ ├── lsp.lua # LSP keymaps -│ │ │ ├── copilot.lua # Copilot keymaps -│ │ │ └── ... -│ │ └── function/ # Custom functions -│ ├── plugins/ # Plugin configurations -│ │ ├── lsp/ # LSP-related plugins -│ │ └── ... -│ └── lazy.lua # Lazy.nvim setup -└── ftplugin/ # Filetype-specific settings -``` - -## Key Features - -- **Colorscheme**: [cargdev-cyberpunk](https://github.com/CarGDev/cargdev-cyberpunk) - Vibrant cyberpunk theme with neon colors and full TypeScript/LSP support -- **Plugin Manager**: [lazy.nvim](https://github.com/folke/lazy.nvim) with auto-update notifications -- **LSP**: Full LSP support with Mason for easy server management -- **Completion**: nvim-cmp with multiple sources -- **File Navigation**: Snacks.nvim (modern) + Telescope (git features) -- **File Explorer**: nvim-tree -- **Git Integration**: LazyGit, Gitsigns -- **AI Assistants**: GitHub Copilot + [Avante.nvim](https://github.com/yetone/avante.nvim) (local LLM support) -- **Debugging**: DAP with UI (Java, Node.js/NestJS, Python) -- **Formatting**: Conform.nvim with auto-format on save -- **Diagnostics**: Trouble.nvim for organized diagnostics view - ## Documentation | Document | Description | |----------|-------------| -| [CHANGELOG.md](./CHANGELOG.md) | Version history and changes | -| [keyboard_mappings.md](./keyboard_mappings.md) | QMK keyboard configuration | -| [NATIVE_AUTO_WRAPPER_GUIDE.md](./NATIVE_AUTO_WRAPPER_GUIDE.md) | Text wrapping configuration | -| [TELESCOPE_TO_SNACKS_MIGRATION.md](./TELESCOPE_TO_SNACKS_MIGRATION.md) | Migration notes | +| [KEYMAPS.md](./KEYMAPS.md) | **Complete keybinding reference** | +| [PLUGINS.md](./PLUGINS.md) | All plugins and their purposes | +| [CHANGELOG.md](./CHANGELOG.md) | Version history | -## Quick Reference - Essential Keymaps +## Quick Start ### Leader Key: `` -### File Operations -| Keymap | Description | -|--------|-------------| -| `w` | Save file | -| `q` | Close file | -| `xa` | Save and close all | -| `bd` | Close buffer (safe) | -| `bD` | Force close buffer | +### Essential Keymaps + +| Key | Action | +|-----|--------| +| `ff` | Find files | +| `fs` | Search text in project | +| `e` | Toggle file explorer (right side) | +| `gg` | Open LazyGit | +| `s` | Flash jump (type chars to jump) | +| `ha` | Harpoon add file | +| `1-5` | Jump to harpooned file | +| `K` | Hover documentation | +| `gd` | Go to definition | +| `ca` | Code actions | +| `rn` | Rename symbol (live preview) | +| `` | Multi-cursor (select word) | ### Navigation -| Keymap | Description | -|--------|-------------| -| `ff` | Find files | -| `fs` | Live grep (search text) | -| `fr` | Recent files | -| `fb` | Find buffers | -| `e` | Toggle file explorer | -### Window Management -| Keymap | Description | -|--------|-------------| -| `sv` | Split vertical | -| `sh` | Split horizontal | -| `se` | Equal splits | -| `sx` | Close split | -| `` | Resize splits | - -### LSP -| Keymap | Description | -|--------|-------------| -| `gd` | Go to definition | -| `gr` | Show references | -| `K` | Hover documentation | -| `ca` | Code actions | -| `rn` | Rename symbol | -| `f` | Format buffer | -| `mm` | Format (conform) | +| Key | Action | +|-----|--------| +| `s` | Flash jump anywhere | +| `S` | Flash treesitter select | +| `nb` | Navbuddy (code structure popup) | +| `cs` | Symbol outline sidebar | +| `tu` | Undo tree | ### Git -| Keymap | Description | -|--------|-------------| + +| Key | Action | +|-----|--------| | `gg` | LazyGit | -| `gs` | Git status | -| `gb` | Git blame | +| `gn` | Neogit (magit-like) | +| `gd` | Diffview | +| `gh` | File history | +| `gB` | Toggle git blame | +| `oi` | GitHub issues (Octo) | +| `op` | GitHub PRs (Octo) | -### Diagnostics & Quickfix -| Keymap | Description | -|--------|-------------| -| `xx` | Toggle Trouble | -| `xd` | Document diagnostics | -| `qn/qp` | Next/prev quickfix | -| `qo/qq` | Open/close quickfix | +### Editing -### Session -| Keymap | Description | -|--------|-------------| -| `sS` | Save session | -| `sR` | Restore session | +| Key | Action | +|-----|--------| +| `` | Add cursor on word (VS Code style) | +| `` / `` | Smart increment/decrement | +| `tj` | Toggle split/join code blocks | +| `sr` | Search & replace (project-wide) | +| `sR` | Structural search/replace | +| `yh` | Yank history | +| `` / `` | Cycle yank history | -### Copilot -| Keymap | Description | -|--------|-------------| -| `` | Accept suggestion | -| `zc` | Open Copilot Chat | -| `ze` | Explain code (visual) | -| `zf` | Fix code (visual) | +### LSP -### Debugging (DAP) -| Keymap | Description | -|--------|-------------| -| `dcr` | Start/Continue Debugging | -| `db` | Toggle Breakpoint | -| `dB` | Conditional Breakpoint | -| `do` | Step Over | -| `di` | Step Into | -| `dot` | Step Out | +| Key | Action | +|-----|--------| +| `K` | Hover documentation | +| `gd` | Peek definition | +| `gD` | Go to definition | +| `gr` | Rename | +| `gh` | LSP finder (refs, implementations) | +| `ca` | Code actions | +| `rn` | Rename (live preview) | +| `sl` | Line diagnostics | +| `[d` / `]d` | Prev/next diagnostic | + +### Debugging + +| Key | Action | +|-----|--------| +| `db` | Toggle breakpoint | +| `dcc` | Start/continue debugging | +| `di` | Step into | +| `do` | Step over | +| `dO` | Step out | | `du` | Toggle DAP UI | -| `dq` | Stop Debugging | -| `dr` | Open REPL | -| `dl` | Run Last Debug | -| `dcf` | DAP Configurations | -| `dcb` | List Breakpoints | -| `dco` | DAP Commands | -### Java Debugging -| Keymap | Description | -|--------|-------------| -| `jd` | Debug Class (DAP) | -| `jt` | Test Class | -| `jn` | Test Nearest Method | -| `jr` | Run Java File | -| `jm` | Run Maven Project | -| `jg` | Run Gradle Project | +### Tasks & HTTP + +| Key | Action | +|-----|--------| +| `or` | Run task (Overseer) | +| `ot` | Toggle task list | +| `kr` | Run HTTP request (in .http file) | +| `ka` | Run all HTTP requests | + +### Productivity + +| Key | Action | +|-----|--------| +| `zz` | Zen mode | +| `zt` | Twilight (dim inactive code) | +| `qs` | Restore session | +| `ht` | Toggle Hardtime (learn vim motions) | +| `vp` | Toggle Precognition (motion hints) | +| `sk` | Toggle Screenkey (show keypresses) | + +### Python + +| Key | Action | +|-----|--------| +| `vs` | Select Python venv | +| Debug configs | Django, FastAPI, Flask, Launch file | + +### JavaScript/TypeScript + +| Key | Action | +|-----|--------| +| `ns` | Show package versions (package.json) | +| `nu` | Update package | +| Debug configs | NestJS, ts-node, Attach | + +### Rust + +| Key | Action | +|-----|--------| +| `cv` | Show crate versions (Cargo.toml) | +| `cu` | Update crate | + +## Plugin Categories + +### Navigation & Search +- **telescope** - Fuzzy finder +- **flash.nvim** - Jump anywhere with minimal keystrokes +- **harpoon** - Quick file marks +- **portal.nvim** - Jump through jumplist with preview +- **nvim-navbuddy** - Code structure navigation + +### Git +- **lazygit** - Terminal UI for git +- **neogit** - Magit-like git interface +- **diffview** - Side-by-side diffs +- **gitsigns** - Git decorations +- **git-blame** - Inline blame +- **octo.nvim** - GitHub issues/PRs + +### LSP & Coding +- **nvim-lspconfig** + **mason** - LSP setup +- **lspsaga** - Pretty LSP UI +- **nvim-cmp** - Completion +- **treesitter** - Syntax highlighting +- **outline.nvim** - Symbol sidebar +- **inc-rename** - Live rename preview +- **lightbulb** - Code action indicator + +### Editing +- **vim-visual-multi** - Multi-cursor +- **yanky.nvim** - Yank ring +- **treesj** - Split/join blocks +- **dial.nvim** - Smart increment +- **nvim-surround** - Surround text +- **nvim-autopairs** - Auto brackets +- **Comment.nvim** - Commenting + +### UI +- **snacks.nvim** - Dashboard, notifier, picker +- **noice.nvim** - UI for messages, cmdline +- **lualine** - Statusline +- **bufferline** - Buffer tabs +- **dropbar** - Breadcrumbs +- **satellite** - Scrollbar with markers +- **which-key** - Keybinding hints +- **trouble** - Diagnostics list + +### Debugging +- **nvim-dap** - Debug Adapter Protocol +- **nvim-dap-ui** - Debug UI +- **nvim-dap-python** - Python debugging +- **nvim-jdtls** - Java debugging + +### Productivity +- **overseer** - Task runner +- **kulala** - HTTP client +- **zen-mode** - Distraction-free +- **persistence** - Session management +- **grug-far** - Search & replace +- **ssr.nvim** - Structural search/replace + +### Eye Candy +- **cargdev-cyberpunk** - Custom theme +- **mini.animate** - Smooth animations +- **reactive** - Mode-based colors +- **hlchunk** - Scope highlighting +- **nvim-highlight-colors** - Color preview ## Commands | Command | Description | |---------|-------------| -| `:Lazy` | Open plugin manager | -| `:Mason` | Open LSP server manager | -| `:checkhealth` | Run health checks | -| `:CheckConfig` | Run config validation | -| `:FormatToggle` | Toggle auto-format on save | +| `:Lazy` | Plugin manager | +| `:Mason` | LSP server manager | +| `:Navbuddy` | Code navigation | +| `:Outline` | Symbol outline | +| `:Neogit` | Git interface | +| `:DiffviewOpen` | Open diff view | +| `:GrugFar` | Search & replace | +| `:Octo` | GitHub integration | +| `:OverseerRun` | Run tasks | +| `:ZenMode` | Distraction-free mode | +| `:Hardtime toggle` | Toggle vim training | +| `:Screenkey` | Show keypresses | ## Debugging Setup -This configuration includes full debugging support for multiple languages using DAP (Debug Adapter Protocol). +### Python +```bash +:Mason # Install debugpy +``` +Configs: Launch File, Django, FastAPI, Flask, Attach Remote -### Supported Languages +### Node.js / TypeScript / NestJS +```bash +:Mason # Install js-debug-adapter +``` +Configs: Launch NestJS, Launch File, ts-node, Attach -| Language | Debug Adapter | Configuration | -|----------|---------------|---------------| -| **Java** | java-debug-adapter | Auto-configured via nvim-jdtls | -| **Node.js/NestJS/TypeScript** | js-debug-adapter (pwa-node) | Launch & Attach configurations | -| **Python** | debugpy | Django, FastAPI, Flask, and general Python | +### Java +```bash +:Mason # Install java-debug-adapter, java-test +``` +Auto-configured via nvim-jdtls -### Debug Configurations +## HTTP Client (Kulala) -#### Node.js/NestJS/TypeScript -- **Launch NestJS** - Runs `dist/main.js` with source maps -- **Launch Current File** - Debug the current TypeScript/JavaScript file -- **Launch with ts-node** - Debug TypeScript directly without compilation -- **Attach to NestJS** - Attach to running process on port 9229 -- **Attach to Process** - Pick from running Node.js processes +Create a `.http` file: -#### Python -- **Launch File** - Debug current Python file -- **Launch with Arguments** - Debug with custom arguments -- **Attach Remote** - Attach to debugpy server (port 5678) -- **Django** - Debug Django with `manage.py runserver` -- **FastAPI** - Debug FastAPI with uvicorn -- **Flask** - Debug Flask application +```http +### Get users +GET https://api.example.com/users +Authorization: Bearer {{token}} -#### Java -- Auto-discovers main classes and test methods -- Hot code replacement enabled -- Use `jd` to debug the current class +### Create user +POST https://api.example.com/users +Content-Type: application/json -### Installation +{ + "name": "John" +} +``` -Debug adapters are automatically installed via Mason. Run `:Mason` to verify: -- `debugpy` - Python debugger -- `js-debug-adapter` - Node.js/TypeScript debugger -- `java-debug-adapter` - Java debugger -- `java-test` - Java test runner +Use `kr` to run request under cursor. + +## Tips & Tricks + +### Learn Vim Motions +Enable Hardtime (`ht`) and Precognition (`vp`) to improve your vim skills. + +### Quick File Switching +Use Harpoon to mark important files (`ha`), then jump instantly with `1-5`. + +### Multi-Cursor Editing +Like VS Code: `` to select word, keep pressing for more occurrences. + +### Smart Increment +`` on `true` → `false`, on `GET` → `POST`, on dates, colors, etc. + +### Split/Join Code +`tj` on arrays, objects, function arguments to toggle between single/multi-line. ## Troubleshooting -### Check Configuration Health ```vim -:checkhealth -:CheckConfig +:checkhealth " Run health checks +:Lazy sync " Sync plugins +:Mason " Check LSP servers +:LspInfo " Check LSP status ``` -### Common Issues - -1. **Plugins not loading**: Run `:Lazy sync` -2. **LSP not working**: Run `:Mason` and install required servers -3. **Formatting not working**: Ensure formatters are installed (prettier, stylua, etc.) -4. **Slow startup**: Check `:Lazy profile` for slow plugins - ## License -MIT License - Feel free to use and modify as needed. +MIT License diff --git a/ftplugin/java.lua b/ftplugin/java.lua index b328c29..db7c6c3 100644 --- a/ftplugin/java.lua +++ b/ftplugin/java.lua @@ -9,18 +9,38 @@ local status, jdtls = pcall(require, "jdtls") if not status then return end -local extendedClientCapabilities = jdtls.extendedClientCapabilities -local bundles = { - vim.fn.glob( - home .. "/.local/share/nvim/mason/packages/java-debug-adapter/extension/server/com.microsoft.java.debug.plugin-*.jar", - true - ), -} -vim.list_extend( - bundles, - vim.split(vim.fn.glob(home .. "/.local/share/nvim/mason/packages/java-test/extension/server/*.jar", true), "\n") +-- Ensure DAP is loaded before setting up Java debugging +local dap_ok, _ = pcall(require, "dap") +if not dap_ok then + vim.notify("nvim-dap not loaded yet. Debug features may not work.", vim.log.levels.WARN) +end + +local extendedClientCapabilities = jdtls.extendedClientCapabilities +extendedClientCapabilities.resolveAdditionalTextEditsSupport = true + +-- Build bundles for java-debug-adapter and java-test +local bundles = {} + +-- Add java-debug-adapter +local debug_jar = vim.fn.glob( + home .. "/.local/share/nvim/mason/packages/java-debug-adapter/extension/server/com.microsoft.java.debug.plugin-*.jar", + true ) +if debug_jar ~= "" then + table.insert(bundles, debug_jar) +end + +-- Add java-test jars +local test_jars = vim.split( + vim.fn.glob(home .. "/.local/share/nvim/mason/packages/java-test/extension/server/*.jar", true), + "\n" +) +for _, jar in ipairs(test_jars) do + if jar ~= "" then + table.insert(bundles, jar) + end +end local config = { cmd = { @@ -79,8 +99,25 @@ local config = { local function jdtls_on_attach(client, bufnr) -- Setup DAP after language server is ready if #bundles > 0 then + -- Ensure DAP is loaded + local dap_loaded, dap = pcall(require, "dap") + if not dap_loaded then + vim.notify("DAP not available for Java debugging", vim.log.levels.WARN) + return + end + + -- Setup DAP with hot code replace require("jdtls").setup_dap({ hotcodereplace = "auto" }) - require("jdtls.dap").setup_dap_main_class_configs() + + -- Defer main class config discovery to allow JDTLS to fully initialize + vim.defer_fn(function() + local ok, err = pcall(function() + require("jdtls.dap").setup_dap_main_class_configs() + end) + if not ok then + vim.notify("Failed to setup Java DAP main configs: " .. tostring(err), vim.log.levels.DEBUG) + end + end, 2000) end end diff --git a/lua/cargdev/core/compatibility.lua b/lua/cargdev/core/compatibility.lua index edc0fcb..1f89427 100644 --- a/lua/cargdev/core/compatibility.lua +++ b/lua/cargdev/core/compatibility.lua @@ -80,7 +80,7 @@ local function setup_lua_runtime() vim.fn.stdpath("data") .. "/lazy/*/lua/?.lua", vim.fn.stdpath("data") .. "/lazy/*/lua/?/init.lua", } - + package.path = table.concat(lua_paths, ";") .. ";" .. package.path end @@ -88,7 +88,7 @@ end local function setup_lua_ls() local lspconfig = require("lspconfig") local capabilities = require("cmp_nvim_lsp").default_capabilities() - + lspconfig.lua_ls.setup({ capabilities = capabilities, settings = { @@ -128,16 +128,16 @@ end -- Initialize compatibility layer function M.setup() setup_lua_runtime() - + -- Setup Lua LSP when available local ok, _ = pcall(require, "lspconfig") if ok then setup_lua_ls() end - + -- Disable deprecated API warnings vim.deprecate = function() end - + -- Set up proper error handling for deprecated functions local original_error = error error = function(msg, level) @@ -148,4 +148,5 @@ function M.setup() end end -return M \ No newline at end of file +return M + diff --git a/lua/cargdev/core/dashboard_config.lua b/lua/cargdev/core/dashboard_config.lua index b396187..08b51bf 100644 --- a/lua/cargdev/core/dashboard_config.lua +++ b/lua/cargdev/core/dashboard_config.lua @@ -1,32 +1,34 @@ --- Shared dashboard configuration for alpha-nvim and snacks.dashboard +-- Minimalist TUI-style dashboard configuration local M = {} +-- CARGDEV NEOVIM ASCII art logo M.header = { + "", " ██████╗ █████╗ ██████╗ ██████╗ ██████╗ ███████╗██╗ ██╗ ", " █╔════╝██╔══██╗██╔══██╗██╔════╝ ██╔══██╗██╔════╝██║ ██║ ", " █║ ███████║██████╔╝██║ ███╗██║ ██║█████╗ ██║ ██║ ", " █║ ██╔══██║██╔══██╗██║ ██║██║ ██║██╔══╝ ╚██╗ ██╔╝ ", " ██████╗██║ ██║██║ ██║╚██████╔╝██████╔╝███████╗ ╚████╔╝ ", " ╚═════╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚══════╝ ╚═══╝ ", - " ", + "", " ███╗ ██╗███████╗ ██████╗ ██╗ ██╗██╗███╗ ███╗ ", " ████╗ ██║██╔════╝██╔═══██╗██║ ██║██║████╗ ████║ ", " ██╔██╗ ██║█████╗ ██║ ██║██║ ██║██║██╔████╔██║ ", " ██║╚██╗██║██╔══╝ ██║ ██║╚██╗ ██╔╝██║██║╚██╔╝██║ ", " ██║ ╚████║███████╗╚██████╔╝ ╚████╔╝ ██║██║ ╚═╝ ██║ ", " ╚═╝ ╚═══╝╚══════╝ ╚═════╝ ╚═══╝ ╚═╝╚═╝ ╚═╝ ", + "", } --- Menu items (single column) +-- Minimal VS Code-like menu items M.menu_items = { - { key = "f", icon = " ", desc = "Find File", action = ":FzfLua files" }, - { key = "n", icon = " ", desc = "New File", action = ":ene | startinsert" }, - { key = "g", icon = " ", desc = "Find Text", action = ":FzfLua live_grep" }, - { key = "r", icon = " ", desc = "Recent Files", action = ":FzfLua oldfiles" }, - { key = "t", icon = " ", desc = "File Tree", action = ":NvimTreeToggle" }, - { key = "L", icon = "󰒲 ", desc = "Lazy", action = ":Lazy" }, - { key = "m", icon = " ", desc = "Mason", action = ":Mason" }, - { key = "q", icon = " ", desc = "Quit", action = ":qa" }, + { key = "f", icon = "", desc = "Go to File", action = ":Telescope find_files" }, + { key = "r", icon = "", desc = "Recent Files", action = ":Telescope oldfiles" }, + { key = "g", icon = "", desc = "Find in Files", action = ":Telescope live_grep" }, + { key = "s", icon = "", desc = "Restore Session", action = ":lua require('persistence').load()" }, + { key = "e", icon = "", desc = "Explorer", action = ":NvimTreeToggle" }, + { key = "c", icon = "", desc = "Settings", action = ":e $MYVIMRC" }, + { key = "q", icon = "", desc = "Quit", action = ":qa" }, } -- Get header as string (for snacks) @@ -53,14 +55,4 @@ function M.get_snacks_keys() return to_snacks_keys(M.menu_items) end --- Get alpha buttons (requires alpha dashboard module) -function M.get_alpha_buttons(dashboard) - local buttons = {} - for _, item in ipairs(M.menu_items) do - local cmd = item.action:gsub("^:", "") .. "" - table.insert(buttons, dashboard.button(item.key, item.icon .. " " .. item.desc, cmd)) - end - return buttons -end - return M diff --git a/lua/cargdev/core/keymaps/README.md b/lua/cargdev/core/keymaps/README.md index 682a65a..79df2b5 100644 --- a/lua/cargdev/core/keymaps/README.md +++ b/lua/cargdev/core/keymaps/README.md @@ -2,112 +2,98 @@ This folder contains all the keymaps organized by category for better maintainability. -## 📁 File Structure +## File Structure ``` keymaps/ ├── README.md # This file -├── general.lua # General keymaps (leader, basic navigation) +├── general.lua # General keymaps (leader, basic navigation, obsidian) ├── personal.lua # Personal workflow keymaps ├── lsp.lua # LSP and function navigation keymaps ├── dap.lua # DAP debugging keymaps -├── snacks.lua # Snacks search and navigation keymaps (replacing Telescope) +├── snacks.lua # Snacks search and navigation keymaps ├── window.lua # Window management keymaps ├── copilot.lua # Copilot AI keymaps -├── gitconflict.lua # Git conflict resolution keymaps -└── plugins.lua # Plugin-specific keymaps +├── plugins.lua # Plugin-specific keymaps (Telescope, trouble, etc.) +├── project.lua # Project-specific keymaps +├── ufo.lua # Folding keymaps +├── leet.lua # LeetCode keymaps +├── sudoku.lua # Sudoku game keymaps +└── database.lua # Database keymaps ``` -## 🔧 How It Works +## How It Works -The main `keymaps.lua` file automatically loads all `.lua` files from this folder. Each file contains keymaps for a specific category: +The main `keymaps.lua` file automatically loads all `.lua` files from this folder: -### **general.lua** -- Leader key setup -- Basic navigation -- General utility keymaps +```lua +local function load_keymaps() + local keymaps_path = vim.fn.stdpath("config") .. "/lua/cargdev/core/keymaps" + local scan = vim.fn.globpath(keymaps_path, "*.lua", false, true) -### **personal.lua** -- Your personal workflow keymaps -- File management -- Window management -- Coding shortcuts -- Copilot integration + for _, file in ipairs(scan) do + local module_name = "cargdev.core.keymaps." .. file:match("([^/]+)%.lua$") + pcall(require, module_name) + end +end +``` -### **lsp.lua** -- Function navigation (`gd`, `gi`, `gr`, `gt`) -- Symbol search (`ds`, `ws`) -- Code actions and documentation -- Diagnostics +## Keymap Categories -### **dap.lua** -- Debug session control (`dcr`, `dq`) -- Breakpoints (`db`, `dB`) -- Step navigation (`do`, `di`, `dot`) -- DAP UI toggle (`du`) -- REPL and configuration pickers +| Category | File | Description | +|----------|------|-------------| +| General | `general.lua` | Basic setup, escape, obsidian links | +| Personal | `personal.lua` | Your workflow shortcuts | +| LSP | `lsp.lua` | Function navigation and LSP features | +| Debugging | `dap.lua` | DAP debugging (Java, Node.js, Python) | +| Search | `snacks.lua` | File and text search (Snacks) | +| Window | `window.lua` | Window/split management | +| Copilot | `copilot.lua` | AI assistant keymaps | +| Plugins | `plugins.lua` | Plugin-specific (Telescope, trouble, etc.) | +| Project | `project.lua` | Project commands | +| Folding | `ufo.lua` | Code folding | +| LeetCode | `leet.lua` | LeetCode integration | +| Database | `database.lua` | Database operations | -### **snacks.lua** -- File search (`ff`, `fs`) -- Buffer management -- Git integration -- Help and commands - -### **plugins.lua** -- NvimTree -- Comment -- DAP (debugging) -- Trouble -- Terminal -- Session management -- Git conflicts -- LeetCode -- And more... - -## ➕ Adding New Keymaps - -To add new keymaps: +## Adding New Keymaps 1. **Choose the appropriate file** based on the category 2. **Add your keymaps** using the standard format: ```lua + local keymap = vim.keymap keymap.set("n", "key", "command", { desc = "Description" }) ``` 3. **The keymaps will be automatically loaded** when Neovim starts -## 🎯 Keymap Categories +## Leader Key Prefixes -| Category | File | Description | -|----------|------|-------------| -| General | `general.lua` | Basic setup and utilities | -| Personal | `personal.lua` | Your workflow shortcuts | -| LSP | `lsp.lua` | Function navigation and LSP features | -| Debugging | `dap.lua` | DAP debugging (Java, Node.js, Python) | -| Search | `snacks.lua` | File and text search | -| Window | `window.lua` | Window/split management | -| Copilot | `copilot.lua` | AI assistant keymaps | -| Git Conflicts | `gitconflict.lua` | Conflict resolution | -| Plugins | `plugins.lua` | Plugin-specific functionality | +| Prefix | Category | +|--------|----------| +| `f` | Find/Files (Telescope) | +| `g` | Git | +| `d` | Debug | +| `l` | LSP/LeetCode | +| `x` | Trouble/Diagnostics | +| `s` | Search/Session | +| `t` | Toggle/Text/Treesj | +| `h` | Harpoon | +| `k` | Kulala (HTTP) | +| `o` | Overseer/Octo | +| `n` | NPM/Navbuddy | +| `c` | Code/Crates | +| `v` | Vim learning | +| `z` | Zen mode | +| `q` | Session (persistence) | +| `r` | Rename/Regex | +| `p` | Portal/Projects | -## 🔄 Benefits +## Full Reference -- **Modular**: Each category is in its own file -- **Maintainable**: Easy to find and modify specific keymaps -- **Scalable**: Easy to add new categories -- **Organized**: Clear separation of concerns -- **Auto-loading**: No need to manually import files +See [KEYMAPS.md](../../../../KEYMAPS.md) in the root directory for complete keybinding reference. -## 🚀 Usage - -The keymaps are automatically loaded when Neovim starts. You can: - -- **View all keymaps**: `fk` (Snacks keymaps) -- **Search keymaps**: Use Snacks to search through your keymaps -- **Modify keymaps**: Edit the appropriate file and restart Neovim - -## 📝 Notes +## Notes - All files are automatically loaded by `keymaps.lua` - Each file should have its own `local keymap = vim.keymap` declaration -- Use descriptive comments to organize keymaps within each file -- Follow the existing naming conventions for consistency \ No newline at end of file +- Use descriptive `desc` for all keymaps (shows in which-key) +- Follow the existing naming conventions for consistency diff --git a/lua/cargdev/core/keymaps/database.lua b/lua/cargdev/core/keymaps/database.lua index 91f5629..3ff5034 100644 --- a/lua/cargdev/core/keymaps/database.lua +++ b/lua/cargdev/core/keymaps/database.lua @@ -1,4 +1,5 @@ -- Database keymaps +-- Using D prefix to avoid conflicts with DAP keymaps (d) local keymap = vim.keymap -- ============================================================================= @@ -6,47 +7,47 @@ local keymap = vim.keymap -- ============================================================================= -- Toggle database UI -keymap.set("n", "du", "DBUIToggle", { desc = "Toggle Database UI" }) +keymap.set("n", "Du", "DBUIToggle", { desc = "Toggle Database UI" }) -- Add a new database connection -keymap.set("n", "da", "DBUIAddConnection", { desc = "Add DB Connection" }) +keymap.set("n", "Da", "DBUIAddConnection", { desc = "Add DB Connection" }) -- Find buffer (useful when you have multiple query buffers) -keymap.set("n", "df", "DBUIFindBuffer", { desc = "Find DB Buffer" }) +keymap.set("n", "Df", "DBUIFindBuffer", { desc = "Find DB Buffer" }) -- Execute query (works in sql buffers) -keymap.set("n", "de", "(DBUI_ExecuteQuery)", { desc = "Execute Query" }) -keymap.set("v", "de", "(DBUI_ExecuteQuery)", { desc = "Execute Selected Query" }) +keymap.set("n", "De", "(DBUI_ExecuteQuery)", { desc = "Execute Query" }) +keymap.set("v", "De", "(DBUI_ExecuteQuery)", { desc = "Execute Selected Query" }) -- Save query -keymap.set("n", "dw", "(DBUI_SaveQuery)", { desc = "Save Query" }) +keymap.set("n", "Dw", "(DBUI_SaveQuery)", { desc = "Save Query" }) -- Rename buffer -keymap.set("n", "dr", "(DBUI_RenameBuf)", { desc = "Rename DB Buffer" }) +keymap.set("n", "Dr", "(DBUI_RenameBuf)", { desc = "Rename DB Buffer" }) -- ============================================================================= -- QUICK CONNECTIONS -- ============================================================================= -- PostgreSQL Docker (default: 5432 postgres postgres postgres) -keymap.set("n", "dp", "DBPostgresDocker", { desc = "Connect PostgreSQL Docker" }) +keymap.set("n", "Dp", "DBPostgresDocker", { desc = "Connect PostgreSQL Docker" }) -- ============================================================================= -- MONGODB -- ============================================================================= -- Open MongoDB shell (local) -keymap.set("n", "dm", "MongoDB", { desc = "Open MongoDB Shell" }) +keymap.set("n", "Dm", "MongoDB", { desc = "Open MongoDB Shell" }) -- Open MongoDB in Docker container -keymap.set("n", "dM", "MongoDBDocker", { desc = "MongoDB Docker Shell" }) +keymap.set("n", "DM", "MongoDBDocker", { desc = "MongoDB Docker Shell" }) -- ============================================================================= -- REDIS -- ============================================================================= -- Open Redis CLI (local) -keymap.set("n", "di", "Redis", { desc = "Open Redis CLI" }) +keymap.set("n", "Di", "Redis", { desc = "Open Redis CLI" }) -- Open Redis in Docker container -keymap.set("n", "dI", "RedisDocker", { desc = "Redis Docker CLI" }) +keymap.set("n", "DI", "RedisDocker", { desc = "Redis Docker CLI" }) diff --git a/lua/cargdev/core/keymaps/gitconflict.lua b/lua/cargdev/core/keymaps/gitconflict.lua deleted file mode 100644 index f242a5e..0000000 --- a/lua/cargdev/core/keymaps/gitconflict.lua +++ /dev/null @@ -1,10 +0,0 @@ --- Git Conflict keymaps -local keymap = vim.keymap - -keymap.set("n", "]x", "(git-conflict-next-conflict)", { desc = "Go to next git conflict" }) -keymap.set("n", "[x", "(git-conflict-prev-conflict)", { desc = "Go to previous git conflict" }) -keymap.set("n", "gco", "(git-conflict-ours)", { desc = "Choose ours (git conflict)" }) -keymap.set("n", "gct", "(git-conflict-theirs)", { desc = "Choose theirs (git conflict)" }) -keymap.set("n", "gcb", "(git-conflict-both)", { desc = "Choose both (git conflict)" }) -keymap.set("n", "gc0", "(git-conflict-none)", { desc = "Choose none (git conflict)" }) -keymap.set("n", "gcl", "(git-conflict-list)", { desc = "List all git conflicts" }) diff --git a/lua/cargdev/core/keymaps/personal.lua b/lua/cargdev/core/keymaps/personal.lua index 83eaebf..ea23c9f 100644 --- a/lua/cargdev/core/keymaps/personal.lua +++ b/lua/cargdev/core/keymaps/personal.lua @@ -6,7 +6,7 @@ local keymap = vim.keymap -- ============================================================================= keymap.set("n", "u", function() - vim.cmd("normal! ggVG") + vim.cmd("normal! ggVG$") end, { desc = "Select the whole file" }) keymap.set("n", "4", function() -- Copy current line and paste below diff --git a/lua/cargdev/plugins/alpha.lua b/lua/cargdev/plugins/alpha.lua deleted file mode 100644 index c9076fd..0000000 --- a/lua/cargdev/plugins/alpha.lua +++ /dev/null @@ -1,50 +0,0 @@ -return { - "goolord/alpha-nvim", - event = "VimEnter", - enabled = false, -- Replaced by Snacks dashboard - config = function() - local alpha = require("alpha") - local dashboard = require("alpha.themes.dashboard") - local config = require("cargdev.core.dashboard_config") - - -- Set header from shared config - dashboard.section.header.val = config.header - - -- Set menu from shared config - dashboard.section.buttons.val = config.get_alpha_buttons(dashboard) - - -- Footer with fortune - local function center_text(text, width) - local padding = math.floor((width - #text) / 2) - return padding > 0 and string.rep(" ", padding) .. text or text - end - - local function wrap_text(text, width) - local wrapped_lines = {} - for line in text:gmatch("[^\n]+") do - while #line > width do - local cut = line:sub(1, width) - table.insert(wrapped_lines, center_text(cut, width)) - line = line:sub(width + 1) - end - table.insert(wrapped_lines, center_text(line, width)) - end - return wrapped_lines - end - - local viewport_width = 50 - local handle = io.popen("fortune") - local quote = handle and handle:read("*a") or "Code, Create, Conquer with CarGDev" - if handle then handle:close() end - local wrapped_quote = wrap_text(quote:gsub("\n", " "), viewport_width) - - dashboard.section.footer.val = { "", center_text("CarGDev - Innovating with Neovim!", viewport_width), "" } - for _, line in ipairs(wrapped_quote) do - table.insert(dashboard.section.footer.val, line) - end - - dashboard.opts.opts = { position = "center", hl = "Statement", spacing = 2 } - alpha.setup(dashboard.opts) - vim.cmd([[autocmd FileType alpha setlocal nofoldenable]]) - end, -} diff --git a/lua/cargdev/plugins/colorful-winsep.lua b/lua/cargdev/plugins/colorful-winsep.lua new file mode 100644 index 0000000..3910bcf --- /dev/null +++ b/lua/cargdev/plugins/colorful-winsep.lua @@ -0,0 +1,43 @@ +return { + "nvim-zh/colorful-winsep.nvim", + event = { "WinLeave" }, + config = function() + require("colorful-winsep").setup({ + hi = { + bg = "", + fg = "#806d9c", + }, + no_exec_files = { + "NvimTree", + "neo-tree", + "packer", + "TelescopePrompt", + "mason", + "lazy", + "CompetiTest", + "fugitive", + }, + smooth = true, + exponential_smoothing = true, + anchor = { + left = { height = 1, x = -1, y = -1 }, + right = { height = 1, x = -1, y = 0 }, + up = { width = 0, x = -1, y = 0 }, + bottom = { width = 0, x = 1, y = 0 }, + }, + symbols = { "─", "│", "┌", "┐", "└", "┘" }, + only_line_seq = true, + create_event = function() + local win_n = require("colorful-winsep.utils").calculate_number_windows() + if win_n == 2 then + local win_id = vim.fn.win_getid(vim.fn.winnr("h")) + local filetype = vim.api.nvim_buf_get_option(vim.api.nvim_win_get_buf(win_id), "filetype") + if filetype == "NvimTree" or filetype == "neo-tree" then + require("colorful-winsep").NvsepRealClose() + end + end + end, + close_event = function() end, + }) + end, +} diff --git a/lua/cargdev/plugins/crates.lua b/lua/cargdev/plugins/crates.lua new file mode 100644 index 0000000..c525c2f --- /dev/null +++ b/lua/cargdev/plugins/crates.lua @@ -0,0 +1,73 @@ +return { + "saecki/crates.nvim", + event = { "BufRead Cargo.toml" }, + dependencies = { "nvim-lua/plenary.nvim" }, + opts = { + smart_insert = true, + insert_closing_quote = true, + autoload = true, + autoupdate = true, + autoupdate_throttle = 250, + loading_indicator = true, + date_format = "%Y-%m-%d", + thousands_separator = ",", + notification_title = "crates.nvim", + curl_args = { "-sL", "--retry", "1" }, + max_parallel_requests = 80, + open_programs = { "xdg-open", "open" }, + expand_crate_moves_cursor = true, + enable_update_available_warning = true, + on_attach = function(bufnr) end, + text = { + loading = " Loading", + version = " %s", + prerelease = " %s", + yanked = " %s", + nomatch = " No match", + upgrade = " %s", + error = " Error fetching crate", + }, + highlight = { + loading = "CratesNvimLoading", + version = "CratesNvimVersion", + prerelease = "CratesNvimPreRelease", + yanked = "CratesNvimYanked", + nomatch = "CratesNvimNoMatch", + upgrade = "CratesNvimUpgrade", + error = "CratesNvimError", + }, + popup = { + autofocus = false, + hide_on_select = false, + copy_register = '"', + style = "minimal", + border = "rounded", + show_version_date = true, + show_dependency_version = true, + max_height = 30, + min_width = 20, + padding = 1, + }, + completion = { + cmp = { + enabled = true, + }, + }, + lsp = { + enabled = true, + on_attach = function(client, bufnr) end, + actions = true, + completion = true, + hover = true, + }, + }, + keys = { + { "ct", "lua require('crates').toggle()", desc = "Toggle crates" }, + { "cr", "lua require('crates').reload()", desc = "Reload crates" }, + { "cv", "lua require('crates').show_versions_popup()", desc = "Show versions" }, + { "cf", "lua require('crates').show_features_popup()", desc = "Show features" }, + { "cd", "lua require('crates').show_dependencies_popup()", desc = "Show dependencies" }, + { "cu", "lua require('crates').update_crate()", desc = "Update crate" }, + { "cU", "lua require('crates').upgrade_crate()", desc = "Upgrade crate" }, + }, +} diff --git a/lua/cargdev/plugins/dadbod.lua b/lua/cargdev/plugins/dadbod.lua index bf8f8df..cd9e968 100644 --- a/lua/cargdev/plugins/dadbod.lua +++ b/lua/cargdev/plugins/dadbod.lua @@ -1,14 +1,20 @@ return { "kristijanhusak/vim-dadbod-ui", dependencies = { - { "tpope/vim-dadbod", lazy = true }, - { "kristijanhusak/vim-dadbod-completion", ft = { "sql", "mysql", "plsql" }, lazy = true }, + { "tpope/vim-dadbod" }, -- Remove lazy = true, needs to load with UI + { "kristijanhusak/vim-dadbod-completion", ft = { "sql", "mysql", "plsql" } }, }, cmd = { "DBUI", "DBUIToggle", "DBUIAddConnection", "DBUIFindBuffer", + "DBUIRenameBuffer", + "DBUILastQueryInfo", + }, + keys = { + { "Du", "DBUIToggle", desc = "Toggle Database UI" }, + { "Da", "DBUIAddConnection", desc = "Add DB Connection" }, }, init = function() -- Database UI configuration @@ -142,12 +148,25 @@ return { vim.api.nvim_create_autocmd("FileType", { pattern = { "sql", "mysql", "plsql" }, callback = function() - require("cmp").setup.buffer({ - sources = { - { name = "vim-dadbod-completion" }, - { name = "buffer" }, - }, - }) + local ok, cmp = pcall(require, "cmp") + if ok then + cmp.setup.buffer({ + sources = { + { name = "vim-dadbod-completion" }, + { name = "buffer" }, + }, + }) + end + end, + }) + + -- Also setup completion for dbui buffers + vim.api.nvim_create_autocmd("FileType", { + pattern = { "dbui" }, + callback = function() + -- Enable line numbers in dbui + vim.opt_local.number = false + vim.opt_local.relativenumber = false end, }) end, diff --git a/lua/cargdev/plugins/dap.lua b/lua/cargdev/plugins/dap.lua index 3fe3b3b..31a44db 100644 --- a/lua/cargdev/plugins/dap.lua +++ b/lua/cargdev/plugins/dap.lua @@ -1,7 +1,8 @@ return { "mfussenegger/nvim-dap", - event = "VeryLazy", -- Changed from immediate loading to lazy loading + event = { "VeryLazy", "FileType java" }, -- Load on VeryLazy or when opening Java files cmd = { "Dap", "DapUI", "DapContinue", "DapToggleBreakpoint" }, -- Load on command + ft = { "java" }, -- Also load for Java filetype dependencies = { { "nvim-neotest/nvim-nio", lazy = false }, "rcarriga/nvim-dap-ui", diff --git a/lua/cargdev/plugins/dial.lua b/lua/cargdev/plugins/dial.lua new file mode 100644 index 0000000..87186a9 --- /dev/null +++ b/lua/cargdev/plugins/dial.lua @@ -0,0 +1,120 @@ +return { + "monaqa/dial.nvim", + keys = { + { "", function() return require("dial.map").inc_normal() end, expr = true, desc = "Increment" }, + { "", function() return require("dial.map").dec_normal() end, expr = true, desc = "Decrement" }, + { "g", function() return require("dial.map").inc_gnormal() end, expr = true, desc = "Increment (g)" }, + { "g", function() return require("dial.map").dec_gnormal() end, expr = true, desc = "Decrement (g)" }, + { "", function() return require("dial.map").inc_visual() end, mode = "v", expr = true, desc = "Increment" }, + { "", function() return require("dial.map").dec_visual() end, mode = "v", expr = true, desc = "Decrement" }, + { "g", function() return require("dial.map").inc_gvisual() end, mode = "v", expr = true, desc = "Increment (g)" }, + { "g", function() return require("dial.map").dec_gvisual() end, mode = "v", expr = true, desc = "Decrement (g)" }, + }, + config = function() + local augend = require("dial.augend") + require("dial.config").augends:register_group({ + default = { + augend.integer.alias.decimal, + augend.integer.alias.hex, + augend.integer.alias.octal, + augend.integer.alias.binary, + augend.date.alias["%Y/%m/%d"], + augend.date.alias["%Y-%m-%d"], + augend.date.alias["%m/%d/%Y"], + augend.date.alias["%d/%m/%Y"], + augend.date.alias["%H:%M:%S"], + augend.date.alias["%H:%M"], + augend.constant.alias.bool, + augend.constant.new({ + elements = { "true", "false" }, + word = true, + cyclic = true, + }), + augend.constant.new({ + elements = { "True", "False" }, + word = true, + cyclic = true, + }), + augend.constant.new({ + elements = { "yes", "no" }, + word = true, + cyclic = true, + }), + augend.constant.new({ + elements = { "Yes", "No" }, + word = true, + cyclic = true, + }), + augend.constant.new({ + elements = { "on", "off" }, + word = true, + cyclic = true, + }), + augend.constant.new({ + elements = { "enable", "disable" }, + word = true, + cyclic = true, + }), + augend.constant.new({ + elements = { "enabled", "disabled" }, + word = true, + cyclic = true, + }), + augend.constant.new({ + elements = { "public", "private", "protected" }, + word = true, + cyclic = true, + }), + augend.constant.new({ + elements = { "let", "const", "var" }, + word = true, + cyclic = true, + }), + augend.constant.new({ + elements = { "&&", "||" }, + word = false, + cyclic = true, + }), + augend.constant.new({ + elements = { "==", "!=" }, + word = false, + cyclic = true, + }), + augend.constant.new({ + elements = { "===", "!==" }, + word = false, + cyclic = true, + }), + augend.constant.new({ + elements = { ">", "<" }, + word = false, + cyclic = true, + }), + augend.constant.new({ + elements = { ">=", "<=" }, + word = false, + cyclic = true, + }), + augend.constant.new({ + elements = { "px", "em", "rem", "%" }, + word = false, + cyclic = true, + }), + augend.constant.new({ + elements = { "GET", "POST", "PUT", "PATCH", "DELETE" }, + word = true, + cyclic = true, + }), + augend.constant.new({ + elements = { "info", "warn", "error", "debug" }, + word = true, + cyclic = true, + }), + augend.hexcolor.new({ + case = "lower", + }), + augend.semver.alias.semver, + }, + }) + end, +} diff --git a/lua/cargdev/plugins/diffview.lua b/lua/cargdev/plugins/diffview.lua new file mode 100644 index 0000000..b7a6c20 --- /dev/null +++ b/lua/cargdev/plugins/diffview.lua @@ -0,0 +1,82 @@ +return { + "sindrets/diffview.nvim", + dependencies = { "nvim-lua/plenary.nvim" }, + cmd = { "DiffviewOpen", "DiffviewClose", "DiffviewToggleFiles", "DiffviewFocusFiles", "DiffviewFileHistory" }, + keys = { + { "gd", "DiffviewOpen", desc = "Diffview open" }, + { "gD", "DiffviewClose", desc = "Diffview close" }, + { "gh", "DiffviewFileHistory %", desc = "File history (current)" }, + { "gH", "DiffviewFileHistory", desc = "File history (repo)" }, + }, + opts = { + diff_binaries = false, + enhanced_diff_hl = true, + use_icons = true, + show_help_hints = true, + watch_index = true, + icons = { + folder_closed = "", + folder_open = "", + }, + signs = { + fold_closed = "", + fold_open = "", + done = "✓", + }, + view = { + default = { + layout = "diff2_horizontal", + winbar_info = false, + }, + merge_tool = { + layout = "diff3_horizontal", + disable_diagnostics = true, + winbar_info = true, + }, + file_history = { + layout = "diff2_horizontal", + winbar_info = false, + }, + }, + file_panel = { + listing_style = "tree", + tree_options = { + flatten_dirs = true, + folder_statuses = "only_folded", + }, + win_config = { + position = "left", + width = 35, + }, + }, + file_history_panel = { + log_options = { + git = { + single_file = { + diff_merges = "combined", + }, + multi_file = { + diff_merges = "first-parent", + }, + }, + }, + win_config = { + position = "bottom", + height = 16, + }, + }, + hooks = {}, + keymaps = { + view = { + { "n", "", "DiffviewToggleFiles", { desc = "Toggle file panel" } }, + { "n", "q", "DiffviewClose", { desc = "Close diffview" } }, + }, + file_panel = { + { "n", "q", "DiffviewClose", { desc = "Close diffview" } }, + }, + file_history_panel = { + { "n", "q", "DiffviewClose", { desc = "Close diffview" } }, + }, + }, + }, +} diff --git a/lua/cargdev/plugins/dropbar.lua b/lua/cargdev/plugins/dropbar.lua new file mode 100644 index 0000000..2dfa7fd --- /dev/null +++ b/lua/cargdev/plugins/dropbar.lua @@ -0,0 +1,137 @@ +return { + "Bekaboo/dropbar.nvim", + event = { "BufReadPost", "BufNewFile" }, + dependencies = { + "nvim-telescope/telescope-fzf-native.nvim", + }, + opts = { + bar = { + hover = true, + sources = function(buf, _) + local sources = require("dropbar.sources") + local utils = require("dropbar.utils") + if vim.bo[buf].ft == "markdown" then + return { sources.markdown } + end + if vim.bo[buf].buftype == "terminal" then + return { sources.terminal } + end + return { + sources.path, + utils.source.fallback({ + sources.lsp, + sources.treesitter, + }), + } + end, + padding = { + left = 1, + right = 1, + }, + pick = { + pivots = "abcdefghijklmnopqrstuvwxyz", + }, + truncate = true, + }, + icons = { + enable = true, + kinds = { + use_devicons = true, + symbols = { + Array = "󰅪 ", + Boolean = " ", + BreakStatement = "󰙧 ", + Call = "󰃷 ", + CaseStatement = "󱃙 ", + Class = " ", + Color = "󰏘 ", + Constant = "󰏿 ", + Constructor = " ", + ContinueStatement = "→ ", + Copilot = " ", + Declaration = "󰙠 ", + Delete = "󰩺 ", + DoStatement = "󰑖 ", + Enum = " ", + EnumMember = " ", + Event = " ", + Field = " ", + File = "󰈙 ", + Folder = " ", + ForStatement = "󰑖 ", + Function = "󰊕 ", + Identifier = "󰀫 ", + IfStatement = "󰇉 ", + Interface = " ", + Keyword = "󰌋 ", + List = "󰅪 ", + Log = "󰦪 ", + Lsp = " ", + Macro = "󰁌 ", + MarkdownH1 = "󰉫 ", + MarkdownH2 = "󰉬 ", + MarkdownH3 = "󰉭 ", + MarkdownH4 = "󰉮 ", + MarkdownH5 = "󰉯 ", + MarkdownH6 = "󰉰 ", + Method = "󰆧 ", + Module = "󰏗 ", + Namespace = "󰅩 ", + Null = "󰟢 ", + Number = "󰎠 ", + Object = "󰅩 ", + Operator = "󰆕 ", + Package = "󰏗 ", + Property = " ", + Reference = "󰈇 ", + Regex = " ", + Repeat = "󰑖 ", + Scope = "󰅩 ", + Snippet = " ", + Specifier = "󰦪 ", + Statement = "󰅩 ", + String = "󰉾 ", + Struct = " ", + SwitchStatement = "󰺟 ", + Text = " ", + Type = " ", + TypeParameter = "󰆩 ", + Unit = " ", + Value = "󰎠 ", + Variable = "󰀫 ", + WhileStatement = "󰑖 ", + }, + }, + ui = { + bar = { + separator = " ", + extends = "…", + }, + menu = { + separator = " ", + indicator = " ", + }, + }, + }, + menu = { + quick_navigation = true, + entry = { + padding = { + left = 1, + right = 1, + }, + }, + keymaps = { + ["q"] = "q", + [""] = "q", + }, + }, + sources = { + path = { + relative_to = function() + return vim.fn.getcwd() + end, + }, + }, + }, +} diff --git a/lua/cargdev/plugins/edgy.lua b/lua/cargdev/plugins/edgy.lua new file mode 100644 index 0000000..99f0a05 --- /dev/null +++ b/lua/cargdev/plugins/edgy.lua @@ -0,0 +1,40 @@ +return { + "folke/edgy.nvim", + event = "VeryLazy", + opts = { + left = { + { + ft = "NvimTree", + size = { width = 35 }, + }, + }, + right = { + { + ft = "Outline", + size = { width = 30 }, + }, + }, + bottom = { + { + ft = "snacks_terminal", + size = { height = 0.25 }, + }, + { + ft = "trouble", + size = { height = 0.25 }, + }, + { + ft = "qf", + size = { height = 0.2 }, + }, + }, + animate = { enabled = false }, + exit_when_last = true, + wo = { + winbar = false, + winfixwidth = true, + winfixheight = false, + signcolumn = "no", + }, + }, +} diff --git a/lua/cargdev/plugins/flash.lua b/lua/cargdev/plugins/flash.lua new file mode 100644 index 0000000..41dd61f --- /dev/null +++ b/lua/cargdev/plugins/flash.lua @@ -0,0 +1,54 @@ +return { + "folke/flash.nvim", + event = "VeryLazy", + opts = { + labels = "asdfghjklqwertyuiopzxcvbnm", + search = { + multi_window = true, + forward = true, + wrap = true, + }, + jump = { + jumplist = true, + pos = "start", + history = false, + register = false, + nohlsearch = false, + autojump = false, + }, + label = { + uppercase = false, + rainbow = { + enabled = true, + shade = 5, + }, + }, + modes = { + search = { + enabled = false, -- set to true to enable flash in search mode + }, + char = { + enabled = true, + jump_labels = true, + multi_line = false, + }, + treesitter = { + labels = "asdfghjklqwertyuiopzxcvbnm", + jump = { pos = "range" }, + search = { incremental = false }, + label = { before = true, after = true, style = "inline" }, + highlight = { + backdrop = false, + matches = false, + }, + }, + }, + }, + keys = { + { "s", mode = { "n", "x", "o" }, function() require("flash").jump() end, desc = "Flash" }, + { "S", mode = { "n", "x", "o" }, function() require("flash").treesitter() end, desc = "Flash Treesitter" }, + { "r", mode = "o", function() require("flash").remote() end, desc = "Remote Flash" }, + { "R", mode = { "o", "x" }, function() require("flash").treesitter_search() end, desc = "Treesitter Search" }, + { "", mode = { "c" }, function() require("flash").toggle() end, desc = "Toggle Flash Search" }, + }, +} diff --git a/lua/cargdev/plugins/fzf-lua.lua b/lua/cargdev/plugins/fzf-lua.lua deleted file mode 100644 index 54b711c..0000000 --- a/lua/cargdev/plugins/fzf-lua.lua +++ /dev/null @@ -1,39 +0,0 @@ -return { - "ibhagwan/fzf-lua", - dependencies = { "nvim-tree/nvim-web-devicons" }, - config = function() - local fzf = require("fzf-lua") - fzf.setup({ - "default", - winopts = { - height = 0.85, - width = 0.80, - row = 0.35, - col = 0.50, - border = "rounded", - preview = { - layout = "flex", - flip_columns = 120, - scrollbar = "float", - }, - }, - keymap = { - builtin = { - [""] = "preview-page-down", - [""] = "preview-page-up", - }, - fzf = { - ["ctrl-q"] = "select-all+accept", - }, - }, - lsp = { - async_or_timeout = 5000, - jump_to_single_result = true, - ignore_current_line = true, - }, - diagnostics = { - severity_limit = vim.diagnostic.severity.HINT, - }, - }) - end, -} diff --git a/lua/cargdev/plugins/git-blame.lua b/lua/cargdev/plugins/git-blame.lua new file mode 100644 index 0000000..93c26bb --- /dev/null +++ b/lua/cargdev/plugins/git-blame.lua @@ -0,0 +1,24 @@ +return { + "f-person/git-blame.nvim", + event = "VeryLazy", + opts = { + enabled = false, -- Start disabled, toggle with gB + message_template = " ", + date_format = "%Y-%m-%d", + virtual_text_column = 80, -- Push to column 80 to avoid overlap + highlight_group = "Comment", + set_extmark_options = { + priority = 1, -- Lower priority so diagnostics show on top + }, + display_virtual_text = true, + ignored_filetypes = { "NvimTree", "neo-tree", "lazy", "mason", "help" }, + delay = 500, + message_when_not_committed = "", + }, + keys = { + { "gB", "GitBlameToggle", desc = "Toggle git blame" }, + { "gbc", "GitBlameCopySHA", desc = "Copy commit SHA" }, + { "gbo", "GitBlameOpenCommitURL", desc = "Open commit URL" }, + { "gbf", "GitBlameOpenFileURL", desc = "Open file URL" }, + }, +} diff --git a/lua/cargdev/plugins/gitConflicts.lua b/lua/cargdev/plugins/gitConflicts.lua deleted file mode 100644 index 1d706b3..0000000 --- a/lua/cargdev/plugins/gitConflicts.lua +++ /dev/null @@ -1,13 +0,0 @@ -return { - "akinsho/git-conflict.nvim", - config = function() - require("git-conflict").setup({ - default_mappings = true, -- enable buffer local mapping created by this plugin - disable_diagnostics = true, -- This will disable diagnostics in a buffer whilst it is conflicted - highlights = { -- They must have background color, otherwise the default color will be used - incoming = "DiffText", - current = "DiffAdd", - }, - }) - end, -} diff --git a/lua/cargdev/plugins/grug-far.lua b/lua/cargdev/plugins/grug-far.lua new file mode 100644 index 0000000..bb51f66 --- /dev/null +++ b/lua/cargdev/plugins/grug-far.lua @@ -0,0 +1,55 @@ +return { + "MagicDuck/grug-far.nvim", + cmd = "GrugFar", + keys = { + { "sr", "GrugFar", desc = "Search and Replace" }, + { + "sR", + function() + require("grug-far").grug_far({ prefills = { search = vim.fn.expand("") } }) + end, + desc = "Search current word", + }, + { + "sR", + function() + require("grug-far").with_visual_selection() + end, + mode = "v", + desc = "Search selection", + }, + }, + opts = { + headerMaxWidth = 80, + icons = { + enabled = true, + actionEntryBullet = " ", + searchInput = " ", + replaceInput = " ", + filesFilterInput = " ", + flagsInput = "󰮚 ", + resultsStatusReady = "󱩊 ", + resultsStatusError = " ", + resultsStatusSuccess = "󰗡 ", + resultsActionMessage = " ", + resultsChangeIndicator = "│", + historyTitle = " ", + }, + startInInsertMode = false, + windowCreationCommand = "vsplit", + transitionDuration = 80, + keymaps = { + replace = { n = "r" }, + qflist = { n = "q" }, + syncLocations = { n = "s" }, + syncLine = { n = "l" }, + close = { n = "q" }, + historyOpen = { n = "t" }, + historyAdd = { n = "a" }, + refresh = { n = "f" }, + gotoLocation = { n = "" }, + pickHistoryEntry = { n = "" }, + abort = { n = "b" }, + }, + }, +} diff --git a/lua/cargdev/plugins/hardtime.lua b/lua/cargdev/plugins/hardtime.lua new file mode 100644 index 0000000..07d6980 --- /dev/null +++ b/lua/cargdev/plugins/hardtime.lua @@ -0,0 +1,50 @@ +return { + "m4xshen/hardtime.nvim", + dependencies = { "MunifTanjim/nui.nvim", "nvim-lua/plenary.nvim" }, + event = "VeryLazy", + opts = { + max_time = 1000, + max_count = 3, + disable_mouse = false, + hint = true, + notification = true, + allow_different_key = true, + enabled = false, -- DISABLED by default - use ht to enable + restriction_mode = "hint", -- Only show hints, never block + restricted_keys = { + ["h"] = { "n", "x" }, + ["j"] = { "n", "x" }, + ["k"] = { "n", "x" }, + ["l"] = { "n", "x" }, + }, + disabled_keys = {}, -- Don't disable any keys + disabled_filetypes = { + "NvimTree", + "neo-tree", + "lazy", + "mason", + "qf", + "netrw", + "help", + "oil", + "Trouble", + "trouble", + "spectre_panel", + "toggleterm", + "TelescopePrompt", + "snacks_input", + "noice", + "DressingInput", + "prompt", + }, + disabled_buftypes = { + "nofile", + "prompt", + "popup", + "terminal", + }, + }, + keys = { + { "ht", "Hardtime toggle", desc = "Toggle Hardtime" }, + }, +} diff --git a/lua/cargdev/plugins/harpoon.lua b/lua/cargdev/plugins/harpoon.lua new file mode 100644 index 0000000..18e8522 --- /dev/null +++ b/lua/cargdev/plugins/harpoon.lua @@ -0,0 +1,33 @@ +return { + "ThePrimeagen/harpoon", + branch = "harpoon2", + dependencies = { "nvim-lua/plenary.nvim" }, + config = function() + local harpoon = require("harpoon") + + harpoon:setup({ + settings = { + save_on_toggle = true, + sync_on_ui_close = true, + key = function() + return vim.loop.cwd() + end, + }, + }) + + -- Keymaps + vim.keymap.set("n", "ha", function() harpoon:list():add() end, { desc = "Harpoon add file" }) + vim.keymap.set("n", "hh", function() harpoon.ui:toggle_quick_menu(harpoon:list()) end, { desc = "Harpoon menu" }) + + -- Quick navigation to harpooned files + vim.keymap.set("n", "1", function() harpoon:list():select(1) end, { desc = "Harpoon file 1" }) + vim.keymap.set("n", "2", function() harpoon:list():select(2) end, { desc = "Harpoon file 2" }) + vim.keymap.set("n", "3", function() harpoon:list():select(3) end, { desc = "Harpoon file 3" }) + vim.keymap.set("n", "4", function() harpoon:list():select(4) end, { desc = "Harpoon file 4" }) + vim.keymap.set("n", "5", function() harpoon:list():select(5) end, { desc = "Harpoon file 5" }) + + -- Navigate between harpooned files + vim.keymap.set("n", "hp", function() harpoon:list():prev() end, { desc = "Harpoon prev" }) + vim.keymap.set("n", "hn", function() harpoon:list():next() end, { desc = "Harpoon next" }) + end, +} diff --git a/lua/cargdev/plugins/hlchunk.lua b/lua/cargdev/plugins/hlchunk.lua new file mode 100644 index 0000000..484cddf --- /dev/null +++ b/lua/cargdev/plugins/hlchunk.lua @@ -0,0 +1,50 @@ +return { + "shellRaining/hlchunk.nvim", + event = { "BufReadPre", "BufNewFile" }, + config = function() + require("hlchunk").setup({ + chunk = { + enable = true, + priority = 15, + style = { + { fg = "#806d9c" }, + { fg = "#c21f30" }, + }, + use_treesitter = true, + chars = { + horizontal_line = "─", + vertical_line = "│", + left_top = "╭", + left_bottom = "╰", + right_arrow = ">", + }, + textobject = "", + max_file_size = 1024 * 1024, + error_sign = true, + duration = 200, + delay = 300, + }, + indent = { + enable = true, + priority = 10, + style = { { fg = vim.fn.synIDattr(vim.fn.synIDtrans(vim.fn.hlID("Whitespace")), "fg", "gui") } }, + use_treesitter = false, + chars = { "│" }, + ahead_lines = 5, + delay = 100, + }, + line_num = { + enable = true, + priority = 10, + style = "#806d9c", + use_treesitter = false, + }, + blank = { + enable = false, + priority = 9, + chars = { "․" }, + style = { { bg = "cursorline" }, { bg = "", fg = "" } }, + }, + }) + end, +} diff --git a/lua/cargdev/plugins/inc-rename.lua b/lua/cargdev/plugins/inc-rename.lua new file mode 100644 index 0000000..698d4fb --- /dev/null +++ b/lua/cargdev/plugins/inc-rename.lua @@ -0,0 +1,23 @@ +return { + "smjonas/inc-rename.nvim", + cmd = "IncRename", + keys = { + { + "rn", + function() + return ":IncRename " .. vim.fn.expand("") + end, + expr = true, + desc = "Incremental rename", + }, + }, + opts = { + cmd_name = "IncRename", + hl_group = "Substitute", + preview_empty_name = false, + show_message = true, + save_in_cmdline_history = true, + input_buffer_type = nil, + post_hook = nil, + }, +} diff --git a/lua/cargdev/plugins/kulala.lua b/lua/cargdev/plugins/kulala.lua new file mode 100644 index 0000000..5af2c33 --- /dev/null +++ b/lua/cargdev/plugins/kulala.lua @@ -0,0 +1,25 @@ +return { + "mistweaverco/kulala.nvim", + ft = "http", + keys = { + { "kr", "lua require('kulala').run()", desc = "Run HTTP request" }, + { "ka", "lua require('kulala').run_all()", desc = "Run all requests" }, + { "kp", "lua require('kulala').jump_prev()", desc = "Previous request" }, + { "kn", "lua require('kulala').jump_next()", desc = "Next request" }, + { "ki", "lua require('kulala').inspect()", desc = "Inspect request" }, + { "kt", "lua require('kulala').toggle_view()", desc = "Toggle headers/body" }, + { "kc", "lua require('kulala').copy()", desc = "Copy as cURL" }, + { "ke", "lua require('kulala').set_selected_env()", desc = "Set environment" }, + }, + opts = { + default_view = "body", + split_direction = "vertical", + icons = { + inlay = { + loading = "⏳", + done = "✅", + error = "❌", + }, + }, + }, +} diff --git a/lua/cargdev/plugins/lsp/lspconfig.lua b/lua/cargdev/plugins/lsp/lspconfig.lua index 7f9287b..f408fe0 100644 --- a/lua/cargdev/plugins/lsp/lspconfig.lua +++ b/lua/cargdev/plugins/lsp/lspconfig.lua @@ -35,34 +35,14 @@ return { local capabilities = cmp_nvim_lsp.default_capabilities() -- Enhanced error handling for LSP diagnostics + -- NOTE: tiny-inline-diagnostic handles the display, so we disable virtual_text and float here vim.diagnostic.config({ - signs = { - severity = { - min = vim.diagnostic.severity.WARN, - }, - icons = { - Error = " ", - Warn = " ", - Hint = "󰠠 ", - Info = " ", - }, - }, - -- Performance optimizations - update_in_insert = false, -- Don't update diagnostics in insert mode - virtual_text = false, -- Disable virtual text for better performance - underline = true, -- Keep underline for errors - severity_sort = true, -- Sort diagnostics by severity - -- Error handling - float = { - border = "rounded", - source = "always", - format = function(diagnostic) - if diagnostic.source == "LSP" then - return string.format("%s [%s]", diagnostic.message, diagnostic.source) - end - return diagnostic.message - end, - }, + signs = true, + update_in_insert = false, + virtual_text = false, + underline = true, + severity_sort = true, + float = false, -- Disabled - use sl for manual diagnostic float }) -- Only attach to sensible buffers diff --git a/lua/cargdev/plugins/lspsaga.lua b/lua/cargdev/plugins/lspsaga.lua new file mode 100644 index 0000000..dcb1d0a --- /dev/null +++ b/lua/cargdev/plugins/lspsaga.lua @@ -0,0 +1,176 @@ +return { + "nvimdev/lspsaga.nvim", + dependencies = { + "nvim-treesitter/nvim-treesitter", + "nvim-tree/nvim-web-devicons", + }, + event = "LspAttach", + opts = { + ui = { + border = "rounded", + devicon = true, + title = true, + expand = "", + collapse = "", + code_action = "💡", + actionfix = " ", + lines = { "┗", "┣", "┃", "━", "┏" }, + kind = nil, + imp_sign = "󰳛 ", + }, + hover = { + max_width = 0.9, + max_height = 0.8, + open_link = "gx", + open_cmd = "!open", + }, + diagnostic = { + show_code_action = false, + show_layout = "float", + show_normal_height = 10, + jump_num_shortcut = true, + max_width = 0.8, + max_height = 0.6, + max_show_width = 0.9, + max_show_height = 0.6, + text_hl_follow = false, + border_follow = true, + extend_relatedInformation = false, + diagnostic_only_current = true, + keys = { + exec_action = "o", + quit = "q", + toggle_or_jump = "", + quit_in_show = { "q", "" }, + }, + }, + code_action = { + num_shortcut = true, + show_server_name = true, + extend_gitsigns = true, + only_in_cursor = true, + max_height = 0.3, + keys = { + quit = "q", + exec = "", + }, + }, + lightbulb = { + enable = false, -- Using nvim-lightbulb instead + sign = false, + virtual_text = false, + }, + scroll_preview = { + scroll_down = "", + scroll_up = "", + }, + finder = { + max_height = 0.5, + left_width = 0.3, + right_width = 0.5, + methods = {}, + default = "ref+imp", + layout = "float", + silent = false, + filter = {}, + keys = { + shuttle = "[w", + toggle_or_open = "o", + vsplit = "s", + split = "i", + tabe = "t", + tabnew = "r", + quit = "q", + close = "", + }, + }, + definition = { + width = 0.6, + height = 0.5, + keys = { + edit = "o", + vsplit = "v", + split = "i", + tabe = "t", + quit = "q", + close = "", + }, + }, + rename = { + in_select = true, + auto_save = false, + project_max_width = 0.5, + project_max_height = 0.5, + keys = { + quit = "", + exec = "", + select = "x", + }, + }, + symbol_in_winbar = { + enable = false, -- Using dropbar instead + separator = " › ", + hide_keyword = true, + show_file = true, + folder_level = 1, + color_mode = true, + }, + outline = { + win_position = "right", + win_width = 30, + auto_preview = true, + detail = true, + auto_close = true, + close_after_jump = false, + layout = "normal", + max_height = 0.5, + left_width = 0.3, + keys = { + toggle_or_jump = "o", + quit = "q", + jump = "e", + }, + }, + callhierarchy = { + layout = "float", + keys = { + edit = "e", + vsplit = "s", + split = "i", + tabe = "t", + quit = "q", + shuttle = "[w", + toggle_or_req = "u", + close = "", + }, + }, + implement = { + enable = true, + sign = true, + virtual_text = true, + }, + beacon = { + enable = true, + frequency = 7, + }, + }, + keys = { + { "gh", "Lspsaga finder", desc = "LSP Finder" }, + { "ca", "Lspsaga code_action", mode = { "n", "v" }, desc = "Code action" }, + { "gr", "Lspsaga rename", desc = "Rename" }, + { "gR", "Lspsaga rename ++project", desc = "Rename (project)" }, + { "gd", "Lspsaga peek_definition", desc = "Peek definition" }, + { "gD", "Lspsaga goto_definition", desc = "Goto definition" }, + { "gt", "Lspsaga peek_type_definition", desc = "Peek type definition" }, + { "gT", "Lspsaga goto_type_definition", desc = "Goto type definition" }, + { "sl", "Lspsaga show_line_diagnostics", desc = "Line diagnostics" }, + { "sc", "Lspsaga show_cursor_diagnostics", desc = "Cursor diagnostics" }, + { "sb", "Lspsaga show_buf_diagnostics", desc = "Buffer diagnostics" }, + { "[d", "Lspsaga diagnostic_jump_prev", desc = "Prev diagnostic" }, + { "]d", "Lspsaga diagnostic_jump_next", desc = "Next diagnostic" }, + { "K", "Lspsaga hover_doc", desc = "Hover doc" }, + { "ci", "Lspsaga incoming_calls", desc = "Incoming calls" }, + { "co", "Lspsaga outgoing_calls", desc = "Outgoing calls" }, + { "so", "Lspsaga outline", desc = "Toggle outline" }, + }, +} diff --git a/lua/cargdev/plugins/marks.lua b/lua/cargdev/plugins/marks.lua new file mode 100644 index 0000000..d39a7d4 --- /dev/null +++ b/lua/cargdev/plugins/marks.lua @@ -0,0 +1,19 @@ +return { + "chentoast/marks.nvim", + event = "VeryLazy", + opts = { + default_mappings = true, + builtin_marks = { ".", "<", ">", "^" }, + cyclic = true, + force_write_shada = false, + refresh_interval = 250, + sign_priority = { lower = 10, upper = 15, builtin = 8, bookmark = 20 }, + excluded_filetypes = { "NvimTree", "neo-tree", "lazy", "mason", "help" }, + bookmark_0 = { + sign = "⚑", + virt_text = "bookmark", + annotate = false, + }, + mappings = {}, + }, +} diff --git a/lua/cargdev/plugins/mini-animate.lua b/lua/cargdev/plugins/mini-animate.lua new file mode 100644 index 0000000..6ecd367 --- /dev/null +++ b/lua/cargdev/plugins/mini-animate.lua @@ -0,0 +1,33 @@ +return { + "echasnovski/mini.animate", + event = "VeryLazy", + opts = function() + local animate = require("mini.animate") + return { + cursor = { + enable = true, + timing = animate.gen_timing.linear({ duration = 80, unit = "total" }), + }, + scroll = { + enable = true, + timing = animate.gen_timing.linear({ duration = 100, unit = "total" }), + }, + resize = { + enable = true, + timing = animate.gen_timing.linear({ duration = 80, unit = "total" }), + }, + open = { + enable = true, + timing = animate.gen_timing.linear({ duration = 80, unit = "total" }), + winconfig = animate.gen_winconfig.wipe({ direction = "from_edge" }), + winblend = animate.gen_winblend.linear({ from = 80, to = 100 }), + }, + close = { + enable = true, + timing = animate.gen_timing.linear({ duration = 80, unit = "total" }), + winconfig = animate.gen_winconfig.wipe({ direction = "to_edge" }), + winblend = animate.gen_winblend.linear({ from = 100, to = 80 }), + }, + } + end, +} diff --git a/lua/cargdev/plugins/modicator.lua b/lua/cargdev/plugins/modicator.lua new file mode 100644 index 0000000..1e916f3 --- /dev/null +++ b/lua/cargdev/plugins/modicator.lua @@ -0,0 +1,23 @@ +return { + "mawkler/modicator.nvim", + event = "VeryLazy", + init = function() + vim.o.cursorline = true + vim.o.number = true + end, + opts = { + show_warnings = false, + highlights = { + defaults = { + bold = true, + }, + }, + integration = { + lualine = { + enabled = true, + mode_section = nil, + highlight = "bg", + }, + }, + }, +} diff --git a/lua/cargdev/plugins/navbuddy.lua b/lua/cargdev/plugins/navbuddy.lua new file mode 100644 index 0000000..59b7c12 --- /dev/null +++ b/lua/cargdev/plugins/navbuddy.lua @@ -0,0 +1,67 @@ +return { + "SmiteshP/nvim-navbuddy", + dependencies = { + "SmiteshP/nvim-navic", + "MunifTanjim/nui.nvim", + }, + keys = { + { "nb", "Navbuddy", desc = "Navbuddy" }, + }, + opts = { + window = { + border = "rounded", + size = "80%", + position = "50%", + sections = { + left = { size = "20%" }, + mid = { size = "40%" }, + right = { preview = "leaf" }, + }, + }, + node_markers = { + enabled = true, + icons = { + leaf = " ", + leaf_selected = " → ", + branch = " ", + }, + }, + icons = { + File = "󰈔 ", + Module = "󰆧 ", + Namespace = "󰅪 ", + Package = "󰏗 ", + Class = " ", + Method = "󰆧 ", + Property = " ", + Field = " ", + Constructor = " ", + Enum = " ", + Interface = " ", + Function = "󰊕 ", + Variable = "󰀫 ", + Constant = "󰏿 ", + String = "󰉾 ", + Number = "󰎠 ", + Boolean = " ", + Array = "󰅪 ", + Object = "󰅩 ", + Key = "󰌋 ", + Null = "󰟢 ", + EnumMember = " ", + Struct = " ", + Event = " ", + Operator = "󰆕 ", + TypeParameter = "󰊄 ", + }, + use_default_mappings = true, + lsp = { + auto_attach = true, + }, + source_buffer = { + follow_node = true, + highlight = true, + reorient = "smart", + }, + }, +} diff --git a/lua/cargdev/plugins/neogit.lua b/lua/cargdev/plugins/neogit.lua new file mode 100644 index 0000000..cbf7cd4 --- /dev/null +++ b/lua/cargdev/plugins/neogit.lua @@ -0,0 +1,84 @@ +return { + "NeogitOrg/neogit", + dependencies = { + "nvim-lua/plenary.nvim", + "sindrets/diffview.nvim", + "nvim-telescope/telescope.nvim", + }, + cmd = "Neogit", + keys = { + { "gn", "Neogit", desc = "Neogit" }, + { "gnc", "Neogit commit", desc = "Neogit commit" }, + { "gnp", "Neogit push", desc = "Neogit push" }, + { "gnl", "Neogit pull", desc = "Neogit pull" }, + { "gnb", "Neogit branch", desc = "Neogit branch" }, + }, + opts = { + disable_hint = false, + disable_context_highlighting = false, + disable_signs = false, + graph_style = "unicode", + git_services = { + ["github.com"] = "https://github.com/${owner}/${repository}/compare/${branch_name}?expand=1", + ["bitbucket.org"] = "https://bitbucket.org/${owner}/${repository}/pull-requests/new?source=${branch_name}&t=1", + ["gitlab.com"] = "https://gitlab.com/${owner}/${repository}/merge_requests/new?merge_request[source_branch]=${branch_name}", + }, + integrations = { + telescope = true, + diffview = true, + }, + sections = { + untracked = { + folded = false, + hidden = false, + }, + unstaged = { + folded = false, + hidden = false, + }, + staged = { + folded = false, + hidden = false, + }, + stashes = { + folded = true, + hidden = false, + }, + unpulled_upstream = { + folded = true, + hidden = false, + }, + unmerged_upstream = { + folded = false, + hidden = false, + }, + unpulled_pushRemote = { + folded = true, + hidden = false, + }, + unmerged_pushRemote = { + folded = false, + hidden = false, + }, + recent = { + folded = true, + hidden = false, + }, + rebase = { + folded = true, + hidden = false, + }, + }, + mappings = { + status = { + ["q"] = "Close", + [""] = "Close", + }, + }, + signs = { + hunk = { "", "" }, + item = { "", "" }, + section = { "", "" }, + }, + }, +} diff --git a/lua/cargdev/plugins/nvim-highlight-colors.lua b/lua/cargdev/plugins/nvim-highlight-colors.lua new file mode 100644 index 0000000..0a85609 --- /dev/null +++ b/lua/cargdev/plugins/nvim-highlight-colors.lua @@ -0,0 +1,21 @@ +return { + "brenoprata10/nvim-highlight-colors", + event = { "BufReadPre", "BufNewFile" }, + opts = { + render = "background", + virtual_symbol = "■", + virtual_symbol_prefix = "", + virtual_symbol_suffix = " ", + virtual_symbol_position = "inline", + enable_hex = true, + enable_short_hex = true, + enable_rgb = true, + enable_hsl = true, + enable_var_usage = true, + enable_named_colors = true, + enable_tailwind = true, + custom_colors = {}, + exclude_filetypes = {}, + exclude_buftypes = {}, + }, +} diff --git a/lua/cargdev/plugins/nvim-jdtls.lua b/lua/cargdev/plugins/nvim-jdtls.lua index a3f3896..4dda888 100644 --- a/lua/cargdev/plugins/nvim-jdtls.lua +++ b/lua/cargdev/plugins/nvim-jdtls.lua @@ -1,3 +1,7 @@ return { - 'mfussenegger/nvim-jdtls', + "mfussenegger/nvim-jdtls", + ft = "java", + dependencies = { + "mfussenegger/nvim-dap", + }, } diff --git a/lua/cargdev/plugins/nvim-lightbulb.lua b/lua/cargdev/plugins/nvim-lightbulb.lua new file mode 100644 index 0000000..87c4754 --- /dev/null +++ b/lua/cargdev/plugins/nvim-lightbulb.lua @@ -0,0 +1,54 @@ +return { + "kosayoda/nvim-lightbulb", + event = "LspAttach", + opts = { + priority = 10, + hide_in_unfocused_buffer = true, + link_highlights = true, + validate_config = "auto", + action_kinds = nil, + sign = { + enabled = true, + text = "💡", + hl = "LightBulbSign", + }, + virtual_text = { + enabled = false, + text = "💡", + pos = "eol", + hl = "LightBulbVirtualText", + hl_mode = "combine", + }, + float = { + enabled = false, + text = "💡", + hl = "LightBulbFloatWin", + win_opts = { + focusable = false, + }, + }, + status_text = { + enabled = false, + text = "💡", + text_unavailable = "", + }, + number = { + enabled = false, + hl = "LightBulbNumber", + }, + line = { + enabled = false, + hl = "LightBulbLine", + }, + autocmd = { + enabled = true, + updatetime = 200, + events = { "CursorHold", "CursorHoldI" }, + pattern = { "*" }, + }, + ignore = { + clients = {}, + actions_without_kind = false, + }, + }, +} diff --git a/lua/cargdev/plugins/nvim-tree.lua b/lua/cargdev/plugins/nvim-tree.lua index dcb5360..4a83a99 100644 --- a/lua/cargdev/plugins/nvim-tree.lua +++ b/lua/cargdev/plugins/nvim-tree.lua @@ -19,6 +19,7 @@ return { nvimtree.setup({ view = { width = 35, + side = "left", relativenumber = true, }, -- change folder arrow icons diff --git a/lua/cargdev/plugins/nvim-ts-autotag.lua b/lua/cargdev/plugins/nvim-ts-autotag.lua new file mode 100644 index 0000000..c6eae42 --- /dev/null +++ b/lua/cargdev/plugins/nvim-ts-autotag.lua @@ -0,0 +1,16 @@ +return { + "windwp/nvim-ts-autotag", + event = { "BufReadPre", "BufNewFile" }, + opts = { + opts = { + enable_close = true, + enable_rename = true, + enable_close_on_slash = true, + }, + per_filetype = { + ["html"] = { + enable_close = true, + }, + }, + }, +} diff --git a/lua/cargdev/plugins/octo.lua b/lua/cargdev/plugins/octo.lua new file mode 100644 index 0000000..56dc705 --- /dev/null +++ b/lua/cargdev/plugins/octo.lua @@ -0,0 +1,69 @@ +return { + "pwntester/octo.nvim", + dependencies = { + "nvim-lua/plenary.nvim", + "nvim-telescope/telescope.nvim", + "nvim-tree/nvim-web-devicons", + }, + cmd = "Octo", + keys = { + { "oi", "Octo issue list", desc = "List issues" }, + { "oI", "Octo issue create", desc = "Create issue" }, + { "op", "Octo pr list", desc = "List PRs" }, + { "oP", "Octo pr create", desc = "Create PR" }, + { "or", "Octo repo list", desc = "List repos" }, + { "os", "Octo search", desc = "Search issues/PRs" }, + { "oa", "Octo actions", desc = "Octo actions" }, + }, + opts = { + use_local_fs = false, + enable_builtin = true, + default_remote = { "upstream", "origin" }, + ssh_aliases = {}, + picker = "telescope", + picker_config = { + use_emojis = true, + mappings = { + open_in_browser = { lhs = "", desc = "open in browser" }, + copy_url = { lhs = "", desc = "copy url to clipboard" }, + checkout_pr = { lhs = "", desc = "checkout PR" }, + merge_pr = { lhs = "", desc = "merge PR" }, + }, + }, + comment_icon = "", + outdated_icon = "󰅒 ", + resolved_icon = " ", + reaction_viewer_hint_icon = " ", + user_icon = " ", + timeline_marker = " ", + timeline_indent = "2", + right_bubble_delimiter = "", + left_bubble_delimiter = "", + github_hostname = "", + snippet_context_lines = 4, + gh_env = {}, + timeout = 5000, + default_to_projects_v2 = false, + ui = { + use_signcolumn = true, + }, + issues = { + order_by = { + field = "CREATED_AT", + direction = "DESC", + }, + }, + pull_requests = { + order_by = { + field = "CREATED_AT", + direction = "DESC", + }, + always_select_remote_on_create = false, + }, + file_panel = { + size = 10, + use_icons = true, + }, + mappings = {}, + }, +} diff --git a/lua/cargdev/plugins/outline.lua b/lua/cargdev/plugins/outline.lua new file mode 100644 index 0000000..a64600e --- /dev/null +++ b/lua/cargdev/plugins/outline.lua @@ -0,0 +1,129 @@ +return { + "hedyhli/outline.nvim", + cmd = { "Outline", "OutlineOpen" }, + keys = { + { "cs", "Outline", desc = "Toggle symbol Outline" }, + }, + opts = { + outline_window = { + position = "right", + split_command = nil, + width = 25, + relative_width = true, + auto_close = false, + auto_jump = false, + jump_highlight_duration = 300, + center_on_jump = true, + show_numbers = false, + show_relative_numbers = false, + wrap = false, + show_cursorline = true, + hide_cursor = false, + focus_on_open = true, + winhl = "", + }, + outline_items = { + show_symbol_details = true, + show_symbol_lineno = false, + highlight_hovered_item = true, + auto_set_cursor = true, + auto_update_events = { + follow = { "CursorMoved" }, + items = { "InsertLeave", "WinEnter", "BufEnter", "BufWinEnter", "TabEnter", "BufWritePost" }, + }, + }, + guides = { + enabled = true, + markers = { + bottom = "└", + middle = "├", + vertical = "│", + }, + }, + symbol_folding = { + autofold_depth = 1, + auto_unfold = { + hovered = true, + only = true, + }, + markers = { "", "" }, + }, + preview_window = { + auto_preview = false, + open_hover_on_preview = false, + width = 50, + min_width = 50, + relative_width = true, + border = "rounded", + winhl = "NormalFloat:", + winblend = 0, + live = false, + }, + keymaps = { + show_help = "?", + close = { "", "q" }, + goto_location = "", + peek_location = "o", + goto_and_close = "", + restore_location = "", + hover_symbol = "", + toggle_preview = "K", + rename_symbol = "r", + code_actions = "a", + fold = "h", + unfold = "l", + fold_toggle = "", + fold_toggle_all = "", + fold_all = "W", + unfold_all = "E", + fold_reset = "R", + down_and_jump = "", + up_and_jump = "", + }, + providers = { + priority = { "lsp", "coc", "markdown", "norg" }, + lsp = { + blacklist_clients = {}, + }, + }, + symbols = { + filter = nil, + icon_fetcher = nil, + icon_source = nil, + icons = { + File = { icon = "󰈔", hl = "Identifier" }, + Module = { icon = "󰆧", hl = "Include" }, + Namespace = { icon = "󰅪", hl = "Include" }, + Package = { icon = "󰏗", hl = "Include" }, + Class = { icon = "", hl = "Type" }, + Method = { icon = "ƒ", hl = "Function" }, + Property = { icon = "", hl = "Identifier" }, + Field = { icon = "󰆨", hl = "Identifier" }, + Constructor = { icon = "", hl = "Special" }, + Enum = { icon = "", hl = "Type" }, + Interface = { icon = "", hl = "Type" }, + Function = { icon = "󰊕", hl = "Function" }, + Variable = { icon = "", hl = "Constant" }, + Constant = { icon = "", hl = "Constant" }, + String = { icon = "", hl = "String" }, + Number = { icon = "#", hl = "Number" }, + Boolean = { icon = "⊨", hl = "Boolean" }, + Array = { icon = "󰅪", hl = "Constant" }, + Object = { icon = "", hl = "Type" }, + Key = { icon = "󰌆", hl = "Type" }, + Null = { icon = "NULL", hl = "Type" }, + EnumMember = { icon = "", hl = "Identifier" }, + Struct = { icon = "", hl = "Structure" }, + Event = { icon = "", hl = "Type" }, + Operator = { icon = "+", hl = "Identifier" }, + TypeParameter = { icon = "", hl = "Identifier" }, + Component = { icon = "󰅴", hl = "Function" }, + Fragment = { icon = "󰅴", hl = "Constant" }, + TypeAlias = { icon = " ", hl = "Type" }, + Parameter = { icon = " ", hl = "Identifier" }, + StaticMethod = { icon = " ", hl = "Function" }, + Macro = { icon = " ", hl = "Function" }, + }, + }, + }, +} diff --git a/lua/cargdev/plugins/overseer.lua b/lua/cargdev/plugins/overseer.lua new file mode 100644 index 0000000..896525b --- /dev/null +++ b/lua/cargdev/plugins/overseer.lua @@ -0,0 +1,227 @@ +return { + "stevearc/overseer.nvim", + cmd = { + "OverseerRun", + "OverseerToggle", + "OverseerOpen", + "OverseerClose", + "OverseerBuild", + "OverseerTaskAction", + "OverseerQuickAction", + }, + keys = { + { "or", "OverseerRun", desc = "Run task" }, + { "ot", "OverseerToggle", desc = "Toggle task list" }, + { "oa", "OverseerTaskAction", desc = "Task action" }, + { "oq", "OverseerQuickAction", desc = "Quick action" }, + { "ob", "OverseerBuild", desc = "Build" }, + { "oc", "OverseerRunCmd", desc = "Run shell command" }, + }, + opts = { + strategy = "terminal", + templates = { "builtin" }, + auto_detect_success_color = true, + dap = true, + task_list = { + default_detail = 1, + max_width = { 100, 0.2 }, + min_width = { 40, 0.1 }, + width = nil, + max_height = { 20, 0.1 }, + min_height = 8, + height = nil, + separator = "────────────────────────────────────────", + direction = "bottom", + bindings = { + ["?"] = "ShowHelp", + ["g?"] = "ShowHelp", + [""] = "RunAction", + [""] = "Edit", + ["o"] = "Open", + [""] = "OpenVsplit", + [""] = "OpenSplit", + [""] = "OpenFloat", + [""] = "OpenQuickFix", + ["p"] = "TogglePreview", + [""] = "IncreaseDetail", + [""] = "DecreaseDetail", + ["L"] = "IncreaseAllDetail", + ["H"] = "DecreaseAllDetail", + ["["] = "DecreaseWidth", + ["]"] = "IncreaseWidth", + ["{"] = "PrevTask", + ["}"] = "NextTask", + [""] = "ScrollOutputUp", + [""] = "ScrollOutputDown", + ["q"] = "Close", + }, + }, + form = { + border = "rounded", + zindex = 40, + min_width = 80, + max_width = 0.9, + width = nil, + min_height = 10, + max_height = 0.9, + height = nil, + win_opts = { + winblend = 0, + }, + }, + task_launcher = { + bindings = { + i = { + [""] = "Submit", + [""] = "Cancel", + }, + n = { + [""] = "Submit", + [""] = "Submit", + ["q"] = "Cancel", + ["?"] = "ShowHelp", + }, + }, + }, + task_editor = { + bindings = { + i = { + [""] = "NextOrSubmit", + [""] = "Submit", + [""] = "Next", + [""] = "Prev", + [""] = "Cancel", + }, + n = { + [""] = "NextOrSubmit", + [""] = "Submit", + [""] = "Next", + [""] = "Prev", + ["q"] = "Cancel", + ["?"] = "ShowHelp", + }, + }, + }, + component_aliases = { + default = { + { "display_duration", detail_level = 2 }, + "on_output_summarize", + "on_exit_set_status", + "on_complete_notify", + "on_complete_dispose", + }, + default_neotest = { + "unique", + { "on_complete_notify", system = "unfocused" }, + "default", + }, + }, + bundles = { + save_task_opts = { + bundleable = true, + }, + }, + preload_components = {}, + default_template_prompt = "allow", + log = { + { + type = "echo", + level = vim.log.levels.WARN, + }, + { + type = "file", + filename = "overseer.log", + level = vim.log.levels.WARN, + }, + }, + }, + config = function(_, opts) + local overseer = require("overseer") + overseer.setup(opts) + + -- Custom templates for common tasks + overseer.register_template({ + name = "npm run dev", + builder = function() + return { + cmd = { "npm" }, + args = { "run", "dev" }, + name = "npm dev", + } + end, + condition = { + filetype = { "javascript", "typescript", "typescriptreact", "javascriptreact" }, + }, + }) + + overseer.register_template({ + name = "npm run build", + builder = function() + return { + cmd = { "npm" }, + args = { "run", "build" }, + name = "npm build", + } + end, + condition = { + filetype = { "javascript", "typescript", "typescriptreact", "javascriptreact" }, + }, + }) + + overseer.register_template({ + name = "npm test", + builder = function() + return { + cmd = { "npm" }, + args = { "test" }, + name = "npm test", + } + end, + condition = { + filetype = { "javascript", "typescript", "typescriptreact", "javascriptreact" }, + }, + }) + + overseer.register_template({ + name = "Python run file", + builder = function() + return { + cmd = { "python3" }, + args = { vim.fn.expand("%:p") }, + name = "python " .. vim.fn.expand("%:t"), + } + end, + condition = { + filetype = { "python" }, + }, + }) + + overseer.register_template({ + name = "Flutter run", + builder = function() + return { + cmd = { "flutter" }, + args = { "run" }, + name = "flutter run", + } + end, + condition = { + filetype = { "dart" }, + }, + }) + + overseer.register_template({ + name = "Go run", + builder = function() + return { + cmd = { "go" }, + args = { "run", "." }, + name = "go run", + } + end, + condition = { + filetype = { "go" }, + }, + }) + end, +} diff --git a/lua/cargdev/plugins/package-info.lua b/lua/cargdev/plugins/package-info.lua new file mode 100644 index 0000000..1518e8b --- /dev/null +++ b/lua/cargdev/plugins/package-info.lua @@ -0,0 +1,30 @@ +return { + "vuki656/package-info.nvim", + dependencies = { "MunifTanjim/nui.nvim" }, + ft = "json", + opts = { + colors = { + up_to_date = "#3C4048", + outdated = "#d19a66", + }, + icons = { + enable = true, + style = { + up_to_date = "| ", + outdated = "| ", + }, + }, + autostart = true, + hide_up_to_date = false, + hide_unstable_versions = false, + package_manager = "npm", + }, + keys = { + { "ns", "lua require('package-info').show()", desc = "Show package info" }, + { "nh", "lua require('package-info').hide()", desc = "Hide package info" }, + { "nu", "lua require('package-info').update()", desc = "Update package" }, + { "nd", "lua require('package-info').delete()", desc = "Delete package" }, + { "ni", "lua require('package-info').install()", desc = "Install package" }, + { "nc", "lua require('package-info').change_version()", desc = "Change version" }, + }, +} diff --git a/lua/cargdev/plugins/persistence.lua b/lua/cargdev/plugins/persistence.lua new file mode 100644 index 0000000..0f2c9af --- /dev/null +++ b/lua/cargdev/plugins/persistence.lua @@ -0,0 +1,15 @@ +return { + "folke/persistence.nvim", + event = "BufReadPre", + opts = { + dir = vim.fn.expand(vim.fn.stdpath("state") .. "/sessions/"), + options = { "buffers", "curdir", "tabpages", "winsize", "help", "globals", "skiprtp" }, + pre_save = nil, + save_empty = false, + }, + keys = { + { "qs", function() require("persistence").load() end, desc = "Restore session" }, + { "ql", function() require("persistence").load({ last = true }) end, desc = "Restore last session" }, + { "qd", function() require("persistence").stop() end, desc = "Don't save session" }, + }, +} diff --git a/lua/cargdev/plugins/portal.lua b/lua/cargdev/plugins/portal.lua new file mode 100644 index 0000000..a5e5024 --- /dev/null +++ b/lua/cargdev/plugins/portal.lua @@ -0,0 +1,25 @@ +return { + "cbochs/portal.nvim", + dependencies = { "cbochs/grapple.nvim" }, + keys = { + { "pj", "Portal jumplist backward", desc = "Portal jumplist backward" }, + { "pk", "Portal jumplist forward", desc = "Portal jumplist forward" }, + { "pc", "Portal changelist backward", desc = "Portal changelist backward" }, + { "pq", "Portal quickfix backward", desc = "Portal quickfix backward" }, + }, + opts = { + escape = { + [""] = true, + ["q"] = true, + }, + window_options = { + relative = "cursor", + width = 80, + height = 4, + col = 2, + focusable = false, + border = "rounded", + noautocmd = true, + }, + }, +} diff --git a/lua/cargdev/plugins/precognition.lua b/lua/cargdev/plugins/precognition.lua new file mode 100644 index 0000000..e8c3a6c --- /dev/null +++ b/lua/cargdev/plugins/precognition.lua @@ -0,0 +1,31 @@ +return { + "tris203/precognition.nvim", + event = "VeryLazy", + opts = { + startVisible = false, + showBlankVirtLine = true, + highlightColor = { link = "Comment" }, + hints = { + Caret = { text = "^", prio = 2 }, + Dollar = { text = "$", prio = 1 }, + MatchingPair = { text = "%", prio = 5 }, + Zero = { text = "0", prio = 1 }, + w = { text = "w", prio = 10 }, + b = { text = "b", prio = 9 }, + e = { text = "e", prio = 8 }, + W = { text = "W", prio = 7 }, + B = { text = "B", prio = 6 }, + E = { text = "E", prio = 5 }, + }, + gutterHints = { + G = { text = "G", prio = 10 }, + gg = { text = "gg", prio = 9 }, + PrevParagraph = { text = "{", prio = 8 }, + NextParagraph = { text = "}", prio = 8 }, + }, + }, + keys = { + { "vp", "lua require('precognition').toggle()", desc = "Toggle Precognition" }, + { "vP", "lua require('precognition').peek()", desc = "Peek Precognition" }, + }, +} diff --git a/lua/cargdev/plugins/reactive.lua b/lua/cargdev/plugins/reactive.lua new file mode 100644 index 0000000..4cd1df0 --- /dev/null +++ b/lua/cargdev/plugins/reactive.lua @@ -0,0 +1,88 @@ +return { + "rasulomaroff/reactive.nvim", + event = "VeryLazy", + opts = { + builtin = { + cursorline = true, + cursor = true, + modemsg = true, + }, + load = { "catppuccin-mocha-cursor", "catppuccin-mocha-cursorline" }, + }, + config = function(_, opts) + require("reactive").setup(opts) + + -- Custom mode colors + require("reactive").add_preset({ + name = "custom", + init = function() + vim.opt.guicursor:append("a:ReactiveCursor") + end, + modes = { + n = { + winhl = { + CursorLine = { bg = "#2a2b3c" }, + CursorLineNr = { fg = "#89b4fa", bg = "#2a2b3c" }, + }, + hl = { + ReactiveCursor = { bg = "#f5e0dc" }, + }, + }, + i = { + winhl = { + CursorLine = { bg = "#1e3a2f" }, + CursorLineNr = { fg = "#a6e3a1", bg = "#1e3a2f" }, + }, + hl = { + ReactiveCursor = { bg = "#a6e3a1" }, + }, + }, + v = { + winhl = { + CursorLine = { bg = "#2d3654" }, + CursorLineNr = { fg = "#89b4fa", bg = "#2d3654" }, + }, + hl = { + ReactiveCursor = { bg = "#89b4fa" }, + }, + }, + V = { + winhl = { + CursorLine = { bg = "#2d3654" }, + CursorLineNr = { fg = "#89b4fa", bg = "#2d3654" }, + }, + hl = { + ReactiveCursor = { bg = "#89b4fa" }, + }, + }, + ["\x16"] = { -- Visual Block mode + winhl = { + CursorLine = { bg = "#2d3654" }, + CursorLineNr = { fg = "#89b4fa", bg = "#2d3654" }, + }, + hl = { + ReactiveCursor = { bg = "#89b4fa" }, + }, + }, + R = { + winhl = { + CursorLine = { bg = "#3d2a2d" }, + CursorLineNr = { fg = "#f38ba8", bg = "#3d2a2d" }, + }, + hl = { + ReactiveCursor = { bg = "#f38ba8" }, + }, + }, + c = { + winhl = { + CursorLine = { bg = "#3d3a2d" }, + CursorLineNr = { fg = "#f9e2af", bg = "#3d3a2d" }, + }, + hl = { + ReactiveCursor = { bg = "#f9e2af" }, + }, + }, + }, + }) + end, +} diff --git a/lua/cargdev/plugins/regexplainer.lua b/lua/cargdev/plugins/regexplainer.lua new file mode 100644 index 0000000..14e7a09 --- /dev/null +++ b/lua/cargdev/plugins/regexplainer.lua @@ -0,0 +1,39 @@ +return { + "bennypowers/nvim-regexplainer", + dependencies = { + "nvim-treesitter/nvim-treesitter", + "MunifTanjim/nui.nvim", + }, + cmd = { "RegexplainerShow", "RegexplainerToggle" }, + keys = { + { "rx", "RegexplainerToggle", desc = "Toggle Regexplainer" }, + }, + opts = { + mode = "narrative", + auto = false, + filetypes = { + "html", + "js", + "cjs", + "mjs", + "ts", + "jsx", + "tsx", + "cjsx", + "mjsx", + "lua", + "python", + "java", + "go", + "rust", + }, + debug = false, + display = "popup", + mappings = { + toggle = "rx", + }, + narrative = { + separator = "\n", + }, + }, +} diff --git a/lua/cargdev/plugins/render-markdown.lua b/lua/cargdev/plugins/render-markdown.lua new file mode 100644 index 0000000..58774c9 --- /dev/null +++ b/lua/cargdev/plugins/render-markdown.lua @@ -0,0 +1,154 @@ +return { + "MeanderingProgrammer/render-markdown.nvim", + dependencies = { + "nvim-treesitter/nvim-treesitter", + "nvim-tree/nvim-web-devicons", + }, + ft = { "markdown", "norg", "rmd", "org" }, + opts = { + enabled = true, + max_file_size = 10.0, -- MB + render_modes = { "n", "c" }, + anti_conceal = { + enabled = true, + ignore = { + code_background = true, + sign = true, + }, + }, + heading = { + enabled = true, + sign = true, + position = "overlay", + icons = { "󰲡 ", "󰲣 ", "󰲥 ", "󰲧 ", "󰲩 ", "󰲫 " }, + signs = { "󰫎 " }, + width = "full", + left_pad = 0, + right_pad = 0, + min_width = 0, + border = false, + border_prefix = false, + above = "▄", + below = "▀", + backgrounds = { + "RenderMarkdownH1Bg", + "RenderMarkdownH2Bg", + "RenderMarkdownH3Bg", + "RenderMarkdownH4Bg", + "RenderMarkdownH5Bg", + "RenderMarkdownH6Bg", + }, + foregrounds = { + "RenderMarkdownH1", + "RenderMarkdownH2", + "RenderMarkdownH3", + "RenderMarkdownH4", + "RenderMarkdownH5", + "RenderMarkdownH6", + }, + }, + code = { + enabled = true, + sign = true, + style = "full", + position = "left", + language_pad = 0, + disable_background = { "diff" }, + width = "full", + left_pad = 0, + right_pad = 0, + min_width = 0, + border = "thin", + above = "▄", + below = "▀", + highlight = "RenderMarkdownCode", + highlight_inline = "RenderMarkdownCodeInline", + }, + dash = { + enabled = true, + icon = "─", + width = "full", + highlight = "RenderMarkdownDash", + }, + bullet = { + enabled = true, + icons = { "●", "○", "◆", "◇" }, + left_pad = 0, + right_pad = 0, + highlight = "RenderMarkdownBullet", + }, + checkbox = { + enabled = true, + position = "inline", + unchecked = { + icon = "󰄱 ", + highlight = "RenderMarkdownUnchecked", + }, + checked = { + icon = "󰱒 ", + highlight = "RenderMarkdownChecked", + }, + custom = { + todo = { raw = "[-]", rendered = "󰥔 ", highlight = "RenderMarkdownTodo" }, + }, + }, + quote = { + enabled = true, + icon = "▋", + repeat_linebreak = false, + highlight = "RenderMarkdownQuote", + }, + pipe_table = { + enabled = true, + preset = "heavy", + style = "full", + cell = "padded", + min_width = 0, + border = { + "┏", "┳", "┓", + "┣", "╋", "┫", + "┗", "┻", "┛", + "┃", "━", + }, + alignment_indicator = "━", + head = "RenderMarkdownTableHead", + row = "RenderMarkdownTableRow", + filler = "RenderMarkdownTableFill", + }, + callout = { + note = { raw = "[!NOTE]", rendered = "󰋽 Note", highlight = "RenderMarkdownInfo" }, + tip = { raw = "[!TIP]", rendered = "󰌶 Tip", highlight = "RenderMarkdownSuccess" }, + important = { raw = "[!IMPORTANT]", rendered = "󰅾 Important", highlight = "RenderMarkdownHint" }, + warning = { raw = "[!WARNING]", rendered = "󰀪 Warning", highlight = "RenderMarkdownWarn" }, + caution = { raw = "[!CAUTION]", rendered = "󰳦 Caution", highlight = "RenderMarkdownError" }, + }, + link = { + enabled = true, + image = "󰥶 ", + email = "󰀓 ", + hyperlink = "󰌹 ", + highlight = "RenderMarkdownLink", + custom = { + web = { pattern = "^http[s]?://", icon = "󰖟 ", highlight = "RenderMarkdownLink" }, + }, + }, + sign = { + enabled = true, + highlight = "RenderMarkdownSign", + }, + indent = { + enabled = false, + per_level = 2, + }, + win_options = { + conceallevel = { + default = vim.api.nvim_get_option_value("conceallevel", {}), + rendered = 3, + }, + concealcursor = { + default = vim.api.nvim_get_option_value("concealcursor", {}), + rendered = "", + }, + }, + }, +} diff --git a/lua/cargdev/plugins/satellite.lua b/lua/cargdev/plugins/satellite.lua new file mode 100644 index 0000000..1af45f1 --- /dev/null +++ b/lua/cargdev/plugins/satellite.lua @@ -0,0 +1,57 @@ +return { + "lewis6991/satellite.nvim", + event = { "BufReadPost", "BufNewFile" }, + opts = { + current_only = false, + winblend = 50, + zindex = 40, + excluded_filetypes = { + "NvimTree", + "neo-tree", + "lazy", + "mason", + "help", + "terminal", + "toggleterm", + "TelescopePrompt", + "alpha", + "dashboard", + "Outline", + "lspsaga", + "spectre_panel", + }, + width = 2, + handlers = { + cursor = { + enable = true, + symbols = { "⎺", "⎻", "⎼", "⎽" }, + }, + search = { + enable = true, + symbols = { "━" }, + }, + diagnostic = { + enable = true, + signs = { "-", "=", "≡" }, + min_severity = vim.diagnostic.severity.HINT, + }, + gitsigns = { + enable = true, + signs = { + add = "│", + change = "│", + delete = "─", + }, + }, + marks = { + enable = true, + show_builtins = false, + key = "m", + }, + quickfix = { + enable = true, + signs = { "-", "=", "≡" }, + }, + }, + }, +} diff --git a/lua/cargdev/plugins/screenkey.lua b/lua/cargdev/plugins/screenkey.lua new file mode 100644 index 0000000..415d9a4 --- /dev/null +++ b/lua/cargdev/plugins/screenkey.lua @@ -0,0 +1,66 @@ +return { + "NStefan002/screenkey.nvim", + lazy = false, + version = "*", + opts = { + win_opts = { + row = vim.o.lines - vim.o.cmdheight - 1, + col = vim.o.columns - 1, + relative = "editor", + anchor = "SE", + width = 40, + height = 3, + border = "rounded", + }, + compress_after = 3, + clear_after = 3, + disable = { + filetypes = { "toggleterm" }, + buftypes = { "terminal" }, + events = false, + }, + show_leader = true, + group_mappings = false, + display_infront = {}, + display_behind = {}, + filter = function(keys) + return keys + end, + keys = { + [""] = "󰌒", + [""] = "󰌑", + [""] = "Esc", + [""] = "␣", + [""] = "󰌥", + [""] = "Del", + [""] = "", + [""] = "", + [""] = "", + [""] = "", + [""] = "Home", + [""] = "End", + [""] = "PgUp", + [""] = "PgDn", + [""] = "Ins", + [""] = "󱊫", + [""] = "󱊬", + [""] = "󱊭", + [""] = "󱊮", + [""] = "󱊯", + [""] = "󱊰", + [""] = "󱊱", + [""] = "󱊲", + [""] = "󱊳", + [""] = "󱊴", + [""] = "󱊵", + [""] = "󱊶", + ["CTRL"] = "Ctrl", + ["ALT"] = "Alt", + ["SUPER"] = "󰀏", + [""] = "", + }, + }, + keys = { + { "sk", "Screenkey", desc = "Toggle Screenkey" }, + }, +} diff --git a/lua/cargdev/plugins/snacks.lua b/lua/cargdev/plugins/snacks.lua index 25eb46a..7770d84 100644 --- a/lua/cargdev/plugins/snacks.lua +++ b/lua/cargdev/plugins/snacks.lua @@ -8,19 +8,26 @@ return { bigfile = { enabled = true }, dashboard = { enabled = true, - width = 60, + width = 40, row = nil, col = nil, - pane_gap = 4, + pane_gap = 2, autokeys = "1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", preset = { keys = dashboard_config.get_snacks_keys(), header = dashboard_config.get_header_string(), }, + formats = { + key = function(item) + return { { item.key, hl = "SnacksDashboardKey" } } + end, + }, sections = { + { padding = 4 }, { section = "header" }, + { padding = 2 }, + { section = "keys", gap = 1, padding = 0 }, { padding = 1 }, - { section = "keys", gap = 1, padding = 1 }, { section = "startup" }, }, }, @@ -31,11 +38,17 @@ return { }, input = { enabled = true }, lazygit = { enabled = true }, - notifier = { enabled = true }, + notifier = { + enabled = true, + timeout = 3000, + style = "minimal", + top_down = false, + margin = { top = 0, right = 1, bottom = 1 }, + }, picker = { enabled = true }, quickfile = { enabled = true }, scope = { enabled = true }, - scroll = { enabled = true }, + scroll = { enabled = false }, statuscolumn = { enabled = true }, terminal = { enabled = true }, toggle = { enabled = true }, @@ -46,11 +59,9 @@ return { }, }) - -- Set up vim.ui.input and vim.ui.select for snacks vim.schedule(function() vim.ui.input = require("snacks.input").input vim.ui.select = require("snacks.picker").select end) - end, } diff --git a/lua/cargdev/plugins/ssr.lua b/lua/cargdev/plugins/ssr.lua new file mode 100644 index 0000000..cab049c --- /dev/null +++ b/lua/cargdev/plugins/ssr.lua @@ -0,0 +1,28 @@ +return { + "cshuaimin/ssr.nvim", + keys = { + { + "sR", + function() + require("ssr").open() + end, + mode = { "n", "x" }, + desc = "Structural search/replace", + }, + }, + opts = { + border = "rounded", + min_width = 50, + min_height = 5, + max_width = 120, + max_height = 25, + adjust_window = true, + keymaps = { + close = "q", + next_match = "n", + prev_match = "N", + replace_confirm = "", + replace_all = "", + }, + }, +} diff --git a/lua/cargdev/plugins/telescope.lua b/lua/cargdev/plugins/telescope.lua index ae059ad..59262e8 100644 --- a/lua/cargdev/plugins/telescope.lua +++ b/lua/cargdev/plugins/telescope.lua @@ -43,7 +43,7 @@ return { -- Binaries "exe", "dll", "so", "dylib", "bin", "app", "dmg", "deb", "rpm", -- Other problematic files - "lock", "log", "tmp", "temp", "cache", "bak", "backup" + "lock", "log", "tmp", "temp", "cache", "bca", "backup" } for _, ext in ipairs(skip_extensions) do diff --git a/lua/cargdev/plugins/tiny-inline-diagnostic.lua b/lua/cargdev/plugins/tiny-inline-diagnostic.lua new file mode 100644 index 0000000..8d8d93c --- /dev/null +++ b/lua/cargdev/plugins/tiny-inline-diagnostic.lua @@ -0,0 +1,59 @@ +return { + "rachartier/tiny-inline-diagnostic.nvim", + event = "LspAttach", + priority = 1000, + config = function() + -- Disable default diagnostics virtual text and auto float + vim.diagnostic.config({ + virtual_text = false, + float = false, -- Disable automatic float, use manual sl instead + signs = true, + underline = true, + update_in_insert = false, + }) + + require("tiny-inline-diagnostic").setup({ + signs = { + left = "", + right = "", + diag = "●", + arrow = " ", + up_arrow = " ", + vertical = " │", + vertical_end = " └", + }, + hi = { + error = "DiagnosticError", + warn = "DiagnosticWarn", + info = "DiagnosticInfo", + hint = "DiagnosticHint", + arrow = "NonText", + background = "CursorLine", + mixing_color = "None", + }, + blend = { + factor = 0.22, + }, + options = { + show_source = true, + throttle = 20, + softwrap = 30, + multiple_diag_under_cursor = true, + multilines = true, + show_all_diags_on_cursorline = false, + enable_on_insert = false, + overflow = { + mode = "wrap", + }, + format = nil, + break_line = { + enabled = false, + after = 30, + }, + virt_texts = { + priority = 2048, + }, + }, + }) + end, +} diff --git a/lua/cargdev/plugins/treesj.lua b/lua/cargdev/plugins/treesj.lua new file mode 100644 index 0000000..c69df3f --- /dev/null +++ b/lua/cargdev/plugins/treesj.lua @@ -0,0 +1,18 @@ +return { + "Wansmer/treesj", + dependencies = { "nvim-treesitter/nvim-treesitter" }, + keys = { + { "tj", "TSJToggle", desc = "Toggle split/join" }, + { "ts", "TSJSplit", desc = "Split code block" }, + { "tJ", "TSJJoin", desc = "Join code block" }, + }, + opts = { + use_default_keymaps = false, + check_syntax_error = true, + max_join_length = 120, + cursor_behavior = "hold", + notify = true, + dot_repeat = true, + on_error = nil, + }, +} diff --git a/lua/cargdev/plugins/ts-comments.lua b/lua/cargdev/plugins/ts-comments.lua new file mode 100644 index 0000000..32732ba --- /dev/null +++ b/lua/cargdev/plugins/ts-comments.lua @@ -0,0 +1,5 @@ +return { + "folke/ts-comments.nvim", + event = "VeryLazy", + opts = {}, +} diff --git a/lua/cargdev/plugins/twilight.lua b/lua/cargdev/plugins/twilight.lua new file mode 100644 index 0000000..72b27d0 --- /dev/null +++ b/lua/cargdev/plugins/twilight.lua @@ -0,0 +1,24 @@ +return { + "folke/twilight.nvim", + cmd = { "Twilight", "TwilightEnable", "TwilightDisable" }, + keys = { + { "zt", "Twilight", desc = "Toggle Twilight" }, + }, + opts = { + dimming = { + alpha = 0.25, + color = { "Normal", "#ffffff" }, + term_bg = "#000000", + inactive = false, + }, + context = 10, + treesitter = true, + expand = { + "function", + "method", + "table", + "if_statement", + }, + exclude = {}, + }, +} diff --git a/lua/cargdev/plugins/undotree.lua b/lua/cargdev/plugins/undotree.lua new file mode 100644 index 0000000..5fe2bb0 --- /dev/null +++ b/lua/cargdev/plugins/undotree.lua @@ -0,0 +1,24 @@ +return { + "mbbill/undotree", + cmd = "UndotreeToggle", + keys = { + { "tu", "UndotreeToggle", desc = "Toggle Undotree" }, + }, + config = function() + vim.g.undotree_WindowLayout = 2 + vim.g.undotree_SplitWidth = 35 + vim.g.undotree_DiffpanelHeight = 10 + vim.g.undotree_SetFocusWhenToggle = 1 + vim.g.undotree_ShortIndicators = 1 + vim.g.undotree_TreeNodeShape = "◉" + vim.g.undotree_TreeVertShape = "│" + vim.g.undotree_TreeSplitShape = "╱" + vim.g.undotree_TreeReturnShape = "╲" + vim.g.undotree_DiffAutoOpen = 1 + vim.g.undotree_HighlightChangedText = 1 + vim.g.undotree_HighlightChangedWithSign = 1 + vim.g.undotree_HighlightSyntaxAdd = "DiffAdd" + vim.g.undotree_HighlightSyntaxChange = "DiffChange" + vim.g.undotree_HighlightSyntaxDel = "DiffDelete" + end, +} diff --git a/lua/cargdev/plugins/venv-selector.lua b/lua/cargdev/plugins/venv-selector.lua new file mode 100644 index 0000000..45879a7 --- /dev/null +++ b/lua/cargdev/plugins/venv-selector.lua @@ -0,0 +1,55 @@ +return { + "linux-cultist/venv-selector.nvim", + branch = "regexp", + dependencies = { + "neovim/nvim-lspconfig", + "nvim-telescope/telescope.nvim", + "mfussenegger/nvim-dap-python", + }, + ft = "python", + keys = { + { "vs", "VenvSelect", desc = "Select Python venv" }, + { "vc", "VenvSelectCached", desc = "Select cached venv" }, + }, + opts = { + settings = { + search = { + root = vim.fn.getcwd(), + workspace = true, + file = true, + anaconda_envs = true, + anaconda_base = true, + pipenv = true, + poetry = true, + hatch = true, + virtualenvs = true, + pyenv = true, + venv = true, + }, + options = { + on_venv_activate_callback = nil, + enable_default_searches = true, + enable_cached_venvs = true, + cached_venv_automatic_activation = true, + activate_venv_in_terminal = true, + set_environment_variables = true, + notify_user_on_venv_activation = true, + }, + }, + }, + config = function(_, opts) + require("venv-selector").setup(opts) + + -- Auto-select venv when opening Python files + vim.api.nvim_create_autocmd("FileType", { + pattern = "python", + callback = function() + local venv = vim.fn.findfile("pyproject.toml", vim.fn.getcwd() .. ";") + if venv ~= "" then + require("venv-selector").retrieve_from_cache() + end + end, + once = true, + }) + end, +} diff --git a/lua/cargdev/plugins/vim-visual-multi.lua b/lua/cargdev/plugins/vim-visual-multi.lua new file mode 100644 index 0000000..5f17f22 --- /dev/null +++ b/lua/cargdev/plugins/vim-visual-multi.lua @@ -0,0 +1,37 @@ +return { + "mg979/vim-visual-multi", + branch = "master", + event = { "BufReadPost", "BufNewFile" }, + init = function() + -- Configuration must be set before plugin loads + vim.g.VM_default_mappings = 1 + vim.g.VM_mouse_mappings = 1 + vim.g.VM_theme = "iceblue" + + vim.g.VM_maps = { + ["Find Under"] = "", -- Like VS Code Ctrl+D + ["Find Subword Under"] = "", -- Like VS Code Ctrl+D + ["Select All"] = "", -- Like VS Code Ctrl+Shift+L + ["Add Cursor Down"] = "", -- Like VS Code + ["Add Cursor Up"] = "", -- Like VS Code + ["Skip Region"] = "", -- Skip current and go to next + ["Remove Region"] = "", -- Remove current cursor + ["Undo"] = "u", + ["Redo"] = "", + } + + -- Highlight settings + vim.g.VM_Mono_hl = "DiffText" + vim.g.VM_Extend_hl = "DiffAdd" + vim.g.VM_Cursor_hl = "Visual" + vim.g.VM_Insert_hl = "DiffChange" + + -- Other settings + vim.g.VM_leader = "\\" + vim.g.VM_show_warnings = 1 + vim.g.VM_silent_exit = 0 + vim.g.VM_quit_after_leaving_insert_mode = 0 + vim.g.VM_skip_empty_lines = 1 + vim.g.VM_case_setting = "smart" + end, +} diff --git a/lua/cargdev/plugins/yanky.lua b/lua/cargdev/plugins/yanky.lua new file mode 100644 index 0000000..7509b03 --- /dev/null +++ b/lua/cargdev/plugins/yanky.lua @@ -0,0 +1,45 @@ +return { + "gbprod/yanky.nvim", + dependencies = { "kkharji/sqlite.lua" }, + event = { "BufReadPost", "BufNewFile" }, + opts = { + ring = { + history_length = 100, + storage = "sqlite", + sync_with_numbered_registers = true, + cancel_event = "update", + }, + picker = { + select = { + action = nil, + }, + telescope = { + use_default_mappings = true, + mappings = nil, + }, + }, + system_clipboard = { + sync_with_ring = true, + }, + highlight = { + on_put = true, + on_yank = true, + timer = 200, + }, + preserve_cursor_position = { + enabled = true, + }, + }, + keys = { + { "y", "(YankyYank)", mode = { "n", "x" }, desc = "Yank" }, + { "p", "(YankyPutAfter)", mode = { "n", "x" }, desc = "Put after" }, + { "P", "(YankyPutBefore)", mode = { "n", "x" }, desc = "Put before" }, + { "gp", "(YankyGPutAfter)", mode = { "n", "x" }, desc = "GPut after" }, + { "gP", "(YankyGPutBefore)", mode = { "n", "x" }, desc = "GPut before" }, + { "", "(YankyPreviousEntry)", desc = "Previous yank" }, + { "", "(YankyNextEntry)", desc = "Next yank" }, + { "]p", "(YankyPutIndentAfterLinewise)", desc = "Put indented after" }, + { "[p", "(YankyPutIndentBeforeLinewise)", desc = "Put indented before" }, + { "yh", "YankyRingHistory", desc = "Yank history" }, + }, +} diff --git a/lua/cargdev/plugins/zen-mode.lua b/lua/cargdev/plugins/zen-mode.lua new file mode 100644 index 0000000..5391e9a --- /dev/null +++ b/lua/cargdev/plugins/zen-mode.lua @@ -0,0 +1,55 @@ +return { + "folke/zen-mode.nvim", + dependencies = { "folke/twilight.nvim" }, + cmd = "ZenMode", + keys = { + { "zz", "ZenMode", desc = "Toggle Zen Mode" }, + }, + opts = { + window = { + backdrop = 0.95, + width = 120, + height = 1, + options = { + signcolumn = "no", + number = false, + relativenumber = false, + cursorline = false, + cursorcolumn = false, + foldcolumn = "0", + list = false, + }, + }, + plugins = { + options = { + enabled = true, + ruler = false, + showcmd = false, + laststatus = 0, + }, + twilight = { enabled = true }, + gitsigns = { enabled = false }, + tmux = { enabled = true }, + kitty = { + enabled = false, + font = "+4", + }, + alacritty = { + enabled = false, + font = "14", + }, + wezterm = { + enabled = false, + font = "+4", + }, + }, + on_open = function(win) + vim.wo.wrap = true + vim.wo.linebreak = true + end, + on_close = function() + vim.wo.wrap = false + vim.wo.linebreak = false + end, + }, +}