Compare commits
13 Commits
1b6a354c86
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
1a1963232e
|
|||
| c867d55228 | |||
|
11a5bc1266
|
|||
|
7e68bc3391
|
|||
|
5c980a8b57
|
|||
| 17a2b4d25b | |||
|
58fc3e53ac
|
|||
|
7f9c380eaa
|
|||
| 859cfc3793 | |||
|
d43128c2d0
|
|||
| 2153591cf5 | |||
|
c28e6c3e59
|
|||
|
93d8f9a28d
|
+149
-7
@@ -1,5 +1,3 @@
|
|||||||
/.claude_session
|
|
||||||
|
|
||||||
# Plugin installs (managed by vim.pack)
|
# Plugin installs (managed by vim.pack)
|
||||||
/pack/
|
/pack/
|
||||||
|
|
||||||
@@ -25,11 +23,155 @@
|
|||||||
# Logs
|
# Logs
|
||||||
*.log
|
*.log
|
||||||
|
|
||||||
# OS
|
# id: gi-patterns-aa0d0d1d58f24039fa0491e40c78bb9f
|
||||||
|
# Created by https://www.toptal.com/developers/gitignore/api/lua
|
||||||
|
# Edit at https://www.toptal.com/developers/gitignore?templates=lua
|
||||||
|
|
||||||
|
### Lua ###
|
||||||
|
# Compiled Lua sources
|
||||||
|
luac.out
|
||||||
|
|
||||||
|
# luarocks build files
|
||||||
|
*.src.rock
|
||||||
|
*.zip
|
||||||
|
*.tar.gz
|
||||||
|
|
||||||
|
# Object files
|
||||||
|
*.o
|
||||||
|
*.os
|
||||||
|
*.ko
|
||||||
|
*.obj
|
||||||
|
*.elf
|
||||||
|
|
||||||
|
# Precompiled Headers
|
||||||
|
*.gch
|
||||||
|
*.pch
|
||||||
|
|
||||||
|
# Libraries
|
||||||
|
*.lib
|
||||||
|
*.a
|
||||||
|
*.la
|
||||||
|
*.lo
|
||||||
|
*.def
|
||||||
|
*.exp
|
||||||
|
|
||||||
|
# Shared objects (inc. Windows DLLs)
|
||||||
|
*.dll
|
||||||
|
*.so
|
||||||
|
*.so.*
|
||||||
|
*.dylib
|
||||||
|
|
||||||
|
# Executables
|
||||||
|
*.exe
|
||||||
|
*.out
|
||||||
|
*.app
|
||||||
|
*.i*86
|
||||||
|
*.x86_64
|
||||||
|
*.hex
|
||||||
|
|
||||||
|
|
||||||
|
# End of https://www.toptal.com/developers/gitignore/api/lua
|
||||||
|
|
||||||
|
# id: gi-patterns-be86a7264ac20631fa0112bcaff396d7
|
||||||
|
# Created by https://www.toptal.com/developers/gitignore/api/vim
|
||||||
|
# Edit at https://www.toptal.com/developers/gitignore?templates=vim
|
||||||
|
|
||||||
|
### Vim ###
|
||||||
|
# Swap
|
||||||
|
[._]*.s[a-v][a-z]
|
||||||
|
!*.svg # comment out if you don't need vector files
|
||||||
|
[._]*.sw[a-p]
|
||||||
|
[._]s[a-rt-v][a-z]
|
||||||
|
[._]ss[a-gi-z]
|
||||||
|
[._]sw[a-p]
|
||||||
|
|
||||||
|
# Session
|
||||||
|
Session.vim
|
||||||
|
Sessionx.vim
|
||||||
|
|
||||||
|
# Temporary
|
||||||
|
.netrwhist
|
||||||
|
*~
|
||||||
|
# Auto-generated tag files
|
||||||
|
tags
|
||||||
|
# Persistent undo
|
||||||
|
[._]*.un~
|
||||||
|
|
||||||
|
# End of https://www.toptal.com/developers/gitignore/api/vim
|
||||||
|
|
||||||
|
# id: gitig-boilerplate-129366cbf5c6513e388d0725c2e4923b
|
||||||
|
# ╭──────────────────────────────────────────────────────────╮
|
||||||
|
# │ GitIgnore Boilerplate Template │
|
||||||
|
# ╰──────────────────────────────────────────────────────────╯
|
||||||
|
#
|
||||||
|
# ──────────────────── OS-Generated Files ────────────────────
|
||||||
|
# automatic backup files created by some editors (e.g., Vim, Emacs)
|
||||||
|
*~
|
||||||
|
|
||||||
|
# temporary files created if a process still has a handle to a deleted file
|
||||||
|
.fuse_hidden*
|
||||||
|
|
||||||
|
# KDE directory preferences
|
||||||
|
.directory
|
||||||
|
|
||||||
|
# MacOS junk
|
||||||
.DS_Store
|
.DS_Store
|
||||||
Thumbs.db
|
Thumbs.db
|
||||||
|
|
||||||
# AI assistant files
|
# Linux trash folder which might appear on any partition or disk
|
||||||
CLAUDE.md
|
.Trash-*
|
||||||
GEMINI.md
|
|
||||||
.gemini_session
|
# files created when an open file is removed but is still being accessed
|
||||||
|
.nfs*
|
||||||
|
|
||||||
|
# ─────────────────── Debug/Temporary/Testing ────────────────
|
||||||
|
# Matches OLD / .OLD
|
||||||
|
[Oo][Ll][Dd]/
|
||||||
|
.[Oo][Ll][Dd]/
|
||||||
|
|
||||||
|
# Matches DISABLE / .DISABLE
|
||||||
|
[Dd][Ii][Ss][Aa][Bb][Ll][Ee]/
|
||||||
|
.[Dd][Ii][Ss][Aa][Bb][Ll][Ee]/
|
||||||
|
|
||||||
|
# Matches DISABLED / .DISABLED
|
||||||
|
[Dd][Ii][Ss][Aa][Bb][Ll][Ee][Dd]/
|
||||||
|
.[Dd][Ii][Ss][Aa][Bb][Ll][Ee][Dd]/
|
||||||
|
|
||||||
|
# Matches DEBUG / .DEBUG
|
||||||
|
[Dd][Ee][Bb][Uu][Gg]/
|
||||||
|
.[Dd][Ee][Bb][Uu][Gg]/
|
||||||
|
|
||||||
|
# Matches TMP / .TMP
|
||||||
|
[Tt][Mm][Pp]/
|
||||||
|
.[Tt][Mm][Pp]/
|
||||||
|
|
||||||
|
# Matches TEMP / .TEMP
|
||||||
|
[Tt][Ee][Mm][Pp]/
|
||||||
|
.[Tt][Ee][Mm][Pp]/
|
||||||
|
|
||||||
|
# Matches TEMPORARY / .TEMPORARY
|
||||||
|
[Tt][Ee][Mm][Pp][Oo][Rr][Aa][Rr][Yy]/
|
||||||
|
.[Tt][Ee][Mm][Pp][Oo][Rr][Aa][Rr][Yy]/
|
||||||
|
|
||||||
|
# Matches TESTING / .TESTING
|
||||||
|
[Tt][Ee][Ss][Tt][Ii][Nn][Gg]/
|
||||||
|
.[Tt][Ee][Ss][Tt][Ii][Nn][Gg]/
|
||||||
|
|
||||||
|
# ─────────────────── AI Sessions and Rules ──────────────────
|
||||||
|
# Matches CLAUDE.md, .claud*, etc.
|
||||||
|
[Cc][Ll][Aa][Uu][Dd][Ee].[Mm][Dd]
|
||||||
|
.[Cc][Ll][Aa][Uu][Dd]*
|
||||||
|
|
||||||
|
# Matches GEMINI.md, .gemin*, etc.
|
||||||
|
[Gg][Ee][Mm][Ii][Nn][Ii].[Mm][Dd]
|
||||||
|
.[Gg][Ee][Mm][Ii][Nn]*
|
||||||
|
|
||||||
|
# Matches ANTIGRAVITY.md, .antigrav*, etc.
|
||||||
|
[Aa][nN][Tt][Ii][Gg][Rr][Aa][Vv][Ii][Tt][Yy].[Mm][Dd]
|
||||||
|
.[Aa][Nn][Tt][Ii][Gg][Rr][Aa][Vv]*
|
||||||
|
|
||||||
|
# Matches AGENTS.md, .remember, etc.
|
||||||
|
[Aa][Gg][Ee][Nn][Tt][Ss].[Mm][Dd]
|
||||||
|
.[Rr][Ee][Mm][Ee][Mm][Bb][Ee][Rr]
|
||||||
|
|
||||||
|
# ──────────────────────────────────────────────────────────────
|
||||||
|
|||||||
@@ -11,22 +11,61 @@ A modern, modular, and high-performance Neovim configuration built from scratch
|
|||||||
- **Phased Loading**: Async, non-blocking startup using a phased `VimEnter` queue for a snappy experience.
|
- **Phased Loading**: Async, non-blocking startup using a phased `VimEnter` queue for a snappy experience.
|
||||||
- **Unified Registry**: Configuration is managed via a global `_G.Config` registry, ensuring cross-plugin consistency.
|
- **Unified Registry**: Configuration is managed via a global `_G.Config` registry, ensuring cross-plugin consistency.
|
||||||
- **High Performance**: Featuring **blink.cmp** (Rust-based completion) and optimized **Snacks.nvim** components.
|
- **High Performance**: Featuring **blink.cmp** (Rust-based completion) and optimized **Snacks.nvim** components.
|
||||||
- **AI-Powered**: Native integration with the **GitHub Copilot Language Server**.
|
- **AI-Powered**: Native integration with **GitHub Copilot** — inline completions via **blink-copilot** and multi-line refactoring via **Sidekick.nvim** Next Edit Suggestions (NES).
|
||||||
- **User-Centric QoL**: Hybrid line numbers, autosave-on-edit, and seamless system clipboard integration.
|
- **User-Centric QoL**: Hybrid line numbers, autosave-on-edit, and seamless system clipboard integration.
|
||||||
- **Resilient & Portable**: Intelligent terminal title management (Kitty + Fallback) and automatic project root detection.
|
- **Resilient & Portable**: Intelligent terminal title management (Kitty + Fallback), automatic project root detection, and machine-local override support.
|
||||||
- **Lean & Readable**: ~800 lines of Lua code (excluding comments and blanks).
|
- **Lean & Readable**: ~850 lines of Lua code (excluding comments and blanks).
|
||||||
|
|
||||||
## 📁 Architecture
|
## 📁 Architecture
|
||||||
|
|
||||||
The configuration is strictly modular:
|
The configuration is strictly modular:
|
||||||
|
|
||||||
- `init.lua`: Entry point and global state initialization.
|
- `init.lua`: Entry point, bootstrap, global state initialization, and machine-local overrides.
|
||||||
|
- `lua/bootstrap.lua`: Early runtime setup — redirects Neovim's data/state paths when running as root (e.g. via a symlinked `~/.config/nvim`), preventing root sessions from polluting or conflicting with the user-level install.
|
||||||
- `lua/lazyload.lua`: Logic for async and phased plugin loading.
|
- `lua/lazyload.lua`: Logic for async and phased plugin loading.
|
||||||
- `lua/options.lua`: Global Vim settings, root management, and terminal title logic.
|
- `lua/options.lua`: Global Vim settings, auto-reload, root management, and terminal title logic.
|
||||||
- `lua/plugins.lua`: Plugin declarations and detailed registry-based configurations.
|
- `lua/plugins.lua`: Plugin declarations and detailed registry-based configurations.
|
||||||
- `lua/keymaps.lua`: Centralized user-facing keybindings.
|
- `lua/keymaps.lua`: Centralized user-facing keybindings.
|
||||||
- `lua/const.lua`: Stores constant values (like dashboard headers) for the configuration.
|
- `lua/const.lua`: Stores constant values (like dashboard headers) for the configuration.
|
||||||
|
|
||||||
|
## 🔌 Plugin Stack
|
||||||
|
|
||||||
|
### Core UI
|
||||||
|
- **Catppuccin**: Primary colorscheme (Mocha flavour).
|
||||||
|
- **Lualine**: Statusline with Git diff and line-by-line Gitsigns blame.
|
||||||
|
- **Noice**: Modern UI for cmdline (popup), messages, and LSP hover.
|
||||||
|
- **Snacks**: High-performance dashboard, explorer, and pickers.
|
||||||
|
- **Nvim-web-devicons**: Consistent icons across UI components.
|
||||||
|
|
||||||
|
### Editing & Navigation
|
||||||
|
- **Flash**: Enhanced motion and search.
|
||||||
|
- **Focusline**: Keeps the active line at a configurable screen position (30%) during scrolling motions.
|
||||||
|
- **Mini.ai**: Better text objects (including `g` for entire buffer).
|
||||||
|
- **Mini.surround**: Surround text objects (add/delete/change).
|
||||||
|
- **Mini.pairs**: Auto-close brackets and quotes.
|
||||||
|
- **Persistence**: Session management.
|
||||||
|
- **Which-key**: Interactive keybinding documentation.
|
||||||
|
- **Gitsigns**: In-buffer git indicators and line highlights.
|
||||||
|
- **Grug-far**: Project-wide search and replace.
|
||||||
|
- **Gx.nvim**: Smart URL/reference opener under cursor.
|
||||||
|
- **Comment-box**: Decorative comment boxes and lines.
|
||||||
|
- **Undotree**: Visual undo history browser.
|
||||||
|
- **Haunt.nvim**: In-buffer annotation and bookmark manager. Integrates with the Snacks picker for browsing bookmarks and exposes `haunt_all` / `haunt_buffer` prompt contexts to Sidekick AI sessions.
|
||||||
|
- **Zen Mode**: Distraction-free editing.
|
||||||
|
- **Qalc**: Inline calculator via `qalculate`.
|
||||||
|
|
||||||
|
### LSP & Completion
|
||||||
|
- **Blink.cmp** + **blink.lib**: High-performance Rust-based completion. Auto-detects binary across install layouts; falls back gracefully if unavailable. Rebuilds automatically on `PackChanged`.
|
||||||
|
- **blink-copilot**: Surfaces GitHub Copilot inline suggestions inside the blink.cmp completion menu.
|
||||||
|
- **Sidekick.nvim**: AI assistant providing Next Edit Suggestions (NES) for multi-line refactoring via the Copilot LSP, plus an integrated AI CLI terminal (`<leader>aa`) with context-aware prompts. Snacks picker integration sends selections to the active AI session via `<Alt-a>`.
|
||||||
|
- **LSPConfig + Mason**: Managed LSP support for Lua, C/C++, Rust, Python, Fish, and Shell.
|
||||||
|
- **Conform**: Formatter with format-on-save and range formatting.
|
||||||
|
- **Inc-rename**: Incremental LSP rename with live preview.
|
||||||
|
- **Lazydev**: Neovim Lua type definitions for `lua_ls`.
|
||||||
|
|
||||||
|
### Terminal
|
||||||
|
- **Kitty Scrollback**: Browse Kitty terminal scrollback buffer inside Neovim.
|
||||||
|
|
||||||
## 🛠️ System Dependencies
|
## 🛠️ System Dependencies
|
||||||
|
|
||||||
To ensure all features (pickers, formatters, and LSPs) work correctly, the following packages are required:
|
To ensure all features (pickers, formatters, and LSPs) work correctly, the following packages are required:
|
||||||
@@ -44,6 +83,7 @@ To ensure all features (pickers, formatters, and LSPs) work correctly, the follo
|
|||||||
- `Node.js` & `npm` (Copilot and various LSPs)
|
- `Node.js` & `npm` (Copilot and various LSPs)
|
||||||
- `Python3` & `pip` (Python LSPs)
|
- `Python3` & `pip` (Python LSPs)
|
||||||
- `Cargo` (Rust toolchain, required for building `blink.cmp`)
|
- `Cargo` (Rust toolchain, required for building `blink.cmp`)
|
||||||
|
- `qalculate` (optional, required for the Qalc calculator plugin)
|
||||||
|
|
||||||
### Installation Commands
|
### Installation Commands
|
||||||
|
|
||||||
@@ -62,15 +102,19 @@ sudo pacman -S git ripgrep fd fzf lazygit github-cli xclip nodejs npm base-devel
|
|||||||
### Installation
|
### Installation
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
git clone https://github.com/your-username/nvim-config ~/.config/nvim
|
git clone https://git.rootiest.dev/rootiest/neovim-config.git ~/.config/nvim
|
||||||
nvim
|
nvim
|
||||||
```
|
```
|
||||||
|
|
||||||
### Post-Install
|
### Post-Install
|
||||||
|
|
||||||
1. **Build Blink**: If completion isn't working, run `cargo build --release` inside `~/.local/share/nvim/site/pack/core/opt/blink.cmp`.
|
1. **Build Blink**: Completion auto-rebuilds on `PackChanged`. If it still isn't working, run `cargo build --release` inside `~/.local/share/nvim/site/pack/core/opt/blink.cmp`.
|
||||||
2. **LSP Servers**: Run `:Mason` to monitor the installation of Language Servers.
|
2. **LSP Servers**: Run `:Mason` to monitor the installation of Language Servers.
|
||||||
3. **Copilot**: Run `:LspCopilotSignIn` to authenticate.
|
3. **Copilot**: Run `:LspCopilotSignIn` to authenticate, then `:checkhealth sidekick` to verify the Sidekick NES integration is working.
|
||||||
|
|
||||||
|
### Machine-Local Overrides
|
||||||
|
|
||||||
|
Place machine-specific or secret configuration in `~/.config/.user-dots/nvim/local.lua` or `~/.config/.user-dots/nvim/secrets.lua`. These files are sourced automatically at startup if present, and are intentionally outside the repo to avoid accidental commits.
|
||||||
|
|
||||||
## ⌨️ Key Features & Mappings
|
## ⌨️ Key Features & Mappings
|
||||||
|
|
||||||
@@ -88,6 +132,21 @@ nvim
|
|||||||
| `K` | Hover Documentation |
|
| `K` | Hover Documentation |
|
||||||
| `s` / `S` | Leap Motion (Normal/Window) |
|
| `s` / `S` | Leap Motion (Normal/Window) |
|
||||||
| `ys` / `ds` / `cs` | Surround (Add/Delete/Change) |
|
| `ys` / `ds` / `cs` | Surround (Add/Delete/Change) |
|
||||||
|
| `gx` / `gX` | Open URL under cursor (Gx.nvim) |
|
||||||
|
| `<Tab>` *(insert)* | Advance snippet → NES suggestion → native inline completion → fallback |
|
||||||
|
| `<Tab>` *(normal)* | Jump to / apply Sidekick NES suggestion |
|
||||||
|
| `<leader>aa` | Toggle Sidekick AI CLI terminal |
|
||||||
|
| `<leader>as` | Select AI tool (Sidekick) |
|
||||||
|
| `<Alt-a>` *(picker)* | Send picker selection to active AI CLI session |
|
||||||
|
| `<leader>ha` | Annotate current position (Haunt) |
|
||||||
|
| `<leader>ht` | Toggle annotation visibility (Haunt) |
|
||||||
|
| `<leader>hd` | Delete bookmark (Haunt) |
|
||||||
|
| `<leader>hn` / `<leader>hp` | Next / Previous bookmark (Haunt) |
|
||||||
|
| `<leader>hl` | Browse all bookmarks in picker (Haunt) |
|
||||||
|
| `<leader>cbb` | Create Centered Comment Box |
|
||||||
|
| `<leader>cbl` | Create Centered Comment Line |
|
||||||
|
| `<leader>cbd` | Delete Comment Box/Line |
|
||||||
|
| `<leader>cbk` | Browse Box Style Catalog |
|
||||||
| `:Q` | Forced Write-All and Quit |
|
| `:Q` | Forced Write-All and Quit |
|
||||||
|
|
||||||
## 📜 License
|
## 📜 License
|
||||||
|
|||||||
@@ -4,33 +4,29 @@
|
|||||||
└────────────────────────────────────────────────────────────────┘
|
└────────────────────────────────────────────────────────────────┘
|
||||||
--]]
|
--]]
|
||||||
|
|
||||||
-- Copyright (C) 2026 rootiest
|
-- Copyright (C) 2026 Rootiest
|
||||||
--
|
-- SPDX-License-Identifier: AGPL-3.0-or-later
|
||||||
-- This program is free software: you can redistribute it and/or modify
|
|
||||||
-- it under the terms of the GNU General Public License as published by
|
|
||||||
-- the Free Software Foundation, either version 3 of the License, or
|
|
||||||
-- (at your option) any later version.
|
|
||||||
--
|
|
||||||
-- This program is distributed in the hope that it will be useful,
|
|
||||||
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
-- GNU General Public License for more details.
|
|
||||||
--
|
|
||||||
-- You should have received a copy of the GNU General Public License
|
|
||||||
-- along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
-- Set leader keys before loading any plugins
|
-- Trigger bootstrap (runtime path, etc.)
|
||||||
vim.g.mapleader = " "
|
require("bootstrap")
|
||||||
vim.g.maplocalleader = " "
|
|
||||||
|
|
||||||
-- Initialize global registry
|
-- Initialize global registry
|
||||||
_G.Config = {
|
_G.Config = {
|
||||||
plugins = {},
|
plugins = {},
|
||||||
called = {},
|
called = {},
|
||||||
}
|
}
|
||||||
|
|
||||||
-- Load core modules
|
-- Load core modules
|
||||||
require('lazyload')
|
require("lazyload") -- Plugin lazy-loading module
|
||||||
require('options')
|
require("options") -- Configuration options
|
||||||
require('plugins')
|
require("plugins") -- Plugin specifications and setup
|
||||||
require('keymaps')
|
require("keymaps") -- Key mappings
|
||||||
|
|
||||||
|
-- Source machine-local and secret overrides (silently ignored if absent)
|
||||||
|
local user_dots = vim.fn.expand("~/.config/.user-dots/nvim/")
|
||||||
|
for _, file in ipairs({ "secrets.lua", "local.lua" }) do
|
||||||
|
local path = user_dots .. file
|
||||||
|
if vim.fn.filereadable(path) == 1 then
|
||||||
|
dofile(path)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
-- ╭─────────────────────────────────────────────────────────╮
|
||||||
|
-- │ Bootstaps │
|
||||||
|
-- ╰─────────────────────────────────────────────────────────╯
|
||||||
|
|
||||||
|
---- Copyright (C) 2026 Rootiest
|
||||||
|
-- SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
|
-- This file is sourced before anything else so it can be used to set up
|
||||||
|
-- the runtime path and other fundamental settings.
|
||||||
|
|
||||||
|
-- ─────────────── Manage root user permissions for Neovim ───────────────
|
||||||
|
|
||||||
|
-- Redirect data directories if running as root to avoid permission issues
|
||||||
|
if os.getenv("USER") == "root" or os.getenv("SUDO_USER") ~= nil then
|
||||||
|
local root_data = "/root/.local/share/nvim-root"
|
||||||
|
vim.opt.packpath:prepend(root_data .. "/site")
|
||||||
|
vim.opt.runtimepath:prepend(root_data .. "/site")
|
||||||
|
-- Prevent root from writing shada to your user home
|
||||||
|
vim.opt.shadafile = "/root/.local/state/nvim-root.shada"
|
||||||
|
end
|
||||||
@@ -4,6 +4,9 @@
|
|||||||
└────────────────────────────────────────────────────────────────┘
|
└────────────────────────────────────────────────────────────────┘
|
||||||
--]]
|
--]]
|
||||||
|
|
||||||
|
-- Copyright (C) 2026 Rootiest
|
||||||
|
-- SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
local M = {}
|
local M = {}
|
||||||
|
|
||||||
--- Dashboard Header
|
--- Dashboard Header
|
||||||
|
|||||||
+39
-14
@@ -4,20 +4,8 @@
|
|||||||
└────────────────────────────────────────────────────────────────┘
|
└────────────────────────────────────────────────────────────────┘
|
||||||
--]]
|
--]]
|
||||||
|
|
||||||
-- Copyright (C) 2026 rootiest
|
---- Copyright (C) 2026 Rootiest
|
||||||
--
|
-- SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
-- This program is free software: you can redistribute it and/or modify
|
|
||||||
-- it under the terms of the GNU General Public License as published by
|
|
||||||
-- the Free Software Foundation, either version 3 of the License, or
|
|
||||||
-- (at your option) any later version.
|
|
||||||
--
|
|
||||||
-- This program is distributed in the hope that it will be useful,
|
|
||||||
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
-- GNU General Public License for more details.
|
|
||||||
--
|
|
||||||
-- You should have received a copy of the GNU General Public License
|
|
||||||
-- along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
-- System Clipboard Integration
|
-- System Clipboard Integration
|
||||||
-- This makes 'y' and 'p' (and all other yank/paste operations)
|
-- This makes 'y' and 'p' (and all other yank/paste operations)
|
||||||
@@ -304,6 +292,13 @@ end, { desc = "Neovim News" })
|
|||||||
|
|
||||||
----------------------------------------------------------
|
----------------------------------------------------------
|
||||||
|
|
||||||
|
-- Sidekick NES: accept next-edit suggestion in normal mode
|
||||||
|
vim.keymap.set("n", "<Tab>", function()
|
||||||
|
require("sidekick").nes_jump_or_apply()
|
||||||
|
end, { desc = "Apply Sidekick NES Suggestion" })
|
||||||
|
|
||||||
|
----------------------------------------------------------
|
||||||
|
|
||||||
-- Leap Keymaps
|
-- Leap Keymaps
|
||||||
vim.keymap.set({ "n", "x", "o" }, "<CR>", "<Plug>(leap)")
|
vim.keymap.set({ "n", "x", "o" }, "<CR>", "<Plug>(leap)")
|
||||||
vim.keymap.set("n", "S", "<Plug>(leap-from-window)")
|
vim.keymap.set("n", "S", "<Plug>(leap-from-window)")
|
||||||
@@ -322,6 +317,14 @@ vim.keymap.set("n", "<leader>uu", "<cmd>UndotreeToggle<cr>", { desc = "Toggle Un
|
|||||||
|
|
||||||
----------------------------------------------------------
|
----------------------------------------------------------
|
||||||
|
|
||||||
|
-- Comment Box Keymaps
|
||||||
|
vim.keymap.set({ "n", "v" }, "<leader>cbb", "<cmd>CBccbox<cr>", { desc = "Centered Box" })
|
||||||
|
vim.keymap.set({ "n", "v" }, "<leader>cbl", "<cmd>CBcline<cr>", { desc = "Centered Line" })
|
||||||
|
vim.keymap.set({ "n", "v" }, "<leader>cbd", "<cmd>CBd<cr>", { desc = "Delete Box/Line" })
|
||||||
|
vim.keymap.set("n", "<leader>cbk", "<cmd>CBcatalog<cr>", { desc = "Box Style Catalog" })
|
||||||
|
|
||||||
|
----------------------------------------------------------
|
||||||
|
|
||||||
-- Persistence Keymaps
|
-- Persistence Keymaps
|
||||||
vim.keymap.set("n", "<leader>qs", function()
|
vim.keymap.set("n", "<leader>qs", function()
|
||||||
require("persistence").load()
|
require("persistence").load()
|
||||||
@@ -335,3 +338,25 @@ end, { desc = "Restore Last Session" })
|
|||||||
vim.keymap.set("n", "<leader>qd", function()
|
vim.keymap.set("n", "<leader>qd", function()
|
||||||
require("persistence").stop()
|
require("persistence").stop()
|
||||||
end, { desc = "Don't Save Current Session" })
|
end, { desc = "Don't Save Current Session" })
|
||||||
|
|
||||||
|
----------------------------------------------------------
|
||||||
|
|
||||||
|
-- Haunt Keymaps
|
||||||
|
vim.keymap.set("n", "<leader>ha", function()
|
||||||
|
require("haunt.api").annotate()
|
||||||
|
end, { desc = "Annotate" })
|
||||||
|
vim.keymap.set("n", "<leader>ht", function()
|
||||||
|
require("haunt.api").toggle_annotation()
|
||||||
|
end, { desc = "Toggle Annotation" })
|
||||||
|
vim.keymap.set("n", "<leader>hd", function()
|
||||||
|
require("haunt.api").delete()
|
||||||
|
end, { desc = "Delete Bookmark" })
|
||||||
|
vim.keymap.set("n", "<leader>hn", function()
|
||||||
|
require("haunt.api").next()
|
||||||
|
end, { desc = "Next Bookmark" })
|
||||||
|
vim.keymap.set("n", "<leader>hp", function()
|
||||||
|
require("haunt.api").prev()
|
||||||
|
end, { desc = "Previous Bookmark" })
|
||||||
|
vim.keymap.set("n", "<leader>hl", function()
|
||||||
|
require("haunt.picker").show()
|
||||||
|
end, { desc = "Show Bookmark Picker" })
|
||||||
|
|||||||
+73
-46
@@ -4,24 +4,34 @@
|
|||||||
└────────────────────────────────────────────────────────────────┘
|
└────────────────────────────────────────────────────────────────┘
|
||||||
--]]
|
--]]
|
||||||
|
|
||||||
|
---- Copyright (C) 2026 Rootiest
|
||||||
|
-- SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
|
-- ╭─────────────────────────────────────────────────────────╮
|
||||||
|
-- │ Basic Options │
|
||||||
|
-- ╰─────────────────────────────────────────────────────────╯
|
||||||
|
|
||||||
-- Set leader keys before any other configuration
|
-- Set leader keys before any other configuration
|
||||||
vim.g.mapleader = " "
|
vim.g.mapleader = " "
|
||||||
vim.g.maplocalleader = "\\"
|
vim.g.maplocalleader = "\\"
|
||||||
|
|
||||||
-- Copyright (C) 2026 rootiest
|
-- Indentation
|
||||||
--
|
vim.opt.tabstop = 2 -- Tab width in spaces
|
||||||
-- This program is free software: you can redistribute it and/or modify
|
vim.opt.shiftwidth = 2 -- Indent width for >> and auto-indent
|
||||||
-- it under the terms of the GNU General Public License as published by
|
vim.opt.expandtab = true -- Use spaces instead of tabs
|
||||||
-- the Free Software Foundation, either version 3 of the License, or
|
|
||||||
-- (at your option) any later version.
|
-- Performance and UI defaults
|
||||||
--
|
vim.opt.updatetime = 200 -- Faster completion and CursorHold events
|
||||||
-- This program is distributed in the hope that it will be useful,
|
vim.opt.autowrite = true -- Enable auto write
|
||||||
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
vim.opt.number = true -- Show line numbers
|
||||||
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
vim.opt.relativenumber = true -- Relative line numbers
|
||||||
-- GNU General Public License for more details.
|
|
||||||
--
|
-- ╭─────────────────────────────────────────────────────────╮
|
||||||
-- You should have received a copy of the GNU General Public License
|
-- │ Sessions and Saving │
|
||||||
-- along with this program. If not, see <https://www.gnu.org/licenses/>.
|
-- ╰─────────────────────────────────────────────────────────╯
|
||||||
|
|
||||||
|
-- Persistent undo across sessions
|
||||||
|
vim.opt.undofile = true
|
||||||
|
|
||||||
-- Autowrite/Autosave
|
-- Autowrite/Autosave
|
||||||
-- This ensures changes are saved on every buffer change or when leaving insert mode.
|
-- This ensures changes are saved on every buffer change or when leaving insert mode.
|
||||||
@@ -36,29 +46,26 @@ vim.api.nvim_create_autocmd({ "InsertLeave", "TextChanged" }, {
|
|||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
-- Performance and UI defaults
|
-- Automatically reload files changed outside of Neovim
|
||||||
vim.opt.updatetime = 200 -- Faster completion and CursorHold events
|
vim.opt.autoread = true
|
||||||
vim.opt.autowrite = true -- Enable auto write
|
|
||||||
vim.opt.number = true -- Show line numbers
|
|
||||||
vim.opt.relativenumber = true -- Relative line numbers
|
|
||||||
|
|
||||||
-- Persistent undo across sessions
|
-- Auto-reload Triggers
|
||||||
vim.opt.undofile = true
|
-- Reload when focus is gained or when the cursor is idle
|
||||||
|
vim.api.nvim_create_autocmd({ "FocusGained", "CursorHold" }, {
|
||||||
-- Indentation
|
group = vim.api.nvim_create_augroup("autoread_on_focus", { clear = true }),
|
||||||
vim.opt.tabstop = 2 -- Tab width in spaces
|
|
||||||
vim.opt.shiftwidth = 2 -- Indent width for >> and auto-indent
|
|
||||||
vim.opt.expandtab = true -- Use spaces instead of tabs
|
|
||||||
|
|
||||||
-- FormatOnSave
|
|
||||||
vim.api.nvim_create_autocmd("BufWritePre", {
|
|
||||||
pattern = "*",
|
pattern = "*",
|
||||||
callback = function(args)
|
callback = function()
|
||||||
require("conform").format({ bufnr = args.buf })
|
-- Only if the buffer is not modified, to avoid losing unsaved changes
|
||||||
|
if vim.bo.modified == false then
|
||||||
|
vim.cmd("checktime")
|
||||||
|
end
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
-- Execute Format
|
-- Format Function
|
||||||
|
-- Formats the entire buffer by default,
|
||||||
|
-- but if a range is provided (e.g., via visual selection),
|
||||||
|
-- it formats only that range.
|
||||||
vim.api.nvim_create_user_command("Format", function(args)
|
vim.api.nvim_create_user_command("Format", function(args)
|
||||||
local range = nil
|
local range = nil
|
||||||
if args.count ~= -1 then
|
if args.count ~= -1 then
|
||||||
@@ -71,17 +78,38 @@ vim.api.nvim_create_user_command("Format", function(args)
|
|||||||
require("conform").format({ async = true, lsp_format = "fallback", range = range })
|
require("conform").format({ async = true, lsp_format = "fallback", range = range })
|
||||||
end, { range = true })
|
end, { range = true })
|
||||||
|
|
||||||
--[[
|
-- FormatOnSave
|
||||||
┌────────────────────────────────────────────────────────────────┐
|
-- Formats the buffer before saving.
|
||||||
│ Root Management │
|
-- This is a common practice to ensure code is consistently formatted.
|
||||||
└────────────────────────────────────────────────────────────────┘
|
vim.api.nvim_create_autocmd("BufWritePre", {
|
||||||
--]]
|
pattern = "*",
|
||||||
|
callback = function()
|
||||||
|
-- Call Format function
|
||||||
|
vim.api.nvim_command("Format")
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Return to last-known cursor position when reopening files
|
||||||
|
vim.api.nvim_create_autocmd("BufReadPost", {
|
||||||
|
desc = "Jump to last known cursor position on open",
|
||||||
|
pattern = "*",
|
||||||
|
callback = function()
|
||||||
|
local last_pos = vim.fn.line("'\"")
|
||||||
|
if last_pos > 1 and last_pos <= vim.fn.line("$") then
|
||||||
|
vim.cmd('normal! g`\"')
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
-- ╭─────────────────────────────────────────────────────────╮
|
||||||
|
-- │ Root Management │
|
||||||
|
-- ╰─────────────────────────────────────────────────────────╯
|
||||||
|
|
||||||
-- Automatically change the working directory to the project root.
|
-- Automatically change the working directory to the project root.
|
||||||
-- This ensures that plugins like Snacks.picker and GrugFar work
|
-- This ensures that plugins like Snacks.picker and GrugFar work
|
||||||
-- relative to the file or project you are currently editing.
|
-- relative to the file or project you are currently editing.
|
||||||
vim.api.nvim_create_autocmd("BufEnter", {
|
vim.api.nvim_create_autocmd("BufEnter", {
|
||||||
group = vim.api.nvim_create_augroup("rootiest_auto_cd", { clear = true }),
|
group = vim.api.nvim_create_augroup("buffer_auto_cd", { clear = true }),
|
||||||
callback = function()
|
callback = function()
|
||||||
local path = vim.api.nvim_buf_get_name(0)
|
local path = vim.api.nvim_buf_get_name(0)
|
||||||
if path == "" then
|
if path == "" then
|
||||||
@@ -115,17 +143,18 @@ vim.api.nvim_create_autocmd("FileType", {
|
|||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
--[[
|
-- ╭─────────────────────────────────────────────────────────╮
|
||||||
┌────────────────────────────────────────────────────────────────┐
|
-- │ Shell Interaction │
|
||||||
│ Shell Interaction │
|
-- ╰─────────────────────────────────────────────────────────╯
|
||||||
└────────────────────────────────────────────────────────────────┘
|
|
||||||
--]]
|
|
||||||
|
|
||||||
-- Detect terminal environment
|
-- Detect terminal environment
|
||||||
local is_kitty = os.getenv("KITTY_PID") ~= nil
|
local is_kitty = os.getenv("KITTY_PID") ~= nil
|
||||||
local current_shell = os.getenv("SHELL") or "/bin/sh"
|
local current_shell = os.getenv("SHELL") or "/bin/sh"
|
||||||
local shell_name = current_shell:match("([^/]+)$") or "sh"
|
local shell_name = current_shell:match("([^/]+)$") or "sh"
|
||||||
|
|
||||||
|
-- Terminal Title Management
|
||||||
|
local title_group = vim.api.nvim_create_augroup("TerminalTitle", { clear = true })
|
||||||
|
|
||||||
-- Helper function to update the terminal title
|
-- Helper function to update the terminal title
|
||||||
local function set_terminal_title(title)
|
local function set_terminal_title(title)
|
||||||
-- If in Kitty, we use the direct escape sequence as it's reliable
|
-- If in Kitty, we use the direct escape sequence as it's reliable
|
||||||
@@ -139,9 +168,7 @@ local function set_terminal_title(title)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Create the Autocommand Group
|
-- Terminal title updates on buffer enter and window enter
|
||||||
local title_group = vim.api.nvim_create_augroup("TerminalTitle", { clear = true })
|
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd({ "BufEnter", "BufWinEnter" }, {
|
vim.api.nvim_create_autocmd({ "BufEnter", "BufWinEnter" }, {
|
||||||
group = title_group,
|
group = title_group,
|
||||||
callback = function()
|
callback = function()
|
||||||
|
|||||||
+177
-22
@@ -4,20 +4,8 @@
|
|||||||
└────────────────────────────────────────────────────────────────┘
|
└────────────────────────────────────────────────────────────────┘
|
||||||
--]]
|
--]]
|
||||||
|
|
||||||
-- Copyright (C) 2026 rootiest
|
---- Copyright (C) 2026 Rootiest
|
||||||
--
|
-- SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
-- This program is free software: you can redistribute it and/or modify
|
|
||||||
-- it under the terms of the GNU General Public License as published by
|
|
||||||
-- the Free Software Foundation, either version 3 of the License, or
|
|
||||||
-- (at your option) any later version.
|
|
||||||
--
|
|
||||||
-- This program is distributed in the hope that it will be useful,
|
|
||||||
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
-- GNU General Public License for more details.
|
|
||||||
--
|
|
||||||
-- You should have received a copy of the GNU General Public License
|
|
||||||
-- along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
-- Catppuccin.nvim
|
-- Catppuccin.nvim
|
||||||
-- Eagerly load the colorscheme plugin.
|
-- Eagerly load the colorscheme plugin.
|
||||||
@@ -68,6 +56,7 @@ Config.plugins.snacks = {
|
|||||||
keys = {
|
keys = {
|
||||||
["<a-s>"] = { "flash", mode = { "n", "i" } },
|
["<a-s>"] = { "flash", mode = { "n", "i" } },
|
||||||
["s"] = { "flash" },
|
["s"] = { "flash" },
|
||||||
|
["<a-a>"] = { "sidekick_send", mode = { "n", "i" } },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -90,6 +79,9 @@ Config.plugins.snacks = {
|
|||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
|
sidekick_send = function(...)
|
||||||
|
return require("sidekick.cli.picker.snacks").send(...)
|
||||||
|
end,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
notifier = { enabled = true },
|
notifier = { enabled = true },
|
||||||
@@ -102,7 +94,14 @@ Config.plugins.snacks = {
|
|||||||
enabled = true,
|
enabled = true,
|
||||||
win = {
|
win = {
|
||||||
keys = {
|
keys = {
|
||||||
toggle = { "<c-/>", function(self) self:hide() end, mode = "t", desc = "Toggle Terminal" },
|
toggle = {
|
||||||
|
"<c-/>",
|
||||||
|
function(self)
|
||||||
|
self:hide()
|
||||||
|
end,
|
||||||
|
mode = "t",
|
||||||
|
desc = "Toggle Terminal",
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -164,6 +163,23 @@ lazyload.on_vim_enter(function()
|
|||||||
vim.pack.add({ { src = "https://git.disroot.org/andyg/leap.nvim", name = "leap" } })
|
vim.pack.add({ { src = "https://git.disroot.org/andyg/leap.nvim", name = "leap" } })
|
||||||
vim.api.nvim_set_hl(0, "LeapBackdrop", { link = "Comment" })
|
vim.api.nvim_set_hl(0, "LeapBackdrop", { link = "Comment" })
|
||||||
|
|
||||||
|
-- Focusline.nvim
|
||||||
|
vim.pack.add({
|
||||||
|
{ src = "https://github.com/ABDsheikho/focusline.nvim" },
|
||||||
|
})
|
||||||
|
|
||||||
|
require("focusline").setup({
|
||||||
|
-- focus_target can be a line number (e.g., 15), or a ratio (e.g., 0.25, 1 / 4, "25%").
|
||||||
|
focus_target = "30%", -- try it with 30%
|
||||||
|
-- which motion to associate focusline with.
|
||||||
|
with_motion = {
|
||||||
|
"zz",
|
||||||
|
"z,",
|
||||||
|
"\x04", -- Ctrl+D
|
||||||
|
"\x15", -- Ctrl+U
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
-- Mini.surround
|
-- Mini.surround
|
||||||
vim.pack.add({ { src = "https://github.com/echasnovski/mini.surround", name = "mini.surround" } })
|
vim.pack.add({ { src = "https://github.com/echasnovski/mini.surround", name = "mini.surround" } })
|
||||||
require("mini.surround").setup()
|
require("mini.surround").setup()
|
||||||
@@ -172,6 +188,22 @@ lazyload.on_vim_enter(function()
|
|||||||
vim.pack.add({ { src = "https://github.com/echasnovski/mini.pairs", name = "mini.pairs" } })
|
vim.pack.add({ { src = "https://github.com/echasnovski/mini.pairs", name = "mini.pairs" } })
|
||||||
require("mini.pairs").setup()
|
require("mini.pairs").setup()
|
||||||
|
|
||||||
|
-- Gx.nvim
|
||||||
|
vim.pack.add({ { src = "https://github.com/chrishrb/gx.nvim", name = "gx" } })
|
||||||
|
---@diagnostic disable-next-line: missing-fields
|
||||||
|
require("gx").setup({
|
||||||
|
handlers = {
|
||||||
|
plugin = true,
|
||||||
|
github = true,
|
||||||
|
package_json = true,
|
||||||
|
search = true,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Comment-box.nvim
|
||||||
|
vim.pack.add({ { src = "https://github.com/LudoPinelli/comment-box.nvim", name = "comment-box" } })
|
||||||
|
require("comment-box").setup()
|
||||||
|
|
||||||
-- Undotree
|
-- Undotree
|
||||||
vim.g.undotree_ShortIndicators = 0
|
vim.g.undotree_ShortIndicators = 0
|
||||||
vim.g.undotree_SplitWidth = 32
|
vim.g.undotree_SplitWidth = 32
|
||||||
@@ -215,6 +247,7 @@ lazyload.on_vim_enter(function()
|
|||||||
vim.pack.add({ { src = "https://github.com/folke/lazydev.nvim", name = "lazydev" } })
|
vim.pack.add({ { src = "https://github.com/folke/lazydev.nvim", name = "lazydev" } })
|
||||||
require("lazydev").setup({
|
require("lazydev").setup({
|
||||||
library = {
|
library = {
|
||||||
|
{ path = "${3rd}/luv/library", words = { "vim%.uv" } },
|
||||||
{ path = "snacks.nvim", words = { "Snacks" } },
|
{ path = "snacks.nvim", words = { "Snacks" } },
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
@@ -230,25 +263,45 @@ lazyload.on_vim_enter(function()
|
|||||||
-- We check if the binary exists or if cargo is available to build it.
|
-- We check if the binary exists or if cargo is available to build it.
|
||||||
-- If neither, we skip loading to avoid errors.
|
-- If neither, we skip loading to avoid errors.
|
||||||
local blink_path = vim.fn.stdpath("data") .. "/site/pack/core/opt/blink.cmp"
|
local blink_path = vim.fn.stdpath("data") .. "/site/pack/core/opt/blink.cmp"
|
||||||
local has_blink_bin = vim.fn.filereadable(blink_path .. "/target/release/libblink_cmp_fuzzy.so") == 1
|
local has_blink_bin =
|
||||||
|
-- Check v2 location (most likely where it is now)
|
||||||
|
vim.fn.filereadable(blink_path .. "/lua/blink/cmp/lib/libblink_cmp_fuzzy.so") == 1
|
||||||
|
-- Check v1/Cargo location (fallback)
|
||||||
|
or vim.fn.filereadable(blink_path .. "/target/release/libblink_cmp_fuzzy.so") == 1
|
||||||
|
-- Check macOS/Windows extensions
|
||||||
or vim.fn.filereadable(blink_path .. "/target/release/libblink_cmp_fuzzy.dylib") == 1
|
or vim.fn.filereadable(blink_path .. "/target/release/libblink_cmp_fuzzy.dylib") == 1
|
||||||
or vim.fn.filereadable(blink_path .. "/target/release/libblink_cmp_fuzzy.dll") == 1
|
or vim.fn.filereadable(blink_path .. "/target/release/libblink_cmp_fuzzy.dll") == 1
|
||||||
|
|
||||||
local has_cargo = vim.fn.executable("cargo") == 1
|
local has_cargo = vim.fn.executable("cargo") == 1
|
||||||
|
|
||||||
if has_blink_bin or has_cargo then
|
if has_blink_bin or has_cargo then
|
||||||
|
-- 1. Add blink.lib first as it's a dependency for blink.cmp
|
||||||
|
vim.pack.add({ { src = "https://github.com/saghen/blink.lib", name = "blink.lib" } })
|
||||||
|
|
||||||
|
-- 2. Add blink.cmp and other sources
|
||||||
vim.pack.add({ { src = "https://github.com/saghen/blink.cmp", name = "blink.cmp" } })
|
vim.pack.add({ { src = "https://github.com/saghen/blink.cmp", name = "blink.cmp" } })
|
||||||
vim.pack.add({ { src = "https://github.com/rafamadriz/friendly-snippets", name = "friendly-snippets" } })
|
vim.pack.add({ { src = "https://github.com/rafamadriz/friendly-snippets", name = "friendly-snippets" } })
|
||||||
vim.pack.add({ { src = "https://github.com/fang2hou/blink-copilot", name = "blink-copilot" } })
|
vim.pack.add({ { src = "https://github.com/fang2hou/blink-copilot", name = "blink-copilot" } })
|
||||||
|
|
||||||
-- Blink.cmp setup
|
-- 3. Blink.cmp setup
|
||||||
require("blink.cmp").setup({
|
require("blink.cmp").setup({
|
||||||
keymap = { preset = "default" },
|
keymap = {
|
||||||
|
preset = "default",
|
||||||
|
["<Tab>"] = {
|
||||||
|
"snippet_forward",
|
||||||
|
function()
|
||||||
|
return require("sidekick").nes_jump_or_apply()
|
||||||
|
end,
|
||||||
|
function()
|
||||||
|
return vim.lsp.inline_completion.get()
|
||||||
|
end,
|
||||||
|
"fallback",
|
||||||
|
},
|
||||||
|
},
|
||||||
appearance = {
|
appearance = {
|
||||||
use_nvim_cmp_as_default = true,
|
use_nvim_cmp_as_default = true,
|
||||||
nerd_font_variant = "mono",
|
nerd_font_variant = "mono",
|
||||||
kind_icons = {
|
kind_icons = { Copilot = "" },
|
||||||
Copilot = "",
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
sources = {
|
sources = {
|
||||||
default = { "lsp", "path", "snippets", "buffer", "copilot" },
|
default = { "lsp", "path", "snippets", "buffer", "copilot" },
|
||||||
@@ -273,9 +326,34 @@ lazyload.on_vim_enter(function()
|
|||||||
vim.notify("blink.cmp: binary not found and cargo not installed. Completion disabled.", vim.log.levels.WARN)
|
vim.notify("blink.cmp: binary not found and cargo not installed. Completion disabled.", vim.log.levels.WARN)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Autocmd to build blink.cmp after plugin installation or update
|
||||||
|
vim.api.nvim_create_autocmd("User", {
|
||||||
|
pattern = "PackChanged", -- This triggers after vim.pack.update() finishes
|
||||||
|
callback = function()
|
||||||
|
-- Check if blink is actually installed before trying to build
|
||||||
|
local status, blink = pcall(require, "blink.cmp")
|
||||||
|
if status then
|
||||||
|
vim.notify("Blink.cmp: Building native library...", vim.log.levels.INFO)
|
||||||
|
---@diagnostic disable-next-line: undefined-field
|
||||||
|
blink.build():wait(60000)
|
||||||
|
vim.notify("Blink.cmp: Build complete.", vim.log.levels.INFO)
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
local lspconfig = require("lspconfig")
|
local lspconfig = require("lspconfig")
|
||||||
local capabilities = (has_blink_bin or has_cargo) and require("blink.cmp").get_lsp_capabilities() or nil
|
local capabilities = (has_blink_bin or has_cargo) and require("blink.cmp").get_lsp_capabilities() or nil
|
||||||
|
|
||||||
|
vim.lsp.config("rust_analyzer", {
|
||||||
|
settings = {
|
||||||
|
["rust-analyzer"] = {
|
||||||
|
check = {
|
||||||
|
command = "clippy",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
require("mason-lspconfig").setup({
|
require("mason-lspconfig").setup({
|
||||||
ensure_installed = {
|
ensure_installed = {
|
||||||
"lua_ls",
|
"lua_ls",
|
||||||
@@ -302,9 +380,24 @@ lazyload.on_vim_enter(function()
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
|
["rust_analyzer"] = function()
|
||||||
|
lspconfig.rust_analyzer.setup({
|
||||||
|
capabilities = capabilities,
|
||||||
|
settings = {
|
||||||
|
["rust-analyzer"] = {
|
||||||
|
check = {
|
||||||
|
command = "clippy",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
end,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
-- Enable native inline completion (ghost text in insert mode)
|
||||||
|
vim.lsp.inline_completion.enable()
|
||||||
|
|
||||||
-- Mini.ai
|
-- Mini.ai
|
||||||
vim.pack.add({ { src = "https://github.com/echasnovski/mini.ai", name = "mini.ai" } })
|
vim.pack.add({ { src = "https://github.com/echasnovski/mini.ai", name = "mini.ai" } })
|
||||||
|
|
||||||
@@ -314,6 +407,7 @@ lazyload.on_vim_enter(function()
|
|||||||
local n_lines = vim.api.nvim_buf_line_count(0)
|
local n_lines = vim.api.nvim_buf_line_count(0)
|
||||||
return {
|
return {
|
||||||
from = { line = 1, col = 1 },
|
from = { line = 1, col = 1 },
|
||||||
|
---@diagnostic disable-next-line: undefined-field
|
||||||
to = { line = n_lines, col = math.max(vim.fn.getline(n_lines):len(), 1) },
|
to = { line = n_lines, col = math.max(vim.fn.getline(n_lines):len(), 1) },
|
||||||
}
|
}
|
||||||
end,
|
end,
|
||||||
@@ -349,7 +443,26 @@ lazyload.on_vim_enter(function()
|
|||||||
|
|
||||||
-- Inc-rename.nvim
|
-- Inc-rename.nvim
|
||||||
vim.pack.add({ { src = "https://github.com/smjonas/inc-rename.nvim", name = "inc-rename" } })
|
vim.pack.add({ { src = "https://github.com/smjonas/inc-rename.nvim", name = "inc-rename" } })
|
||||||
require("inc_rename").setup()
|
require("inc_rename").setup({
|
||||||
|
-- the name of the command
|
||||||
|
cmd_name = "IncRename",
|
||||||
|
-- the highlight group used for highlighting the identifier's new name
|
||||||
|
hl_group = "Substitute",
|
||||||
|
-- whether an empty new name should be previewed; if false the command preview will be cancelled instead
|
||||||
|
preview_empty_name = false,
|
||||||
|
-- whether to display a `Renamed m instances in n files` message after a rename operation
|
||||||
|
show_message = true,
|
||||||
|
-- whether to save the "IncRename" command in the commandline history (set to false to prevent issues with
|
||||||
|
-- navigating to older entries that may arise due to the behavior of command preview)
|
||||||
|
save_in_cmdline_history = true,
|
||||||
|
-- the type of the external input buffer to use (currently supports "dressing" or "snacks")
|
||||||
|
input_buffer_type = nil,
|
||||||
|
-- callback to run after renaming, receives the result table (from LSP handler) as an argument
|
||||||
|
post_hook = nil,
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Qalc
|
||||||
|
vim.pack.add({ { src = "https://github.com/Apeiros-46B/qalc.nvim", name = "qalc" } })
|
||||||
|
|
||||||
-- Noice dependencies
|
-- Noice dependencies
|
||||||
vim.pack.add({ { src = "https://github.com/MunifTanjim/nui.nvim", name = "nui" } })
|
vim.pack.add({ { src = "https://github.com/MunifTanjim/nui.nvim", name = "nui" } })
|
||||||
@@ -373,5 +486,47 @@ lazyload.on_vim_enter(function()
|
|||||||
inc_rename = true, -- enables an input dialog for inc-rename.nvim
|
inc_rename = true, -- enables an input dialog for inc-rename.nvim
|
||||||
lsp_doc_border = false, -- add a border to hover docs and signature help
|
lsp_doc_border = false, -- add a border to hover docs and signature help
|
||||||
},
|
},
|
||||||
|
routes = {
|
||||||
|
{
|
||||||
|
filter = { event = "lsp", kind = "progress", find = "Loading workspace" },
|
||||||
|
opts = { skip = true },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
filter = { event = "lsp", kind = "progress", find = "^Diagnosing" },
|
||||||
|
opts = { skip = true },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
filter = { event = "lsp", kind = "progress", find = "semantic tokens" },
|
||||||
|
opts = { skip = true },
|
||||||
|
},
|
||||||
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
-- Kitty Scrollback
|
||||||
|
vim.pack.add({ { src = "https://github.com/mikesmithgh/kitty-scrollback.nvim", name = "kitty-scrollback" } })
|
||||||
|
Config.plugins.kitty_scrollback = {}
|
||||||
|
require("kitty-scrollback").setup(Config.plugins.kitty_scrollback)
|
||||||
|
|
||||||
|
-- Haunt.nvim
|
||||||
|
vim.pack.add({ { src = "https://github.com/TheNoeTrevino/haunt.nvim", name = "haunt" } })
|
||||||
|
Config.plugins.haunt = {
|
||||||
|
picker = "snacks",
|
||||||
|
}
|
||||||
|
require("haunt").setup(Config.plugins.haunt)
|
||||||
|
|
||||||
|
-- Sidekick.nvim
|
||||||
|
vim.pack.add({ { src = "https://github.com/folke/sidekick.nvim", name = "sidekick" } })
|
||||||
|
Config.plugins.sidekick = {
|
||||||
|
cli = {
|
||||||
|
prompts = {
|
||||||
|
haunt_all = function()
|
||||||
|
return require("haunt.sidekick").get_locations()
|
||||||
|
end,
|
||||||
|
haunt_buffer = function()
|
||||||
|
return require("haunt.sidekick").get_locations({ current_buffer = true })
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
require("sidekick").setup(Config.plugins.sidekick)
|
||||||
end)
|
end)
|
||||||
|
|||||||
+46
-10
@@ -5,21 +5,37 @@
|
|||||||
"src": "https://github.com/fang2hou/blink-copilot"
|
"src": "https://github.com/fang2hou/blink-copilot"
|
||||||
},
|
},
|
||||||
"blink.cmp": {
|
"blink.cmp": {
|
||||||
"rev": "c573a15a62bd0bfd4006ee0849b24f5404395500",
|
"rev": "80f5dd3f11049f1c3a87557718d4e55556a0e3f5",
|
||||||
"src": "https://github.com/saghen/blink.cmp"
|
"src": "https://github.com/saghen/blink.cmp"
|
||||||
},
|
},
|
||||||
|
"blink.lib": {
|
||||||
|
"rev": "f29d8bac6549bc1e7d699c83f680823d7def98bd",
|
||||||
|
"src": "https://github.com/saghen/blink.lib"
|
||||||
|
},
|
||||||
"catppuccin": {
|
"catppuccin": {
|
||||||
"rev": "426dbebe06b5c69fd846ceb17b42e12f890aedf1",
|
"rev": "426dbebe06b5c69fd846ceb17b42e12f890aedf1",
|
||||||
"src": "https://github.com/catppuccin/nvim"
|
"src": "https://github.com/catppuccin/nvim"
|
||||||
},
|
},
|
||||||
|
"comment-box": {
|
||||||
|
"rev": "06bb771690bc9df0763d14769b779062d8f12bc5",
|
||||||
|
"src": "https://github.com/LudoPinelli/comment-box.nvim"
|
||||||
|
},
|
||||||
"conform": {
|
"conform": {
|
||||||
"rev": "086a40dc7ed8242c03be9f47fbcee68699cc2395",
|
"rev": "dca1a190aa85f9065979ef35802fb77131911106",
|
||||||
"src": "https://github.com/stevearc/conform.nvim"
|
"src": "https://github.com/stevearc/conform.nvim"
|
||||||
},
|
},
|
||||||
|
"cord.nvim": {
|
||||||
|
"rev": "0be090969e978f7442870ef227e09eff7bf3480d",
|
||||||
|
"src": "https://github.com/vyfor/cord.nvim"
|
||||||
|
},
|
||||||
"flash": {
|
"flash": {
|
||||||
"rev": "fcea7ff883235d9024dc41e638f164a450c14ca2",
|
"rev": "fcea7ff883235d9024dc41e638f164a450c14ca2",
|
||||||
"src": "https://github.com/folke/flash.nvim"
|
"src": "https://github.com/folke/flash.nvim"
|
||||||
},
|
},
|
||||||
|
"focusline.nvim": {
|
||||||
|
"rev": "037a5c3e7849f2b9ad65732733d43c1136d72601",
|
||||||
|
"src": "https://github.com/ABDsheikho/focusline.nvim"
|
||||||
|
},
|
||||||
"friendly-snippets": {
|
"friendly-snippets": {
|
||||||
"rev": "6cd7280adead7f586db6fccbd15d2cac7e2188b9",
|
"rev": "6cd7280adead7f586db6fccbd15d2cac7e2188b9",
|
||||||
"src": "https://github.com/rafamadriz/friendly-snippets"
|
"src": "https://github.com/rafamadriz/friendly-snippets"
|
||||||
@@ -29,35 +45,47 @@
|
|||||||
"src": "https://github.com/f-person/git-blame.nvim"
|
"src": "https://github.com/f-person/git-blame.nvim"
|
||||||
},
|
},
|
||||||
"gitsigns": {
|
"gitsigns": {
|
||||||
"rev": "8d82c240f190fc33723d48c308ccc1ed8baad69d",
|
"rev": "dd3f588bacbeb041be6facf1742e42097f62165d",
|
||||||
"src": "https://github.com/lewis6991/gitsigns.nvim"
|
"src": "https://github.com/lewis6991/gitsigns.nvim"
|
||||||
},
|
},
|
||||||
"grug-far": {
|
"grug-far": {
|
||||||
"rev": "21604255d0e8f9968322f61f2b6c09e5efe1285a",
|
"rev": "21790e59dd0109a92a70cb874dd002af186314f5",
|
||||||
"src": "https://github.com/MagicDuck/grug-far.nvim"
|
"src": "https://github.com/MagicDuck/grug-far.nvim"
|
||||||
},
|
},
|
||||||
|
"gx": {
|
||||||
|
"rev": "ba9c408fc0130fc4548760c3933a81b58fc50de8",
|
||||||
|
"src": "https://github.com/chrishrb/gx.nvim"
|
||||||
|
},
|
||||||
|
"haunt": {
|
||||||
|
"rev": "815141d7367c9d895e902db27e2d25d4652ad0fc",
|
||||||
|
"src": "https://github.com/TheNoeTrevino/haunt.nvim"
|
||||||
|
},
|
||||||
"inc-rename": {
|
"inc-rename": {
|
||||||
"rev": "0074b551a17338ccdcd299bd86687cc651bcb33d",
|
"rev": "0074b551a17338ccdcd299bd86687cc651bcb33d",
|
||||||
"src": "https://github.com/smjonas/inc-rename.nvim"
|
"src": "https://github.com/smjonas/inc-rename.nvim"
|
||||||
},
|
},
|
||||||
|
"kitty-scrollback": {
|
||||||
|
"rev": "27a34ad53f188758fe202eb08f0063bce572dde4",
|
||||||
|
"src": "https://github.com/mikesmithgh/kitty-scrollback.nvim"
|
||||||
|
},
|
||||||
"lazydev": {
|
"lazydev": {
|
||||||
"rev": "ff2cbcba459b637ec3fd165a2be59b7bbaeedf0d",
|
"rev": "ff2cbcba459b637ec3fd165a2be59b7bbaeedf0d",
|
||||||
"src": "https://github.com/folke/lazydev.nvim"
|
"src": "https://github.com/folke/lazydev.nvim"
|
||||||
},
|
},
|
||||||
"leap": {
|
"leap": {
|
||||||
"rev": "b960d5038c5c505c52e56a54490f9bbb1f0e6ef6",
|
"rev": "156c71aabb68d520c6269db4103c8e5580e3ea67",
|
||||||
"src": "https://git.disroot.org/andyg/leap.nvim"
|
"src": "https://git.disroot.org/andyg/leap.nvim"
|
||||||
},
|
},
|
||||||
"lualine": {
|
"lualine": {
|
||||||
"rev": "a905eeebc4e63fdc48b5135d3bf8aea5618fb21c",
|
"rev": "131a558e13f9f28b15cd235557150ccb23f89286",
|
||||||
"src": "https://github.com/nvim-lualine/lualine.nvim"
|
"src": "https://github.com/nvim-lualine/lualine.nvim"
|
||||||
},
|
},
|
||||||
"mason": {
|
"mason": {
|
||||||
"rev": "b03fb0f20bc1d43daf558cda981a2be22e73ac42",
|
"rev": "cb8445f8ce85d957416c106b780efd51c6298f89",
|
||||||
"src": "https://github.com/williamboman/mason.nvim"
|
"src": "https://github.com/williamboman/mason.nvim"
|
||||||
},
|
},
|
||||||
"mason-lspconfig": {
|
"mason-lspconfig": {
|
||||||
"rev": "0a3b42c3e503df87aef6d6513e13148381495c3a",
|
"rev": "0c2823e0418f3d9230ff8b201c976e84de1cb401",
|
||||||
"src": "https://github.com/williamboman/mason-lspconfig.nvim"
|
"src": "https://github.com/williamboman/mason-lspconfig.nvim"
|
||||||
},
|
},
|
||||||
"mini.ai": {
|
"mini.ai": {
|
||||||
@@ -81,7 +109,7 @@
|
|||||||
"src": "https://github.com/MunifTanjim/nui.nvim"
|
"src": "https://github.com/MunifTanjim/nui.nvim"
|
||||||
},
|
},
|
||||||
"nvim-lspconfig": {
|
"nvim-lspconfig": {
|
||||||
"rev": "4b7fbaa239c5db6b36f424a4521ca9f1a401be33",
|
"rev": "31026a13eefb20681124706a79fc1df6bf11ab27",
|
||||||
"src": "https://github.com/neovim/nvim-lspconfig"
|
"src": "https://github.com/neovim/nvim-lspconfig"
|
||||||
},
|
},
|
||||||
"nvim-treesitter": {
|
"nvim-treesitter": {
|
||||||
@@ -93,13 +121,21 @@
|
|||||||
"src": "https://github.com/nvim-treesitter/nvim-treesitter-context"
|
"src": "https://github.com/nvim-treesitter/nvim-treesitter-context"
|
||||||
},
|
},
|
||||||
"nvim-web-devicons": {
|
"nvim-web-devicons": {
|
||||||
"rev": "c72328a5494b4502947a022fe69c0c47e53b6aa6",
|
"rev": "4fc505ac7bd7692824a142e96e5f529c133862f8",
|
||||||
"src": "https://github.com/nvim-tree/nvim-web-devicons"
|
"src": "https://github.com/nvim-tree/nvim-web-devicons"
|
||||||
},
|
},
|
||||||
"persistence": {
|
"persistence": {
|
||||||
"rev": "b20b2a7887bd39c1a356980b45e03250f3dce49c",
|
"rev": "b20b2a7887bd39c1a356980b45e03250f3dce49c",
|
||||||
"src": "https://github.com/folke/persistence.nvim"
|
"src": "https://github.com/folke/persistence.nvim"
|
||||||
},
|
},
|
||||||
|
"qalc": {
|
||||||
|
"rev": "33198ba0533d6a514f9a48cb472e40407c2ea9f6",
|
||||||
|
"src": "https://github.com/Apeiros-46B/qalc.nvim"
|
||||||
|
},
|
||||||
|
"sidekick": {
|
||||||
|
"rev": "208e1c5b8170c01fd1d07df0139322a76479b235",
|
||||||
|
"src": "https://github.com/folke/sidekick.nvim"
|
||||||
|
},
|
||||||
"snacks": {
|
"snacks": {
|
||||||
"rev": "ad9ede6a9cddf16cedbd31b8932d6dcdee9b716e",
|
"rev": "ad9ede6a9cddf16cedbd31b8932d6dcdee9b716e",
|
||||||
"src": "https://github.com/folke/snacks.nvim"
|
"src": "https://github.com/folke/snacks.nvim"
|
||||||
|
|||||||
Reference in New Issue
Block a user