mirror of
https://github.com/boxpositron/absolute-vim.git
synced 2026-10-24 05:23:19 +00:00
Compare commits
23 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d24b3ba574 | |||
| a0adcf2224 | |||
| 2d427aac96 | |||
| e98864d488 | |||
| 81662b99b5 | |||
| 58db15c1c0 | |||
| 38606b86c6 | |||
| b4bb915a3f | |||
| 5d9852f4ee | |||
| 13ddbe2f56 | |||
| f0093997bf | |||
| 32d652a93f | |||
| e9d9d2ac3b | |||
| ddb1a63b2a | |||
| e641c42858 | |||
| a55fa95d04 | |||
| a12b3bb04e | |||
| 71e165541c | |||
| 95e0c9d74c | |||
| f42b8759c5 | |||
| bdc798ba64 | |||
| 41c18ff80c | |||
| 107d3c5db2 |
@@ -49,3 +49,6 @@ luac.out
|
|||||||
.DS_Store
|
.DS_Store
|
||||||
/Screenshots/*
|
/Screenshots/*
|
||||||
.env
|
.env
|
||||||
|
|
||||||
|
# oh-my-claudecode session state
|
||||||
|
.omc/
|
||||||
|
|||||||
@@ -0,0 +1,2 @@
|
|||||||
|
python 3.11.0
|
||||||
|
nodejs 20.0.0
|
||||||
@@ -1,81 +1,81 @@
|
|||||||
# Absolute VIM Configuration
|
# Absolute VIM
|
||||||
|
|
||||||
## Introduction
|
A Lua Neovim configuration managed by [lazy.nvim](https://github.com/folke/lazy.nvim). It lives at `.config/nvim` in [absolute-dotfiles](https://github.com/boxpositron/absolute-dotfiles) as a submodule, and works on its own too.
|
||||||
|
|
||||||
Here's the VIM configuration I'm going to be using for most of my professional work this year.
|
## Install
|
||||||
There may be changes as I discover new plugins. I intent to personalize this to my taste and
|
|
||||||
coding conventions. Feel free to try it out if you fancy 😄.
|
|
||||||
|
|
||||||
## Installation
|
Requirements: Neovim 0.12 or newer, git, a Nerd Font, `ripgrep` and `fd` for the picker, a C compiler for treesitter parsers, and optionally `lazygit` and ImageMagick (for image previews).
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
git clone https://github.com/boxpositron/absolute-vim ~/.config/nvim
|
||||||
git clone https://github.com/boxpositron/absolute-vim ~/.config/nvim --depth 1 && nvim
|
nvim # lazy.nvim bootstraps itself and installs the pinned plugins from lazy-lock.json
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Dependencies
|
Plugin versions are pinned in `lazy-lock.json`. Update them with `:Lazy update`, then commit the lockfile.
|
||||||
|
|
||||||
### Binaries
|
## Layout
|
||||||
|
|
||||||
> Improved Git Experience
|
```
|
||||||
|
init.lua -> require("absolute")
|
||||||
|
lua/current-theme.lua default colorscheme
|
||||||
|
lua/absolute/
|
||||||
|
core/ options, leader, colorscheme sync and the theme registry
|
||||||
|
lazy.lua lazy.nvim bootstrap; imports every spec in plugins/
|
||||||
|
plugins/ one plugin spec per file
|
||||||
|
after/ the matching configuration, required from each spec's config
|
||||||
|
remap.lua editor keymaps
|
||||||
|
lsp/, helpers/, utils/ extra LSP setup, project helpers, environment detection
|
||||||
|
docs/superpowers/ design spec and plan for the 2026 modernization
|
||||||
|
```
|
||||||
|
|
||||||
- [lazygit](https://github.com/jesseduffield/lazygit)
|
To add a plugin, create `plugins/<name>.lua` returning its spec, and put its setup in `after/<name>.lua`.
|
||||||
|
|
||||||
> Beautiful Code Screenshots
|
## What's inside
|
||||||
|
|
||||||
- [silicon](https://github.com/Aloxaf/silicon)
|
| Area | Plugins |
|
||||||
|
|---|---|
|
||||||
|
| Picker, explorer, notifications, input | snacks.nvim (also `bigfile` and `quickfile`) |
|
||||||
|
| Completion | blink.cmp with friendly-snippets; LSP, path, snippet and buffer sources, plus cmdline completion |
|
||||||
|
| LSP and formatting | nvim-lspconfig, mason (ts_ls, lua_ls, rust_analyzer, clangd, tailwindcss, svelte, astro, biome and more), conform |
|
||||||
|
| Syntax | nvim-treesitter, treesitter-context, treesj, tree-sitter-ghostty |
|
||||||
|
| Git | gitsigns with current-line blame, mini.diff, lazygit in toggleterm |
|
||||||
|
| Diagnostics and lists | trouble, todo-comments, nvim-bqf |
|
||||||
|
| Debugging | nvim-dap and dap-ui |
|
||||||
|
| Languages and tools | flutter-tools, venv-selector, apple-pkl, tailwind-sorter, markview, image.nvim, nvim-silicon |
|
||||||
|
| UI | lualine, incline, indent-blankline, smear-cursor, highlight-colors, flash, mini |
|
||||||
|
| Themes | tokyonight (default), catppuccin, rose-pine, nightfly |
|
||||||
|
|
||||||
> Fuzzy Finder
|
The 2026 modernization replaced Telescope with the snacks picker, nvim-cmp with blink.cmp, and nvim-notify and dressing with snacks, and removed abandoned and AI plugins. The spec and plan are in `docs/superpowers/`.
|
||||||
|
|
||||||
- [fzf](https://github.com/junegunn/fzf)
|
## Themes
|
||||||
|
|
||||||
### Fonts
|
`<leader>cs` opens a colorscheme picker. Changing the colorscheme also switches Ghostty and WezTerm to the matching theme, using the mappings in `core/theme-registry.lua`. The startup colorscheme is set in `lua/current-theme.lua`.
|
||||||
|
|
||||||
- [Noto Emoji](https://fonts.google.com/noto/specimen/Noto+Emoji)
|
## Keymaps
|
||||||
- [JetBrains Mono](https://fonts.google.com/specimen/JetBrains+Mono)
|
|
||||||
|
|
||||||
### Themes
|
The leader is Space. Highlights:
|
||||||
|
|
||||||
- [Tokyonight](https://github.com/folke/tokyonight.nvim)
|
| Keys | Action |
|
||||||
|
|---|---|
|
||||||
|
| `<C-p>` | Find files |
|
||||||
|
| `<leader>gf` / `<leader>pr` | Git files / recent files |
|
||||||
|
| `<leader>ps` / `<leader>sb` | Live grep / grep the word under the cursor |
|
||||||
|
| `<leader>pf` / `<leader>cf` | File explorer at the cwd / at the current file's directory |
|
||||||
|
| `<leader>pt` / `<leader>tt` | TODO comments in the picker / in Trouble |
|
||||||
|
| `gd` `gi` `gt` / `<leader>cr` | Definitions, implementations, type definitions / references |
|
||||||
|
| `K` / `<leader>gh` | Hover docs / signature help |
|
||||||
|
| `<leader>rn` / `<leader>ca` / `<leader>f` | Rename / code actions / format |
|
||||||
|
| `<leader>rs` | Restart LSP |
|
||||||
|
| `<leader>td` `<leader>ts` `<leader>tq` | Trouble: diagnostics, symbols, quickfix |
|
||||||
|
| `<leader>gs` | lazygit |
|
||||||
|
| `<leader>db` | Toggle a breakpoint |
|
||||||
|
| `<leader>m` | Split or join the node under the cursor (treesj) |
|
||||||
|
| `<leader>u` | Undo tree |
|
||||||
|
| `<leader>sr` | Replace the word under the cursor |
|
||||||
|
| `<leader>y` / `<leader>p` | Yank to the system clipboard / paste without overwriting the register |
|
||||||
|
| `<leader>gr` | Run a shell command in the git root |
|
||||||
|
| `<leader>vs` | Select a Python virtualenv |
|
||||||
|
| `<leader>sc` | Screenshot the selection with Silicon |
|
||||||
|
| `<leader>?` | Search all keymaps |
|
||||||
|
|
||||||
### Plugins
|
blink.cmp uses its default keymap preset: `<C-space>` opens the menu, `<C-y>` accepts, `<C-n>` and `<C-p>` move through items.
|
||||||
|
|
||||||
- [CheatSheet](https://github.com/sudormrfbin/cheatsheet.nvim)
|
|
||||||
- [Comment](https://github.com/numToStr/Comment.nvim)
|
|
||||||
- DAP
|
|
||||||
- Dashboard
|
|
||||||
- GitIgnore
|
|
||||||
- GitSigns
|
|
||||||
- Harpoon
|
|
||||||
- Incline
|
|
||||||
- IndentBlankline
|
|
||||||
- Jedi
|
|
||||||
- KeySeer
|
|
||||||
- LuaLine
|
|
||||||
- Mason
|
|
||||||
- Mini
|
|
||||||
- NoneLS
|
|
||||||
- NvimBQF
|
|
||||||
- NvimCMP
|
|
||||||
- NvimSilicon
|
|
||||||
- NvimSurround
|
|
||||||
- NvimTree
|
|
||||||
- NvimTreesitter
|
|
||||||
- PoetV
|
|
||||||
- SuperTab
|
|
||||||
- TailwindSorter
|
|
||||||
- Telescope
|
|
||||||
- TodoComments
|
|
||||||
- ToggleTerm
|
|
||||||
- TreeSJ
|
|
||||||
- Trouble
|
|
||||||
- UndoTree
|
|
||||||
|
|
||||||
## Keybindings
|
|
||||||
|
|
||||||
### General
|
|
||||||
|
|
||||||
| Keybinding | Description |
|
|
||||||
|
|
||||||
|------------|-------------|
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,369 @@
|
|||||||
|
# Neovim Config Modernization — Design Spec
|
||||||
|
|
||||||
|
**Date:** 2026-05-02
|
||||||
|
**Target Neovim version:** 0.12.x
|
||||||
|
**Branch strategy:** Single branch, three sequential commits with restart-and-validate between each.
|
||||||
|
|
||||||
|
## Goals
|
||||||
|
|
||||||
|
1. Fix four silent breakages currently in the running config.
|
||||||
|
2. Remove abandoned, archived, or superseded plugins.
|
||||||
|
3. Swap two plugin engines that have been overtaken by snacks.nvim and blink.cmp in the 2026 ecosystem.
|
||||||
|
4. End up with a smaller, less-redundant `lua/absolute/` tree that is consistent with Neovim 0.12 idioms.
|
||||||
|
|
||||||
|
## Non-goals
|
||||||
|
|
||||||
|
- Migrating `nvim-treesitter` from frozen `master` to the 0.12-only `main` rewrite. Deferred to a separate, future spec.
|
||||||
|
- Restructuring the `absolute/` module layout. The current `core / plugins / after / utils / helpers` split is preserved.
|
||||||
|
- Adding new AI plugins. All AI integrations (`opencode`, `codecompanion`, `copilot`, `gen`, `llm`) are removed in this spec.
|
||||||
|
- Changing colorscheme behavior or the `theme-registry` system, which is recent and intentional.
|
||||||
|
|
||||||
|
## Scope summary
|
||||||
|
|
||||||
|
| Phase | Theme | Risk | Files touched |
|
||||||
|
|---|---|---|---|
|
||||||
|
| 1 | Triage and deletions | Low | ~20 files (mostly deletes) |
|
||||||
|
| 2 | UI swap (notify + dressing → snacks) | Low | 4 files |
|
||||||
|
| 3 | Engine swaps (nvim-cmp → blink, telescope → snacks.picker) | Medium | ~15 files |
|
||||||
|
|
||||||
|
Each phase is one commit on the same branch. Restart Neovim and validate after each commit before starting the next.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Phase 1 — Triage and deletions
|
||||||
|
|
||||||
|
### Critical fixes
|
||||||
|
|
||||||
|
**C1 — `lua/absolute/remap.lua`: keymap collision on `<leader>j` / `<leader>k`.**
|
||||||
|
Lines 70–73 bind `<leader>k`/`<leader>j` to `lnext`/`lprev`. Lines 120–124 rebind the same keys to window resize, silently overriding them. The window-resize 4-way pad (`<leader>h/j/k/l`) is the intentional binding.
|
||||||
|
|
||||||
|
**Action:** Delete lines 70–73. If location-list nav is wanted, rebind to the idiomatic `]l` / `[l` pair (next / previous location-list entry). Decision in this spec: rebind to `]l` / `[l`.
|
||||||
|
|
||||||
|
**C2 — `lua/absolute/after/lsp-config.lua`: deprecated diagnostic-sign API.**
|
||||||
|
Lines 73–83 use `vim.fn.sign_define` to set diagnostic gutter icons. This API is deprecated in 0.10 and is removed in 0.12.
|
||||||
|
|
||||||
|
**Action:** Replace with the modern `vim.diagnostic.config` table:
|
||||||
|
```lua
|
||||||
|
vim.diagnostic.config({
|
||||||
|
signs = {
|
||||||
|
text = {
|
||||||
|
[vim.diagnostic.severity.ERROR] = " ",
|
||||||
|
[vim.diagnostic.severity.WARN] = " ",
|
||||||
|
[vim.diagnostic.severity.HINT] = " ",
|
||||||
|
[vim.diagnostic.severity.INFO] = " ",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
```
|
||||||
|
|
||||||
|
**C3 — Orphan after-file `lua/absolute/after/nvim-tree.lua`.**
|
||||||
|
There is no matching plugin spec in `lua/absolute/plugins/`. The file is dead but will crash on `require` if anything ever loads it.
|
||||||
|
|
||||||
|
**Action:** Delete the file.
|
||||||
|
|
||||||
|
**C4 — Non-idiomatic require in `lua/absolute/lazy.lua:36`.**
|
||||||
|
`require("../current-theme")` uses a literal-slash module name. The file is at `lua/current-theme.lua`, which is on the runtime path; the canonical form is `require("current-theme")`.
|
||||||
|
|
||||||
|
**Action:** Change to `require("current-theme")`.
|
||||||
|
|
||||||
|
### Plugin removals
|
||||||
|
|
||||||
|
The following plugin specs and their after-files are deleted. lazy.nvim removes them from `lazy-lock.json` automatically on the next `:Lazy sync`.
|
||||||
|
|
||||||
|
| Plugin | Files deleted | Reason |
|
||||||
|
|---|---|---|
|
||||||
|
| `playground` | `plugins/nvim-treesitter-playground.lua` | Repo archived 2024; replaced by built-in `:Inspect` / `:InspectTree` / `:EditQuery` |
|
||||||
|
| `vim-maximizer` | `plugins/vim-maximizer.lua` | Last commit 2013; native `<C-w>_` and `<C-w>\|` cover the use case |
|
||||||
|
| `poet-v` | `plugins/poet-v.lua`, `after/poet-v.lua` | Abandoned; `venv-selector.nvim` covers Python envs |
|
||||||
|
| `git-blame.nvim` | `plugins/git-blame.lua` | Replaced by gitsigns `current_line_blame` |
|
||||||
|
| `render-markdown.nvim` | `plugins/render-markdown.lua` | Picked `markview.nvim` as single markdown renderer |
|
||||||
|
| `codecompanion.nvim` | `plugins/codecompanion.lua`, `after/codecompanion.lua` | AI cleanup |
|
||||||
|
| `copilot.vim` | `plugins/copilot.lua` | AI cleanup |
|
||||||
|
| `gen.nvim` | `plugins/gen.lua`, `after/gen.lua` | AI cleanup |
|
||||||
|
| `llm.nvim` | `plugins/llm.lua`, `after/llm.lua` | AI cleanup |
|
||||||
|
| `opencode.nvim` | `plugins/opencode.lua`, `after/opencode.lua` | AI cleanup |
|
||||||
|
|
||||||
|
`dressing.nvim` and `nvim-notify` removal is deferred to Phase 2 because both are *swapped*, not deleted.
|
||||||
|
|
||||||
|
### New file: `lua/absolute/plugins/snacks.lua`
|
||||||
|
|
||||||
|
Removing `opencode.nvim` removes the dependency that pulled `snacks.nvim` into the tree. snacks is required for Phase 2 (input, notifier) and Phase 3 (picker), so a top-level spec is added now.
|
||||||
|
|
||||||
|
```lua
|
||||||
|
return {
|
||||||
|
"folke/snacks.nvim",
|
||||||
|
priority = 1000,
|
||||||
|
lazy = false,
|
||||||
|
---@type snacks.Config
|
||||||
|
opts = {
|
||||||
|
bigfile = { enabled = true },
|
||||||
|
quickfile = { enabled = true },
|
||||||
|
-- input, notifier added in Phase 2
|
||||||
|
-- picker added in Phase 3
|
||||||
|
},
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Config tweak: gitsigns line-blame
|
||||||
|
|
||||||
|
`lua/absolute/after/gitsigns.lua` is updated to enable virtual-text blame on the current line, replacing the functionality lost when `git-blame.nvim` is removed:
|
||||||
|
|
||||||
|
```lua
|
||||||
|
current_line_blame = true,
|
||||||
|
current_line_blame_opts = {
|
||||||
|
virt_text_pos = "eol",
|
||||||
|
delay = 500,
|
||||||
|
ignore_whitespace = false,
|
||||||
|
},
|
||||||
|
```
|
||||||
|
|
||||||
|
### Untracked work
|
||||||
|
- `lua/absolute/core/theme-registry.lua` is committed as-is (already complete).
|
||||||
|
- `lua/absolute/plugins/flash.lua` is committed as-is, retaining `enabled = false`.
|
||||||
|
- `lua/absolute/after/opencode.lua` is deleted in this phase along with the rest of opencode.
|
||||||
|
|
||||||
|
### Disabled-spec policy
|
||||||
|
|
||||||
|
Seven plugin specs currently have `enabled = false` and look intentional:
|
||||||
|
`apple-pkl`, `flash`, `flutter-tools`, `mini`, `nvim-surround`, `smear-cursor`, `tailwind-sorter`.
|
||||||
|
|
||||||
|
These are left untouched — the user toggles them on for specific projects. They are not part of this modernization.
|
||||||
|
|
||||||
|
### Phase 1 net change
|
||||||
|
|
||||||
|
- 16 plugin spec or after-files deleted
|
||||||
|
- 1 file added (`plugins/snacks.lua`)
|
||||||
|
- 4 files edited (`remap.lua`, `after/lsp-config.lua`, `after/gitsigns.lua`, `lazy.lua`)
|
||||||
|
- ~10 plugins removed from lockfile
|
||||||
|
|
||||||
|
### Phase 1 validation
|
||||||
|
|
||||||
|
After committing Phase 1, restart Neovim and verify:
|
||||||
|
|
||||||
|
1. No errors on startup (`:messages` empty of `E:` lines).
|
||||||
|
2. Diagnostic signs render (open a Lua file with an error).
|
||||||
|
3. `:Lazy clean` removes the orphaned plugins from disk.
|
||||||
|
4. `<leader>j` and `<leader>k` resize the current window.
|
||||||
|
5. `]l` / `[l` jump in location list.
|
||||||
|
6. Gitsigns shows current-line blame after a 500 ms idle.
|
||||||
|
7. `:Inspect`, `:InspectTree`, `:EditQuery` all work (proves treesitter playground replacement).
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Phase 2 — UI swap (notify + dressing → snacks)
|
||||||
|
|
||||||
|
Both replaced plugins are tiny. Migration is mostly deletes plus a snacks config bump.
|
||||||
|
|
||||||
|
### Deletions
|
||||||
|
|
||||||
|
| File | Notes |
|
||||||
|
|---|---|
|
||||||
|
| `lua/absolute/plugins/notify.lua` | Lazy spec |
|
||||||
|
| `lua/absolute/after/notify.lua` | Configures `vim.notify = notify` |
|
||||||
|
| `lua/absolute/plugins/dressing.lua` | Trivial `VeryLazy` spec, no after-file |
|
||||||
|
|
||||||
|
`nvim-notify` and `dressing.nvim` drop from the lockfile.
|
||||||
|
|
||||||
|
### Update `lua/absolute/plugins/snacks.lua`
|
||||||
|
|
||||||
|
Add `input` and `notifier` modules. Notifier config preserves the icons and timeout from the existing nvim-notify setup:
|
||||||
|
|
||||||
|
```lua
|
||||||
|
opts = {
|
||||||
|
bigfile = { enabled = true },
|
||||||
|
quickfile = { enabled = true },
|
||||||
|
input = { enabled = true },
|
||||||
|
notifier = {
|
||||||
|
enabled = true,
|
||||||
|
timeout = 3000,
|
||||||
|
style = "compact",
|
||||||
|
top_down = true,
|
||||||
|
icons = {
|
||||||
|
debug = "",
|
||||||
|
error = "",
|
||||||
|
info = "",
|
||||||
|
trace = "✎",
|
||||||
|
warn = "",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
snacks installs `vim.notify = Snacks.notifier.notify` and overrides `vim.ui.input` automatically when the modules are enabled. No manual hookup is needed.
|
||||||
|
|
||||||
|
### Settings dropped (no equivalent needed)
|
||||||
|
|
||||||
|
`background_colour`, `fps`, `render`, `stages`, `minimum_width`, `time_formats` from the old nvim-notify config — all subsumed by snacks defaults or replaced by the `style = "compact"` choice.
|
||||||
|
|
||||||
|
### Phase 2 net change
|
||||||
|
|
||||||
|
- 3 files deleted
|
||||||
|
- 1 file edited (`plugins/snacks.lua`)
|
||||||
|
- 0 keymaps changed
|
||||||
|
- 2 plugins removed from lockfile
|
||||||
|
|
||||||
|
### Phase 2 validation
|
||||||
|
|
||||||
|
1. Restart Neovim. No errors on startup.
|
||||||
|
2. Trigger a notification (e.g. `:lua vim.notify("test", vim.log.levels.INFO)`) — toast appears in the top-right.
|
||||||
|
3. Trigger a `vim.ui.input` (e.g. `<leader>rn` to LSP-rename, or `<leader>gr` to enter a git-root command) — centered floating prompt appears.
|
||||||
|
4. Trigger a `vim.ui.select` (e.g. `<leader>ca` for code actions) — the snacks select UI appears.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Phase 3 — Engine swaps (blink.cmp + snacks.picker)
|
||||||
|
|
||||||
|
The largest phase. Two engine swaps in one commit because they share the snacks ecosystem and both touch the LSP attach path.
|
||||||
|
|
||||||
|
### 3a — `nvim-cmp` → `blink.cmp`
|
||||||
|
|
||||||
|
**Plugins removed from lockfile** when `nvim-cmp` is deleted (they were nvim-cmp dependencies):
|
||||||
|
`nvim-cmp`, `cmp-nvim-lsp`, `cmp-buffer`, `cmp-path`, `cmp-cmdline`, `cmp_luasnip`, `LuaSnip`, `lspkind.nvim`. `friendly-snippets` is kept and consumed directly by blink.
|
||||||
|
|
||||||
|
Files deleted: `lua/absolute/plugins/nvim-cmp.lua`, `lua/absolute/after/nvim-cmp.lua`.
|
||||||
|
|
||||||
|
**New file `lua/absolute/plugins/blink-cmp.lua`:**
|
||||||
|
```lua
|
||||||
|
return {
|
||||||
|
"saghen/blink.cmp",
|
||||||
|
version = "1.*", -- pin to v1 stable
|
||||||
|
event = "InsertEnter",
|
||||||
|
dependencies = { "rafamadriz/friendly-snippets" },
|
||||||
|
config = function()
|
||||||
|
require("absolute.after.blink-cmp")
|
||||||
|
end,
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
**New file `lua/absolute/after/blink-cmp.lua`:**
|
||||||
|
```lua
|
||||||
|
require("blink.cmp").setup({
|
||||||
|
keymap = { preset = "default" }, -- C-y accept, C-n/p navigate, C-Space trigger
|
||||||
|
appearance = { nerd_font_variant = "mono" },
|
||||||
|
sources = {
|
||||||
|
default = { "lsp", "path", "snippets", "buffer" },
|
||||||
|
},
|
||||||
|
cmdline = {
|
||||||
|
keymap = { preset = "cmdline" },
|
||||||
|
completion = { menu = { auto_show = true } },
|
||||||
|
},
|
||||||
|
signature = { enabled = true },
|
||||||
|
})
|
||||||
|
```
|
||||||
|
|
||||||
|
**Edit `lua/absolute/after/lsp-config.lua`:**
|
||||||
|
|
||||||
|
Replace the cmp-nvim-lsp capabilities provider:
|
||||||
|
```lua
|
||||||
|
-- old:
|
||||||
|
local cmp_nvim_lsp = require("cmp_nvim_lsp")
|
||||||
|
local capabilities = cmp_nvim_lsp.default_capabilities()
|
||||||
|
|
||||||
|
-- new:
|
||||||
|
local capabilities = require("blink.cmp").get_lsp_capabilities()
|
||||||
|
```
|
||||||
|
|
||||||
|
### 3b — `telescope.nvim` → `snacks.picker`
|
||||||
|
|
||||||
|
**Plugins removed from lockfile** when `telescope.nvim` is deleted:
|
||||||
|
`telescope.nvim`, `telescope-file-browser.nvim`, `telescope-live-grep-args.nvim`, `telescope-media-files.nvim`, `telescope-themes`, `telescope-dap.nvim`, `popup.nvim`.
|
||||||
|
|
||||||
|
`junegunn/fzf` **stays** — it is also a dependency of `nvim-bqf` (`lua/absolute/plugins/nvim-bqf.lua:6`), which is unrelated to this swap. The `lua/absolute/plugins/fzf.lua` spec is kept as-is.
|
||||||
|
|
||||||
|
Files deleted:
|
||||||
|
- `lua/absolute/plugins/telescope.lua`
|
||||||
|
- `lua/absolute/after/telescope.lua`
|
||||||
|
- `lua/absolute/utils/telescope_image_preview.lua` (replaced by snacks built-in image preview via image.nvim)
|
||||||
|
|
||||||
|
**Update `lua/absolute/plugins/snacks.lua`** — add the picker module:
|
||||||
|
```lua
|
||||||
|
opts = {
|
||||||
|
bigfile = { enabled = true },
|
||||||
|
quickfile = { enabled = true },
|
||||||
|
input = { enabled = true },
|
||||||
|
notifier = { enabled = true, ... }, -- from Phase 2
|
||||||
|
picker = {
|
||||||
|
enabled = true,
|
||||||
|
ui_select = true, -- override vim.ui.select with picker
|
||||||
|
},
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
**New file `lua/absolute/after/snacks.lua`** — replaces the old `after/telescope.lua` and houses the picker keymaps:
|
||||||
|
```lua
|
||||||
|
local map = vim.keymap.set
|
||||||
|
local opts = { noremap = true, silent = true }
|
||||||
|
|
||||||
|
map("n", "<C-p>", function() Snacks.picker.files() end, vim.tbl_extend("force", opts, { desc = "Find files" }))
|
||||||
|
map("n", "<leader>gf", function() Snacks.picker.git_files() end, vim.tbl_extend("force", opts, { desc = "Find git files" }))
|
||||||
|
map("n", "<leader>pr", function() Snacks.picker.recent() end, vim.tbl_extend("force", opts, { desc = "Recent files" }))
|
||||||
|
map("n", "<leader>ps", function() Snacks.picker.grep() end, vim.tbl_extend("force", opts, { desc = "Live grep" }))
|
||||||
|
map("n", "<leader>sb", function() Snacks.picker.grep_word() end, vim.tbl_extend("force", opts, { desc = "Grep word under cursor" }))
|
||||||
|
map("n", "<leader>pf", function() Snacks.picker.explorer() end, vim.tbl_extend("force", opts, { desc = "File explorer" }))
|
||||||
|
map("n", "<leader>cf", function() Snacks.picker.explorer({ cwd = vim.fn.expand("%:p:h") }) end, vim.tbl_extend("force", opts, { desc = "File explorer at file dir" }))
|
||||||
|
```
|
||||||
|
|
||||||
|
**Edits to existing files**, swapping `<cmd>Telescope ...<CR>` for `Snacks.picker.*` calls:
|
||||||
|
|
||||||
|
| File | Old binding | New binding |
|
||||||
|
|---|---|---|
|
||||||
|
| `remap.lua:7` | `<cmd>Telescope keymaps<CR>` | `function() Snacks.picker.keymaps() end` |
|
||||||
|
| `core/colorscheme.lua:150` | `<cmd>Telescope colorscheme<CR>` | `function() Snacks.picker.colorschemes() end` |
|
||||||
|
| `core/colorscheme.lua:153` | `<cmd>Telescope themes<CR>` | **delete** the `<leader>th` binding entirely (merged into `<leader>cs`) |
|
||||||
|
| `after/lsp-config.lua:20` | `<cmd>Telescope lsp_definitions<CR>` | `function() Snacks.picker.lsp_definitions() end` |
|
||||||
|
| `after/lsp-config.lua:26` | `<cmd>Telescope lsp_implementations<CR>` | `function() Snacks.picker.lsp_implementations() end` |
|
||||||
|
| `after/lsp-config.lua:38` | `<cmd>Telescope lsp_type_definitions<CR>` | `function() Snacks.picker.lsp_type_definitions() end` |
|
||||||
|
| `after/lsp-config.lua:47` | `<cmd>Telescope lsp_references<CR>` | `function() Snacks.picker.lsp_references() end` |
|
||||||
|
| `after/todo-comments.lua:18-20` | `vim.cmd([[TodoTelescope]])` | `Snacks.picker.todo_comments()` |
|
||||||
|
|
||||||
|
### Things lost in Phase 3
|
||||||
|
|
||||||
|
1. **DAP picker** (`telescope-dap`) — DAP itself works; the picker UI for breakpoints/variables is gone. `nvim-dap-ui` already covers most of this.
|
||||||
|
2. **`live-grep-args` argument syntax** — snacks accepts `--type lua` style args via a slightly different prompt prefix; muscle-memory shifts.
|
||||||
|
3. **Custom `telescope_image_preview.lua`** — dropped. snacks displays images natively via `image.nvim` integration in its file picker.
|
||||||
|
4. **`telescope-themes` registry helpers** — `<leader>th` is dropped. `<leader>cs` (colorschemes picker) replaces both. The `theme-registry.lua` system continues to work because it hooks `ColorScheme` autocmds, which fire regardless of how the colorscheme is selected.
|
||||||
|
|
||||||
|
### Phase 3 net change
|
||||||
|
|
||||||
|
- ~14 plugins removed from lockfile (8 from `nvim-cmp` chain, 7 from `telescope` chain — `friendly-snippets` stays)
|
||||||
|
- 5 files deleted (`plugins/nvim-cmp.lua`, `after/nvim-cmp.lua`, `plugins/telescope.lua`, `after/telescope.lua`, `utils/telescope_image_preview.lua`)
|
||||||
|
- 3 files added (`plugins/blink-cmp.lua`, `after/blink-cmp.lua`, `after/snacks.lua`)
|
||||||
|
- 5 files edited (`plugins/snacks.lua`, `after/lsp-config.lua`, `core/colorscheme.lua`, `remap.lua`, `after/todo-comments.lua`)
|
||||||
|
|
||||||
|
### Phase 3 validation
|
||||||
|
|
||||||
|
1. Restart Neovim. No errors on startup.
|
||||||
|
2. Open an insert-mode completion (`<C-Space>` in a code file) — blink menu appears with LSP, snippets, path, buffer sources.
|
||||||
|
3. Trigger snippet expansion (e.g. `for<Tab>` in Lua) — friendly-snippets fire via blink's snippet engine.
|
||||||
|
4. `<C-p>` opens snacks file picker and previews work.
|
||||||
|
5. `<leader>ps` opens live grep; `<leader>sb` greps the word under cursor.
|
||||||
|
6. LSP `gd` / `gi` / `gt` / `<leader>cr` open snacks LSP pickers.
|
||||||
|
7. `<leader>cs` opens colorscheme picker; selecting a theme triggers the wezterm/ghostty sync.
|
||||||
|
8. `<leader>?` opens keymaps picker.
|
||||||
|
9. `:checkhealth blink.cmp` is clean.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Risk and rollback
|
||||||
|
|
||||||
|
Each phase is one commit. To roll a phase back, `git revert <sha>` and `:Lazy sync` to restore the prior plugin set. Because each phase ends in a working state, partial rollback (e.g. revert Phase 3 but keep Phases 1 and 2) is safe.
|
||||||
|
|
||||||
|
The highest-risk single change is the LSP-capabilities provider swap in `after/lsp-config.lua` (Phase 3a). If LSP completion misbehaves after Phase 3, isolate by temporarily reverting just that one line to the cmp-nvim-lsp provider and bisecting the blink.cmp config.
|
||||||
|
|
||||||
|
## Open items deferred
|
||||||
|
|
||||||
|
- Treesitter `master` → `main` rewrite (Neovim 0.12-only). Worth its own spec when ready.
|
||||||
|
- Replacing `nvim-tmux-navigation` configuration file naming (the spec file is `vim-tmux-navigator.lua` but the plugin is `alexghergh/nvim-tmux-navigation`). Cosmetic; not part of this work.
|
||||||
|
- Auditing the seven intentionally-disabled plugin specs. Out of scope.
|
||||||
|
|
||||||
|
## Acceptance criteria
|
||||||
|
|
||||||
|
After all three phases land:
|
||||||
|
|
||||||
|
1. `:checkhealth` reports no deprecated API usage related to this work.
|
||||||
|
2. `lazy-lock.json` no longer contains: `nvim-cmp`, `cmp-*`, `lspkind.nvim`, `LuaSnip`, `telescope.nvim`, `telescope-*`, `popup.nvim`, `nvim-notify`, `dressing.nvim`, `playground`, `vim-maximizer`, `poet-v`, `git-blame.nvim`, `render-markdown.nvim`, `codecompanion.nvim`, `copilot.vim`, `gen.nvim`, `llm.nvim`, `opencode.nvim`.
|
||||||
|
3. `lazy-lock.json` newly contains: `blink.cmp`, `snacks.nvim`.
|
||||||
|
4. Every keymap in the migration tables resolves to a working snacks.picker or blink.cmp action.
|
||||||
|
5. Diagnostic gutter signs render through `vim.diagnostic.config`.
|
||||||
|
6. `<leader>j` and `<leader>k` resize the current window with no collision.
|
||||||
|
7. Startup time as reported by `:Lazy profile` is no worse than before.
|
||||||
+48
-66
@@ -1,69 +1,51 @@
|
|||||||
{
|
{
|
||||||
"Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" },
|
"Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" },
|
||||||
"LuaSnip": { "branch": "master", "commit": "e808bee352d1a6fcf902ca1a71cee76e60e24071" },
|
"blink.cmp": { "branch": "main", "commit": "78336bc89ee5365633bcf754d93df01678b5c08f" },
|
||||||
"catppuccin": { "branch": "main", "commit": "63685e1562ef53873c9764b483d7ac5c7a608922" },
|
"catppuccin": { "branch": "main", "commit": "edefef779ab08ce1a4a404713e3012b0d202bd35" },
|
||||||
"cheatsheet.nvim": { "branch": "master", "commit": "9716f9aaa94dd1fd6ce59b5aae0e5f25e2a463ef" },
|
"conform.nvim": { "branch": "master", "commit": "016802de402556da54c36bd7359b441266b01cdd" },
|
||||||
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
|
"flash.nvim": { "branch": "main", "commit": "3c942666f115e2811e959eabbdd361a025db8b63" },
|
||||||
"cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" },
|
"flutter-tools.nvim": { "branch": "main", "commit": "70430c32d176f4a15c6e2c80586cd2791e3a664e" },
|
||||||
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
|
"friendly-snippets": { "branch": "main", "commit": "b4d01b0fdf3c9a549961c2f9ffe8dc09be166219" },
|
||||||
"cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" },
|
"fzf": { "branch": "master", "commit": "25adb674537bb2140f82602651a31fbd7677cd50" },
|
||||||
"conform.nvim": { "branch": "master", "commit": "1a99fdc1d3aa9ccdf3021e67982a679a8c5c740c" },
|
"gitsigns.nvim": { "branch": "main", "commit": "851a051e2bd2caba97e23314c68d69f1b1cf5d19" },
|
||||||
"copilot.vim": { "branch": "release", "commit": "782461159655b259cff10ecff05efa761e3d4764" },
|
"image.nvim": { "branch": "master", "commit": "365e2ace0f619164ae6fd2f6f1d2807775dd6849" },
|
||||||
"dashboard-nvim": { "branch": "master", "commit": "fabf5feec96185817c732d47d363f34034212685" },
|
"incline.nvim": { "branch": "main", "commit": "debd628e9395f7a9da57bdc31ce75ca6b40a880b" },
|
||||||
"dressing.nvim": { "branch": "master", "commit": "1b7921eecc65af1baf8ac1dc06f0794934cbcfb2" },
|
"indent-blankline.nvim": { "branch": "master", "commit": "f1e186e44d3b7f9ae918008e2c28ce37c6023d2d" },
|
||||||
"flutter-tools.nvim": { "branch": "main", "commit": "ea1d398f543a54ba95357c3b8bb9d6f68eaec36c" },
|
"lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" },
|
||||||
"friendly-snippets": { "branch": "main", "commit": "00ebcaa159e817150bd83bfe2d51fa3b3377d5c4" },
|
"lualine.nvim": { "branch": "master", "commit": "221ce6b2d999187044529f49da6554a92f740a96" },
|
||||||
"fzf": { "branch": "master", "commit": "855f90727af7827d9934b7fa00ea5ed51f5e4e81" },
|
"markview.nvim": { "branch": "main", "commit": "49d2cf7ced872db74083a144ded1f94fe224d09a" },
|
||||||
"git-blame.nvim": { "branch": "master", "commit": "8c56e864d448e84e0162872c381dd2715824dce2" },
|
"mason-lspconfig.nvim": { "branch": "main", "commit": "e17625cdc8c2650787467398e02c5d63a2cde966" },
|
||||||
"gitignore.nvim": { "branch": "master", "commit": "2455191ec94da8ed222806a4fe3aa358eac1e558" },
|
"mason-registry": { "branch": "main", "commit": "ee10e9db59f13054eea925042cae6d1df461ec25" },
|
||||||
"gitsigns.nvim": { "branch": "main", "commit": "1ef74b546732f185d0f806860fa5404df7614f28" },
|
"mason.nvim": { "branch": "main", "commit": "2a6940af80375532e5e9e7c1f2fc6319a1b7a69d" },
|
||||||
"harpoon": { "branch": "master", "commit": "1bc17e3e42ea3c46b33c0bbad6a880792692a1b3" },
|
"mini.diff": { "branch": "main", "commit": "626b8a5b93874c4d05ca25aedec56cfff0b378fb" },
|
||||||
"incline.nvim": { "branch": "main", "commit": "16fc9c073e3ea4175b66ad94375df6d73fc114c0" },
|
"mini.nvim": { "branch": "main", "commit": "0420076298c4457f200c2de468f65d080597a347" },
|
||||||
"indent-blankline.nvim": { "branch": "master", "commit": "18603eb949eba08300799f64027af11ef922283f" },
|
"nightfly": { "branch": "master", "commit": "2c31d07ce05efa92bcb7f893f9c74a846226c898" },
|
||||||
"keyseer.nvim": { "branch": "main", "commit": "6cb478f9b2be4af4680ceb0308a9b49cd6b6ea73" },
|
"nvim-bqf": { "branch": "main", "commit": "c282a62bec6c0621a1ef5132aa3f4c9fc4dcc2c7" },
|
||||||
"lazy.nvim": { "branch": "main", "commit": "460e1cd8f24e364d54543a4b0e83f6f4ec1f65fb" },
|
"nvim-dap": { "branch": "master", "commit": "cfa2d58f4537aca6ca83e2de1a0d9f1491121264" },
|
||||||
"lspkind.nvim": { "branch": "master", "commit": "cff4ae321a91ee3473a92ea1a8c637e3a9510aec" },
|
"nvim-dap-ui": { "branch": "master", "commit": "cc9dd33aade7f20bae414d0cba163bc60d4d4b43" },
|
||||||
"lualine.nvim": { "branch": "master", "commit": "b431d228b7bbcdaea818bdc3e25b8cdbe861f056" },
|
"nvim-dap-virtual-text": { "branch": "master", "commit": "fbdb48c2ed45f4a8293d0d483f7730d24467ccb6" },
|
||||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "25c11854aa25558ee6c03432edfa0df0217324be" },
|
"nvim-highlight-colors": { "branch": "main", "commit": "e4c7af0211866162d999ce0bdd6a029302e19139" },
|
||||||
"mason-nvim-dap.nvim": { "branch": "main", "commit": "8b9363d83b5d779813cdd2819b8308651cec2a09" },
|
"nvim-lsp-file-operations": { "branch": "master", "commit": "72ea1d0fb1e5be0b4434ad794c8e0bb46d4df64c" },
|
||||||
"mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" },
|
"nvim-lspconfig": { "branch": "master", "commit": "c59fc922f718fa055f69f5f3bc888f23211571eb" },
|
||||||
"mini.nvim": { "branch": "main", "commit": "19e1584124cda35388d4fdb911eab7124014e541" },
|
"nvim-nio": { "branch": "master", "commit": "edcc181a875301dd21840189aa2f2f9ad69fc172" },
|
||||||
"nightfly": { "branch": "master", "commit": "19efaf31cbe15a429cb3ca6ac9c9fce13275045b" },
|
"nvim-silicon": { "branch": "main", "commit": "7f66bda8f60c97a5bf4b37e5b8acb0e829ae3c32" },
|
||||||
"noice.nvim": { "branch": "main", "commit": "c1ba80ccf6b3bd8c7fc88fe2e61085131d44ad65" },
|
"nvim-surround": { "branch": "main", "commit": "ae298105122c87bbe0a36b1ad20b06d417c0433e" },
|
||||||
"nui.nvim": { "branch": "main", "commit": "b58e2bfda5cea347c9d58b7f11cf3012c7b3953f" },
|
"nvim-tmux-navigation": { "branch": "main", "commit": "4898c98702954439233fdaf764c39636681e2861" },
|
||||||
"nvim-bqf": { "branch": "main", "commit": "1b24dc6050c34e8cd377b6b4cd6abe40509e0187" },
|
"nvim-treesitter": { "branch": "master", "commit": "cf12346a3414fa1b06af75c79faebe7f76df080a" },
|
||||||
"nvim-cmp": { "branch": "main", "commit": "ae644feb7b67bf1ce4260c231d1d4300b19c6f30" },
|
"nvim-treesitter-context": { "branch": "master", "commit": "8decd73460d26ef0a0befb745d022dd1fc2c38b8" },
|
||||||
"nvim-dap": { "branch": "master", "commit": "90616ae6ae40053103dc66872886fc26b94c70c8" },
|
"nvim-web-devicons": { "branch": "master", "commit": "58447c1fca354bbf184425e4a8d01deecbd6f3c4" },
|
||||||
"nvim-dap-python": { "branch": "master", "commit": "db72bf6ab9f75fe841e8e11e772ee7fef6f484f1" },
|
"pkl-neovim": { "branch": "main", "commit": "da9d189b4fad7e67e6b2a5456a3cbc4c9d32a17f" },
|
||||||
"nvim-dap-ui": { "branch": "master", "commit": "1c351e4e417d4691da12948b6ecf966936a56d28" },
|
"plenary.nvim": { "branch": "master", "commit": "74b06c6c75e4eeb3108ec01852001636d85a932b" },
|
||||||
"nvim-dap-virtual-text": { "branch": "master", "commit": "3497eb39bf413a57ab5b7e7e2e192683e462148c" },
|
"rose-pine": { "branch": "main", "commit": "ff483051a47e27d84bdef47703538df1ed9f4a47" },
|
||||||
"nvim-highlight-colors": { "branch": "main", "commit": "a411550ef85cae467b889ba7d1a96bd78332d90e" },
|
"smear-cursor.nvim": { "branch": "main", "commit": "4a0f7ac265b4ed1ce4d0af2afc13072763bfa691" },
|
||||||
"nvim-lsp-file-operations": { "branch": "master", "commit": "92a673de7ecaa157dd230d0128def10beb56d103" },
|
"snacks.nvim": { "branch": "main", "commit": "882c996cf28183f4d63640de0b4c02ec886d01f2" },
|
||||||
"nvim-lspconfig": { "branch": "master", "commit": "aaec5d049af99e7b975bdf68aca582f1aa91b338" },
|
"tailwind-sorter.nvim": { "branch": "main", "commit": "717e5c9761ed8334dadbb9357df7d826aae97b92" },
|
||||||
"nvim-nio": { "branch": "master", "commit": "a428f309119086dc78dd4b19306d2d67be884eee" },
|
"todo-comments.nvim": { "branch": "main", "commit": "31e3c38ce9b29781e4422fc0322eb0a21f4e8668" },
|
||||||
"nvim-notify": { "branch": "master", "commit": "d333b6f167900f6d9d42a59005d82919830626bf" },
|
"toggleterm.nvim": { "branch": "main", "commit": "50ea089fc548917cc3cc16b46a8211833b9e3c7c" },
|
||||||
"nvim-silicon": { "branch": "main", "commit": "9fe6001dc8cad4d9c53bcfc8649e3dc76ffa169c" },
|
"tokyonight": { "branch": "main", "commit": "cdc07ac78467a233fd62c493de29a17e0cf2b2b6" },
|
||||||
"nvim-surround": { "branch": "main", "commit": "ec2dc7671067e0086cdf29c2f5df2dd909d5f71f" },
|
"tree-sitter-ghostty": { "branch": "main", "commit": "a2075c3761a41449bb4faf69794c902dfef6d70e" },
|
||||||
"nvim-treesitter": { "branch": "master", "commit": "2b2ac302324f4cd2194c5dcaa59332b65e1c6403" },
|
"treesj": { "branch": "main", "commit": "9f349ba62c524f065d6f43254d731ddf8319b9bf" },
|
||||||
"nvim-treesitter-context": { "branch": "master", "commit": "7f7eeaa99e5a9beab518f502292871ae5f20de6f" },
|
"trouble.nvim": { "branch": "main", "commit": "bd67efe408d4816e25e8491cc5ad4088e708a69a" },
|
||||||
"nvim-web-devicons": { "branch": "master", "commit": "9154484705968658e9aab2b894d1b2a64bf9f83d" },
|
"undotree": { "branch": "master", "commit": "6fa6b57cda8459e1e4b2ca34df702f55242f4e4d" },
|
||||||
"nvim_lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" },
|
"venv-selector.nvim": { "branch": "main", "commit": "cc4bb3975de8835291f9bb45889e96c6b2795fc4" }
|
||||||
"pkl-neovim": { "branch": "main", "commit": "a0ae099c7eb926150ee0a126b1dd78086edbe3fc" },
|
|
||||||
"playground": { "branch": "master", "commit": "ba48c6a62a280eefb7c85725b0915e021a1a0749" },
|
|
||||||
"plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" },
|
|
||||||
"poet-v": { "branch": "master", "commit": "85a5dd44d89602cc3dccd2489924e9c7caab0044" },
|
|
||||||
"rose-pine": { "branch": "main", "commit": "8b1fd252255a7f2c41b4192a787ab62660b29f72" },
|
|
||||||
"tailwind-sorter.nvim": { "branch": "main", "commit": "e03eea3909c28509375993fb77a42454ac8ecbb2" },
|
|
||||||
"telescope-dap.nvim": { "branch": "master", "commit": "8c88d9716c91eaef1cdea13cb9390d8ef447dbfe" },
|
|
||||||
"telescope-file-browser.nvim": { "branch": "master", "commit": "dd9de68c08b6d678198a99f5ea13e0384a1f04cf" },
|
|
||||||
"telescope-themes": { "branch": "main", "commit": "f005622f066cc0cdbaf9bb44c48edbec67985501" },
|
|
||||||
"telescope.nvim": { "branch": "0.1.x", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" },
|
|
||||||
"todo-comments.nvim": { "branch": "main", "commit": "ae0a2afb47cf7395dc400e5dc4e05274bf4fb9e0" },
|
|
||||||
"toggleterm.nvim": { "branch": "main", "commit": "48be57eaba817f038d61bbf64d2c597f578c0827" },
|
|
||||||
"tokyonight": { "branch": "main", "commit": "817bb6ffff1b9ce72cdd45d9fcfa8c9cd1ad3839" },
|
|
||||||
"treesj": { "branch": "main", "commit": "0d81326b5afd36babe7dd480aabbb0b05f33e688" },
|
|
||||||
"trouble.nvim": { "branch": "main", "commit": "6efc446226679fda0547c0fd6a7892fd5f5b15d8" },
|
|
||||||
"undotree": { "branch": "master", "commit": "78b5241191852ffa9bb5da5ff2ee033160798c3b" },
|
|
||||||
"vim-maximizer": { "branch": "master", "commit": "2e54952fe91e140a2e69f35f22131219fcd9c5f1" },
|
|
||||||
"vim-tmux-navigator": { "branch": "master", "commit": "a9b52e7d36114d40350099f254b5f299a35df978" }
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,14 @@
|
|||||||
|
require("blink.cmp").setup({
|
||||||
|
keymap = { preset = "default" },
|
||||||
|
appearance = {
|
||||||
|
nerd_font_variant = "mono",
|
||||||
|
},
|
||||||
|
sources = {
|
||||||
|
default = { "lsp", "path", "snippets", "buffer" },
|
||||||
|
},
|
||||||
|
cmdline = {
|
||||||
|
keymap = { preset = "cmdline" },
|
||||||
|
completion = { menu = { auto_show = true } },
|
||||||
|
},
|
||||||
|
signature = { enabled = true },
|
||||||
|
})
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
local cheatsheet = require("cheatsheet")
|
|
||||||
|
|
||||||
cheatsheet.setup({})
|
|
||||||
@@ -1,14 +1,33 @@
|
|||||||
local conform = require("conform")
|
local conform = require("conform")
|
||||||
|
|
||||||
conform.setup({
|
conform.setup({
|
||||||
|
format_on_save = function(bufnr)
|
||||||
|
local disable_filetypes = {}
|
||||||
|
return {
|
||||||
|
timeout_ms = 500,
|
||||||
|
lsp_fallback = not disable_filetypes[vim.bo[bufnr].filetype],
|
||||||
|
}
|
||||||
|
end,
|
||||||
formatters_by_ft = {
|
formatters_by_ft = {
|
||||||
|
sh = { "shfmt" },
|
||||||
lua = { "stylua" },
|
lua = { "stylua" },
|
||||||
-- Conform will run multiple formatters sequentially
|
-- Conform will run multiple formatters sequentially
|
||||||
python = { "isort", "black" },
|
python = {
|
||||||
|
|
||||||
|
-- To fix auto-fixable lint errors.
|
||||||
|
"ruff_fix",
|
||||||
|
-- To run the Ruff formatter.
|
||||||
|
"ruff_format",
|
||||||
|
-- To organize the imports.
|
||||||
|
"ruff_organize_imports",
|
||||||
|
},
|
||||||
-- Use a sub-list to run only the first available formatter
|
-- Use a sub-list to run only the first available formatter
|
||||||
javascript = { "biome" },
|
javascript = { "biome" },
|
||||||
astro = { { "prettierd", "prettier" } },
|
astro = { "prettierd", "prettier", "biome" },
|
||||||
|
vue = { "prettierd", "prettier" },
|
||||||
|
proto = { "buf" },
|
||||||
|
yaml = { "prettierd", "prettier" },
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
vim.o.formatexpr = "v:lua.require'conform'.formatexpr()"
|
-- vim.o.formatexpr = "v:lua.require'conform'.formatexpr()"
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
local dap = require("dap")
|
local dap = require("dap")
|
||||||
local dapui = require("dapui")
|
local dapui = require("dapui")
|
||||||
local dap_python = require("dap-python")
|
|
||||||
local virtual_text = require("nvim-dap-virtual-text")
|
local virtual_text = require("nvim-dap-virtual-text")
|
||||||
|
|
||||||
-- Setup Virtual Text
|
-- Setup Virtual Text
|
||||||
@@ -11,12 +10,7 @@ virtual_text.setup({
|
|||||||
enabled = true,
|
enabled = true,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
local mason_path = vim.fn.glob(vim.fn.stdpath("data") .. "/mason")
|
|
||||||
local debugpy_path = mason_path .. "/packages/debugpy/venv/bin/python"
|
|
||||||
|
|
||||||
dapui.setup()
|
dapui.setup()
|
||||||
dap_python.setup(debugpy_path)
|
|
||||||
|
|
||||||
dap.listeners.after.event_initialized["dapui_config"] = function()
|
dap.listeners.after.event_initialized["dapui_config"] = function()
|
||||||
dapui.open()
|
dapui.open()
|
||||||
@@ -35,8 +29,3 @@ local opts = { noremap = true, silent = true }
|
|||||||
|
|
||||||
opts.desc = "Toggle breakpoint"
|
opts.desc = "Toggle breakpoint"
|
||||||
vim.keymap.set("n", "<leader>db", "<cmd> DapToggleBreakpoint<CR>", opts)
|
vim.keymap.set("n", "<leader>db", "<cmd> DapToggleBreakpoint<CR>", opts)
|
||||||
|
|
||||||
opts.desc = "Debug Python Run"
|
|
||||||
vim.keymap.set("n", "<leader>dpr", function()
|
|
||||||
dap_python.test_method()
|
|
||||||
end, opts)
|
|
||||||
|
|||||||
@@ -1,25 +0,0 @@
|
|||||||
local dashboard = require("dashboard")
|
|
||||||
|
|
||||||
local header = {
|
|
||||||
[[' ⣇⣿⠘⣿⣿⣿⡿⡿⣟⣟⢟⢟⢝⠵⡝⣿⡿⢂⣼⣿⣷⣌⠩⡫⡻⣝⠹⢿⣿⣷ ']],
|
|
||||||
[[' ⡆⣿⣆⠱⣝⡵⣝⢅⠙⣿⢕⢕⢕⢕⢝⣥⢒⠅⣿⣿⣿⡿⣳⣌⠪⡪⣡⢑⢝⣇ ']],
|
|
||||||
[[' ⡆⣿⣿⣦⠹⣳⣳⣕⢅⠈⢗⢕⢕⢕⢕⢕⢈⢆⠟⠋⠉⠁⠉⠉⠁⠈⠼⢐⢕⢽ ']],
|
|
||||||
[[' ⡗⢰⣶⣶⣦⣝⢝⢕⢕⠅⡆⢕⢕⢕⢕⢕⣴⠏⣠⡶⠛⡉⡉⡛⢶⣦⡀⠐⣕⢕ ']],
|
|
||||||
[[' ⡝⡄⢻⢟⣿⣿⣷⣕⣕⣅⣿⣔⣕⣵⣵⣿⣿⢠⣿⢠⣮⡈⣌⠨⠅⠹⣷⡀⢱⢕ ']],
|
|
||||||
[[' ⡝⡵⠟⠈⢀⣀⣀⡀⠉⢿⣿⣿⣿⣿⣿⣿⣿⣼⣿⢈⡋⠴⢿⡟⣡⡇⣿⡇⡀⢕ ']],
|
|
||||||
[[' ⡝⠁⣠⣾⠟⡉⡉⡉⠻⣦⣻⣿⣿⣿⣿⣿⣿⣿⣿⣧⠸⣿⣦⣥⣿⡇⡿⣰⢗⢄ ']],
|
|
||||||
[[' ⠁⢰⣿⡏⣴⣌⠈⣌⠡⠈⢻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣬⣉⣉⣁⣄⢖⢕⢕⢕ ']],
|
|
||||||
[[' ⡀⢻⣿⡇⢙⠁⠴⢿⡟⣡⡆⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣵⣵⣿ ']],
|
|
||||||
[[' ⡻⣄⣻⣿⣌⠘⢿⣷⣥⣿⠇⣿⣿⣿⣿⣿⣿⠛⠻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿ ']],
|
|
||||||
[[' ⣷⢄⠻⣿⣟⠿⠦⠍⠉⣡⣾⣿⣿⣿⣿⣿⣿⢸⣿⣦⠙⣿⣿⣿⣿⣿⣿⣿⣿⠟ ']],
|
|
||||||
[[' ⡕⡑⣑⣈⣻⢗⢟⢞⢝⣻⣿⣿⣿⣿⣿⣿⣿⠸⣿⠿⠃⣿⣿⣿⣿⣿⣿⡿⠁⣠ ']],
|
|
||||||
[[' ⡝⡵⡈⢟⢕⢕⢕⢕⣵⣿⣿⣿⣿⣿⣿⣿⣿⣿⣶⣶⣿⣿⣿⣿⣿⠿⠋⣀⣈⠙ ']],
|
|
||||||
[[' ⡝⡵⡕⡀⠑⠳⠿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠿⠛⢉⡠⡲⡫⡪⡪⡣ ']],
|
|
||||||
}
|
|
||||||
|
|
||||||
dashboard.setup({
|
|
||||||
theme = "hyper",
|
|
||||||
config = {
|
|
||||||
header = header,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
local gitignore = require("gitignore")
|
|
||||||
local GetProjectRoot = require("absolute.utils.get-git-root")
|
|
||||||
|
|
||||||
-- Keymaps
|
|
||||||
|
|
||||||
local opts = { noremap = true, silent = true }
|
|
||||||
|
|
||||||
opts.desc = "GitIgnore: Generate .gitignore"
|
|
||||||
|
|
||||||
vim.keymap.set("n", "<leader>gi", function()
|
|
||||||
local path = GetProjectRoot()
|
|
||||||
|
|
||||||
gitignore.generate(path)
|
|
||||||
end, opts)
|
|
||||||
|
|
||||||
-- Global Settings
|
|
||||||
|
|
||||||
vim.g.gitignore_nvim_overwrite = true
|
|
||||||
@@ -1,3 +1,10 @@
|
|||||||
local gitsigns = require("gitsigns")
|
local gitsigns = require("gitsigns")
|
||||||
|
|
||||||
gitsigns.setup()
|
gitsigns.setup({
|
||||||
|
current_line_blame = true,
|
||||||
|
current_line_blame_opts = {
|
||||||
|
virt_text_pos = "eol",
|
||||||
|
delay = 500,
|
||||||
|
ignore_whitespace = false,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|||||||
@@ -1,10 +0,0 @@
|
|||||||
local mark = require("harpoon.mark")
|
|
||||||
local ui = require("harpoon.ui")
|
|
||||||
|
|
||||||
vim.keymap.set("n", "<leader>a", mark.add_file)
|
|
||||||
vim.keymap.set("n", "<C-e>", ui.toggle_quick_menu)
|
|
||||||
|
|
||||||
vim.keymap.set("n", "<C-1>", function() ui.nav_file(1) end)
|
|
||||||
vim.keymap.set("n", "<C-2>", function() ui.nav_file(2) end)
|
|
||||||
vim.keymap.set("n", "<C-3>", function() ui.nav_file(3) end)
|
|
||||||
vim.keymap.set("n", "<C-4>", function() ui.nav_file(4) end)
|
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
require("image").setup({
|
||||||
|
backend = "kitty",
|
||||||
|
processor = "magick_rock", -- or "magick_cli"
|
||||||
|
integrations = {
|
||||||
|
markdown = {
|
||||||
|
enabled = true,
|
||||||
|
clear_in_insert_mode = false,
|
||||||
|
download_remote_images = true,
|
||||||
|
only_render_image_at_cursor = false,
|
||||||
|
floating_windows = true, -- if true, images will be rendered in floating markdown windows
|
||||||
|
filetypes = { "markdown", "vimwiki" }, -- markdown extensions (ie. quarto) can go here
|
||||||
|
},
|
||||||
|
neorg = {
|
||||||
|
enabled = true,
|
||||||
|
filetypes = { "norg" },
|
||||||
|
},
|
||||||
|
typst = {
|
||||||
|
enabled = true,
|
||||||
|
filetypes = { "typst" },
|
||||||
|
},
|
||||||
|
html = {
|
||||||
|
enabled = false,
|
||||||
|
},
|
||||||
|
css = {
|
||||||
|
enabled = false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
max_width = nil,
|
||||||
|
max_height = nil,
|
||||||
|
max_width_window_percentage = nil,
|
||||||
|
max_height_window_percentage = 50,
|
||||||
|
window_overlap_clear_enabled = true, -- toggles images when windows are overlapped
|
||||||
|
window_overlap_clear_ft_ignore = { "cmp_menu", "cmp_docs", "snacks_notif", "scrollview", "scrollview_sign" },
|
||||||
|
editor_only_render_when_focused = true, -- auto show/hide images when the editor gains/looses focus
|
||||||
|
tmux_show_only_in_active_window = true, -- auto show/hide images in the correct Tmux window (needs visual-activity off)
|
||||||
|
hijack_file_patterns = { "*.png", "*.jpg", "*.jpeg", "*.gif", "*.webp", "*.avif", "*.svg" }, -- render image files as images when opened
|
||||||
|
})
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
local keyseer = require("keyseer")
|
|
||||||
|
|
||||||
keyseer.setup({})
|
|
||||||
+149
-121
@@ -1,10 +1,11 @@
|
|||||||
-- Setup language servers.
|
-- Setup language servers.
|
||||||
local lspconfig = require("lspconfig")
|
local conform = require("conform")
|
||||||
local cmp_nvim_lsp = require("cmp_nvim_lsp")
|
|
||||||
|
|
||||||
local DPE = require("absolute.utils.detect-python-env")
|
|
||||||
|
|
||||||
local opts = { noremap = true, silent = true }
|
local opts = { noremap = true, silent = true }
|
||||||
|
|
||||||
|
local global_node_modules = vim.fn.system("npm root -g")
|
||||||
|
|
||||||
|
-- client, buffer
|
||||||
local on_attach = function(client, bufnr)
|
local on_attach = function(client, bufnr)
|
||||||
opts.buffer = bufnr
|
opts.buffer = bufnr
|
||||||
|
|
||||||
@@ -15,13 +16,13 @@ local on_attach = function(client, bufnr)
|
|||||||
vim.keymap.set("n", "gD", vim.lsp.buf.declaration, opts)
|
vim.keymap.set("n", "gD", vim.lsp.buf.declaration, opts)
|
||||||
|
|
||||||
opts.desc = "Go to definitions"
|
opts.desc = "Go to definitions"
|
||||||
vim.keymap.set("n", "gd", "<cmd>Telescope lsp_definitions<CR>", opts)
|
vim.keymap.set("n", "gd", function() Snacks.picker.lsp_definitions() end, opts)
|
||||||
|
|
||||||
opts.desc = "Show documentation for what is under cursor"
|
opts.desc = "Show documentation for what is under cursor"
|
||||||
vim.keymap.set("n", "K", vim.lsp.buf.hover, opts)
|
vim.keymap.set("n", "K", vim.lsp.buf.hover, opts)
|
||||||
|
|
||||||
opts.desc = "Show LSP Implementation"
|
opts.desc = "Show LSP Implementation"
|
||||||
vim.keymap.set("n", "gi", "<cmd>Telescope lsp_implementations<CR>", opts)
|
vim.keymap.set("n", "gi", function() Snacks.picker.lsp_implementations() end, opts)
|
||||||
|
|
||||||
opts.desc = "Get Help"
|
opts.desc = "Get Help"
|
||||||
vim.keymap.set("n", "<leader>gh", vim.lsp.buf.signature_help, opts)
|
vim.keymap.set("n", "<leader>gh", vim.lsp.buf.signature_help, opts)
|
||||||
@@ -33,7 +34,7 @@ local on_attach = function(client, bufnr)
|
|||||||
-- end, opts)
|
-- end, opts)
|
||||||
|
|
||||||
opts.desc = "Show LSP type definitions"
|
opts.desc = "Show LSP type definitions"
|
||||||
vim.keymap.set("n", "gt", "<cmd>Telescope lsp_type_definitions<CR>", opts)
|
vim.keymap.set("n", "gt", function() Snacks.picker.lsp_type_definitions() end, opts)
|
||||||
|
|
||||||
opts.desc = "Smart rename"
|
opts.desc = "Smart rename"
|
||||||
vim.keymap.set("n", "<leader>rn", vim.lsp.buf.rename, opts)
|
vim.keymap.set("n", "<leader>rn", vim.lsp.buf.rename, opts)
|
||||||
@@ -42,58 +43,76 @@ local on_attach = function(client, bufnr)
|
|||||||
vim.keymap.set({ "n", "v" }, "<leader>ca", vim.lsp.buf.code_action, opts)
|
vim.keymap.set({ "n", "v" }, "<leader>ca", vim.lsp.buf.code_action, opts)
|
||||||
|
|
||||||
opts.desc = "Show LSP references"
|
opts.desc = "Show LSP references"
|
||||||
vim.keymap.set("n", "<leader>cr", "<cmd>Telescope lsp_references<CR>", opts)
|
vim.keymap.set("n", "<leader>cr", function() Snacks.picker.lsp_references() end, opts)
|
||||||
|
|
||||||
opts.desc = "Format File"
|
opts.desc = "Format File"
|
||||||
vim.keymap.set("n", "<leader>f", function()
|
vim.keymap.set({ "n", "v" }, "<leader>f", function()
|
||||||
vim.lsp.buf.format({ async = true })
|
-- vim.lsp.buf.format({ async = true })
|
||||||
|
conform.format({
|
||||||
|
bufnr = opts.buffer,
|
||||||
|
async = true,
|
||||||
|
lsp_fallback = true,
|
||||||
|
})
|
||||||
end, opts)
|
end, opts)
|
||||||
|
|
||||||
opts.desc = "Restart LSP"
|
opts.desc = "Restart LSP"
|
||||||
vim.keymap.set("n", "<leader>rs", "<cmd>LspRestart<CR>", opts)
|
vim.keymap.set("n", "<leader>rs", "<cmd>LspRestart<CR>", opts)
|
||||||
|
|
||||||
|
-- LSP Only Settings
|
||||||
|
-- Ruff & Pyright behaviour
|
||||||
|
if client.name == "ruff" then
|
||||||
|
-- Disable hover in favor of Pyright
|
||||||
|
client.server_capabilities.hoverProvider = false
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local capabilities = cmp_nvim_lsp.default_capabilities()
|
local capabilities = require("blink.cmp").get_lsp_capabilities()
|
||||||
|
|
||||||
-- Change the Diagnostic symbols in the sign column (gutter)
|
-- Configure diagnostic signs (Neovim 0.10+ API; required in 0.12)
|
||||||
local signs = {
|
vim.diagnostic.config({
|
||||||
Error = " ",
|
signs = {
|
||||||
Warn = " ",
|
text = {
|
||||||
Hint = " ",
|
[vim.diagnostic.severity.ERROR] = " ",
|
||||||
Info = " ",
|
[vim.diagnostic.severity.WARN] = " ",
|
||||||
}
|
[vim.diagnostic.severity.HINT] = " ",
|
||||||
|
[vim.diagnostic.severity.INFO] = " ",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
for type, icon in pairs(signs) do
|
-- Configure LSP servers using vim.lsp.config
|
||||||
local hl = "DiagnosticSign" .. type
|
vim.lsp.config("html", {
|
||||||
vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = "" })
|
|
||||||
end
|
|
||||||
|
|
||||||
-- configure html server
|
|
||||||
lspconfig["html"].setup({
|
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
})
|
})
|
||||||
|
|
||||||
-- configure typescript server with plugin
|
vim.lsp.config("ts_ls", {
|
||||||
lspconfig["ts_ls"].setup({
|
capabilities = capabilities,
|
||||||
|
on_attach = on_attach,
|
||||||
|
init_options = {
|
||||||
|
plugins = {
|
||||||
|
{
|
||||||
|
name = "@vue/typescript-plugin",
|
||||||
|
location = global_node_modules .. "@vue/typescript-plugin",
|
||||||
|
languages = { "vue" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
filetypes = { "typescript", "javascript", "javascriptreact", "typescriptreact", "vue" },
|
||||||
|
})
|
||||||
|
|
||||||
|
vim.lsp.config("cssls", {
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
})
|
})
|
||||||
|
|
||||||
-- configure css server
|
vim.lsp.config("tailwindcss", {
|
||||||
lspconfig["cssls"].setup({
|
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
|
filetypes = { "html", "svelte", "vue", "astro" },
|
||||||
})
|
})
|
||||||
|
|
||||||
-- configure tailwindcss server
|
vim.lsp.config("svelte", {
|
||||||
lspconfig["tailwindcss"].setup({
|
|
||||||
capabilities = capabilities,
|
|
||||||
on_attach = on_attach,
|
|
||||||
})
|
|
||||||
|
|
||||||
-- configure svelte server
|
|
||||||
lspconfig["svelte"].setup({
|
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
on_attach = function(client, bufnr)
|
on_attach = function(client, bufnr)
|
||||||
on_attach(client, bufnr)
|
on_attach(client, bufnr)
|
||||||
@@ -109,14 +128,14 @@ lspconfig["svelte"].setup({
|
|||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
-- configure emmet language server
|
vim.lsp.config("emmet_ls", {
|
||||||
lspconfig["emmet_ls"].setup({
|
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
filetypes = {
|
filetypes = {
|
||||||
"html",
|
"html",
|
||||||
"typescriptreact",
|
"typescriptreact",
|
||||||
"javascriptreact",
|
"javascriptreact",
|
||||||
|
"astro",
|
||||||
"css",
|
"css",
|
||||||
"sass",
|
"sass",
|
||||||
"scss",
|
"scss",
|
||||||
@@ -126,63 +145,70 @@ lspconfig["emmet_ls"].setup({
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
vim.lsp.config("ruff", {
|
||||||
|
capabilities = capabilities,
|
||||||
|
on_attach = on_attach,
|
||||||
|
})
|
||||||
|
|
||||||
-- configure python lsp
|
vim.lsp.config("pyright", {
|
||||||
lspconfig["pylsp"].setup({
|
capabilities = capabilities,
|
||||||
|
on_attach = on_attach,
|
||||||
filetypes = { "python" },
|
filetypes = { "python" },
|
||||||
capabilities = capabilities,
|
settings = {
|
||||||
on_attach = on_attach,
|
python = {
|
||||||
pylsp = {
|
analysis = {
|
||||||
pylsp = {
|
autoSearchPaths = true,
|
||||||
plugins = {
|
useLibraryCodeForTypes = true,
|
||||||
rope_autoimport = {
|
diagnosticMode = "workspace",
|
||||||
enabled = true,
|
|
||||||
completions = { enabled = true },
|
|
||||||
rename = { enabled = false },
|
|
||||||
},
|
|
||||||
black = { enabled = true },
|
|
||||||
autopep8 = { enabled = false },
|
|
||||||
yapf = { enabled = false },
|
|
||||||
flake8 = { enabled = true },
|
|
||||||
jedi_completion = {
|
|
||||||
enabled = true,
|
|
||||||
include_params = true,
|
|
||||||
fuzzy = true,
|
|
||||||
},
|
|
||||||
pylsp_mypy = {
|
|
||||||
enabled = true,
|
|
||||||
overrides = DPE.ResolvePythonEnvironment(),
|
|
||||||
report_progress = true,
|
|
||||||
live_mode = true,
|
|
||||||
},
|
|
||||||
-- import sorting
|
|
||||||
pyls_isort = { enabled = true },
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
-- configure docker server
|
|
||||||
lspconfig["dockerls"].setup({
|
vim.lsp.config("dockerls", {
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
})
|
})
|
||||||
|
|
||||||
-- configure json server
|
vim.lsp.config("jsonls", {
|
||||||
lspconfig["jsonls"].setup({
|
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
})
|
})
|
||||||
|
|
||||||
-- configure vue server
|
vim.lsp.config("vue_ls", {
|
||||||
lspconfig["volar"].setup({
|
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
filetypes = { "vue" },
|
filetypes = { "vue" },
|
||||||
|
init_options = {
|
||||||
|
vue = {
|
||||||
|
hybridMode = false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
settings = {
|
||||||
|
typescript = {
|
||||||
|
inlayHints = {
|
||||||
|
enumMemberValues = {
|
||||||
|
enabled = true,
|
||||||
|
},
|
||||||
|
functionLikeReturnTypes = {
|
||||||
|
enabled = true,
|
||||||
|
},
|
||||||
|
propertyDeclarationTypes = {
|
||||||
|
enabled = true,
|
||||||
|
},
|
||||||
|
parameterTypes = {
|
||||||
|
enabled = true,
|
||||||
|
suppressWhenArgumentMatchesName = true,
|
||||||
|
},
|
||||||
|
variableTypes = {
|
||||||
|
enabled = true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
-- configure rust server
|
vim.lsp.config("rust_analyzer", {
|
||||||
lspconfig.rust_analyzer.setup({
|
|
||||||
-- Server-specific settings. See `:help lspconfig-setup`
|
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
settings = {
|
settings = {
|
||||||
@@ -190,18 +216,15 @@ lspconfig.rust_analyzer.setup({
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
-- configure lua server (with special settings)
|
vim.lsp.config("lua_ls", {
|
||||||
lspconfig["lua_ls"].setup({
|
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
settings = { -- custom settings for lua
|
settings = {
|
||||||
Lua = {
|
Lua = {
|
||||||
-- make the language server recognize "vim" global
|
|
||||||
diagnostics = {
|
diagnostics = {
|
||||||
globals = { "vim" },
|
globals = { "vim" },
|
||||||
},
|
},
|
||||||
workspace = {
|
workspace = {
|
||||||
-- make language server aware of runtime files
|
|
||||||
library = {
|
library = {
|
||||||
[vim.fn.expand("$VIMRUNTIME/lua")] = true,
|
[vim.fn.expand("$VIMRUNTIME/lua")] = true,
|
||||||
[vim.fn.stdpath("config") .. "/lua"] = true,
|
[vim.fn.stdpath("config") .. "/lua"] = true,
|
||||||
@@ -211,65 +234,45 @@ lspconfig["lua_ls"].setup({
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
-- configure css server
|
vim.lsp.config("docker_compose_language_service", {
|
||||||
lspconfig["cssls"].setup({
|
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
})
|
})
|
||||||
|
|
||||||
-- configure htmx server
|
vim.lsp.config("eslint", {
|
||||||
lspconfig["htmx"].setup({
|
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
})
|
})
|
||||||
|
|
||||||
--configure docker file server
|
vim.lsp.config("astro", {
|
||||||
lspconfig["dockerls"].setup({
|
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
})
|
})
|
||||||
|
|
||||||
-- configure docker compose server
|
vim.lsp.config("kotlin_language_server", {
|
||||||
lspconfig["docker_compose_language_service"].setup({
|
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
})
|
})
|
||||||
|
|
||||||
-- configure eslint server
|
vim.lsp.config("clangd", {
|
||||||
lspconfig["eslint"].setup({
|
cmd = { "clangd", "--compile-commands-dir=./", "--background-index=false" },
|
||||||
|
capabilities = capabilities,
|
||||||
|
on_attach = on_attach,
|
||||||
|
filetypes = { "c", "cpp", "objc", "objcpp" },
|
||||||
|
})
|
||||||
|
|
||||||
|
vim.lsp.config("buf_ls", {
|
||||||
|
capabilities = capabilities,
|
||||||
|
on_attach = on_attach,
|
||||||
|
filetypes = { "proto" },
|
||||||
|
})
|
||||||
|
|
||||||
|
vim.lsp.config("arduino_language_server", {
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
})
|
})
|
||||||
|
|
||||||
-- configure astro server
|
vim.lsp.config("biome", {
|
||||||
lspconfig["astro"].setup({
|
|
||||||
capabilities = capabilities,
|
|
||||||
on_attach = on_attach,
|
|
||||||
})
|
|
||||||
|
|
||||||
-- configure kotlin server
|
|
||||||
lspconfig["kotlin_language_server"].setup({
|
|
||||||
capabilities = capabilities,
|
|
||||||
on_attach = on_attach,
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
-- configure clang server
|
|
||||||
|
|
||||||
lspconfig["clangd"].setup({
|
|
||||||
capabilities = capabilities,
|
|
||||||
on_attach = on_attach,
|
|
||||||
})
|
|
||||||
|
|
||||||
-- configure arduino language server
|
|
||||||
|
|
||||||
lspconfig["arduino_language_server"].setup({
|
|
||||||
capabilities = capabilities,
|
|
||||||
on_attach = on_attach,
|
|
||||||
})
|
|
||||||
|
|
||||||
-- configure biome server
|
|
||||||
lspconfig["biome"].setup({
|
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
filetypes = {
|
filetypes = {
|
||||||
@@ -285,3 +288,28 @@ lspconfig["biome"].setup({
|
|||||||
"vue",
|
"vue",
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
-- Enable all configured LSP servers
|
||||||
|
vim.lsp.enable({
|
||||||
|
"html",
|
||||||
|
"ts_ls",
|
||||||
|
"cssls",
|
||||||
|
"tailwindcss",
|
||||||
|
"svelte",
|
||||||
|
"emmet_ls",
|
||||||
|
"ruff",
|
||||||
|
"pyright",
|
||||||
|
"dockerls",
|
||||||
|
"jsonls",
|
||||||
|
"vue_ls",
|
||||||
|
"rust_analyzer",
|
||||||
|
"lua_ls",
|
||||||
|
"docker_compose_language_service",
|
||||||
|
"eslint",
|
||||||
|
"astro",
|
||||||
|
"kotlin_language_server",
|
||||||
|
"clangd",
|
||||||
|
"buf_ls",
|
||||||
|
"arduino_language_server",
|
||||||
|
"biome",
|
||||||
|
})
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
local lualine = require("lualine")
|
local lualine = require("lualine")
|
||||||
local lazy_status = require("lazy.status") -- to configure lazy pending updates count
|
local lazy_status = require("lazy.status") -- to configure lazy pending updates count
|
||||||
local noice = require("noice")
|
|
||||||
|
|
||||||
local colors = {
|
local colors = {
|
||||||
blue = "#65D1FF",
|
blue = "#65D1FF",
|
||||||
@@ -46,21 +45,6 @@ local my_lualine_theme = {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
function GetFlutterToolsStatusLine()
|
|
||||||
local application_version = vim.g.flutter_tools_decorations.app_version
|
|
||||||
local device = vim.g.flutter_tools_decorations.device
|
|
||||||
|
|
||||||
local result = "Flutter: " .. application_version .. " " .. device
|
|
||||||
end
|
|
||||||
|
|
||||||
function IsFlutterToolsActive()
|
|
||||||
if vim.g.flutter_tools_decorations ~= nil then
|
|
||||||
return true
|
|
||||||
else
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function GetPoetvStatusLine()
|
function GetPoetvStatusLine()
|
||||||
-- Get the poetv statusline
|
-- Get the poetv statusline
|
||||||
-- If poetv is not active, return empty string
|
-- If poetv is not active, return empty string
|
||||||
@@ -95,16 +79,6 @@ lualine.setup({
|
|||||||
},
|
},
|
||||||
sections = {
|
sections = {
|
||||||
lualine_x = {
|
lualine_x = {
|
||||||
{
|
|
||||||
noice.api.statusline.mode.get,
|
|
||||||
cond = noice.api.statusline.mode.has,
|
|
||||||
color = { fg = "#ff9e64" },
|
|
||||||
},
|
|
||||||
{
|
|
||||||
GetFlutterToolsStatusLine,
|
|
||||||
cond = IsFlutterToolsActive,
|
|
||||||
color = { fg = "#ff9e64" },
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
GetPoetvStatusLine,
|
GetPoetvStatusLine,
|
||||||
cond = IsPoetvActive,
|
cond = IsPoetvActive,
|
||||||
|
|||||||
@@ -8,19 +8,13 @@ require("mason-lspconfig").setup({
|
|||||||
"html",
|
"html",
|
||||||
"emmet_ls",
|
"emmet_ls",
|
||||||
"lua_ls",
|
"lua_ls",
|
||||||
'arduino_language_server',
|
"arduino_language_server",
|
||||||
'clangd',
|
"clangd",
|
||||||
"tailwindcss",
|
"tailwindcss",
|
||||||
"svelte",
|
"svelte",
|
||||||
"cssls",
|
"cssls",
|
||||||
"jedi_language_server",
|
"jedi_language_server",
|
||||||
"kotlin_language_server"
|
"kotlin_language_server",
|
||||||
},
|
},
|
||||||
automatic_installation = true,
|
automatic_enable = false,
|
||||||
})
|
|
||||||
require("mason-nvim-dap").setup({
|
|
||||||
ensure_installed = {
|
|
||||||
"debugpy", -- python
|
|
||||||
},
|
|
||||||
automatic_installation = true,
|
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -0,0 +1,6 @@
|
|||||||
|
local diff = require("mini.diff")
|
||||||
|
|
||||||
|
diff.setup({
|
||||||
|
-- Disabled by default
|
||||||
|
source = diff.gen_source.none(),
|
||||||
|
})
|
||||||
@@ -1,92 +0,0 @@
|
|||||||
local noice = require("noice")
|
|
||||||
local notify = require("notify")
|
|
||||||
|
|
||||||
|
|
||||||
notify.setup({
|
|
||||||
top_down = false,
|
|
||||||
animate = false,
|
|
||||||
stages = "static",
|
|
||||||
})
|
|
||||||
|
|
||||||
noice.setup({
|
|
||||||
routes = {
|
|
||||||
{
|
|
||||||
filter = {
|
|
||||||
event = "msg_show",
|
|
||||||
min_height = 20,
|
|
||||||
},
|
|
||||||
view = "cmdline_output",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
filter = {
|
|
||||||
event = "lsp",
|
|
||||||
kind = "progress",
|
|
||||||
cond = function(message)
|
|
||||||
local client = vim.tbl_get(message.opts, "progress", "client")
|
|
||||||
|
|
||||||
return client == "lua_ls"
|
|
||||||
end
|
|
||||||
},
|
|
||||||
opts = { skip = true },
|
|
||||||
}
|
|
||||||
},
|
|
||||||
lsp = {
|
|
||||||
-- override markdown rendering so that **cmp** and other plugins use **Treesitter**
|
|
||||||
override = {
|
|
||||||
["vim.lsp.util.convert_input_to_markdown_lines"] = true,
|
|
||||||
["vim.lsp.util.stylize_markdown"] = true,
|
|
||||||
["cmp.entry.get_documentation"] = true, -- requires hrsh7th/nvim-cmp
|
|
||||||
},
|
|
||||||
},
|
|
||||||
cmdline = {
|
|
||||||
format = {
|
|
||||||
search_down = {
|
|
||||||
view = "cmdline",
|
|
||||||
},
|
|
||||||
search_up = {
|
|
||||||
view = "cmdline",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
views = {
|
|
||||||
cmdline_popup = {
|
|
||||||
relative = "editor",
|
|
||||||
position = {
|
|
||||||
row = 5,
|
|
||||||
col = "50%",
|
|
||||||
},
|
|
||||||
size = {
|
|
||||||
width = 60,
|
|
||||||
height = "auto",
|
|
||||||
},
|
|
||||||
border = {
|
|
||||||
style = { "╭", "─", "╮", "│", "╯", "─", "╰", "│" },
|
|
||||||
padding = { 0, 1 },
|
|
||||||
},
|
|
||||||
filter_options = {},
|
|
||||||
win_options = {
|
|
||||||
winhighlight = {
|
|
||||||
Normal = "Normal",
|
|
||||||
}
|
|
||||||
},
|
|
||||||
},
|
|
||||||
popupmenu = {
|
|
||||||
relative = "editor",
|
|
||||||
position = {
|
|
||||||
row = 8,
|
|
||||||
col = "50%",
|
|
||||||
},
|
|
||||||
size = {
|
|
||||||
width = 60,
|
|
||||||
height = 10,
|
|
||||||
},
|
|
||||||
border = {
|
|
||||||
style = "rounded",
|
|
||||||
padding = { 0, 1 },
|
|
||||||
},
|
|
||||||
win_options = {
|
|
||||||
winhighlight = { Normal = "Normal", FloatBorder = "DiagnosticInfo" },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
local null_ls = require("null-ls")
|
|
||||||
|
|
||||||
null_ls.setup({
|
|
||||||
sources = {
|
|
||||||
null_ls.builtins.formatting.stylua,
|
|
||||||
null_ls.builtins.formatting.prettierd,
|
|
||||||
null_ls.builtins.formatting.shfmt,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
@@ -1,51 +0,0 @@
|
|||||||
local cmp = require("cmp")
|
|
||||||
local types = require('cmp.types')
|
|
||||||
local luasnip = require("luasnip")
|
|
||||||
local lspkind = require("lspkind")
|
|
||||||
|
|
||||||
-- loads vscode style snippets from installed plugins (e.g. friendly-snippets)
|
|
||||||
require("luasnip.loaders.from_vscode").lazy_load()
|
|
||||||
|
|
||||||
cmp.setup({
|
|
||||||
completion = {
|
|
||||||
completeopt = "menu,menuone,preview,noinsert",
|
|
||||||
autocomplete = { types.cmp.TriggerEvent.TextChanged },
|
|
||||||
},
|
|
||||||
window = {
|
|
||||||
documentation = {
|
|
||||||
border = { '┌', '─', '┐', '│', '┘', '─', '└', '│' },
|
|
||||||
winhighlight = 'Normal:CmpPmenu,FloatBorder:CmpPmenuBorder,CursorLine:PmenuSel,Search:None',
|
|
||||||
},
|
|
||||||
completion = {
|
|
||||||
side_padding = 1,
|
|
||||||
border = { '┌', '─', '┐', '│', '┘', '─', '└', '│' },
|
|
||||||
winhighlight = 'Normal:CmpPmenu,FloatBorder:CmpPmenuBorder,CursorLine:PmenuSel,Search:None',
|
|
||||||
scrollbar = false,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
snippet = { -- configure how nvim-cmp interacts with snippet engine
|
|
||||||
expand = function(args)
|
|
||||||
luasnip.lsp_expand(args.body)
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
mapping = cmp.mapping.preset.insert({
|
|
||||||
["<C-o>"] = cmp.mapping.complete(), -- show completion suggestions
|
|
||||||
["<C-e>"] = cmp.mapping.abort(), -- close completion menu
|
|
||||||
["<CR>"] = cmp.mapping.confirm({ select = true }), -- accept current selection
|
|
||||||
}),
|
|
||||||
-- sources for autocompletion
|
|
||||||
sources = cmp.config.sources({
|
|
||||||
{ name = "nvim_lsp" },
|
|
||||||
{ name = "luasnip" }, -- snippets
|
|
||||||
{ name = "buffer" }, -- text within current buffer
|
|
||||||
{ name = "path" }, -- file system paths,
|
|
||||||
{ name = 'nvim_lsp_signature_help' },
|
|
||||||
}),
|
|
||||||
-- configure lspkind for vs-code like pictograms in completion menu
|
|
||||||
formatting = {
|
|
||||||
format = lspkind.cmp_format({
|
|
||||||
maxwidth = 50,
|
|
||||||
ellipsis_char = "...",
|
|
||||||
}),
|
|
||||||
},
|
|
||||||
})
|
|
||||||
@@ -1,49 +0,0 @@
|
|||||||
local nvimtree = require("absolute.disabled.nvim-tree")
|
|
||||||
|
|
||||||
vim.g.loaded_netrw = 1
|
|
||||||
vim.g.loaded_netrwPlugin = 1
|
|
||||||
|
|
||||||
vim.cmd([[ highlight NvimTreeIndentMarker guifg=#3FC5FF ]])
|
|
||||||
|
|
||||||
vim.cmd([[ highlight NvimTreeFolderArrowClosed guifg=#3FC5FF ]])
|
|
||||||
vim.cmd([[ highlight NvimTreeFolderArrowOpen guifg=#3FC5FF ]])
|
|
||||||
|
|
||||||
nvimtree.setup({
|
|
||||||
view = {
|
|
||||||
width = 45,
|
|
||||||
relativenumber = true,
|
|
||||||
},
|
|
||||||
update_focused_file = {
|
|
||||||
enable = true,
|
|
||||||
},
|
|
||||||
renderer = {
|
|
||||||
indent_markers = {
|
|
||||||
enable = true,
|
|
||||||
},
|
|
||||||
icons = {
|
|
||||||
glyphs = {
|
|
||||||
|
|
||||||
folder = {
|
|
||||||
arrow_closed = "", -- arrow when folder is closed
|
|
||||||
arrow_open = "", -- arrow when folder is open
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
-- disable window_picker for
|
|
||||||
-- explorer to work well with
|
|
||||||
-- window splits
|
|
||||||
actions = {
|
|
||||||
open_file = {
|
|
||||||
window_picker = {
|
|
||||||
enable = false,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
filters = {
|
|
||||||
custom = { ".DS_Store" },
|
|
||||||
},
|
|
||||||
git = {
|
|
||||||
ignore = false,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
@@ -2,7 +2,7 @@ local treesittercontext = require("treesitter-context")
|
|||||||
|
|
||||||
treesittercontext.setup({
|
treesittercontext.setup({
|
||||||
enable = true, -- Enable this plugin (Can be enabled/disabled later via commands)
|
enable = true, -- Enable this plugin (Can be enabled/disabled later via commands)
|
||||||
max_lines = 0, -- How many lines the window should span. Values <= 0 mean no limit.
|
max_lines = 5, -- How many lines the window should span. Values <= 0 mean no limit.
|
||||||
min_window_height = 0, -- Minimum editor window height to enable context. Values <= 0 mean no limit.
|
min_window_height = 0, -- Minimum editor window height to enable context. Values <= 0 mean no limit.
|
||||||
line_numbers = true,
|
line_numbers = true,
|
||||||
multiline_threshold = 20, -- Maximum number of lines to show for a single context
|
multiline_threshold = 20, -- Maximum number of lines to show for a single context
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ require("nvim-treesitter.configs").setup({
|
|||||||
"javascript",
|
"javascript",
|
||||||
"typescript",
|
"typescript",
|
||||||
"python",
|
"python",
|
||||||
|
"proto",
|
||||||
"c",
|
"c",
|
||||||
"lua",
|
"lua",
|
||||||
"vim",
|
"vim",
|
||||||
@@ -30,6 +31,7 @@ require("nvim-treesitter.configs").setup({
|
|||||||
-- Using this option may slow down your editor, and you may see some duplicate highlights.
|
-- Using this option may slow down your editor, and you may see some duplicate highlights.
|
||||||
-- Instead of true it can also be a list of languages
|
-- Instead of true it can also be a list of languages
|
||||||
additional_vim_regex_highlighting = false,
|
additional_vim_regex_highlighting = false,
|
||||||
|
disable = { "php" },
|
||||||
},
|
},
|
||||||
textobjects = {
|
textobjects = {
|
||||||
move = {
|
move = {
|
||||||
|
|||||||
@@ -1,22 +0,0 @@
|
|||||||
vim.g.poetv_executables = { "poetry", "pipenv" }
|
|
||||||
vim.g.poetv_auto_activate = 1
|
|
||||||
vim.g.poetv_set_environment = 1
|
|
||||||
vim.g.poetv_statusline_symbol = "🐍"
|
|
||||||
|
|
||||||
|
|
||||||
-- Keybindings
|
|
||||||
|
|
||||||
local opts = { noremap = true, silent = true }
|
|
||||||
|
|
||||||
-- Poetv: Activate Virtualenv
|
|
||||||
opts.desc = "Poetv: Activate virtualenv"
|
|
||||||
vim.keymap.set("n", "<leader>pva", "<cmd>PoetvActivate<CR>", opts)
|
|
||||||
|
|
||||||
-- Poetv: Deactivate Virtualenv
|
|
||||||
opts.desc = "Poetv: Deactivate virtualenv"
|
|
||||||
vim.keymap.set("n", "<leader>pvd", "<cmd>PoetvDeactivate<CR>", opts)
|
|
||||||
|
|
||||||
-- Setup Autocommands
|
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd({ "BufEnter", "BufWinEnter" },
|
|
||||||
{ pattern = { "*/.venv/*", "*.py" }, callback = function() vim.cmd([[ PoetvActivate]]) end })
|
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
local smear_cursor = require("smear_cursor")
|
||||||
|
|
||||||
|
smear_cursor.setup({
|
||||||
|
stiffness = 0.5,
|
||||||
|
trailing_stiffness = 0.49,
|
||||||
|
never_draw_over_target = false,
|
||||||
|
smear_insert_mode = false,
|
||||||
|
smear_between_buffers = true,
|
||||||
|
cursor_color = "#7DF9FF",
|
||||||
|
})
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
local map = vim.keymap.set
|
||||||
|
|
||||||
|
local function with_desc(desc)
|
||||||
|
return { noremap = true, silent = true, desc = desc }
|
||||||
|
end
|
||||||
|
|
||||||
|
map("n", "<C-p>", function()
|
||||||
|
Snacks.picker.files()
|
||||||
|
end, with_desc("Find files"))
|
||||||
|
|
||||||
|
map("n", "<leader>gf", function()
|
||||||
|
Snacks.picker.git_files()
|
||||||
|
end, with_desc("Find git files"))
|
||||||
|
|
||||||
|
map("n", "<leader>pr", function()
|
||||||
|
Snacks.picker.recent()
|
||||||
|
end, with_desc("Recent files"))
|
||||||
|
|
||||||
|
map("n", "<leader>ps", function()
|
||||||
|
Snacks.picker.grep()
|
||||||
|
end, with_desc("Live grep"))
|
||||||
|
|
||||||
|
map("n", "<leader>sb", function()
|
||||||
|
Snacks.picker.grep_word()
|
||||||
|
end, with_desc("Grep word under cursor"))
|
||||||
|
|
||||||
|
map("n", "<leader>pf", function()
|
||||||
|
Snacks.picker.explorer()
|
||||||
|
end, with_desc("File explorer (cwd)"))
|
||||||
|
|
||||||
|
map("n", "<leader>cf", function()
|
||||||
|
Snacks.picker.explorer({ cwd = vim.fn.expand("%:p:h") })
|
||||||
|
end, with_desc("File explorer (current file dir)"))
|
||||||
@@ -1,76 +0,0 @@
|
|||||||
local telescope = require("telescope")
|
|
||||||
local builtin = require("telescope.builtin")
|
|
||||||
local actions = require("telescope.actions")
|
|
||||||
local trouble = require("trouble.sources.telescope")
|
|
||||||
|
|
||||||
|
|
||||||
telescope.setup({
|
|
||||||
defaults = {
|
|
||||||
vimgrep_arguments = {
|
|
||||||
"rg",
|
|
||||||
"--color=never",
|
|
||||||
"--no-heading",
|
|
||||||
"--with-filename",
|
|
||||||
"--line-number",
|
|
||||||
"--column",
|
|
||||||
"--smart-case",
|
|
||||||
},
|
|
||||||
mappings = {
|
|
||||||
i = {
|
|
||||||
["<C-t>"] = trouble.open,
|
|
||||||
["<C-q>"] = actions.send_to_qflist,
|
|
||||||
},
|
|
||||||
n = {
|
|
||||||
["<C-t>"] = trouble.open,
|
|
||||||
["<C-q>"] = actions.send_to_qflist,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
extensions = {
|
|
||||||
file_browser = {
|
|
||||||
hijack_netrw = true,
|
|
||||||
hide_parent_dir = true,
|
|
||||||
depth = 1,
|
|
||||||
respect_gitignore = false,
|
|
||||||
auto_depth = true,
|
|
||||||
display_stat = {
|
|
||||||
date = true,
|
|
||||||
size = true,
|
|
||||||
mode = false,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
telescope.load_extension("file_browser")
|
|
||||||
telescope.load_extension("flutter")
|
|
||||||
telescope.load_extension("dap")
|
|
||||||
telescope.load_extension("themes")
|
|
||||||
|
|
||||||
local find_files = function()
|
|
||||||
builtin.find_files({
|
|
||||||
find_command = { "rg", "--files", "--hidden", "--glob", "!.git" },
|
|
||||||
})
|
|
||||||
end
|
|
||||||
|
|
||||||
local opts = { noremap = true, silent = true }
|
|
||||||
|
|
||||||
opts.desc = "Open file browser (cwd)"
|
|
||||||
vim.keymap.set("n", "<leader>af", "<cmd>Telescope file_browser<CR>", opts)
|
|
||||||
|
|
||||||
opts.desc = "Open file browser (current file)"
|
|
||||||
vim.keymap.set("n", "<leader>cf", "<cmd>Telescope file_browser path=%:p:h select_buffer=true<CR>", opts)
|
|
||||||
|
|
||||||
opts.desc = "Fuzzy find files (cwd)"
|
|
||||||
vim.keymap.set("n", "<leader>pf", find_files, opts)
|
|
||||||
|
|
||||||
opts.desc = "Fuzzy find recent files"
|
|
||||||
vim.keymap.set("n", "<leader>pr", builtin.oldfiles, opts)
|
|
||||||
|
|
||||||
opts.desc = "Fuzzy find files in git in cwd"
|
|
||||||
vim.keymap.set("n", "<C-p>", builtin.git_files, opts)
|
|
||||||
|
|
||||||
opts.desc = "Fuzzy find string under cursor in cwd"
|
|
||||||
vim.keymap.set("n", "<leader>ps", function()
|
|
||||||
builtin.grep_string({ search = vim.fn.input("Grep > ") })
|
|
||||||
end, opts)
|
|
||||||
@@ -14,9 +14,9 @@ vim.keymap.set("n", "]t", function()
|
|||||||
todo_comments.jump_next()
|
todo_comments.jump_next()
|
||||||
end, opts)
|
end, opts)
|
||||||
|
|
||||||
opts.desc = "Open Comments in Telescope"
|
opts.desc = "Open todo comments in picker"
|
||||||
vim.keymap.set("n", "<leader>pt", function()
|
vim.keymap.set("n", "<leader>pt", function()
|
||||||
vim.cmd([[TodoTelescope]])
|
Snacks.picker.todo_comments()
|
||||||
end, opts)
|
end, opts)
|
||||||
|
|
||||||
opts.desc = "Open Comments in Trouble"
|
opts.desc = "Open Comments in Trouble"
|
||||||
|
|||||||
@@ -29,8 +29,34 @@ function _LAZYGIT_TOGGLE()
|
|||||||
lazygit:toggle()
|
lazygit:toggle()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Todo prompt model to run
|
||||||
|
local ollama = Terminal:new({
|
||||||
|
cmd = "ollama run llama3",
|
||||||
|
dir = "git_dir",
|
||||||
|
direction = "float",
|
||||||
|
float_opts = {
|
||||||
|
border = "double",
|
||||||
|
},
|
||||||
|
-- function to run on opening the terminal
|
||||||
|
on_open = function(term)
|
||||||
|
vim.cmd("startinsert!")
|
||||||
|
vim.api.nvim_buf_set_keymap(term.bufnr, "n", "q", "<cmd>close<CR>", opts)
|
||||||
|
end,
|
||||||
|
-- function to run on closing the terminal
|
||||||
|
on_close = function(term)
|
||||||
|
vim.cmd("startinsert!")
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
function _OLLAMA_TOGGLE()
|
||||||
|
ollama:toggle()
|
||||||
|
end
|
||||||
|
|
||||||
opts.desc = "Open lazygit"
|
opts.desc = "Open lazygit"
|
||||||
vim.api.nvim_set_keymap("n", "<leader>gs", "<cmd>lua _LAZYGIT_TOGGLE()<CR>", opts)
|
vim.api.nvim_set_keymap("n", "<leader>gs", "<cmd>lua _LAZYGIT_TOGGLE()<CR>", opts)
|
||||||
|
|
||||||
|
opts.desc = "Open ollama"
|
||||||
|
vim.api.nvim_set_keymap("n", "<leader>ol", "<cmd>lua _OLLAMA_TOGGLE()<CR>", opts)
|
||||||
|
|
||||||
-- opts.desc = "Open a terminal"
|
-- opts.desc = "Open a terminal"
|
||||||
-- vim.api.nvim_set_keymap("n", "<C-`>", "<cmd>ToggleTerm<CR>", opts)
|
-- vim.api.nvim_set_keymap("n", "<C-`>", "<cmd>ToggleTerm<CR>", opts)
|
||||||
|
|||||||
@@ -0,0 +1,14 @@
|
|||||||
|
local venvSelector = require("venv-selector")
|
||||||
|
|
||||||
|
venvSelector.setup({
|
||||||
|
-- name = "venv",
|
||||||
|
auto_refresh = false,
|
||||||
|
})
|
||||||
|
|
||||||
|
local opts = { noremap = true, silent = true }
|
||||||
|
|
||||||
|
opts.desc = "Open VenvSelector to pick a venv."
|
||||||
|
vim.api.nvim_set_keymap("n", "<leader>vs", "<cmd>VenvSelect<cr>", opts)
|
||||||
|
|
||||||
|
opts.desc = "Retrieve the venv from a cache."
|
||||||
|
vim.api.nvim_set_keymap("n", "<leader>vc", "<cmd>VenvSelectCached<cr>", opts)
|
||||||
@@ -1,3 +1,5 @@
|
|||||||
|
local ThemeRegistry = require("absolute.core.theme-registry")
|
||||||
|
|
||||||
local function SetupWindowPreferences()
|
local function SetupWindowPreferences()
|
||||||
-- Utility function to get the blend value or set a default
|
-- Utility function to get the blend value or set a default
|
||||||
local function get_blend_value(group_name, default_blend)
|
local function get_blend_value(group_name, default_blend)
|
||||||
@@ -7,55 +9,144 @@ local function SetupWindowPreferences()
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- Set the Normal group with dynamic blend
|
-- Set the Normal group with dynamic blend
|
||||||
local normal_blend = get_blend_value("Normal", 50)
|
local normal_blend = get_blend_value("Normal", 0)
|
||||||
vim.api.nvim_set_hl(0, "Normal", { bg = "none", blend = normal_blend })
|
vim.api.nvim_set_hl(0, "Normal", { bg = "none", blend = normal_blend })
|
||||||
|
|
||||||
-- Set the NormalFloat group with dynamic blend
|
-- Set the NormalFloat group with dynamic blend
|
||||||
local normal_float_blend = get_blend_value("NormalFloat", 50)
|
local normal_float_blend = get_blend_value("NormalFloat", 0)
|
||||||
vim.api.nvim_set_hl(1, "NormalFloat", { bg = "none", blend = normal_float_blend })
|
vim.api.nvim_set_hl(1, "NormalFloat", { bg = "none", blend = normal_float_blend })
|
||||||
|
|
||||||
-- Set the NormalNC group with dynamic blend
|
-- Set the NormalNC group with dynamic blend
|
||||||
local normal_nc_blend = get_blend_value("NormalNC", 50)
|
local normal_nc_blend = get_blend_value("NormalNC", 0)
|
||||||
vim.api.nvim_set_hl(0, "NormalNC", { bg = "none", blend = normal_nc_blend })
|
vim.api.nvim_set_hl(0, "NormalNC", { bg = "none", blend = normal_nc_blend })
|
||||||
end
|
end
|
||||||
|
|
||||||
local colorschemes = {
|
|
||||||
["tokyonight-day"] = "Tokyo Night Day",
|
|
||||||
["tokyonight-night"] = "Tokyo Night Night",
|
|
||||||
["tokyonight-storm"] = "Tokyo Night Storm",
|
|
||||||
["tokynight-moon"] = "Tokyo Night Moon",
|
|
||||||
["catppuccin-frappe"] = "Catppuccin Frappe",
|
|
||||||
["catppuccin-latte"] = "Catppuccin Latte",
|
|
||||||
["catppuccin-macchiato"] = "Catppuccin Macchiato",
|
|
||||||
["catppuccin-mocha"] = "Catppuccin Mocha",
|
|
||||||
}
|
|
||||||
|
|
||||||
local function SyncWezTerm()
|
local function SyncWezTerm()
|
||||||
vim.api.nvim_create_autocmd("ColorScheme", {
|
vim.api.nvim_create_autocmd("ColorScheme", {
|
||||||
group = vim.api.nvim_create_augroup("wezterm_colorscheme", { clear = true }),
|
group = vim.api.nvim_create_augroup("wezterm_colorscheme", { clear = true }),
|
||||||
callback = function(args)
|
callback = function(args)
|
||||||
SetupWindowPreferences()
|
SetupWindowPreferences()
|
||||||
|
|
||||||
local colorscheme = colorschemes[args.match]
|
-- Get terminal theme from registry
|
||||||
if not colorscheme then
|
local wezterm_theme = ThemeRegistry.get_theme(args.match, "wezterm")
|
||||||
|
if not wezterm_theme then
|
||||||
|
-- Theme not in registry, skip silently
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
-- if the file does not exists, exit early
|
||||||
|
local filename = vim.fn.expand("$XDG_CONFIG_HOME/wezterm/colorscheme")
|
||||||
|
if not vim.fn.filereadable(filename) then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Write the colorscheme to a file
|
-- Write the colorscheme to a file
|
||||||
local filename = vim.fn.expand("$XDG_CONFIG_HOME/wezterm/colorscheme")
|
|
||||||
assert(type(filename) == "string")
|
assert(type(filename) == "string")
|
||||||
|
|
||||||
local file = io.open(filename, "w")
|
local file = io.open(filename, "w")
|
||||||
|
|
||||||
assert(file)
|
assert(file)
|
||||||
file:write(colorscheme)
|
|
||||||
|
file:write(wezterm_theme)
|
||||||
file:close()
|
file:close()
|
||||||
-- vim.notify("Setting WezTerm color scheme to " .. colorscheme, vim.log.levels.INFO)
|
-- vim.notify("Setting WezTerm color scheme to " .. wezterm_theme, vim.log.levels.INFO)
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local function SyncGhostyTerm()
|
||||||
|
vim.api.nvim_create_user_command("SendCmdShiftComma", function()
|
||||||
|
os.execute(
|
||||||
|
'osascript -e \'tell application "System Events" to keystroke "," using {command down, shift down}\''
|
||||||
|
)
|
||||||
|
end, {})
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd("ColorScheme", {
|
||||||
|
group = vim.api.nvim_create_augroup("ghostty_colorscheme", { clear = true }),
|
||||||
|
callback = function(args)
|
||||||
|
SetupWindowPreferences()
|
||||||
|
|
||||||
|
local notifyOpts = { title = "Set Ghostty Theme" }
|
||||||
|
|
||||||
|
-- Get terminal theme from registry
|
||||||
|
local ghostty_colorscheme = ThemeRegistry.get_theme(args.match, "ghostty")
|
||||||
|
if not ghostty_colorscheme then
|
||||||
|
-- Theme not in registry, skip silently
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
-- if the file does not exists, exit early
|
||||||
|
|
||||||
|
local filename = vim.fn.expand("$XDG_CONFIG_HOME/ghostty/colorscheme")
|
||||||
|
if not vim.fn.filereadable(filename) then
|
||||||
|
vim.notify("Ghostty colorscheme file not found", vim.log.levels.ERROR, notifyOpts)
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
-- lets check if ghostty supports the theme
|
||||||
|
-- ghostty +list-themes | xargs -I {} echo {} | grep <theme>
|
||||||
|
|
||||||
|
local cmd = "ghostty +list-themes | sed 's/ (resources)//g' | grep '^" .. ghostty_colorscheme .. "$'"
|
||||||
|
|
||||||
|
local status = vim.fn.system(cmd)
|
||||||
|
local trimmed_output = vim.fn.substitute(status, "^s+|s+$", "", "g")
|
||||||
|
-- check if status is empty
|
||||||
|
|
||||||
|
if trimmed_output == "" then
|
||||||
|
vim.notify(ghostty_colorscheme .. " is not supported by Ghostty", vim.log.levels.ERROR, notifyOpts)
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
assert(type(filename) == "string")
|
||||||
|
|
||||||
|
local file = io.open(filename, "w")
|
||||||
|
|
||||||
|
assert(file)
|
||||||
|
|
||||||
|
local theme_string = 'theme = "' .. ghostty_colorscheme .. '"'
|
||||||
|
|
||||||
|
file:write(theme_string)
|
||||||
|
file:close()
|
||||||
|
|
||||||
|
vim.cmd([[SendCmdShiftComma]])
|
||||||
|
|
||||||
|
-- send a key combination to reload the theme
|
||||||
|
-- cmd + shift + ,
|
||||||
|
-- vim.api.nvim_feedkeys("<Cmd-Shift-,>", "n", true)
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
local function is_wezterm()
|
||||||
|
return os.getenv("TERM_PROGRAM") == "WezTerm"
|
||||||
|
or os.getenv("WEZTERM_EXECUTABLE") ~= nil
|
||||||
|
or vim.fn.executable("wezterm") == 1
|
||||||
|
end
|
||||||
|
|
||||||
|
local function is_ghostty()
|
||||||
|
return os.getenv("TERM_PROGRAM") == "Ghostty"
|
||||||
|
or os.getenv("GHOSTTY_EXECUTABLE") ~= nil
|
||||||
|
or vim.fn.executable("ghostty") == 1
|
||||||
|
end
|
||||||
|
|
||||||
|
local function SetupAutocommands()
|
||||||
-- Setup Autocommand if wezterm is available in the system
|
-- Setup Autocommand if wezterm is available in the system
|
||||||
if vim.fn.executable("wezterm") == 1 then
|
if is_wezterm() then
|
||||||
SyncWezTerm()
|
SyncWezTerm()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Setup Autommand if the terminal is Ghostty
|
||||||
|
if is_ghostty() then
|
||||||
|
SyncGhostyTerm()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
SetupWindowPreferences()
|
SetupWindowPreferences()
|
||||||
|
SetupAutocommands()
|
||||||
|
|
||||||
|
local opts = { noremap = true, silent = true }
|
||||||
|
|
||||||
|
opts.desc = "Fuzzy find colorschemes"
|
||||||
|
vim.keymap.set("n", "<leader>cs", function()
|
||||||
|
Snacks.picker.colorschemes()
|
||||||
|
end, opts)
|
||||||
|
|||||||
@@ -2,11 +2,21 @@ local lua_utils = require("absolute.utils.detect-lua")
|
|||||||
|
|
||||||
package.path = package.path .. lua_utils.GetLatestLuaVersion()
|
package.path = package.path .. lua_utils.GetLatestLuaVersion()
|
||||||
|
|
||||||
|
local current_home = os.getenv("HOME")
|
||||||
|
|
||||||
|
vim.g.python3_host_prog = current_home .. "/.pyenv/versions/py3nvim/bin/python"
|
||||||
|
|
||||||
|
vim.opt.title = true
|
||||||
|
|
||||||
|
vim.opt.titlestring = "%{fnamemodify(getcwd(), ':t')}"
|
||||||
|
|
||||||
|
-- auto reload
|
||||||
|
vim.o.autoread = true
|
||||||
|
|
||||||
-- disable nvim intro
|
-- disable nvim intro
|
||||||
vim.opt.shortmess:append "sI"
|
vim.opt.shortmess:append("sI")
|
||||||
|
|
||||||
|
vim.opt.shell = "zsh"
|
||||||
|
|
||||||
vim.opt.nu = true
|
vim.opt.nu = true
|
||||||
vim.opt.relativenumber = true
|
vim.opt.relativenumber = true
|
||||||
@@ -71,4 +81,26 @@ vim.api.nvim_create_autocmd("InsertLeave", {
|
|||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
vim.api.nvim_create_user_command("GitRootRun", function(opts)
|
||||||
|
local cmd = opts.args
|
||||||
|
local git_root = vim.fn.systemlist("git rev-parse --show-toplevel")[1]
|
||||||
|
if git_root and git_root ~= "" then
|
||||||
|
vim.cmd("!cd " .. git_root .. " && " .. cmd)
|
||||||
|
else
|
||||||
|
print("Not in a Git repository.")
|
||||||
|
end
|
||||||
|
end, { nargs = "+" })
|
||||||
|
|
||||||
|
local opts = { noremap = true, silent = true }
|
||||||
|
opts.desc = "Run command in Git root"
|
||||||
|
|
||||||
|
vim.keymap.set("n", "<leader>gr", function()
|
||||||
|
local command = vim.fn.input("$: ")
|
||||||
|
if command ~= "" then
|
||||||
|
vim.cmd("GitRootRun " .. command)
|
||||||
|
else
|
||||||
|
print("No command entered.")
|
||||||
|
end
|
||||||
|
end, opts)
|
||||||
|
|
||||||
-- Add similar autocommands for other modes as needed
|
-- Add similar autocommands for other modes as needed
|
||||||
|
|||||||
@@ -0,0 +1,491 @@
|
|||||||
|
-- Theme Registry
|
||||||
|
-- Central mapping between Neovim colorschemes and terminal themes (WezTerm, Ghostty)
|
||||||
|
-- Maintains a curated list of popular themes with verified mappings
|
||||||
|
|
||||||
|
local M = {}
|
||||||
|
|
||||||
|
-- Core theme mappings (manually curated and tested)
|
||||||
|
-- Each entry maps a Neovim colorscheme to its terminal equivalents
|
||||||
|
M.themes = {
|
||||||
|
-- ============================================================================
|
||||||
|
-- Tokyo Night Family (5 variants)
|
||||||
|
-- ============================================================================
|
||||||
|
["tokyonight"] = {
|
||||||
|
nvim = "tokyonight",
|
||||||
|
wezterm = "Tokyo Night",
|
||||||
|
ghostty = "TokyoNight",
|
||||||
|
family = "tokyonight",
|
||||||
|
variant = "night",
|
||||||
|
description = "A clean, dark Tokyo Night theme",
|
||||||
|
},
|
||||||
|
["tokyonight-night"] = {
|
||||||
|
nvim = "tokyonight-night",
|
||||||
|
wezterm = "Tokyo Night",
|
||||||
|
ghostty = "TokyoNight Night",
|
||||||
|
family = "tokyonight",
|
||||||
|
variant = "night",
|
||||||
|
description = "Tokyo Night (night variant)",
|
||||||
|
},
|
||||||
|
["tokyonight-storm"] = {
|
||||||
|
nvim = "tokyonight-storm",
|
||||||
|
wezterm = "Tokyo Night Storm",
|
||||||
|
ghostty = "TokyoNight Storm",
|
||||||
|
family = "tokyonight",
|
||||||
|
variant = "storm",
|
||||||
|
description = "Tokyo Night (storm variant)",
|
||||||
|
},
|
||||||
|
["tokyonight-day"] = {
|
||||||
|
nvim = "tokyonight-day",
|
||||||
|
wezterm = "Tokyo Night Day",
|
||||||
|
ghostty = "TokyoNight Day",
|
||||||
|
family = "tokyonight",
|
||||||
|
variant = "day",
|
||||||
|
description = "Tokyo Night (light day variant)",
|
||||||
|
},
|
||||||
|
["tokyonight-moon"] = {
|
||||||
|
nvim = "tokyonight-moon",
|
||||||
|
wezterm = "Tokyo Night Moon",
|
||||||
|
ghostty = "TokyoNight Moon",
|
||||||
|
family = "tokyonight",
|
||||||
|
variant = "moon",
|
||||||
|
description = "Tokyo Night (moon variant)",
|
||||||
|
},
|
||||||
|
|
||||||
|
-- ============================================================================
|
||||||
|
-- Catppuccin Family (4 variants)
|
||||||
|
-- ============================================================================
|
||||||
|
["catppuccin"] = {
|
||||||
|
nvim = "catppuccin",
|
||||||
|
wezterm = "Catppuccin Mocha",
|
||||||
|
ghostty = "Catppuccin Mocha",
|
||||||
|
family = "catppuccin",
|
||||||
|
variant = "mocha",
|
||||||
|
description = "Catppuccin (default mocha variant)",
|
||||||
|
},
|
||||||
|
["catppuccin-mocha"] = {
|
||||||
|
nvim = "catppuccin-mocha",
|
||||||
|
wezterm = "Catppuccin Mocha",
|
||||||
|
ghostty = "Catppuccin Mocha",
|
||||||
|
family = "catppuccin",
|
||||||
|
variant = "mocha",
|
||||||
|
description = "Catppuccin Mocha (warm, dark)",
|
||||||
|
},
|
||||||
|
["catppuccin-macchiato"] = {
|
||||||
|
nvim = "catppuccin-macchiato",
|
||||||
|
wezterm = "Catppuccin Macchiato",
|
||||||
|
ghostty = "Catppuccin Macchiato",
|
||||||
|
family = "catppuccin",
|
||||||
|
variant = "macchiato",
|
||||||
|
description = "Catppuccin Macchiato (mid-tone dark)",
|
||||||
|
},
|
||||||
|
["catppuccin-frappe"] = {
|
||||||
|
nvim = "catppuccin-frappe",
|
||||||
|
wezterm = "Catppuccin Frappe",
|
||||||
|
ghostty = "Catppuccin Frappe",
|
||||||
|
family = "catppuccin",
|
||||||
|
variant = "frappe",
|
||||||
|
description = "Catppuccin Frappe (cool, dark)",
|
||||||
|
},
|
||||||
|
["catppuccin-latte"] = {
|
||||||
|
nvim = "catppuccin-latte",
|
||||||
|
wezterm = "Catppuccin Latte",
|
||||||
|
ghostty = "Catppuccin Latte",
|
||||||
|
family = "catppuccin",
|
||||||
|
variant = "latte",
|
||||||
|
description = "Catppuccin Latte (light variant)",
|
||||||
|
},
|
||||||
|
|
||||||
|
-- ============================================================================
|
||||||
|
-- Rose Pine Family (4 variants)
|
||||||
|
-- ============================================================================
|
||||||
|
["rose-pine"] = {
|
||||||
|
nvim = "rose-pine",
|
||||||
|
wezterm = "rose-pine",
|
||||||
|
ghostty = "Rose Pine",
|
||||||
|
family = "rose-pine",
|
||||||
|
variant = "main",
|
||||||
|
description = "Rose Pine (main dark variant)",
|
||||||
|
},
|
||||||
|
["rose-pine-main"] = {
|
||||||
|
nvim = "rose-pine-main",
|
||||||
|
wezterm = "rose-pine",
|
||||||
|
ghostty = "Rose Pine",
|
||||||
|
family = "rose-pine",
|
||||||
|
variant = "main",
|
||||||
|
description = "Rose Pine (main dark variant)",
|
||||||
|
},
|
||||||
|
["rose-pine-moon"] = {
|
||||||
|
nvim = "rose-pine-moon",
|
||||||
|
wezterm = "rose-pine-moon",
|
||||||
|
ghostty = "Rose Pine Moon",
|
||||||
|
family = "rose-pine",
|
||||||
|
variant = "moon",
|
||||||
|
description = "Rose Pine Moon (darker variant)",
|
||||||
|
},
|
||||||
|
["rose-pine-dawn"] = {
|
||||||
|
nvim = "rose-pine-dawn",
|
||||||
|
wezterm = "rose-pine-dawn",
|
||||||
|
ghostty = "Rose Pine Dawn",
|
||||||
|
family = "rose-pine",
|
||||||
|
variant = "dawn",
|
||||||
|
description = "Rose Pine Dawn (light variant)",
|
||||||
|
},
|
||||||
|
|
||||||
|
-- ============================================================================
|
||||||
|
-- Nightfox Family (7 variants)
|
||||||
|
-- ============================================================================
|
||||||
|
["nightfox"] = {
|
||||||
|
nvim = "nightfox",
|
||||||
|
wezterm = "nightfox",
|
||||||
|
ghostty = "Nightfox",
|
||||||
|
family = "nightfox",
|
||||||
|
variant = "night",
|
||||||
|
description = "Nightfox (main dark variant)",
|
||||||
|
},
|
||||||
|
["carbonfox"] = {
|
||||||
|
nvim = "carbonfox",
|
||||||
|
wezterm = "carbonfox",
|
||||||
|
ghostty = "Carbonfox",
|
||||||
|
family = "nightfox",
|
||||||
|
variant = "carbon",
|
||||||
|
description = "Carbonfox (carbon variant)",
|
||||||
|
},
|
||||||
|
["dawnfox"] = {
|
||||||
|
nvim = "dawnfox",
|
||||||
|
wezterm = "dawnfox",
|
||||||
|
ghostty = "Dawnfox",
|
||||||
|
family = "nightfox",
|
||||||
|
variant = "dawn",
|
||||||
|
description = "Dawnfox (dawn variant)",
|
||||||
|
},
|
||||||
|
["dayfox"] = {
|
||||||
|
nvim = "dayfox",
|
||||||
|
wezterm = "dayfox",
|
||||||
|
ghostty = "Dayfox",
|
||||||
|
family = "nightfox",
|
||||||
|
variant = "day",
|
||||||
|
description = "Dayfox (light day variant)",
|
||||||
|
},
|
||||||
|
["duskfox"] = {
|
||||||
|
nvim = "duskfox",
|
||||||
|
wezterm = "duskfox",
|
||||||
|
ghostty = "Duskfox",
|
||||||
|
family = "nightfox",
|
||||||
|
variant = "dusk",
|
||||||
|
description = "Duskfox (dusk variant)",
|
||||||
|
},
|
||||||
|
["nordfox"] = {
|
||||||
|
nvim = "nordfox",
|
||||||
|
wezterm = "nordfox",
|
||||||
|
ghostty = "Nordfox",
|
||||||
|
family = "nightfox",
|
||||||
|
variant = "nord",
|
||||||
|
description = "Nordfox (nord-inspired variant)",
|
||||||
|
},
|
||||||
|
["terafox"] = {
|
||||||
|
nvim = "terafox",
|
||||||
|
wezterm = "terafox",
|
||||||
|
ghostty = "Terafox",
|
||||||
|
family = "nightfox",
|
||||||
|
variant = "tera",
|
||||||
|
description = "Terafox (tera variant)",
|
||||||
|
},
|
||||||
|
|
||||||
|
-- ============================================================================
|
||||||
|
-- Gruvbox Family (4 variants)
|
||||||
|
-- ============================================================================
|
||||||
|
["gruvbox"] = {
|
||||||
|
nvim = "gruvbox",
|
||||||
|
wezterm = "GruvboxDark",
|
||||||
|
ghostty = "Gruvbox Dark",
|
||||||
|
family = "gruvbox",
|
||||||
|
variant = "dark",
|
||||||
|
description = "Gruvbox (dark variant)",
|
||||||
|
},
|
||||||
|
["gruvbox-material"] = {
|
||||||
|
nvim = "gruvbox-material",
|
||||||
|
wezterm = "Gruvbox Material (Gogh)",
|
||||||
|
ghostty = "Gruvbox Material",
|
||||||
|
family = "gruvbox",
|
||||||
|
variant = "material",
|
||||||
|
description = "Gruvbox Material",
|
||||||
|
},
|
||||||
|
|
||||||
|
-- ============================================================================
|
||||||
|
-- Nord
|
||||||
|
-- ============================================================================
|
||||||
|
["nord"] = {
|
||||||
|
nvim = "nord",
|
||||||
|
wezterm = "Nord (base16)",
|
||||||
|
ghostty = "Nord",
|
||||||
|
family = "nord",
|
||||||
|
variant = "main",
|
||||||
|
description = "Nord (arctic, north-bluish color palette)",
|
||||||
|
},
|
||||||
|
|
||||||
|
-- ============================================================================
|
||||||
|
-- Dracula
|
||||||
|
-- ============================================================================
|
||||||
|
["dracula"] = {
|
||||||
|
nvim = "dracula",
|
||||||
|
wezterm = "Dracula (Official)",
|
||||||
|
ghostty = "Dracula",
|
||||||
|
family = "dracula",
|
||||||
|
variant = "main",
|
||||||
|
description = "Dracula (dark theme)",
|
||||||
|
},
|
||||||
|
|
||||||
|
-- ============================================================================
|
||||||
|
-- One Dark / One Light
|
||||||
|
-- ============================================================================
|
||||||
|
["onedark"] = {
|
||||||
|
nvim = "onedark",
|
||||||
|
wezterm = "OneDark (base16)",
|
||||||
|
ghostty = "Atom One Dark",
|
||||||
|
family = "onedark",
|
||||||
|
variant = "dark",
|
||||||
|
description = "One Dark (Atom-inspired dark theme)",
|
||||||
|
},
|
||||||
|
["onelight"] = {
|
||||||
|
nvim = "onelight",
|
||||||
|
wezterm = "One Light (base16)",
|
||||||
|
ghostty = "Atom One Light",
|
||||||
|
family = "onelight",
|
||||||
|
variant = "light",
|
||||||
|
description = "One Light (Atom-inspired light theme)",
|
||||||
|
},
|
||||||
|
|
||||||
|
-- ============================================================================
|
||||||
|
-- Material
|
||||||
|
-- ============================================================================
|
||||||
|
["material"] = {
|
||||||
|
nvim = "material",
|
||||||
|
wezterm = "MaterialDark",
|
||||||
|
ghostty = "Material",
|
||||||
|
family = "material",
|
||||||
|
variant = "dark",
|
||||||
|
description = "Material (dark variant)",
|
||||||
|
},
|
||||||
|
["material-darker"] = {
|
||||||
|
nvim = "material-darker",
|
||||||
|
wezterm = "MaterialDarker",
|
||||||
|
ghostty = "Material Darker",
|
||||||
|
family = "material",
|
||||||
|
variant = "darker",
|
||||||
|
description = "Material (darker variant)",
|
||||||
|
},
|
||||||
|
|
||||||
|
-- ============================================================================
|
||||||
|
-- Solarized
|
||||||
|
-- ============================================================================
|
||||||
|
["solarized-dark"] = {
|
||||||
|
nvim = "solarized-dark",
|
||||||
|
wezterm = "Builtin Solarized Dark",
|
||||||
|
ghostty = "Builtin Solarized Dark",
|
||||||
|
family = "solarized",
|
||||||
|
variant = "dark",
|
||||||
|
description = "Solarized Dark",
|
||||||
|
},
|
||||||
|
["solarized-light"] = {
|
||||||
|
nvim = "solarized-light",
|
||||||
|
wezterm = "Builtin Solarized Light",
|
||||||
|
ghostty = "Builtin Solarized Light",
|
||||||
|
family = "solarized",
|
||||||
|
variant = "light",
|
||||||
|
description = "Solarized Light",
|
||||||
|
},
|
||||||
|
|
||||||
|
-- ============================================================================
|
||||||
|
-- Monokai
|
||||||
|
-- ============================================================================
|
||||||
|
["monokai"] = {
|
||||||
|
nvim = "monokai",
|
||||||
|
wezterm = "Monokai Remastered",
|
||||||
|
ghostty = "Monokai Classic",
|
||||||
|
family = "monokai",
|
||||||
|
variant = "main",
|
||||||
|
description = "Monokai (classic variant)",
|
||||||
|
},
|
||||||
|
["monokai-pro"] = {
|
||||||
|
nvim = "monokai-pro",
|
||||||
|
wezterm = "Monokai Pro (Gogh)",
|
||||||
|
ghostty = "Monokai Pro",
|
||||||
|
family = "monokai",
|
||||||
|
variant = "pro",
|
||||||
|
description = "Monokai Pro",
|
||||||
|
},
|
||||||
|
|
||||||
|
-- ============================================================================
|
||||||
|
-- GitHub
|
||||||
|
-- ============================================================================
|
||||||
|
["github-dark"] = {
|
||||||
|
nvim = "github-dark",
|
||||||
|
wezterm = "GitHub Dark",
|
||||||
|
ghostty = "GitHub Dark",
|
||||||
|
family = "github",
|
||||||
|
variant = "dark",
|
||||||
|
description = "GitHub Dark",
|
||||||
|
},
|
||||||
|
|
||||||
|
-- ============================================================================
|
||||||
|
-- Ayu
|
||||||
|
-- ============================================================================
|
||||||
|
["ayu-dark"] = {
|
||||||
|
nvim = "ayu-dark",
|
||||||
|
wezterm = "Ayu Dark (Gogh)",
|
||||||
|
ghostty = "Ayu",
|
||||||
|
family = "ayu",
|
||||||
|
variant = "dark",
|
||||||
|
description = "Ayu (dark variant)",
|
||||||
|
},
|
||||||
|
["ayu-mirage"] = {
|
||||||
|
nvim = "ayu-mirage",
|
||||||
|
wezterm = "Ayu Mirage",
|
||||||
|
ghostty = "Ayu Mirage",
|
||||||
|
family = "ayu",
|
||||||
|
variant = "mirage",
|
||||||
|
description = "Ayu Mirage (mid-tone variant)",
|
||||||
|
},
|
||||||
|
["ayu-light"] = {
|
||||||
|
nvim = "ayu-light",
|
||||||
|
wezterm = "Ayu Light (Gogh)",
|
||||||
|
ghostty = "Ayu Light",
|
||||||
|
family = "ayu",
|
||||||
|
variant = "light",
|
||||||
|
description = "Ayu (light variant)",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
-- ============================================================================
|
||||||
|
-- Helper Functions
|
||||||
|
-- ============================================================================
|
||||||
|
|
||||||
|
--- Get the terminal theme name for a given Neovim colorscheme
|
||||||
|
--- @param nvim_name string The Neovim colorscheme name
|
||||||
|
--- @param terminal_type string The terminal type ("wezterm" or "ghostty")
|
||||||
|
--- @return string|nil The terminal theme name, or nil if not found
|
||||||
|
function M.get_theme(nvim_name, terminal_type)
|
||||||
|
local theme = M.themes[nvim_name]
|
||||||
|
if not theme then
|
||||||
|
return nil
|
||||||
|
end
|
||||||
|
|
||||||
|
if terminal_type == "wezterm" then
|
||||||
|
return theme.wezterm
|
||||||
|
elseif terminal_type == "ghostty" then
|
||||||
|
return theme.ghostty
|
||||||
|
end
|
||||||
|
|
||||||
|
return nil
|
||||||
|
end
|
||||||
|
|
||||||
|
--- Check if a Neovim colorscheme is supported for a given terminal
|
||||||
|
--- @param nvim_name string The Neovim colorscheme name
|
||||||
|
--- @param terminal_type string The terminal type ("wezterm" or "ghostty")
|
||||||
|
--- @return boolean True if the mapping exists
|
||||||
|
function M.is_supported(nvim_name, terminal_type)
|
||||||
|
return M.get_theme(nvim_name, terminal_type) ~= nil
|
||||||
|
end
|
||||||
|
|
||||||
|
--- Get all Neovim themes in the registry
|
||||||
|
--- @return table List of Neovim colorscheme names
|
||||||
|
function M.get_all_nvim_themes()
|
||||||
|
local themes = {}
|
||||||
|
for nvim_name, _ in pairs(M.themes) do
|
||||||
|
table.insert(themes, nvim_name)
|
||||||
|
end
|
||||||
|
table.sort(themes)
|
||||||
|
return themes
|
||||||
|
end
|
||||||
|
|
||||||
|
--- Get theme family and variant information
|
||||||
|
--- @param nvim_name string The Neovim colorscheme name
|
||||||
|
--- @return table|nil Theme metadata (family, variant, description)
|
||||||
|
function M.get_theme_info(nvim_name)
|
||||||
|
local theme = M.themes[nvim_name]
|
||||||
|
if not theme then
|
||||||
|
return nil
|
||||||
|
end
|
||||||
|
|
||||||
|
return {
|
||||||
|
family = theme.family,
|
||||||
|
variant = theme.variant,
|
||||||
|
description = theme.description,
|
||||||
|
wezterm = theme.wezterm,
|
||||||
|
ghostty = theme.ghostty,
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
--- Get all themes in a family
|
||||||
|
--- @param family_name string The theme family name (e.g., "tokyonight", "catppuccin")
|
||||||
|
--- @return table List of theme entries in the family
|
||||||
|
function M.get_family_themes(family_name)
|
||||||
|
local family_themes = {}
|
||||||
|
for nvim_name, theme in pairs(M.themes) do
|
||||||
|
if theme.family == family_name then
|
||||||
|
table.insert(family_themes, {
|
||||||
|
nvim = nvim_name,
|
||||||
|
variant = theme.variant,
|
||||||
|
description = theme.description,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Sort by variant name
|
||||||
|
table.sort(family_themes, function(a, b)
|
||||||
|
return a.variant < b.variant
|
||||||
|
end)
|
||||||
|
|
||||||
|
return family_themes
|
||||||
|
end
|
||||||
|
|
||||||
|
--- Get a list of all theme families
|
||||||
|
--- @return table List of unique family names
|
||||||
|
function M.get_all_families()
|
||||||
|
local families = {}
|
||||||
|
local seen = {}
|
||||||
|
|
||||||
|
for _, theme in pairs(M.themes) do
|
||||||
|
if not seen[theme.family] then
|
||||||
|
seen[theme.family] = true
|
||||||
|
table.insert(families, theme.family)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
table.sort(families)
|
||||||
|
return families
|
||||||
|
end
|
||||||
|
|
||||||
|
--- Get statistics about the theme registry
|
||||||
|
--- @return table Statistics (total_themes, families_count, terminal_coverage)
|
||||||
|
function M.get_stats()
|
||||||
|
local total = 0
|
||||||
|
local wezterm_count = 0
|
||||||
|
local ghostty_count = 0
|
||||||
|
local families = {}
|
||||||
|
|
||||||
|
for _, theme in pairs(M.themes) do
|
||||||
|
total = total + 1
|
||||||
|
if theme.wezterm then
|
||||||
|
wezterm_count = wezterm_count + 1
|
||||||
|
end
|
||||||
|
if theme.ghostty then
|
||||||
|
ghostty_count = ghostty_count + 1
|
||||||
|
end
|
||||||
|
families[theme.family] = true
|
||||||
|
end
|
||||||
|
|
||||||
|
local families_count = 0
|
||||||
|
for _ in pairs(families) do
|
||||||
|
families_count = families_count + 1
|
||||||
|
end
|
||||||
|
|
||||||
|
return {
|
||||||
|
total_themes = total,
|
||||||
|
families_count = families_count,
|
||||||
|
wezterm_coverage = wezterm_count,
|
||||||
|
ghostty_coverage = ghostty_count,
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
return M
|
||||||
@@ -1,6 +1,8 @@
|
|||||||
|
local lua_utils = require("absolute.utils.detect-lua")
|
||||||
|
|
||||||
|
package.path = package.path .. lua_utils.GetLatestLuaVersion()
|
||||||
|
|
||||||
require("absolute.core")
|
require("absolute.core")
|
||||||
require("absolute.lazy")
|
require("absolute.lazy")
|
||||||
require("absolute.helpers")
|
require("absolute.helpers")
|
||||||
require("absolute.remap")
|
require("absolute.remap")
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -27,7 +27,10 @@ require("lazy")
|
|||||||
change_detection = {
|
change_detection = {
|
||||||
notify = false,
|
notify = false,
|
||||||
},
|
},
|
||||||
|
ui = {
|
||||||
|
border = "rounded",
|
||||||
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
require("absolute.core.colorscheme")
|
require("absolute.core.colorscheme")
|
||||||
require("../current-theme");
|
require("current-theme")
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
return {
|
||||||
|
default_config = {
|
||||||
|
cmd = { "pb", "lsp" },
|
||||||
|
filetypes = { "proto" },
|
||||||
|
single_file_support = true,
|
||||||
|
root_dir = require("lspconfig.util").root_pattern(".git"),
|
||||||
|
},
|
||||||
|
}
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
return {
|
return {
|
||||||
"https://github.com/apple/pkl-neovim",
|
"https://github.com/apple/pkl-neovim",
|
||||||
|
enabled = false,
|
||||||
lazy = true,
|
lazy = true,
|
||||||
event = "BufReadPre *.pkl",
|
event = "BufReadPre *.pkl",
|
||||||
dependencies = {
|
dependencies = {
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
return {
|
||||||
|
"saghen/blink.cmp",
|
||||||
|
version = "1.*",
|
||||||
|
event = "InsertEnter",
|
||||||
|
dependencies = { "rafamadriz/friendly-snippets" },
|
||||||
|
config = function()
|
||||||
|
require("absolute.after.blink-cmp")
|
||||||
|
end,
|
||||||
|
}
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
return {
|
|
||||||
"sudormrfbin/cheatsheet.nvim",
|
|
||||||
dependencies = {
|
|
||||||
{ "nvim-telescope/telescope.nvim" },
|
|
||||||
{ "nvim-lua/plenary.nvim" },
|
|
||||||
},
|
|
||||||
config = function()
|
|
||||||
require("absolute.after.cheatsheet")
|
|
||||||
|
|
||||||
end,
|
|
||||||
}
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
return {
|
|
||||||
"github/copilot.vim"
|
|
||||||
}
|
|
||||||
@@ -4,13 +4,6 @@ return {
|
|||||||
"theHamsta/nvim-dap-virtual-text",
|
"theHamsta/nvim-dap-virtual-text",
|
||||||
"rcarriga/nvim-dap-ui",
|
"rcarriga/nvim-dap-ui",
|
||||||
"nvim-neotest/nvim-nio",
|
"nvim-neotest/nvim-nio",
|
||||||
"nvim-telescope/telescope-dap.nvim",
|
|
||||||
{
|
|
||||||
"mfussenegger/nvim-dap-python",
|
|
||||||
ft = "python",
|
|
||||||
dependencies = { "mfussenegger/nvim-dap" },
|
|
||||||
},
|
|
||||||
-- "Pocco81/DAPInstall.nvim"
|
|
||||||
},
|
},
|
||||||
config = function()
|
config = function()
|
||||||
require("absolute.after.dap")
|
require("absolute.after.dap")
|
||||||
|
|||||||
@@ -1,11 +0,0 @@
|
|||||||
return {
|
|
||||||
"nvimdev/dashboard-nvim",
|
|
||||||
dependencies = {
|
|
||||||
"nvim-tree/nvim-web-devicons"
|
|
||||||
},
|
|
||||||
event = "VimEnter",
|
|
||||||
config = function()
|
|
||||||
require("absolute.after.dashboard")
|
|
||||||
end
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
return {
|
|
||||||
"stevearc/dressing.nvim",
|
|
||||||
event = "VeryLazy"
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
return {
|
||||||
|
enabled = false,
|
||||||
|
"folke/flash.nvim",
|
||||||
|
event = "VeryLazy",
|
||||||
|
---@type Flash.Config
|
||||||
|
opts = {},
|
||||||
|
-- stylua: ignore
|
||||||
|
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" },
|
||||||
|
{ "<c-s>", mode = { "c" }, function() require("flash").toggle() end, desc = "Toggle Flash Search" },
|
||||||
|
},
|
||||||
|
}
|
||||||
@@ -1,9 +1,10 @@
|
|||||||
return {
|
return {
|
||||||
'akinsho/flutter-tools.nvim',
|
"akinsho/flutter-tools.nvim",
|
||||||
|
enabled = false,
|
||||||
lazy = false,
|
lazy = false,
|
||||||
dependencies = {
|
dependencies = {
|
||||||
'nvim-lua/plenary.nvim',
|
"nvim-lua/plenary.nvim",
|
||||||
'stevearc/dressing.nvim', -- optional for vim.ui.select
|
"stevearc/dressing.nvim", -- optional for vim.ui.select
|
||||||
},
|
},
|
||||||
config = function()
|
config = function()
|
||||||
require("absolute.after.flutter-tools")
|
require("absolute.after.flutter-tools")
|
||||||
|
|||||||
@@ -1,4 +0,0 @@
|
|||||||
return {
|
|
||||||
"f-person/git-blame.nvim",
|
|
||||||
event = "VeryLazy",
|
|
||||||
}
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
return {
|
|
||||||
"wintermute-cell/gitignore.nvim",
|
|
||||||
dependencies = {
|
|
||||||
"nvim-telescope/telescope.nvim",
|
|
||||||
},
|
|
||||||
config = function()
|
|
||||||
require("absolute.after.gitignore")
|
|
||||||
end
|
|
||||||
}
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
return {
|
|
||||||
"theprimeagen/harpoon",
|
|
||||||
dependencies = { 'nvim-lua/plenary.nvim' },
|
|
||||||
config = function()
|
|
||||||
require("absolute.after.harpoon")
|
|
||||||
end
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
return {
|
||||||
|
"3rd/image.nvim",
|
||||||
|
config = function()
|
||||||
|
require("absolute.after.image")
|
||||||
|
end,
|
||||||
|
}
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
return {
|
|
||||||
"jokajak/keyseer.nvim",
|
|
||||||
version = "*",
|
|
||||||
config = function()
|
|
||||||
require("absolute.after.keyseer")
|
|
||||||
end,
|
|
||||||
}
|
|
||||||
@@ -2,10 +2,6 @@ return {
|
|||||||
"neovim/nvim-lspconfig",
|
"neovim/nvim-lspconfig",
|
||||||
event = { "BufReadPre", "BufNewFile" },
|
event = { "BufReadPre", "BufNewFile" },
|
||||||
dependencies = {
|
dependencies = {
|
||||||
{
|
|
||||||
"hrsh7th/cmp-nvim-lsp",
|
|
||||||
name = "nvim_lsp",
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"antosha417/nvim-lsp-file-operations",
|
"antosha417/nvim-lsp-file-operations",
|
||||||
config = true,
|
config = true,
|
||||||
|
|||||||
@@ -0,0 +1,11 @@
|
|||||||
|
return {
|
||||||
|
"OXY2DEV/markview.nvim",
|
||||||
|
lazy = false,
|
||||||
|
opts = {
|
||||||
|
preview = {
|
||||||
|
filetypes = { "markdown", "codecompanion" },
|
||||||
|
ignore_buftypes = {},
|
||||||
|
},
|
||||||
|
experimental = { check_rtp_message = false },
|
||||||
|
},
|
||||||
|
}
|
||||||
@@ -1,17 +1,11 @@
|
|||||||
return {
|
return {
|
||||||
'williamboman/mason.nvim',
|
"mason-org/mason.nvim",
|
||||||
dependencies = {
|
dependencies = {
|
||||||
'williamboman/mason-lspconfig.nvim',
|
"mason-org/mason-registry",
|
||||||
{
|
"mason-org/mason-lspconfig.nvim",
|
||||||
"jay-babu/mason-nvim-dap.nvim",
|
"neovim/nvim-lspconfig",
|
||||||
dependencies = {
|
|
||||||
"mfussenegger/nvim-dap",
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
config = function()
|
config = function()
|
||||||
require("absolute.after.mason")
|
require("absolute.after.mason")
|
||||||
end
|
end,
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,6 @@
|
|||||||
|
return {
|
||||||
|
"echasnovski/mini.diff",
|
||||||
|
config = function()
|
||||||
|
require("absolute.after.mini-diff")
|
||||||
|
end,
|
||||||
|
}
|
||||||
@@ -1,7 +1,8 @@
|
|||||||
return {
|
return {
|
||||||
"echasnovski/mini.nvim",
|
"echasnovski/mini.nvim",
|
||||||
|
enabled = false,
|
||||||
version = "*", -- Stable Version
|
version = "*", -- Stable Version
|
||||||
config = function()
|
config = function()
|
||||||
require("absolute.after.mini")
|
require("absolute.after.mini")
|
||||||
end
|
end,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,15 +0,0 @@
|
|||||||
return {
|
|
||||||
"folke/noice.nvim",
|
|
||||||
event = "VeryLazy",
|
|
||||||
dependencies = {
|
|
||||||
-- if you lazy-load any plugin below, make sure to add proper `module="..."` entries
|
|
||||||
"MunifTanjim/nui.nvim",
|
|
||||||
-- OPTIONAL:
|
|
||||||
-- `nvim-notify` is only needed, if you want to use the notification view.
|
|
||||||
-- If not available, we use `mini` as the fallback
|
|
||||||
"rcarriga/nvim-notify",
|
|
||||||
},
|
|
||||||
config = function()
|
|
||||||
require("absolute.after.noice")
|
|
||||||
end,
|
|
||||||
}
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
return {
|
|
||||||
"nvimtools/none-ls.nvim",
|
|
||||||
config = function()
|
|
||||||
require("absolute.after.none-ls")
|
|
||||||
end
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
return {
|
|
||||||
'hrsh7th/nvim-cmp',
|
|
||||||
event = "InsertEnter",
|
|
||||||
dependencies = {
|
|
||||||
'neovim/nvim-lspconfig',
|
|
||||||
'hrsh7th/cmp-nvim-lsp',
|
|
||||||
'hrsh7th/cmp-buffer', --source for text in buffer
|
|
||||||
'hrsh7th/cmp-path', --source for file system paths
|
|
||||||
'hrsh7th/cmp-cmdline',
|
|
||||||
"saadparwaiz1/cmp_luasnip", --source for autocompletion
|
|
||||||
"onsails/lspkind.nvim",
|
|
||||||
"L3MON4D3/LuaSnip", --Snippet Engine
|
|
||||||
"rafamadriz/friendly-snippets", --Useful snippets
|
|
||||||
},
|
|
||||||
config = function()
|
|
||||||
require("absolute.after.nvim-cmp")
|
|
||||||
end
|
|
||||||
}
|
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
return {
|
return {
|
||||||
"kylechui/nvim-surround",
|
"kylechui/nvim-surround",
|
||||||
|
enabled = false,
|
||||||
version = "*", -- Use for stability; omit to use `main` branch for the latest features
|
version = "*", -- Use for stability; omit to use `main` branch for the latest features
|
||||||
event = "VeryLazy",
|
event = "VeryLazy",
|
||||||
config = function()
|
config = function()
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
return {
|
return {
|
||||||
|
enabled = true,
|
||||||
"nvim-treesitter/nvim-treesitter-context",
|
"nvim-treesitter/nvim-treesitter-context",
|
||||||
config = function()
|
config = function()
|
||||||
require("absolute.after.nvim-treesitter-context")
|
require("absolute.after.nvim-treesitter-context")
|
||||||
|
|||||||
@@ -1,3 +0,0 @@
|
|||||||
return {
|
|
||||||
"nvim-treesitter/playground",
|
|
||||||
}
|
|
||||||
@@ -1,7 +1,10 @@
|
|||||||
return {
|
return {
|
||||||
"nvim-treesitter/nvim-treesitter",
|
"nvim-treesitter/nvim-treesitter",
|
||||||
|
dependencies = {
|
||||||
|
"OXY2DEV/markview.nvim",
|
||||||
|
},
|
||||||
config = function()
|
config = function()
|
||||||
vim.cmd([[:silent !TSUpdate]])
|
vim.cmd([[:silent !TSUpdate]])
|
||||||
require("absolute.after.nvim-treesitter")
|
require("absolute.after.nvim-treesitter")
|
||||||
end
|
end,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +0,0 @@
|
|||||||
return {
|
|
||||||
"petobens/poet-v",
|
|
||||||
lazy = true,
|
|
||||||
ft = "py",
|
|
||||||
config = function()
|
|
||||||
require("absolute.after.poet-v")
|
|
||||||
end,
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
return {
|
||||||
|
enabled = false,
|
||||||
|
"sphamba/smear-cursor.nvim",
|
||||||
|
config = function()
|
||||||
|
require("absolute.after.smear-cursor")
|
||||||
|
end,
|
||||||
|
}
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
return {
|
||||||
|
"folke/snacks.nvim",
|
||||||
|
priority = 1000,
|
||||||
|
lazy = false,
|
||||||
|
---@type snacks.Config
|
||||||
|
opts = {
|
||||||
|
bigfile = { enabled = true },
|
||||||
|
quickfile = { enabled = true },
|
||||||
|
input = { enabled = true },
|
||||||
|
notifier = {
|
||||||
|
enabled = true,
|
||||||
|
timeout = 3000,
|
||||||
|
style = "compact",
|
||||||
|
top_down = true,
|
||||||
|
icons = {
|
||||||
|
debug = "",
|
||||||
|
error = "",
|
||||||
|
info = "",
|
||||||
|
trace = "✎",
|
||||||
|
warn = "",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
picker = {
|
||||||
|
enabled = true,
|
||||||
|
ui_select = true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
config = function(_, opts)
|
||||||
|
require("snacks").setup(opts)
|
||||||
|
require("absolute.after.snacks")
|
||||||
|
end,
|
||||||
|
}
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
return {
|
return {
|
||||||
|
enabled = false,
|
||||||
"laytan/tailwind-sorter.nvim",
|
"laytan/tailwind-sorter.nvim",
|
||||||
dependencies = { "nvim-treesitter/nvim-treesitter", "nvim-lua/plenary.nvim" },
|
dependencies = { "nvim-treesitter/nvim-treesitter", "nvim-lua/plenary.nvim" },
|
||||||
build = "cd formatter && npm i && npm run build",
|
build = "cd formatter && npm i && npm run build",
|
||||||
|
|||||||
@@ -1,7 +0,0 @@
|
|||||||
return {
|
|
||||||
"nvim-telescope/telescope-file-browser.nvim",
|
|
||||||
dependencies = {
|
|
||||||
"nvim-telescope/telescope.nvim",
|
|
||||||
"nvim-lua/plenary.nvim"
|
|
||||||
},
|
|
||||||
}
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
return {
|
|
||||||
'nvim-telescope/telescope.nvim',
|
|
||||||
branch = '0.1.x',
|
|
||||||
dependencies = {
|
|
||||||
"nvim-lua/plenary.nvim",
|
|
||||||
"nvim-telescope/telescope-dap.nvim",
|
|
||||||
"andrew-george/telescope-themes",
|
|
||||||
},
|
|
||||||
config = function()
|
|
||||||
require("absolute.after.telescope")
|
|
||||||
end
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
return {
|
||||||
|
"bezhermoso/tree-sitter-ghostty",
|
||||||
|
build = "make nvim_install",
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
return {
|
||||||
|
"linux-cultist/venv-selector.nvim",
|
||||||
|
lazy = false,
|
||||||
|
branch = "main", -- This is the regexp branch, use this for the new version
|
||||||
|
dependencies = {
|
||||||
|
"neovim/nvim-lspconfig",
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
require("absolute.after.venv-selector")
|
||||||
|
end,
|
||||||
|
event = "VeryLazy", -- Optional: needed only if you want to type `:VenvSelect` without a keymapping
|
||||||
|
}
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
return {
|
|
||||||
"szw/vim-maximizer"
|
|
||||||
}
|
|
||||||
@@ -1,17 +1,17 @@
|
|||||||
return {
|
return {
|
||||||
"christoomey/vim-tmux-navigator",
|
"alexghergh/nvim-tmux-navigation",
|
||||||
cmd = {
|
config = function()
|
||||||
"TmuxNavigateLeft",
|
local nvim_tmux_nav = require("nvim-tmux-navigation")
|
||||||
"TmuxNavigateDown",
|
|
||||||
"TmuxNavigateUp",
|
nvim_tmux_nav.setup({
|
||||||
"TmuxNavigateRight",
|
disable_when_zoomed = true, -- defaults to false
|
||||||
"TmuxNavigatePrevious",
|
})
|
||||||
},
|
|
||||||
keys = {
|
vim.keymap.set("n", "<C-h>", nvim_tmux_nav.NvimTmuxNavigateLeft)
|
||||||
{ "<C-h>", "<cmd><C-U>TmuxNavigateLeft<CR>" },
|
vim.keymap.set("n", "<C-j>", nvim_tmux_nav.NvimTmuxNavigateDown)
|
||||||
{ "<C-j>", "<cmd><C-U>TmuxNavigateDown<CR>" },
|
vim.keymap.set("n", "<C-k>", nvim_tmux_nav.NvimTmuxNavigateUp)
|
||||||
{ "<C-k>", "<cmd><C-U>TmuxNavigateUp<CR>" },
|
vim.keymap.set("n", "<C-l>", nvim_tmux_nav.NvimTmuxNavigateRight)
|
||||||
{ "<C-l>", "<cmd><C-U>TmuxNavigateRight<CR>" },
|
vim.keymap.set("n", "<C-\\>", nvim_tmux_nav.NvimTmuxNavigateLastActive)
|
||||||
{ "<C-\\>", "<cmd><C-U>TmuxNavigatePrevious<CR>" },
|
vim.keymap.set("n", "<C-Space>", nvim_tmux_nav.NvimTmuxNavigateNext)
|
||||||
},
|
end,
|
||||||
}
|
}
|
||||||
|
|||||||
+38
-32
@@ -1,10 +1,12 @@
|
|||||||
local opts = { noremap = true, silent = true }
|
local opts = {
|
||||||
|
noremap = true,
|
||||||
|
silent = true,
|
||||||
|
}
|
||||||
|
|
||||||
opts.desc = "Show Cheatsheet"
|
opts.desc = "Show keymaps"
|
||||||
vim.keymap.set("n", "<leader>\\", "<cmd>Cheatsheet<CR>", opts) -- toggle file explorer
|
vim.keymap.set("n", "<leader>?", function()
|
||||||
|
Snacks.picker.keymaps()
|
||||||
opts.desc = "Show Keymap"
|
end, opts)
|
||||||
vim.keymap.set("n", "<leader>?", "<cmd>Telescope keymaps<CR>", opts) -- toggle file explorer
|
|
||||||
|
|
||||||
opts.desc = "Select All"
|
opts.desc = "Select All"
|
||||||
vim.keymap.set("n", "<C-a>", "gg0vG$", opts) -- select all
|
vim.keymap.set("n", "<C-a>", "gg0vG$", opts) -- select all
|
||||||
@@ -53,10 +55,6 @@ vim.keymap.set("n", "<leader>Y", [["+Y]], opts)
|
|||||||
opts.desc = "Delete current line (blackhole)"
|
opts.desc = "Delete current line (blackhole)"
|
||||||
vim.keymap.set({ "n", "v" }, "<leader>d", [["_d]], opts)
|
vim.keymap.set({ "n", "v" }, "<leader>d", [["_d]], opts)
|
||||||
|
|
||||||
-- Alternate Escape (Easy to Reach)
|
|
||||||
opts.desc = "Alternate Escape (Easy to Reach)"
|
|
||||||
vim.keymap.set("i", "<C-c>", "<Esc>", opts)
|
|
||||||
|
|
||||||
-- Disable Q - Nothing Good Ever Happens
|
-- Disable Q - Nothing Good Ever Happens
|
||||||
-- Q is normally used to enable Ex mode. We dont want that
|
-- Q is normally used to enable Ex mode. We dont want that
|
||||||
opts.desc = "Disable Q - Nothing Good Ever Happens"
|
opts.desc = "Disable Q - Nothing Good Ever Happens"
|
||||||
@@ -70,36 +68,44 @@ vim.keymap.set("n", "<C-k>", "<cmd>cnext<CR>zz", opts)
|
|||||||
opts.desc = "Jump down and center screen"
|
opts.desc = "Jump down and center screen"
|
||||||
vim.keymap.set("n", "<C-j>", "<cmd>cprev<CR>zz", opts)
|
vim.keymap.set("n", "<C-j>", "<cmd>cprev<CR>zz", opts)
|
||||||
|
|
||||||
opts.desc = "Jump to next location and center screen"
|
opts.desc = "Next location-list entry"
|
||||||
vim.keymap.set("n", "<leader>k", "<cmd>lnext<CR>zz", opts)
|
vim.keymap.set("n", "]l", "<cmd>lnext<CR>zz", opts)
|
||||||
|
|
||||||
opts.desc = "Jump to previous location and center screen"
|
|
||||||
vim.keymap.set("n", "<leader>j", "<cmd>lprev<CR>zz", opts)
|
|
||||||
|
|
||||||
|
opts.desc = "Previous location-list entry"
|
||||||
|
vim.keymap.set("n", "[l", "<cmd>lprev<CR>zz", opts)
|
||||||
|
|
||||||
-- Search Regex Keymap
|
-- Search Regex Keymap
|
||||||
opts.desc = "Regex Replace"
|
opts.desc = "Regex Replace"
|
||||||
vim.keymap.set("n", "<leader>sr", [[:%s/\<<C-r><C-w>\>/<C-r><C-w>/gI<Left><Left><Left>]], opts)
|
vim.keymap.set("n", "<leader>sr", [[:%s/\<<C-r><C-w>\>/<C-r><C-w>/gI<Left><Left><Left>]], opts)
|
||||||
|
|
||||||
opts.desc = "Replace selected text"
|
opts.desc = "Replace selected text"
|
||||||
vim.keymap.set("v", "<leader>ss", [[:s/\<<C-r><C-w>\>/<C-r><C-w>/gI<Left><Left><Left>]], opts)
|
vim.keymap.set("v", "<leader>sr", [[:s/\<<C-r><C-w>\>/<C-r><C-w>/gI<Left><Left><Left>]], opts)
|
||||||
|
|
||||||
-- Source File Keymap
|
-- -- Source File Keymap
|
||||||
opts.desc = "Source File"
|
-- opts.desc = "Source File"
|
||||||
vim.keymap.set("n", "<leader><leader>", function()
|
-- vim.keymap.set("n", "<leader><leader>", function()
|
||||||
-- Only source these file extensions
|
-- -- Only source these file extensions
|
||||||
local allowed_extensions = [[".vim", ".lua", ".vimrc", ".gvimrc", ".nvim", ".nvimrc", ".sh"]]
|
-- local allowed_extensions = [[
|
||||||
|
-- ".vim",
|
||||||
-- Get the file extension
|
-- ".lua",
|
||||||
local file_extension = vim.fn.expand("%:e")
|
-- ".vimrc",
|
||||||
|
-- ".gvimrc",
|
||||||
-- Check if the file extension is allowed
|
-- ".nvim",
|
||||||
if string.find(allowed_extensions, file_extension) then
|
-- ".nvimrc",
|
||||||
vim.cmd("so %")
|
-- ".sh"
|
||||||
else
|
-- ]]
|
||||||
vim.notify("Filetype not supported", vim.log.levels.ERROR)
|
--
|
||||||
end
|
-- -- Get the file extension
|
||||||
end, opts)
|
-- local file_extension = vim.fn.expand("%:e")
|
||||||
|
--
|
||||||
|
-- -- Check if the file extension is allowed
|
||||||
|
-- if string.find(allowed_extensions, file_extension) then
|
||||||
|
-- vim.cmd("so %")
|
||||||
|
-- vim.notify("Sourced file", vim.log.levels.INFO)
|
||||||
|
-- else
|
||||||
|
-- vim.notify("Filetype not supported", vim.log.levels.ERROR)
|
||||||
|
-- end
|
||||||
|
-- end, opts)
|
||||||
|
|
||||||
-- Optimize Window Resize
|
-- Optimize Window Resize
|
||||||
|
|
||||||
|
|||||||
@@ -7,26 +7,40 @@ function CheckPoetryVirtualEnv()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function ResolvePythonEnvironment()
|
function ResolvePythonEnvironment()
|
||||||
|
-- Check if asdf is installed
|
||||||
|
|
||||||
-- Get system global python env
|
-- Get system global python env
|
||||||
local python = vim.fn.system("which python3")
|
local python = vim.fn.system("which python3")
|
||||||
-- Check of virtual environments exists
|
-- Check of virtual environments exists
|
||||||
local virtual = os.getenv("VIRTUAL_ENV") or os.getenv("CONDA_PREFIX") or CheckPoetryVirtualEnv()
|
local virtual = os.getenv("VIRTUAL_ENV") or CheckPoetryVirtualEnv()
|
||||||
|
|
||||||
if virtual == nil then
|
if virtual == nil then
|
||||||
-- Check if poetry environment exists
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"--python-executable", python
|
"--python-executable",
|
||||||
|
python,
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"--python-executable", virtual .. "/bin/python"
|
"--python-executable",
|
||||||
|
virtual .. "/bin/python",
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function ResolvePythonEnvironmentAsString()
|
||||||
|
local env = ResolvePythonEnvironment()
|
||||||
|
if env == nil then
|
||||||
|
return ""
|
||||||
|
end
|
||||||
|
|
||||||
|
local path = table.concat(env, " ")
|
||||||
|
|
||||||
|
return path
|
||||||
|
end
|
||||||
|
|
||||||
M = {}
|
M = {}
|
||||||
|
|
||||||
|
M.ResolvePythonEnvironmentAsString = ResolvePythonEnvironmentAsString
|
||||||
M.ResolvePythonEnvironment = ResolvePythonEnvironment
|
M.ResolvePythonEnvironment = ResolvePythonEnvironment
|
||||||
M.CheckPoetryVirtualEnv = CheckPoetryVirtualEnv
|
M.CheckPoetryVirtualEnv = CheckPoetryVirtualEnv
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,67 @@
|
|||||||
|
M = {}
|
||||||
|
local function trim(s)
|
||||||
|
return s:gsub("^%s*(.-)%s*$", "%1")
|
||||||
|
end
|
||||||
|
|
||||||
|
local ResolveTypescriptServer = function()
|
||||||
|
-- Find the package.json file
|
||||||
|
local viable = vim.fn.system("find . -name 'package.json' -maxdepth 3 | xargs dirname")
|
||||||
|
viable = trim(viable)
|
||||||
|
|
||||||
|
if viable == "" then
|
||||||
|
return nil
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Check for lock files
|
||||||
|
local find_npm_result = trim(vim.fn.system("find . -name 'package-lock.json' -maxdepth 3 | wc -l"))
|
||||||
|
local find_pnpm_result = trim(vim.fn.system("find . -name 'pnpm-lock.yaml' -maxdepth 3 | wc -l"))
|
||||||
|
local find_yarn_result = trim(vim.fn.system("find . -name 'yarn.lock' -maxdepth 3 | wc -l"))
|
||||||
|
|
||||||
|
local is_npm = find_npm_result == "1"
|
||||||
|
local is_pnpm = find_pnpm_result == "1"
|
||||||
|
local is_yarn = find_yarn_result == "1"
|
||||||
|
|
||||||
|
-- if no package lock files are found, end early
|
||||||
|
if not is_npm and not is_pnpm and not is_yarn then
|
||||||
|
return nil
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Determine the preferred package manager
|
||||||
|
local ppm = "pnpm" -- Default to pnpm
|
||||||
|
if is_npm then
|
||||||
|
ppm = "npm"
|
||||||
|
end
|
||||||
|
if is_yarn then
|
||||||
|
ppm = "yarn"
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Resolve TypeScript server path
|
||||||
|
local base_command = ppm .. " list typescript --dir " .. viable .. " --json"
|
||||||
|
local base_result = trim(vim.fn.system(base_command))
|
||||||
|
|
||||||
|
if base_result == "" then
|
||||||
|
vim.notify("Failed to run " .. base_command, vim.log.levels.ERROR)
|
||||||
|
return nil
|
||||||
|
end
|
||||||
|
|
||||||
|
local typescript_path = nil
|
||||||
|
|
||||||
|
if ppm == "pnpm" or ppm == "npm" or ppm == "yarn" then
|
||||||
|
local ok, parsed = pcall(vim.fn.json_decode, base_result)
|
||||||
|
if ok and parsed and #parsed > 0 and parsed[1].path then
|
||||||
|
typescript_path = parsed[1].path .. "/node_modules/typescript/lib"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if not typescript_path or typescript_path == "" then
|
||||||
|
vim.notify("TypeScript not found. Please install TypeScript globally or in the project.", vim.log.levels.ERROR)
|
||||||
|
return nil
|
||||||
|
end
|
||||||
|
|
||||||
|
return typescript_path
|
||||||
|
end
|
||||||
|
|
||||||
|
M.ResolveTypescriptServer = ResolveTypescriptServer
|
||||||
|
M.trim = trim
|
||||||
|
|
||||||
|
return M
|
||||||
@@ -1 +1 @@
|
|||||||
vim.cmd("colorscheme catppuccin")
|
vim.cmd("colorscheme tokyonight-night")
|
||||||
Reference in New Issue
Block a user