migration complete
This commit is contained in:
parent
c0c1148fde
commit
88d84fee4c
34 changed files with 4641 additions and 281 deletions
82
archive/CONSISTENCY.md
Normal file
82
archive/CONSISTENCY.md
Normal file
|
|
@ -0,0 +1,82 @@
|
|||
# Keymap Consistency Guide
|
||||
|
||||
> **Last Updated:** November 1, 2025
|
||||
> **Purpose:** Document consistent keymaps across Telescope and Neo-tree
|
||||
|
||||
## 🎯 Consistent Actions
|
||||
|
||||
The following keymaps work **identically** in both Telescope and Neo-tree:
|
||||
|
||||
### File Opening Actions
|
||||
|
||||
| Key | Action | Telescope | Neo-tree |
|
||||
|-----|--------|-----------|----------|
|
||||
| `<CR>` or `o` | Open in current window | ✅ | ✅ |
|
||||
| `<C-x>` | Open in horizontal split | ✅ | ✅ |
|
||||
| `<C-v>` | Open in vertical split | ✅ | ✅ |
|
||||
| `<C-t>` | Open in new tab | ✅ | ✅ |
|
||||
|
||||
### Navigation
|
||||
|
||||
| Key | Action | Telescope | Neo-tree |
|
||||
|-----|--------|-----------|----------|
|
||||
| `<C-j>` | Next item/source | ✅ | ✅ |
|
||||
| `<C-k>` | Previous item/source | ✅ | ✅ |
|
||||
| `j/k` (normal mode) | Down/Up | ✅ | ✅ |
|
||||
| `gg/G` (normal mode) | First/Last | ✅ | ✅ |
|
||||
|
||||
### Utility
|
||||
|
||||
| Key | Action | Telescope | Neo-tree |
|
||||
|-----|--------|-----------|----------|
|
||||
| `?` | Show help | ✅ | ✅ |
|
||||
| `<Esc>` or `q` | Close | ✅ | ✅ (`\\` for Neo-tree) |
|
||||
|
||||
### Cross-Plugin Integration
|
||||
|
||||
| Key | Action | Context |
|
||||
|-----|--------|---------|
|
||||
| `<leader>sf` | Telescope find files | Works in both editor and Neo-tree |
|
||||
| `<leader>sg` | Telescope live grep | Works in both editor and Neo-tree |
|
||||
|
||||
When used in Neo-tree, these commands search from the currently selected directory!
|
||||
|
||||
## 📚 Complete Cheatsheet Access
|
||||
|
||||
Access the comprehensive cheatsheet with:
|
||||
|
||||
```
|
||||
<leader>sc - Complete cheatsheet (vim, plugins, language-specific)
|
||||
<leader>sk - Search keymaps (Telescope)
|
||||
<leader>sK - All keymaps (which-key)
|
||||
<leader>? - Quick keymap search
|
||||
```
|
||||
|
||||
## 🎨 Visual Consistency
|
||||
|
||||
Both Telescope and Neo-tree now follow the same pattern:
|
||||
- **Same keys** for same actions
|
||||
- **Predictable behavior** across interfaces
|
||||
- **Integrated workflows** (use Telescope from Neo-tree)
|
||||
- **Help always available** with `?`
|
||||
|
||||
## 📝 Quick Reference
|
||||
|
||||
### In Telescope:
|
||||
1. `<C-j/k>` to navigate
|
||||
2. `<C-x/v/t>` to open in split/vsplit/tab
|
||||
3. `<CR>` to open in current window
|
||||
4. `?` for help
|
||||
|
||||
### In Neo-tree:
|
||||
1. `<C-j/k>` to switch sources
|
||||
2. `<C-x/v/t>` to open in split/vsplit/tab
|
||||
3. `<CR>` or `o` to open file
|
||||
4. `?` for help
|
||||
5. `<leader>sf/sg` to launch Telescope from current directory
|
||||
|
||||
### Both Share:
|
||||
- Consistent split/tab opening
|
||||
- Same navigation philosophy
|
||||
- Integrated search capabilities
|
||||
- Help on demand
|
||||
90
archive/DUPLICATES.md
Normal file
90
archive/DUPLICATES.md
Normal file
|
|
@ -0,0 +1,90 @@
|
|||
# Duplicate Keymaps Reference
|
||||
|
||||
This document lists all keymaps where the same action can be performed using multiple key combinations.
|
||||
|
||||
## Philosophy
|
||||
|
||||
Having duplicate keymaps is **intentional and beneficial**:
|
||||
- **Vim defaults + Modern alternatives**: Keep familiar vim keys while adding intuitive modern ones
|
||||
- **Consistency across plugins**: Same keys work the same way in Telescope and Neo-tree
|
||||
- **Ergonomics**: Function keys (F5-F12) AND leader keys for debugging
|
||||
- **Context switching**: Use what feels natural in different workflows
|
||||
|
||||
## Debug Actions
|
||||
|
||||
| Action | Keys | Notes |
|
||||
|--------|------|-------|
|
||||
| Continue | `F5` or `<Space>dc` | F5 is standard in many IDEs |
|
||||
| Step over | `F10` or `<Space>dO` | Uppercase O for over |
|
||||
| Step into | `F11` or `<Space>di` | |
|
||||
| Step out | `F12` or `<Space>do` | Lowercase o for out |
|
||||
|
||||
**Why duplicates?** Function keys are muscle memory from other IDEs. Leader keys are more discoverable via which-key and don't conflict with terminal function keys.
|
||||
|
||||
## Neo-tree vs Consistent Actions
|
||||
|
||||
| Action | Neo-tree Default | Consistent Alternative | Notes |
|
||||
|--------|------------------|------------------------|-------|
|
||||
| Vertical split | `s` | `Ctrl-v` | Matches Telescope |
|
||||
| Horizontal split | `S` | `Ctrl-x` | Matches Telescope |
|
||||
| New tab | `t` | `Ctrl-t` | Matches Telescope |
|
||||
| Next source | `>` | `Ctrl-j` | Matches Telescope navigation |
|
||||
| Previous source | `<` | `Ctrl-k` | Matches Telescope navigation |
|
||||
| Close window | `q` | `\` or `Esc` | Backslash mirrors toggle |
|
||||
| Open file | `<CR>` | `o` | Two ways to open |
|
||||
|
||||
**Why duplicates?** Neo-tree defaults are efficient single-key presses. Consistent alternatives (`Ctrl-x/v/t/j/k`) work the same way in Telescope, reducing cognitive load when switching between file finder and file tree.
|
||||
|
||||
## Flutter Code Actions
|
||||
|
||||
| Action | Keys | Notes |
|
||||
|--------|------|-------|
|
||||
| Code actions | `<Space>.` or `gra` | Period mimics Cmd+. in IDEs, gra is standard LSP |
|
||||
|
||||
**Why duplicates?** Flutter developers coming from IDEs expect `.` (like Cmd+.). `gra` is the standard LSP keymap used everywhere else.
|
||||
|
||||
## Telescope Navigation
|
||||
|
||||
| Action | Keys | Notes |
|
||||
|--------|------|-------|
|
||||
| Next/prev item | `Ctrl-j/k` or `j/k` (normal) | Insert mode uses Ctrl, normal mode uses plain |
|
||||
| Close | `Ctrl-c` or `Esc` or `q` (normal) | Three ways to exit |
|
||||
|
||||
**Why duplicates?** `Ctrl-j/k` work in insert mode without switching modes. In normal mode, plain `j/k` are more natural.
|
||||
|
||||
## Vim Defaults
|
||||
|
||||
| Action | Keys | Notes |
|
||||
|--------|------|-------|
|
||||
| Save and quit | `:wq` or `ZZ` | ZZ is faster |
|
||||
| Quit without save | `:q!` or `ZQ` | ZQ is faster |
|
||||
|
||||
**Why duplicates?** Both are vim defaults. ZZ/ZQ are faster but less discoverable.
|
||||
|
||||
## Summary of Duplicate Patterns
|
||||
|
||||
1. **Debug**: F-keys + Leader keys (muscle memory from IDEs + discoverability)
|
||||
2. **Splits/Tabs**: Single keys + Ctrl combos (efficiency + consistency)
|
||||
3. **Navigation**: Plain + Ctrl variants (context-dependent ergonomics)
|
||||
4. **Close/Exit**: Multiple keys (q, Esc, Ctrl-c, \\) (different mental models)
|
||||
|
||||
## Design Principles
|
||||
|
||||
1. **Never remove defaults** unless they conflict
|
||||
2. **Add consistent alternatives** that work across plugins
|
||||
3. **Document all options** so users can choose their preferred style
|
||||
4. **Optimize for discoverability** (leader keys show in which-key)
|
||||
5. **Respect muscle memory** (keep vim and IDE conventions)
|
||||
|
||||
## Quick Reference: Cross-Plugin Consistency
|
||||
|
||||
These keys work the same way in **both Telescope and Neo-tree**:
|
||||
|
||||
- `Ctrl-x` → Horizontal split
|
||||
- `Ctrl-v` → Vertical split
|
||||
- `Ctrl-t` → New tab
|
||||
- `Ctrl-j` → Next/down
|
||||
- `Ctrl-k` → Previous/up
|
||||
- `?` → Show help
|
||||
|
||||
This consistency means once you learn these in one plugin, they work the same everywhere.
|
||||
527
archive/INSTALLATION.md
Normal file
527
archive/INSTALLATION.md
Normal file
|
|
@ -0,0 +1,527 @@
|
|||
# Complete Installation Guide - Neovim Profile Setup
|
||||
|
||||
This guide documents all the tools and setup steps needed to replicate this VS Code-like Neovim configuration on a new computer.
|
||||
|
||||
## 📋 Prerequisites
|
||||
|
||||
### Required Software
|
||||
- **macOS** (this guide is for macOS, adapt for Linux/Windows)
|
||||
- **Homebrew** - Package manager for macOS
|
||||
- **Neovim v0.10+** - Text editor
|
||||
- **Git** - Version control
|
||||
|
||||
## 🛠️ Installation Steps
|
||||
|
||||
### 1. Install Homebrew (if not already installed)
|
||||
```bash
|
||||
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
|
||||
```
|
||||
|
||||
### 2. Install Neovim
|
||||
```bash
|
||||
brew install neovim
|
||||
```
|
||||
|
||||
Verify installation:
|
||||
```bash
|
||||
nvim --version
|
||||
# Should show v0.10.0 or higher
|
||||
```
|
||||
|
||||
### 3. Install Node.js via fnm (Fast Node Manager)
|
||||
|
||||
#### Why fnm?
|
||||
- Fast and simple Node.js version manager
|
||||
- Written in Rust (very fast)
|
||||
- Better than nvm for switching Node.js versions
|
||||
- Required for GitHub Copilot and some LSP servers
|
||||
|
||||
#### Install fnm
|
||||
```bash
|
||||
brew install fnm
|
||||
```
|
||||
|
||||
#### Configure fnm in your shell
|
||||
Add to `~/.zshrc`:
|
||||
```bash
|
||||
# fnm (Fast Node Manager) - for managing Node.js versions
|
||||
eval "$(fnm env --use-on-cd)"
|
||||
```
|
||||
|
||||
Reload your shell:
|
||||
```bash
|
||||
source ~/.zshrc
|
||||
```
|
||||
|
||||
#### Install Node.js LTS
|
||||
```bash
|
||||
# Install latest LTS version
|
||||
fnm install --lts
|
||||
|
||||
# Set it as default
|
||||
fnm default lts-latest
|
||||
|
||||
# Verify installation
|
||||
node --version
|
||||
# Should show v24.x.x or similar
|
||||
|
||||
npm --version
|
||||
# Should show 11.x.x or similar
|
||||
```
|
||||
|
||||
#### fnm Directory Structure
|
||||
fnm stores Node.js versions here:
|
||||
- **Versions**: `~/.local/share/fnm/node-versions/`
|
||||
- **Default alias**: `~/.local/share/fnm/aliases/default/bin/`
|
||||
|
||||
The default alias automatically points to your default Node.js version, so you don't need to update paths when upgrading Node.js.
|
||||
|
||||
### 4. Install Bun (Fast JavaScript Runtime)
|
||||
|
||||
#### Why Bun?
|
||||
- Faster than Node.js for development
|
||||
- Great for running Svelte/TypeScript projects
|
||||
- Built-in bundler and test runner
|
||||
- Compatible with Node.js packages
|
||||
|
||||
#### Install Bun
|
||||
```bash
|
||||
curl -fsSL https://bun.sh/install | bash
|
||||
```
|
||||
|
||||
This installs Bun to `~/.bun/bin/bun`
|
||||
|
||||
#### Configure Bun in your shell
|
||||
Add to `~/.zshrc` (should be added automatically, but verify):
|
||||
```bash
|
||||
# Bun - Fast JavaScript runtime
|
||||
export BUN_INSTALL="$HOME/.bun"
|
||||
export PATH="$BUN_INSTALL/bin:$PATH"
|
||||
```
|
||||
|
||||
Reload your shell:
|
||||
```bash
|
||||
source ~/.zshrc
|
||||
```
|
||||
|
||||
Verify installation:
|
||||
```bash
|
||||
bun --version
|
||||
# Should show 1.3.x or similar
|
||||
```
|
||||
|
||||
### 5. Clone Kickstart.nvim Configuration
|
||||
|
||||
#### Backup existing config (if you have one)
|
||||
```bash
|
||||
mv ~/.config/nvim ~/.config/nvim.backup
|
||||
mv ~/.local/share/nvim ~/.local/share/nvim.backup
|
||||
mv ~/.local/state/nvim ~/.local/state/nvim.backup
|
||||
```
|
||||
|
||||
#### Clone Kickstart.nvim
|
||||
```bash
|
||||
git clone https://github.com/nvim-lua/kickstart.nvim.git ~/.config/nvim
|
||||
```
|
||||
|
||||
### 6. Apply Custom Profile Configuration
|
||||
|
||||
You need to copy these custom files to your new machine:
|
||||
|
||||
#### Required Custom Files
|
||||
```
|
||||
~/.config/nvim/
|
||||
├── init.lua (modified from kickstart)
|
||||
└── lua/custom/plugins/
|
||||
├── init.lua # Common plugins (Copilot, Neo-tree)
|
||||
├── flutter.lua # Flutter/Dart profile
|
||||
├── python.lua # Python profile
|
||||
└── svelte.lua # Svelte/Web profile
|
||||
```
|
||||
|
||||
#### Copy from this repository
|
||||
If you've pushed your config to GitHub:
|
||||
```bash
|
||||
cd ~/.config/nvim
|
||||
git remote set-url origin YOUR_FORK_URL
|
||||
git pull
|
||||
```
|
||||
|
||||
Or manually copy the `lua/custom/` directory from your current setup.
|
||||
|
||||
### 7. Configure Node.js Path in Neovim
|
||||
|
||||
This is **critical** for GitHub Copilot to work!
|
||||
|
||||
The `init.lua` file should have this configuration (around lines 96-110):
|
||||
|
||||
```lua
|
||||
-- ========================================================================
|
||||
-- NODE.JS PATH CONFIGURATION (for GitHub Copilot and LSP servers)
|
||||
-- ========================================================================
|
||||
-- GitHub Copilot and some LSP servers require Node.js to be in PATH.
|
||||
-- fnm doesn't add Node.js to Neovim's PATH automatically, so we do it here.
|
||||
-- Using fnm aliases ensures this works even when Node.js version changes.
|
||||
-- ========================================================================
|
||||
|
||||
-- Add fnm Node.js to PATH for Copilot and other Node.js-dependent plugins
|
||||
local fnm_default_path = vim.fn.expand '~/.local/share/fnm/aliases/default/bin'
|
||||
local fnm_multishells_path = vim.fn.expand '~/.local/share/fnm/node-versions/*/installation/bin'
|
||||
|
||||
if vim.fn.isdirectory(fnm_default_path) == 1 then
|
||||
vim.env.PATH = fnm_default_path .. ':' .. vim.env.PATH
|
||||
elseif vim.fn.glob(fnm_multishells_path) ~= '' then
|
||||
local node_path = vim.fn.glob(fnm_multishells_path)
|
||||
vim.env.PATH = node_path .. ':' .. vim.env.PATH
|
||||
end
|
||||
```
|
||||
|
||||
This ensures Neovim can find Node.js even when it's not in the shell PATH.
|
||||
|
||||
### 8. First Launch - Install Plugins
|
||||
|
||||
#### Open Neovim
|
||||
```bash
|
||||
nvim
|
||||
```
|
||||
|
||||
On first launch:
|
||||
1. **lazy.nvim** will automatically install all plugins
|
||||
2. Wait for plugins to finish installing (watch the bottom of the screen)
|
||||
3. You may see some errors - this is normal on first launch
|
||||
|
||||
#### Manually sync plugins (if needed)
|
||||
```vim
|
||||
:Lazy sync
|
||||
```
|
||||
|
||||
Wait for completion, then restart Neovim:
|
||||
```vim
|
||||
:qa
|
||||
nvim
|
||||
```
|
||||
|
||||
### 9. Install LSP Servers and Tools via Mason
|
||||
|
||||
#### Open Mason
|
||||
```vim
|
||||
nvim
|
||||
:Mason
|
||||
```
|
||||
|
||||
#### Required Tools
|
||||
These should auto-install via `mason-tool-installer`, but verify:
|
||||
|
||||
**Common:**
|
||||
- `lua-language-server` (lua_ls)
|
||||
- `stylua`
|
||||
|
||||
**Flutter:**
|
||||
- `dart-language-server` (dartls)
|
||||
|
||||
**Python:**
|
||||
- `pyright`
|
||||
- `ruff`
|
||||
|
||||
**Svelte/Web:**
|
||||
- `svelte-language-server`
|
||||
- `typescript-language-server` (ts_ls)
|
||||
- `tailwindcss-language-server`
|
||||
- `prettier`
|
||||
|
||||
#### Manual Installation (if needed)
|
||||
In Mason, navigate to a tool and press:
|
||||
- `i` - Install
|
||||
- `U` - Update
|
||||
- `X` - Uninstall
|
||||
- `g?` - Help
|
||||
|
||||
### 10. Setup GitHub Copilot
|
||||
|
||||
#### Authenticate Copilot
|
||||
```vim
|
||||
nvim
|
||||
:Copilot setup
|
||||
```
|
||||
|
||||
Follow the prompts:
|
||||
1. It will give you a code
|
||||
2. Open the URL in your browser
|
||||
3. Enter the code
|
||||
4. Authorize GitHub Copilot
|
||||
|
||||
#### Verify Copilot works
|
||||
```vim
|
||||
:Copilot status
|
||||
```
|
||||
|
||||
Should show: "Copilot: Ready"
|
||||
|
||||
### 11. Install Treesitter Parsers
|
||||
|
||||
Parsers should auto-install when you open files, but you can manually install:
|
||||
|
||||
```vim
|
||||
:TSInstall dart python svelte typescript tsx javascript css html json lua vim vimdoc
|
||||
```
|
||||
|
||||
Verify:
|
||||
```vim
|
||||
:TSInstallInfo
|
||||
```
|
||||
|
||||
## 🔧 Configuration Summary
|
||||
|
||||
### Shell Configuration (~/.zshrc)
|
||||
|
||||
Your `~/.zshrc` should have these additions:
|
||||
|
||||
```bash
|
||||
# fnm (Fast Node Manager) - for managing Node.js versions
|
||||
eval "$(fnm env --use-on-cd)"
|
||||
|
||||
# Bun - Fast JavaScript runtime
|
||||
export BUN_INSTALL="$HOME/.bun"
|
||||
export PATH="$BUN_INSTALL/bin:$PATH"
|
||||
```
|
||||
|
||||
### Directory Structure After Installation
|
||||
|
||||
```
|
||||
~/.config/nvim/
|
||||
├── init.lua # Main Kickstart config (modified with Node.js PATH)
|
||||
├── lazy-lock.json # Plugin versions (auto-generated)
|
||||
├── LICENSE.md
|
||||
├── README.md
|
||||
├── SETUP-GUIDE.md # Profile setup guide
|
||||
├── INSTALLATION.md # This file
|
||||
├── doc/
|
||||
│ └── kickstart.txt
|
||||
└── lua/
|
||||
├── custom/
|
||||
│ └── plugins/
|
||||
│ ├── init.lua # Common plugins (Copilot, Neo-tree)
|
||||
│ ├── flutter.lua # Flutter profile
|
||||
│ ├── python.lua # Python profile
|
||||
│ └── svelte.lua # Svelte profile
|
||||
└── kickstart/
|
||||
└── plugins/
|
||||
├── autopairs.lua
|
||||
├── debug.lua
|
||||
├── gitsigns.lua
|
||||
├── indent_line.lua
|
||||
├── lint.lua
|
||||
└── neo-tree.lua
|
||||
|
||||
~/.local/share/fnm/
|
||||
├── aliases/
|
||||
│ └── default/ # Default Node.js version
|
||||
│ └── bin/
|
||||
│ ├── node
|
||||
│ └── npm
|
||||
└── node-versions/
|
||||
└── v24.11.0/ # Actual Node.js installation
|
||||
|
||||
~/.bun/
|
||||
└── bin/
|
||||
└── bun # Bun executable
|
||||
|
||||
~/.local/share/nvim/
|
||||
├── lazy/ # lazy.nvim plugin installations
|
||||
└── mason/ # Mason LSP/tool installations
|
||||
```
|
||||
|
||||
## 🧪 Verification Checklist
|
||||
|
||||
After installation, verify everything works:
|
||||
|
||||
### Check Node.js Setup
|
||||
```bash
|
||||
# Should all work:
|
||||
which node
|
||||
node --version
|
||||
which npm
|
||||
npm --version
|
||||
which fnm
|
||||
fnm list
|
||||
```
|
||||
|
||||
### Check Bun Setup
|
||||
```bash
|
||||
which bun
|
||||
bun --version
|
||||
```
|
||||
|
||||
### Check Neovim
|
||||
```bash
|
||||
nvim --version
|
||||
# Should be v0.10.0+
|
||||
```
|
||||
|
||||
### Test in Neovim
|
||||
```vim
|
||||
# Open Neovim
|
||||
nvim
|
||||
|
||||
# Check Node.js is in PATH
|
||||
:echo $PATH
|
||||
# Should include: /Users/YOUR_USERNAME/.local/share/fnm/aliases/default/bin
|
||||
|
||||
# Check Copilot
|
||||
:Copilot status
|
||||
# Should show: Ready
|
||||
|
||||
# Check plugins
|
||||
:Lazy
|
||||
# All plugins should be loaded or available
|
||||
|
||||
# Check Mason
|
||||
:Mason
|
||||
# All tools should be installed
|
||||
|
||||
# Check LSP
|
||||
:checkhealth lsp
|
||||
# Should show no errors
|
||||
```
|
||||
|
||||
## 🔄 Updating Tools
|
||||
|
||||
### Update Node.js
|
||||
```bash
|
||||
# Install new LTS version
|
||||
fnm install --lts
|
||||
|
||||
# Set as default
|
||||
fnm default lts-latest
|
||||
|
||||
# Old versions are kept, you can switch back:
|
||||
fnm use 22 # if you need an older version
|
||||
```
|
||||
|
||||
The fnm alias system means Neovim automatically uses the new version without config changes!
|
||||
|
||||
### Update Bun
|
||||
```bash
|
||||
bun upgrade
|
||||
```
|
||||
|
||||
### Update Neovim Plugins
|
||||
```vim
|
||||
:Lazy update
|
||||
```
|
||||
|
||||
### Update Mason Tools
|
||||
```vim
|
||||
:Mason
|
||||
# Press 'U' to update all tools
|
||||
```
|
||||
|
||||
### Update Neovim
|
||||
```bash
|
||||
brew upgrade neovim
|
||||
```
|
||||
|
||||
## 🐛 Troubleshooting
|
||||
|
||||
### Copilot says "Node.js not found"
|
||||
1. Check Node.js is installed: `which node`
|
||||
2. Check fnm is in PATH: `which fnm`
|
||||
3. Verify init.lua has Node.js PATH configuration (see step 7)
|
||||
4. Restart Neovim completely
|
||||
|
||||
### LSP not loading
|
||||
```vim
|
||||
:LspInfo # Check if attached
|
||||
:checkhealth lsp # Check for issues
|
||||
:Mason # Verify tool is installed
|
||||
```
|
||||
|
||||
### Plugins not loading
|
||||
```vim
|
||||
:Lazy check
|
||||
:Lazy clean
|
||||
:Lazy sync
|
||||
```
|
||||
|
||||
### Format-on-save not working
|
||||
```vim
|
||||
:ConformInfo # Check formatter config
|
||||
:Mason # Verify formatter installed
|
||||
```
|
||||
|
||||
### Treesitter syntax highlighting broken
|
||||
```vim
|
||||
:TSUpdate # Update all parsers
|
||||
:checkhealth nvim-treesitter
|
||||
```
|
||||
|
||||
## 🚀 Platform-Specific Notes
|
||||
|
||||
### Linux
|
||||
- Use your package manager instead of Homebrew
|
||||
- fnm install: `curl -fsSL https://fnm.vercel.app/install | bash`
|
||||
- Bun works the same way
|
||||
- Shell config goes in `~/.bashrc` or `~/.zshrc`
|
||||
|
||||
### Windows (WSL)
|
||||
- Use WSL2 with Ubuntu/Debian
|
||||
- Follow Linux instructions above
|
||||
- Make sure Neovim is installed in WSL, not Windows
|
||||
|
||||
### Windows (Native)
|
||||
- Use Scoop or Chocolatey instead of Homebrew
|
||||
- fnm Windows install: `winget install Schniz.fnm`
|
||||
- Bun: `powershell -c "irm bun.sh/install.ps1 | iex"`
|
||||
- Config goes in `~\AppData\Local\nvim\`
|
||||
|
||||
## 📚 Additional Resources
|
||||
|
||||
- **Kickstart.nvim**: https://github.com/nvim-lua/kickstart.nvim
|
||||
- **fnm**: https://github.com/Schniz/fnm
|
||||
- **Bun**: https://bun.sh
|
||||
- **Mason**: https://github.com/williamboman/mason.nvim
|
||||
- **lazy.nvim**: https://github.com/folke/lazy.nvim
|
||||
- **Neovim**: https://neovim.io
|
||||
|
||||
## 📝 Quick Setup Script
|
||||
|
||||
For experienced users, here's a one-liner (review before running!):
|
||||
|
||||
```bash
|
||||
# Install Homebrew (if needed)
|
||||
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
|
||||
|
||||
# Install all tools
|
||||
brew install neovim fnm && \
|
||||
fnm install --lts && \
|
||||
fnm default lts-latest && \
|
||||
curl -fsSL https://bun.sh/install | bash
|
||||
|
||||
# Add to ~/.zshrc
|
||||
echo 'eval "$(fnm env --use-on-cd)"' >> ~/.zshrc
|
||||
echo 'export BUN_INSTALL="$HOME/.bun"' >> ~/.zshrc
|
||||
echo 'export PATH="$BUN_INSTALL/bin:$PATH"' >> ~/.zshrc
|
||||
|
||||
# Clone Kickstart
|
||||
git clone https://github.com/nvim-lua/kickstart.nvim.git ~/.config/nvim
|
||||
|
||||
# Copy your custom plugins
|
||||
# (You need to do this manually from your backup/repo)
|
||||
|
||||
# Launch Neovim
|
||||
source ~/.zshrc
|
||||
nvim
|
||||
```
|
||||
|
||||
Then in Neovim:
|
||||
1. Wait for plugins to install
|
||||
2. Run `:Copilot setup`
|
||||
3. Restart Neovim
|
||||
4. Done! 🎉
|
||||
|
||||
---
|
||||
|
||||
**Last Updated**: October 29, 2025
|
||||
**Neovim Version**: v0.11.4
|
||||
**Node.js Version**: v24.11.0 LTS
|
||||
**Bun Version**: 1.3.1
|
||||
422
archive/KEYMAPS.md
Normal file
422
archive/KEYMAPS.md
Normal file
|
|
@ -0,0 +1,422 @@
|
|||
# Neovim Keymap Reference
|
||||
|
||||
> **Last Updated:** November 1, 2025
|
||||
> **Organization Status:** ⚠️ NEEDS CLEANUP - Duplicates and conflicts identified
|
||||
|
||||
## Table of Contents
|
||||
- [Global Keymaps](#global-keymaps)
|
||||
- [LSP Keymaps](#lsp-keymaps)
|
||||
- [Language-Specific Keymaps](#language-specific-keymaps)
|
||||
- [Conflicts & Duplicates](#conflicts--duplicates)
|
||||
- [Proposed Organization](#proposed-organization)
|
||||
|
||||
---
|
||||
|
||||
## Global Keymaps
|
||||
|
||||
### Window Navigation
|
||||
| Key | Mode | Action | Status |
|
||||
|-----|------|--------|--------|
|
||||
| `<C-h>` | n | Move to left window | ✅ Keep |
|
||||
| `<C-l>` | n | Move to right window | ✅ Keep |
|
||||
| `<C-j>` | n | Move to lower window | ⚠️ **CONFLICT** with Telescope |
|
||||
| `<C-k>` | n | Move to upper window | ⚠️ **CONFLICT** with Telescope |
|
||||
|
||||
### Quit Commands
|
||||
| Key | Mode | Action | Status |
|
||||
|-----|------|--------|--------|
|
||||
| `<leader>Q` | n | Quit all | ✅ Keep |
|
||||
| `<leader>q` | n | Open diagnostic quickfix | ✅ Keep |
|
||||
|
||||
### File Explorer
|
||||
| Key | Mode | Action | Status |
|
||||
|-----|------|--------|--------|
|
||||
| `\` | n | Toggle Neo-tree | ✅ Keep (user requested) |
|
||||
|
||||
### Terminal
|
||||
| Key | Mode | Action | Status |
|
||||
|-----|------|--------|--------|
|
||||
| `<Esc><Esc>` | t | Exit terminal mode | ✅ Keep |
|
||||
|
||||
### Escape/Clear
|
||||
| Key | Mode | Action | Status |
|
||||
|-----|------|--------|--------|
|
||||
| `<Esc>` | n | Clear highlights + close floats | ✅ Keep |
|
||||
|
||||
---
|
||||
|
||||
## Search/Telescope (`<leader>s`)
|
||||
|
||||
| Key | Mode | Action | Status |
|
||||
|-----|------|--------|--------|
|
||||
| `<leader>sh` | n | Search Help | ✅ Keep |
|
||||
| `<leader>sk` | n | Search Keymaps | ✅ Keep |
|
||||
| `<leader>sf` | n | Search Files | ✅ Keep |
|
||||
| `<leader>ss` | n | Search Select Telescope | ✅ Keep |
|
||||
| `<leader>sw` | n | Search current Word | ✅ Keep |
|
||||
| `<leader>sg` | n | Search by Grep | ✅ Keep |
|
||||
| `<leader>sd` | n | Search Diagnostics | ✅ Keep |
|
||||
| `<leader>sr` | n | Search Resume | ✅ Keep |
|
||||
| `<leader>s.` | n | Search Recent Files | ✅ Keep |
|
||||
| `<leader>s/` | n | Search in open files | ✅ Keep |
|
||||
| `<leader>sn` | n | Search Neovim config | ✅ Keep |
|
||||
| `<leader>/` | n | Fuzzy search in buffer | ✅ Keep |
|
||||
| `<leader><leader>` | n | Find buffers | ✅ Keep |
|
||||
|
||||
### Telescope Navigation (Within Telescope)
|
||||
| Key | Mode | Action | Status |
|
||||
|-----|------|--------|--------|
|
||||
| `<C-j>` | i | Next item | ⚠️ **CONFLICT** with window nav |
|
||||
| `<C-k>` | i | Previous item | ⚠️ **CONFLICT** with window nav |
|
||||
|
||||
---
|
||||
|
||||
## Session (`<leader>S`)
|
||||
|
||||
| Key | Mode | Action | Status |
|
||||
|-----|------|--------|--------|
|
||||
| `<leader>Ss` | n | Session save | ✅ Keep |
|
||||
| `<leader>Sr` | n | Session restore | ✅ Keep |
|
||||
| `<leader>Sd` | n | Session delete | ✅ Keep |
|
||||
|
||||
---
|
||||
|
||||
## LSP Keymaps (All Languages)
|
||||
|
||||
### Go-to Commands (`gr*`)
|
||||
| Key | Mode | Action | Status |
|
||||
|-----|------|--------|--------|
|
||||
| `grd` | n | Go to Definition | ✅ Keep |
|
||||
| `grD` | n | Go to Declaration | ✅ Keep |
|
||||
| `gri` | n | Go to Implementation | ✅ Keep |
|
||||
| `grr` | n | Go to References | ✅ Keep |
|
||||
| `grt` | n | Go to Type Definition | ✅ Keep |
|
||||
| `grn` | n | Rename | ✅ Keep |
|
||||
| `gra` | n,v | Code Action | ⚠️ **DUPLICATE** (also `<leader>.` in Flutter) |
|
||||
|
||||
### Other LSP
|
||||
| Key | Mode | Action | Status |
|
||||
|-----|------|--------|--------|
|
||||
| `K` | n | Hover Documentation | ✅ Keep |
|
||||
| `gO` | n | Document Symbols | ✅ Keep |
|
||||
| `gW` | n | Workspace Symbols | ✅ Keep |
|
||||
|
||||
---
|
||||
|
||||
## Toggle (`<leader>t`)
|
||||
|
||||
| Key | Mode | Action | Status |
|
||||
|-----|------|--------|--------|
|
||||
| `<leader>th` | n | Toggle Inlay Hints | ✅ Keep |
|
||||
|
||||
---
|
||||
|
||||
## Diagnostics/Quickfix (`<leader>x`)
|
||||
|
||||
| Key | Mode | Action | Status |
|
||||
|-----|------|--------|--------|
|
||||
| `<leader>xx` | n | Toggle diagnostics list (Trouble) | ✅ Keep |
|
||||
| `<leader>xX` | n | Toggle buffer diagnostics (Trouble) | ✅ Keep |
|
||||
| `<leader>xs` | n | Toggle symbols (Trouble) | ✅ Keep |
|
||||
|
||||
---
|
||||
|
||||
## Git Hunks (`<leader>h`)
|
||||
|
||||
| Key | Mode | Action | Status |
|
||||
|-----|------|--------|--------|
|
||||
| `<leader>hs` | n,v | Stage hunk | ✅ Keep |
|
||||
| `<leader>hr` | n,v | Reset hunk | ✅ Keep |
|
||||
| `<leader>hS` | n | Stage buffer | ✅ Keep |
|
||||
| `<leader>hu` | n | Undo stage hunk | ✅ Keep |
|
||||
| `<leader>hR` | n | Reset buffer | ✅ Keep |
|
||||
| `<leader>hp` | n | Preview hunk | ✅ Keep |
|
||||
| `<leader>hb` | n | Blame line | ✅ Keep |
|
||||
| `<leader>hd` | n | Diff this | ✅ Keep |
|
||||
| `<leader>hD` | n | Diff this ~ | ✅ Keep |
|
||||
|
||||
---
|
||||
|
||||
## Language-Specific Keymaps
|
||||
|
||||
### Flutter/Dart (`<leader>f`, `<leader>d`)
|
||||
|
||||
#### Flutter Workflow
|
||||
| Key | Mode | Action | Status |
|
||||
|-----|------|--------|--------|
|
||||
| `<leader>fr` | n | Flutter Run | ✅ Keep |
|
||||
| `<leader>fR` | n | Flutter Hot Restart | ✅ Keep |
|
||||
| `<leader>fq` | n | Flutter Quit | ✅ Keep |
|
||||
| `<leader>fd` | n | Flutter Devices (select) | ✅ Keep |
|
||||
| `<leader>fe` | n | Flutter Emulators | ✅ Keep |
|
||||
| `<leader>fo` | n | Flutter Outline Toggle | ✅ Keep |
|
||||
| `<leader>fc` | n | Flutter Copy Profiler URL | ✅ Keep |
|
||||
| `<leader>fl` | n | Flutter LSP Restart | ✅ Keep |
|
||||
|
||||
#### Flutter Code Actions
|
||||
| Key | Mode | Action | Status |
|
||||
|-----|------|--------|--------|
|
||||
| `<leader>.` | n,v | Code Actions (Cmd+.) | ⚠️ **DUPLICATE** with `gra` |
|
||||
| `gra` | n,v | Code Action | ⚠️ **DUPLICATE** with `<leader>.` |
|
||||
|
||||
#### Debug (Flutter/Dart)
|
||||
| Key | Mode | Action | Status |
|
||||
|-----|------|--------|--------|
|
||||
| `<F5>` | n | Debug: Start/Continue | ✅ Keep |
|
||||
| `<F10>` | n | Debug: Step Over | ✅ Keep |
|
||||
| `<F11>` | n | Debug: Step Into | ✅ Keep |
|
||||
| `<F12>` | n | Debug: Step Out | ✅ Keep |
|
||||
| `<leader>db` | n | Debug: Toggle Breakpoint | ✅ Keep |
|
||||
| `<leader>dB` | n | Debug: Conditional Breakpoint | ✅ Keep |
|
||||
| `<leader>dc` | n | Debug: Continue | ⚠️ **DUPLICATE** with `<F5>` |
|
||||
| `<leader>dt` | n | Debug: Terminate | ✅ Keep |
|
||||
| `<leader>du` | n | Debug: Toggle UI | ✅ Keep |
|
||||
|
||||
### Rust (`<leader>r`, `<leader>c`)
|
||||
|
||||
#### Rust Tools
|
||||
| Key | Mode | Action | Status |
|
||||
|-----|------|--------|--------|
|
||||
| `<leader>rh` | n | Rust Hover Actions | ✅ Keep |
|
||||
| `<leader>ra` | n | Rust Code Actions | ✅ Keep |
|
||||
| `<leader>re` | n | Rust Explain Error | ✅ Keep |
|
||||
| `<leader>rc` | n | Rust Open Cargo.toml | ⚠️ **CONFLICT** with Crates (in Cargo.toml) |
|
||||
| `<leader>rp` | n | Rust Parent Module | ✅ Keep |
|
||||
| `<leader>rj` | n | Rust Join Lines | ✅ Keep |
|
||||
|
||||
#### Crates (Cargo.toml only)
|
||||
| Key | Mode | Action | Status |
|
||||
|-----|------|--------|--------|
|
||||
| `<leader>ct` | n | Crates Toggle | ✅ Keep |
|
||||
| `<leader>cr` | n | Crates Reload | ⚠️ **CONFLICT** with `<leader>rc` in .rs files |
|
||||
| `<leader>cv` | n | Crates Show Versions | ✅ Keep |
|
||||
| `<leader>cf` | n | Crates Show Features | ✅ Keep |
|
||||
| `<leader>cd` | n | Crates Show Dependencies | ✅ Keep |
|
||||
| `<leader>cu` | n,v | Crates Update | ✅ Keep |
|
||||
| `<leader>ca` | n | Crates Update All | ✅ Keep |
|
||||
| `<leader>cU` | n,v | Crates Upgrade | ✅ Keep |
|
||||
| `<leader>cA` | n | Crates Upgrade All | ✅ Keep |
|
||||
| `<leader>ce` | n | Crates Expand to inline | ✅ Keep |
|
||||
| `<leader>cE` | n | Crates Extract to table | ✅ Keep |
|
||||
| `<leader>cH` | n | Crates Open Homepage | ✅ Keep |
|
||||
| `<leader>cR` | n | Crates Open Repository | ✅ Keep |
|
||||
| `<leader>cD` | n | Crates Open Documentation | ✅ Keep |
|
||||
| `<leader>cC` | n | Crates Open Crates.io | ✅ Keep |
|
||||
|
||||
### Python (`<leader>p`)
|
||||
| Key | Mode | Action | Status |
|
||||
|-----|------|--------|--------|
|
||||
| (No keymaps defined yet) | - | - | ⚠️ Need to add |
|
||||
|
||||
### Svelte (`<leader>v`)
|
||||
| Key | Mode | Action | Status |
|
||||
|-----|------|--------|--------|
|
||||
| (No keymaps defined yet) | - | - | ⚠️ Need to add |
|
||||
|
||||
---
|
||||
|
||||
## Conflicts & Duplicates
|
||||
|
||||
### 🔴 Critical Conflicts
|
||||
|
||||
1. **Window Navigation vs Telescope Navigation**
|
||||
- `<C-j>` and `<C-k>` used for BOTH window navigation AND Telescope item navigation
|
||||
- **Impact:** Medium - Can't navigate windows while Telescope is open
|
||||
- **Resolution:** Telescope should use different keys or remain as-is (works in insert mode)
|
||||
|
||||
2. **Code Actions: `gra` vs `<leader>.`**
|
||||
- Both do the same thing in Flutter/Dart files
|
||||
- **Impact:** Low - Just redundant
|
||||
- **Resolution:** Keep both (muscle memory from different editors)
|
||||
|
||||
3. **Debug Continue: `<F5>` vs `<leader>dc`**
|
||||
- Both do the same thing
|
||||
- **Impact:** Low - Just redundant
|
||||
- **Resolution:** Keep both (F5 is standard, leader-based for discoverability)
|
||||
|
||||
4. **Rust Cargo.toml conflicts**
|
||||
- `<leader>rc` means different things in `.rs` vs `Cargo.toml` files
|
||||
- `<leader>cr` means different things in `.rs` vs `Cargo.toml` files
|
||||
- **Impact:** High - Same key does different things based on filename
|
||||
- **Resolution:** This is acceptable since they're context-dependent (filetype-specific)
|
||||
|
||||
### 🟡 Minor Issues
|
||||
|
||||
1. **No Python or Svelte keymaps**
|
||||
- Missing language-specific shortcuts
|
||||
- **Resolution:** Add `<leader>p` for Python, `<leader>v` for Svelte
|
||||
|
||||
2. **No unified debug keymaps**
|
||||
- Debug keys only in Flutter, not available globally
|
||||
- **Resolution:** Move debug keymaps to global scope if DAP is loaded
|
||||
|
||||
---
|
||||
|
||||
## Proposed Organization
|
||||
|
||||
### Leader Key Groups (LazyVim-style with Icons)
|
||||
|
||||
```
|
||||
<leader>
|
||||
├── <leader><leader> → Buffers
|
||||
├── <leader>/ → Search in buffer
|
||||
├── <leader>. → Code action (Flutter/Dart specific)
|
||||
├── <leader>Q → Quit all
|
||||
├── <leader>q → Quickfix diagnostics
|
||||
│
|
||||
├── <leader>b → [B]uffer operations (NEW)
|
||||
│ ├── <leader>bd → Delete buffer
|
||||
│ ├── <leader>bD → Delete buffer (force)
|
||||
│ ├── <leader>bn → Next buffer
|
||||
│ ├── <leader>bp → Previous buffer
|
||||
│ └── <leader>bP → Pin buffer
|
||||
│
|
||||
├── <leader>c → [C]ode operations (NEW - UNIFY CODE ACTIONS)
|
||||
│ ├── <leader>ca → Code action
|
||||
│ ├── <leader>cf → Format
|
||||
│ ├── <leader>cr → Rename
|
||||
│ └── <leader>cs → Symbol search
|
||||
│
|
||||
├── <leader>d → [D]ebug (GLOBAL - move from Flutter-only)
|
||||
│ ├── <leader>db → Toggle breakpoint
|
||||
│ ├── <leader>dB → Conditional breakpoint
|
||||
│ ├── <leader>dc → Continue
|
||||
│ ├── <leader>di → Step into
|
||||
│ ├── <leader>do → Step out
|
||||
│ ├── <leader>dO → Step over
|
||||
│ ├── <leader>dt → Terminate
|
||||
│ └── <leader>du → Toggle UI
|
||||
│
|
||||
├── <leader>f → [F]lutter (Dart files only)
|
||||
│ ├── <leader>fr → Run
|
||||
│ ├── <leader>fR → Hot restart
|
||||
│ ├── <leader>fq → Quit
|
||||
│ ├── <leader>fd → Devices
|
||||
│ ├── <leader>fe → Emulators
|
||||
│ ├── <leader>fo → Outline toggle
|
||||
│ ├── <leader>fc → Copy profiler URL
|
||||
│ └── <leader>fl → LSP restart
|
||||
│
|
||||
├── <leader>g → [G]it (RENAME from <leader>h)
|
||||
│ ├── <leader>gs → Stage hunk
|
||||
│ ├── <leader>gr → Reset hunk
|
||||
│ ├── <leader>gS → Stage buffer
|
||||
│ ├── <leader>gu → Undo stage
|
||||
│ ├── <leader>gR → Reset buffer
|
||||
│ ├── <leader>gp → Preview hunk
|
||||
│ ├── <leader>gb → Blame line
|
||||
│ ├── <leader>gd → Diff this
|
||||
│ └── <leader>gD → Diff this ~
|
||||
│
|
||||
├── <leader>p → [P]ython (Python files only) (NEW)
|
||||
│ ├── <leader>pr → Run file
|
||||
│ ├── <leader>pR → Run with args
|
||||
│ ├── <leader>pi → Import sort
|
||||
│ ├── <leader>pe → Select environment
|
||||
│ └── <leader>pt → Run tests
|
||||
│
|
||||
├── <leader>r → [R]ust (Rust files only)
|
||||
│ ├── <leader>rh → Hover actions
|
||||
│ ├── <leader>ra → Code actions
|
||||
│ ├── <leader>re → Explain error
|
||||
│ ├── <leader>rc → Open Cargo.toml
|
||||
│ ├── <leader>rp → Parent module
|
||||
│ ├── <leader>rj → Join lines
|
||||
│ ├── <leader>rt → Runnables
|
||||
│ └── <leader>rr → Run (NEW)
|
||||
│ │
|
||||
│ └── <leader>rc → [C]rates (Cargo.toml only)
|
||||
│ ├── <leader>rct → Toggle
|
||||
│ ├── <leader>rcr → Reload
|
||||
│ ├── <leader>rcv → Show versions
|
||||
│ ├── <leader>rcf → Show features
|
||||
│ ├── <leader>rcd → Show dependencies
|
||||
│ ├── <leader>rcu → Update crate
|
||||
│ ├── <leader>rca → Update all
|
||||
│ ├── <leader>rcU → Upgrade crate
|
||||
│ └── <leader>rcA → Upgrade all
|
||||
│
|
||||
├── <leader>s → [S]earch
|
||||
│ ├── <leader>sh → Help
|
||||
│ ├── <leader>sk → Keymaps
|
||||
│ ├── <leader>sf → Files
|
||||
│ ├── <leader>ss → Select Telescope
|
||||
│ ├── <leader>sw → Current word
|
||||
│ ├── <leader>sg → Grep
|
||||
│ ├── <leader>sd → Diagnostics
|
||||
│ ├── <leader>sr → Resume
|
||||
│ ├── <leader>s. → Recent files
|
||||
│ ├── <leader>s/ → Open files
|
||||
│ ├── <leader>sn → Neovim config
|
||||
│ └── <leader>sc → Cheatsheet (NEW)
|
||||
│
|
||||
├── <leader>S → [S]ession
|
||||
│ ├── <leader>Ss → Save
|
||||
│ ├── <leader>Sr → Restore
|
||||
│ └── <leader>Sd → Delete
|
||||
│
|
||||
├── <leader>t → [T]oggle
|
||||
│ ├── <leader>th → Inlay hints
|
||||
│ ├── <leader>td → Diagnostics
|
||||
│ ├── <leader>tl → Line numbers
|
||||
│ ├── <leader>tr → Relative numbers
|
||||
│ ├── <leader>ts → Spell check
|
||||
│ ├── <leader>tw → Wrap
|
||||
│ └── <leader>tc → Conceallevel
|
||||
│
|
||||
├── <leader>u → [U]I (NEW)
|
||||
│ ├── <leader>un → Noice dismiss
|
||||
│ ├── <leader>ul → Lazy
|
||||
│ ├── <leader>um → Mason
|
||||
│ └── <leader>ui → Inspect tree
|
||||
│
|
||||
├── <leader>v → S[v]elte (Svelte files only) (NEW)
|
||||
│ └── (TBD)
|
||||
│
|
||||
├── <leader>w → [W]indow operations (NEW)
|
||||
│ ├── <leader>ww → Other window
|
||||
│ ├── <leader>wd → Delete window
|
||||
│ ├── <leader>ws → Split below
|
||||
│ ├── <leader>wv → Split right
|
||||
│ └── <leader>wm → Maximize toggle
|
||||
│
|
||||
└── <leader>x → Diagnostics/quickfi[X]
|
||||
├── <leader>xx → Toggle diagnostics
|
||||
├── <leader>xX → Buffer diagnostics
|
||||
└── <leader>xs → Symbols
|
||||
```
|
||||
|
||||
### Non-Leader Keys
|
||||
|
||||
```
|
||||
\ → Toggle Neo-tree (file explorer)
|
||||
K → Hover documentation (LSP)
|
||||
<Esc> → Clear highlights + close floats
|
||||
|
||||
gr* → LSP "go to" commands
|
||||
├── grd → Definition
|
||||
├── grD → Declaration
|
||||
├── gri → Implementation
|
||||
├── grr → References
|
||||
├── grt → Type definition
|
||||
├── grn → Rename
|
||||
└── gra → Code action
|
||||
|
||||
gO → Document symbols
|
||||
gW → Workspace symbols
|
||||
|
||||
<C-hjkl> → Window navigation
|
||||
<F5-F12> → Debug keys (when available)
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Next Steps
|
||||
|
||||
1. ✅ **Document current state** (this file)
|
||||
2. ⏳ **Clean up duplicates** - Remove redundant keymaps
|
||||
3. ⏳ **Reorganize which-key** - Add icons, proper groups, submenus
|
||||
4. ⏳ **Add missing keymaps** - Python, Svelte, Buffer, Window, UI operations
|
||||
5. ⏳ **Update language configs** - Move Crates under `<leader>rc`, standardize patterns
|
||||
6. ⏳ **Implement cheatsheet** - Telescope-based searchable keymap reference
|
||||
7. ⏳ **Test everything** - Ensure no conflicts, all descriptions visible
|
||||
156
archive/MIGRATION.md
Normal file
156
archive/MIGRATION.md
Normal file
|
|
@ -0,0 +1,156 @@
|
|||
# Migration Checklist - Neovim Config Refactor
|
||||
|
||||
## Current State ✅
|
||||
- [x] Working Python LSP (pyright)
|
||||
- [x] Working Flutter LSP (dartls)
|
||||
- [x] Lazy-loaded language profiles
|
||||
- [x] Common plugins loaded globally
|
||||
- [x] ~1200 line init.lua (needs refactoring)
|
||||
|
||||
## Phase 1: Understand Your Config (Before Refactoring)
|
||||
- [ ] Read through entire `init.lua` - understand every line
|
||||
- [ ] List all plugins you actually use (vs installed)
|
||||
- [ ] Identify startup bottlenecks: `nvim --startuptime startup.log`
|
||||
- [ ] Document your most-used keybindings
|
||||
- [ ] Run `:checkhealth` to verify everything works
|
||||
|
||||
## Phase 2: Extract Configuration (Low Risk)
|
||||
- [ ] Create `lua/config/options.lua` - Move all `vim.opt` settings
|
||||
- [ ] Create `lua/config/keymaps.lua` - Move global keymaps
|
||||
- [ ] Create `lua/config/autocmds.lua` - Move global autocmds
|
||||
- [ ] Update `init.lua` to require these modules
|
||||
- [ ] Test: Restart nvim, verify everything works
|
||||
|
||||
## Phase 3: Reorganize Plugins (Medium Risk)
|
||||
- [ ] Create `lua/plugins/core/` directory structure
|
||||
- [ ] Move UI plugins to `core/ui.lua`
|
||||
- [ ] Move editor plugins to `core/editor.lua`
|
||||
- [ ] Move git plugins to `core/git.lua`
|
||||
- [ ] Move completion to `core/completion.lua`
|
||||
- [ ] Test after EACH move - don't batch them!
|
||||
|
||||
## Phase 4: Refactor LSP (High Risk - Do Last!)
|
||||
- [ ] Create `lua/plugins/lsp/init.lua` for mason setup
|
||||
- [ ] Create `lua/plugins/lsp/servers.lua` for general servers (lua_ls)
|
||||
- [ ] Move language-specific LSP to their lang files
|
||||
- [ ] Create `lua/util/lsp.lua` for shared utilities
|
||||
- [ ] Test each language: Python, Flutter, Svelte
|
||||
|
||||
## Phase 5: Cleanup
|
||||
- [ ] Remove unused plugins (check with `:Lazy`)
|
||||
- [ ] Remove duplicate code
|
||||
- [ ] Add comments explaining WHY, not WHAT
|
||||
- [ ] Update README.md with your structure
|
||||
- [ ] Profile startup time - compare before/after
|
||||
|
||||
## Testing Checklist (Run After Each Phase)
|
||||
- [ ] Python: Open .py file, verify pyright loads, test completion
|
||||
- [ ] Flutter: Open .dart file, verify dartls loads, test completion
|
||||
- [ ] Svelte: Open .svelte file, verify svelte-ls loads
|
||||
- [ ] Git: Open a git repo, test gitsigns
|
||||
- [ ] Telescope: Test fuzzy finding (<leader>sf)
|
||||
- [ ] LSP: Test go-to-definition, hover, rename
|
||||
- [ ] Formatting: Test format-on-save
|
||||
- [ ] Sessions: Test session save/restore
|
||||
|
||||
## Rollback Plan
|
||||
```bash
|
||||
# Before starting, create a backup branch
|
||||
cd ~/.config/nvim
|
||||
git checkout -b refactor-backup
|
||||
git checkout -b refactor-attempt
|
||||
|
||||
# If something breaks:
|
||||
git checkout refactor-backup
|
||||
```
|
||||
|
||||
## Performance Targets
|
||||
| Metric | Before | Target | After |
|
||||
|--------|--------|--------|-------|
|
||||
| Startup time | ? ms | <100ms | ? ms |
|
||||
| Plugins loaded on startup | ? | <30 | ? |
|
||||
| Time to first edit | ? ms | <200ms | ? ms |
|
||||
|
||||
Measure with:
|
||||
```bash
|
||||
nvim --startuptime startup.log
|
||||
# Check the last line for total time
|
||||
```
|
||||
|
||||
## When NOT to Refactor
|
||||
- [ ] You don't understand why your current config works
|
||||
- [ ] You're in the middle of a project deadline
|
||||
- [ ] Your startup time is already <50ms
|
||||
- [ ] You haven't backed up your config
|
||||
|
||||
## When TO Refactor
|
||||
- [x] Your init.lua is >500 lines (yours is 1200!)
|
||||
- [x] You have duplicate code across files
|
||||
- [x] You're adding a 4th+ language (you have 3)
|
||||
- [x] Startup time is >200ms
|
||||
- [x] You want to understand how Neovim works
|
||||
|
||||
## Expected Benefits
|
||||
- Faster startup (lazy-loading)
|
||||
- Easier to add new languages (template)
|
||||
- Easier to debug (modular)
|
||||
- Easier to share/document
|
||||
- Better understanding of Neovim
|
||||
|
||||
## Expected Challenges
|
||||
- LSP loading timing issues (we already solved this!)
|
||||
- Plugin dependency conflicts
|
||||
- Breaking changes in lazy.nvim API
|
||||
- Time investment (plan 4-6 hours)
|
||||
|
||||
---
|
||||
|
||||
## Quick Win: Do This First (30 minutes)
|
||||
|
||||
1. **Extract options** (lowest risk, immediate clarity):
|
||||
```lua
|
||||
-- lua/config/options.lua
|
||||
vim.g.mapleader = ' '
|
||||
vim.g.maplocalleader = ' '
|
||||
vim.g.have_nerd_font = true
|
||||
vim.opt.number = true
|
||||
vim.opt.relativenumber = true
|
||||
-- ... all your vim.opt settings
|
||||
```
|
||||
|
||||
2. **Extract keymaps**:
|
||||
```lua
|
||||
-- lua/config/keymaps.lua
|
||||
-- Escape closes floating windows
|
||||
vim.keymap.set('n', '<Esc>', function()
|
||||
-- ... your escape logic
|
||||
end)
|
||||
```
|
||||
|
||||
3. **Update init.lua**:
|
||||
```lua
|
||||
-- NEW init.lua (first 3 lines!)
|
||||
require('config.options')
|
||||
require('config.keymaps')
|
||||
-- ... rest stays the same for now
|
||||
```
|
||||
|
||||
This alone will make your init.lua 200 lines shorter and much clearer!
|
||||
|
||||
---
|
||||
|
||||
## Resources to Keep Handy
|
||||
- [Lazy.nvim Spec](https://lazy.folke.io/spec)
|
||||
- [:help lua-guide](https://neovim.io/doc/user/lua-guide.html)
|
||||
- [Your ORGANIZATION.md](./ORGANIZATION.md)
|
||||
- [Kickstart.nvim](https://github.com/nvim-lua/kickstart.nvim) (reference only)
|
||||
|
||||
---
|
||||
|
||||
**Remember:** Refactoring is optional. Your current setup WORKS. Only refactor if:
|
||||
1. You want to learn more about Neovim
|
||||
2. You want to add many more languages
|
||||
3. Your startup time bothers you
|
||||
4. You enjoy organizing code
|
||||
|
||||
Good luck! 🚀
|
||||
77
archive/NEO-TREE-CHEATSHEET.md
Normal file
77
archive/NEO-TREE-CHEATSHEET.md
Normal file
|
|
@ -0,0 +1,77 @@
|
|||
# Neo-tree File Explorer Cheat Sheet
|
||||
|
||||
## Opening/Closing
|
||||
- `\` - Toggle Neo-tree reveal (show tree with current file highlighted)
|
||||
- `q` - Close Neo-tree window
|
||||
- `<Esc>` - Cancel/close preview or Neo-tree window
|
||||
|
||||
## Navigation
|
||||
- `j` / `k` - Move down/up in the file list
|
||||
- `l` - Focus preview window
|
||||
- `<CR>` (Enter) - Open file or toggle directory expand/collapse
|
||||
- `<Space>` - Toggle directory expand/collapse
|
||||
- `<Backspace>` - Navigate up one directory level
|
||||
- `.` - Set current directory as root
|
||||
|
||||
## Directory Expand/Collapse
|
||||
- `<Space>` - Toggle expand/collapse directory
|
||||
- `<CR>` (Enter) - Open file OR toggle directory
|
||||
- `C` - Close node (collapse directory)
|
||||
- `z` - Close all nodes (collapse all directories)
|
||||
|
||||
## File Operations
|
||||
- `a` - Add new file (prompts for name)
|
||||
- `A` - Add new directory
|
||||
- `d` - Delete file/directory
|
||||
- `r` - Rename file/directory
|
||||
- `c` - Copy (prompts for destination path)
|
||||
- `m` - Move (prompts for destination path)
|
||||
- `y` - Copy to clipboard
|
||||
- `x` - Cut to clipboard
|
||||
- `p` - Paste from clipboard
|
||||
- `b` - Rename basename only (keep path)
|
||||
|
||||
## File Opening
|
||||
- `<CR>` - Open in current window
|
||||
- `s` - Open in vertical split
|
||||
- `S` - Open in horizontal split
|
||||
- `t` - Open in new tab
|
||||
- `w` - Open with window picker
|
||||
|
||||
## Display & Navigation
|
||||
- `H` - Toggle hidden files
|
||||
- `/` - Fuzzy finder (search files in tree)
|
||||
- `f` - Filter on submit
|
||||
- `<C-x>` - Clear filter
|
||||
- `i` - Show file details
|
||||
- `R` - Refresh tree
|
||||
- `?` - Show help (displays all available mappings)
|
||||
|
||||
## Git Navigation
|
||||
- `[g` - Previous git modified file
|
||||
- `]g` - Next git modified file
|
||||
|
||||
## Sorting
|
||||
Press `o` to show the order by menu, then:
|
||||
- `oc` - Order by created date
|
||||
- `od` - Order by diagnostics
|
||||
- `og` - Order by git status
|
||||
- `om` - Order by modified date
|
||||
- `on` - Order by name
|
||||
- `os` - Order by size
|
||||
- `ot` - Order by type
|
||||
|
||||
## Custom Mappings (from your config)
|
||||
- `<leader>sf` - Telescope find files in current directory
|
||||
- `<leader>sg` - Telescope live grep in current directory
|
||||
|
||||
## Preview Window
|
||||
- `P` - Toggle preview window
|
||||
- `<C-f>` - Scroll preview down
|
||||
- `<C-b>` - Scroll preview up
|
||||
|
||||
## Tips
|
||||
- Use `?` inside Neo-tree to see all available commands and their keybindings
|
||||
- The tree follows your current file automatically (if `follow_current_file` is enabled)
|
||||
- Hidden files (dotfiles) are toggled with `H`
|
||||
- Most operations can be cancelled with `<Esc>`
|
||||
389
archive/ORGANIZATION.md
Normal file
389
archive/ORGANIZATION.md
Normal file
|
|
@ -0,0 +1,389 @@
|
|||
# Neovim Configuration Organization Guide
|
||||
|
||||
## Current Structure (What You Have)
|
||||
|
||||
```
|
||||
~/.config/nvim/
|
||||
├── init.lua # Main entry point (1200 lines - TOO LARGE!)
|
||||
├── lua/
|
||||
│ ├── custom/
|
||||
│ │ └── plugins/
|
||||
│ │ ├── init.lua # Common plugins (all filetypes)
|
||||
│ │ ├── flutter.lua # Flutter-specific (lazy-loaded)
|
||||
│ │ ├── python.lua # Python-specific (lazy-loaded)
|
||||
│ │ ├── svelte.lua # Svelte-specific (lazy-loaded)
|
||||
│ │ └── session.lua # Session management
|
||||
│ └── kickstart/
|
||||
│ ├── health.lua
|
||||
│ └── plugins/
|
||||
│ ├── autopairs.lua
|
||||
│ ├── debug.lua
|
||||
│ ├── gitsigns.lua
|
||||
│ ├── indent_line.lua
|
||||
│ ├── lint.lua
|
||||
│ └── neo-tree.lua
|
||||
```
|
||||
|
||||
## Problems with Current Setup
|
||||
|
||||
1. **`init.lua` is massive (1200 lines)** - Should be split into modules
|
||||
2. **LSP setup is duplicated** - Language-specific LSP code is in `init.lua` instead of language files
|
||||
3. **Unclear separation** - What belongs in `custom/` vs `kickstart/`?
|
||||
4. **No clear loading strategy** - Which plugins load when?
|
||||
|
||||
---
|
||||
|
||||
## Recommended Structure (Optimal Organization)
|
||||
|
||||
```
|
||||
~/.config/nvim/
|
||||
├── init.lua # THIN entry point (~50 lines)
|
||||
│
|
||||
├── lua/
|
||||
│ ├── config/
|
||||
│ │ ├── options.lua # Vim options (set, opt)
|
||||
│ │ ├── keymaps.lua # Global keymaps
|
||||
│ │ ├── autocmds.lua # Global autocmds
|
||||
│ │ └── lazy.lua # Lazy.nvim bootstrap
|
||||
│ │
|
||||
│ ├── plugins/
|
||||
│ │ ├── core/
|
||||
│ │ │ ├── ui.lua # UI plugins (always loaded)
|
||||
│ │ │ ├── editor.lua # Editor enhancements (always loaded)
|
||||
│ │ │ ├── git.lua # Git tools (always loaded)
|
||||
│ │ │ └── completion.lua # Completion engine (always loaded)
|
||||
│ │ │
|
||||
│ │ ├── lsp/
|
||||
│ │ │ ├── init.lua # LSP infrastructure (mason, lspconfig)
|
||||
│ │ │ ├── servers.lua # General LSP servers (lua_ls, etc.)
|
||||
│ │ │ └── keymaps.lua # LSP keymaps (shared)
|
||||
│ │ │
|
||||
│ │ └── lang/
|
||||
│ │ ├── python.lua # Python: LSP + formatters + linters
|
||||
│ │ ├── flutter.lua # Flutter: LSP + debugging + tools
|
||||
│ │ ├── svelte.lua # Svelte: LSP + formatters
|
||||
│ │ ├── go.lua # Future: Go support
|
||||
│ │ └── rust.lua # Future: Rust support
|
||||
│ │
|
||||
│ └── util/
|
||||
│ ├── lsp.lua # Shared LSP utilities
|
||||
│ └── init.lua # Shared helper functions
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## How This Works: Lazy-Loading Strategy
|
||||
|
||||
### 1. **Core Plugins (Always Loaded)**
|
||||
```lua
|
||||
-- lua/plugins/core/editor.lua
|
||||
return {
|
||||
{ 'echasnovski/mini.pairs' }, -- Autopairs
|
||||
{ 'folke/which-key.nvim' }, -- Keybinding helper
|
||||
{ 'nvim-telescope/telescope.nvim' }, -- Fuzzy finder
|
||||
}
|
||||
```
|
||||
|
||||
### 2. **LSP Infrastructure (Loaded Early)**
|
||||
```lua
|
||||
-- lua/plugins/lsp/init.lua
|
||||
return {
|
||||
'neovim/nvim-lspconfig',
|
||||
dependencies = { 'mason.nvim', 'mason-lspconfig.nvim' },
|
||||
config = function()
|
||||
-- Setup mason, but don't configure language servers here
|
||||
require('mason').setup()
|
||||
require('mason-lspconfig').setup()
|
||||
end,
|
||||
}
|
||||
```
|
||||
|
||||
### 3. **Language-Specific (Lazy-Loaded by FileType)**
|
||||
```lua
|
||||
-- lua/plugins/lang/python.lua
|
||||
return {
|
||||
-- Mason tools
|
||||
{
|
||||
'WhoIsSethDaniel/mason-tool-installer.nvim',
|
||||
ft = 'python',
|
||||
config = function()
|
||||
require('mason-tool-installer').setup({
|
||||
ensure_installed = { 'pyright', 'ruff' }
|
||||
})
|
||||
end,
|
||||
},
|
||||
|
||||
-- LSP setup
|
||||
{
|
||||
'neovim/nvim-lspconfig',
|
||||
ft = 'python',
|
||||
config = function()
|
||||
-- Start pyright via autocmd
|
||||
vim.api.nvim_create_autocmd('FileType', {
|
||||
pattern = 'python',
|
||||
callback = function(args)
|
||||
local capabilities = require('blink.cmp').get_lsp_capabilities()
|
||||
vim.lsp.start({
|
||||
name = 'pyright',
|
||||
cmd = { vim.fn.stdpath('data') .. '/mason/bin/pyright-langserver', '--stdio' },
|
||||
root_dir = vim.fs.root(args.buf, { 'pyproject.toml', 'setup.py', '.git' }),
|
||||
capabilities = capabilities,
|
||||
})
|
||||
end,
|
||||
})
|
||||
end,
|
||||
},
|
||||
|
||||
-- Formatters
|
||||
{
|
||||
'stevearc/conform.nvim',
|
||||
ft = 'python',
|
||||
config = function()
|
||||
require('conform').formatters_by_ft.python = { 'ruff_format', 'ruff_organize_imports' }
|
||||
end,
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Migration Plan (Step-by-Step)
|
||||
|
||||
### Phase 1: Extract Configuration from init.lua
|
||||
```lua
|
||||
-- NEW init.lua (50 lines instead of 1200!)
|
||||
require('config.options') -- Vim settings
|
||||
require('config.keymaps') -- Global keymaps
|
||||
require('config.autocmds') -- Global autocmds
|
||||
require('config.lazy') -- Bootstrap lazy.nvim and load plugins
|
||||
```
|
||||
|
||||
### Phase 2: Organize Plugins by Loading Strategy
|
||||
|
||||
**Always Loaded (Core):**
|
||||
- `lua/plugins/core/ui.lua` - colorscheme, statusline, bufferline
|
||||
- `lua/plugins/core/editor.lua` - telescope, which-key, autopairs, neo-tree
|
||||
- `lua/plugins/core/git.lua` - gitsigns, fugitive
|
||||
- `lua/plugins/core/completion.lua` - blink.cmp
|
||||
|
||||
**Lazy-Loaded by FileType:**
|
||||
- `lua/plugins/lang/python.lua` - ft = 'python'
|
||||
- `lua/plugins/lang/flutter.lua` - ft = { 'dart', 'flutter' }
|
||||
- `lua/plugins/lang/svelte.lua` - ft = 'svelte'
|
||||
|
||||
**Lazy-Loaded by Command:**
|
||||
- Debugging tools - cmd = { 'DapContinue', 'DapToggleBreakpoint' }
|
||||
- Session management - cmd = { 'SessionSave', 'SessionLoad' }
|
||||
|
||||
### Phase 3: Fix LSP Loading Issue
|
||||
|
||||
**Problem:** You discovered that language-specific LSP configs in lazy-loaded files don't work because `nvim-lspconfig` is already loaded by `init.lua`.
|
||||
|
||||
**Solution:** Two approaches:
|
||||
|
||||
#### Option A: Centralized LSP Setup (Simpler)
|
||||
```lua
|
||||
-- lua/plugins/lsp/servers.lua
|
||||
local M = {}
|
||||
|
||||
M.setup_python = function()
|
||||
-- Python LSP setup
|
||||
end
|
||||
|
||||
M.setup_flutter = function()
|
||||
-- Flutter LSP setup
|
||||
end
|
||||
|
||||
-- Autocmds to trigger setup
|
||||
vim.api.nvim_create_autocmd('FileType', {
|
||||
pattern = 'python',
|
||||
once = true,
|
||||
callback = M.setup_python,
|
||||
})
|
||||
```
|
||||
|
||||
#### Option B: Per-Language Setup (Cleaner but Complex)
|
||||
```lua
|
||||
-- lua/plugins/lang/python.lua
|
||||
return {
|
||||
{
|
||||
'WhoIsSethDaniel/mason-tool-installer.nvim',
|
||||
ft = 'python',
|
||||
config = function()
|
||||
-- Install tools
|
||||
require('mason-tool-installer').setup({ ensure_installed = { 'pyright', 'ruff' }})
|
||||
|
||||
-- Setup LSP via autocmd (since lspconfig is already loaded)
|
||||
vim.api.nvim_create_autocmd('FileType', {
|
||||
pattern = 'python',
|
||||
callback = function(args)
|
||||
require('util.lsp').start_server('pyright', args.buf, {
|
||||
settings = { python = { analysis = { typeCheckingMode = 'basic' }}}
|
||||
})
|
||||
end,
|
||||
})
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
||||
-- lua/util/lsp.lua (shared utility)
|
||||
local M = {}
|
||||
|
||||
M.start_server = function(name, bufnr, opts)
|
||||
local clients = vim.lsp.get_clients({ bufnr = bufnr, name = name })
|
||||
if #clients > 0 then return end
|
||||
|
||||
local capabilities = require('blink.cmp').get_lsp_capabilities()
|
||||
vim.lsp.start(vim.tbl_deep_extend('force', {
|
||||
name = name,
|
||||
capabilities = capabilities,
|
||||
}, opts))
|
||||
end
|
||||
|
||||
return M
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Loading Performance Best Practices
|
||||
|
||||
### 1. Use Lazy-Loading Triggers
|
||||
|
||||
```lua
|
||||
-- ❌ BAD: Loads immediately on startup
|
||||
{ 'some/plugin' }
|
||||
|
||||
-- ✅ GOOD: Loads only when needed
|
||||
{ 'some/plugin', ft = 'python' } -- When opening .py files
|
||||
{ 'some/plugin', cmd = 'SomeCommand' } -- When running :SomeCommand
|
||||
{ 'some/plugin', keys = '<leader>x' } -- When pressing <leader>x
|
||||
{ 'some/plugin', event = 'VeryLazy' } -- After startup (low priority)
|
||||
```
|
||||
|
||||
### 2. Profile Your Startup Time
|
||||
|
||||
```bash
|
||||
# Measure startup time
|
||||
nvim --startuptime startup.log
|
||||
|
||||
# Find slow plugins
|
||||
grep "sourcing" startup.log | sort -k2 -n
|
||||
```
|
||||
|
||||
### 3. Use `:Lazy` to Monitor Loading
|
||||
|
||||
- Green plugins = loaded
|
||||
- Gray plugins = not loaded yet (lazy)
|
||||
- See what triggered loading
|
||||
|
||||
---
|
||||
|
||||
## Recommended Final Structure
|
||||
|
||||
```
|
||||
~/.config/nvim/
|
||||
├── init.lua # ~50 lines: require config modules
|
||||
│
|
||||
├── lua/
|
||||
│ ├── config/
|
||||
│ │ ├── options.lua # set.number, opt.clipboard, etc.
|
||||
│ │ ├── keymaps.lua # Global keymaps only
|
||||
│ │ ├── autocmds.lua # Global autocmds only
|
||||
│ │ └── lazy.lua # Bootstrap lazy.nvim
|
||||
│ │
|
||||
│ ├── plugins/
|
||||
│ │ ├── core/
|
||||
│ │ │ ├── ui.lua # Colorscheme, statusline, etc.
|
||||
│ │ │ ├── editor.lua # Telescope, which-key, autopairs
|
||||
│ │ │ ├── git.lua # Gitsigns, fugitive
|
||||
│ │ │ └── completion.lua # blink.cmp
|
||||
│ │ │
|
||||
│ │ ├── lsp/
|
||||
│ │ │ ├── init.lua # Mason, lspconfig setup
|
||||
│ │ │ ├── servers.lua # lua_ls and other general servers
|
||||
│ │ │ └── keymaps.lua # LSP keymaps (on_attach)
|
||||
│ │ │
|
||||
│ │ └── lang/
|
||||
│ │ ├── python.lua # ft = 'python'
|
||||
│ │ ├── flutter.lua # ft = 'dart'
|
||||
│ │ └── svelte.lua # ft = 'svelte'
|
||||
│ │
|
||||
│ └── util/
|
||||
│ ├── lsp.lua # Shared LSP helpers
|
||||
│ └── init.lua # Shared utility functions
|
||||
│
|
||||
├── ORGANIZATION.md # This file
|
||||
├── MIGRATION.md # Step-by-step migration guide
|
||||
└── README.md # Your custom README
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Key Principles
|
||||
|
||||
1. **Thin `init.lua`** - Just require modules, no logic
|
||||
2. **Separate concerns** - Options, keymaps, autocmds, plugins
|
||||
3. **Lazy-load everything possible** - Use `ft`, `cmd`, `keys`, `event`
|
||||
4. **Language files are independent** - Each lang/ file is self-contained
|
||||
5. **Share common code** - Use `util/` for helpers
|
||||
6. **Profile regularly** - Use `:Lazy profile` and `--startuptime`
|
||||
|
||||
---
|
||||
|
||||
## Learning Resources
|
||||
|
||||
### Understanding Neovim Configuration
|
||||
- `:help lua-guide` - Official Lua guide
|
||||
- `:help options` - All vim options
|
||||
- `:help api` - Lua API reference
|
||||
|
||||
### Lazy-Loading
|
||||
- `:help lazy.nvim` - Lazy.nvim documentation
|
||||
- `:Lazy profile` - See what's slow
|
||||
- `:Lazy` - Interactive plugin manager
|
||||
|
||||
### LSP
|
||||
- `:help lsp` - LSP overview
|
||||
- `:help vim.lsp.start()` - Start LSP servers
|
||||
- `:LspInfo` - See active LSP clients
|
||||
|
||||
### Performance
|
||||
- `nvim --startuptime startup.log` - Measure startup
|
||||
- `:profile start profile.log | profile func * | profile file *` - Profile runtime
|
||||
|
||||
---
|
||||
|
||||
## Next Steps
|
||||
|
||||
1. **Commit current working state** ✅ (You're doing this now)
|
||||
2. **Read through this guide** to understand the concepts
|
||||
3. **Try the migration in a branch** (don't break your working config!)
|
||||
4. **Migrate incrementally**:
|
||||
- Step 1: Extract options/keymaps from init.lua
|
||||
- Step 2: Move plugins to core/ structure
|
||||
- Step 3: Refactor language-specific configs
|
||||
5. **Test after each step** - Make sure everything still works
|
||||
6. **Profile before and after** - Measure improvements
|
||||
|
||||
---
|
||||
|
||||
## Questions to Consider
|
||||
|
||||
1. **Do you need kickstart/ folder anymore?**
|
||||
- If you understand the code, merge it into your own structure
|
||||
|
||||
2. **How many languages will you support?**
|
||||
- 3-5 languages: Current structure is fine
|
||||
- 10+ languages: Consider more sophisticated loading
|
||||
|
||||
3. **Do you want to share your config?**
|
||||
- Yes: Document everything, make it modular
|
||||
- No: Optimize for your own workflow
|
||||
|
||||
4. **How often will you add new languages?**
|
||||
- Frequently: Build a template system
|
||||
- Rarely: Current per-file approach works
|
||||
|
||||
---
|
||||
|
||||
**Remember:** This is YOUR config. Start with what works, refactor when you understand WHY you're refactoring. Don't cargo-cult someone else's structure!
|
||||
241
archive/README.old.md
Normal file
241
archive/README.old.md
Normal file
|
|
@ -0,0 +1,241 @@
|
|||
# kickstart.nvim
|
||||
|
||||
## Introduction
|
||||
|
||||
A starting point for Neovim that is:
|
||||
|
||||
* Small
|
||||
* Single-file
|
||||
* Completely Documented
|
||||
|
||||
**NOT** a Neovim distribution, but instead a starting point for your configuration.
|
||||
|
||||
## Installation
|
||||
|
||||
### Install Neovim
|
||||
|
||||
Kickstart.nvim targets *only* the latest
|
||||
['stable'](https://github.com/neovim/neovim/releases/tag/stable) and latest
|
||||
['nightly'](https://github.com/neovim/neovim/releases/tag/nightly) of Neovim.
|
||||
If you are experiencing issues, please make sure you have the latest versions.
|
||||
|
||||
### Install External Dependencies
|
||||
|
||||
External Requirements:
|
||||
- Basic utils: `git`, `make`, `unzip`, C Compiler (`gcc`)
|
||||
- [ripgrep](https://github.com/BurntSushi/ripgrep#installation),
|
||||
[fd-find](https://github.com/sharkdp/fd#installation)
|
||||
- Clipboard tool (xclip/xsel/win32yank or other depending on the platform)
|
||||
- A [Nerd Font](https://www.nerdfonts.com/): optional, provides various icons
|
||||
- if you have it set `vim.g.have_nerd_font` in `init.lua` to true
|
||||
- Emoji fonts (Ubuntu only, and only if you want emoji!) `sudo apt install fonts-noto-color-emoji`
|
||||
- Language Setup:
|
||||
- If you want to write Typescript, you need `npm`
|
||||
- If you want to write Golang, you will need `go`
|
||||
- etc.
|
||||
|
||||
> [!NOTE]
|
||||
> See [Install Recipes](#Install-Recipes) for additional Windows and Linux specific notes
|
||||
> and quick install snippets
|
||||
|
||||
### Install Kickstart
|
||||
|
||||
> [!NOTE]
|
||||
> [Backup](#FAQ) your previous configuration (if any exists)
|
||||
|
||||
Neovim's configurations are located under the following paths, depending on your OS:
|
||||
|
||||
| OS | PATH |
|
||||
| :- | :--- |
|
||||
| Linux, MacOS | `$XDG_CONFIG_HOME/nvim`, `~/.config/nvim` |
|
||||
| Windows (cmd)| `%localappdata%\nvim\` |
|
||||
| Windows (powershell)| `$env:LOCALAPPDATA\nvim\` |
|
||||
|
||||
#### Recommended Step
|
||||
|
||||
[Fork](https://docs.github.com/en/get-started/quickstart/fork-a-repo) this repo
|
||||
so that you have your own copy that you can modify, then install by cloning the
|
||||
fork to your machine using one of the commands below, depending on your OS.
|
||||
|
||||
> [!NOTE]
|
||||
> Your fork's URL will be something like this:
|
||||
> `https://github.com/<your_github_username>/kickstart.nvim.git`
|
||||
|
||||
You likely want to remove `lazy-lock.json` from your fork's `.gitignore` file
|
||||
too - it's ignored in the kickstart repo to make maintenance easier, but it's
|
||||
[recommended to track it in version control](https://lazy.folke.io/usage/lockfile).
|
||||
|
||||
#### Clone kickstart.nvim
|
||||
|
||||
> [!NOTE]
|
||||
> If following the recommended step above (i.e., forking the repo), replace
|
||||
> `nvim-lua` with `<your_github_username>` in the commands below
|
||||
|
||||
<details><summary> Linux and Mac </summary>
|
||||
|
||||
```sh
|
||||
git clone https://github.com/nvim-lua/kickstart.nvim.git "${XDG_CONFIG_HOME:-$HOME/.config}"/nvim
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
<details><summary> Windows </summary>
|
||||
|
||||
If you're using `cmd.exe`:
|
||||
|
||||
```
|
||||
git clone https://github.com/nvim-lua/kickstart.nvim.git "%localappdata%\nvim"
|
||||
```
|
||||
|
||||
If you're using `powershell.exe`
|
||||
|
||||
```
|
||||
git clone https://github.com/nvim-lua/kickstart.nvim.git "${env:LOCALAPPDATA}\nvim"
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
### Post Installation
|
||||
|
||||
Start Neovim
|
||||
|
||||
```sh
|
||||
nvim
|
||||
```
|
||||
|
||||
That's it! Lazy will install all the plugins you have. Use `:Lazy` to view
|
||||
the current plugin status. Hit `q` to close the window.
|
||||
|
||||
#### Read The Friendly Documentation
|
||||
|
||||
Read through the `init.lua` file in your configuration folder for more
|
||||
information about extending and exploring Neovim. That also includes
|
||||
examples of adding popularly requested plugins.
|
||||
|
||||
> [!NOTE]
|
||||
> For more information about a particular plugin check its repository's documentation.
|
||||
|
||||
|
||||
### Getting Started
|
||||
|
||||
[The Only Video You Need to Get Started with Neovim](https://youtu.be/m8C0Cq9Uv9o)
|
||||
|
||||
### FAQ
|
||||
|
||||
* What should I do if I already have a pre-existing Neovim configuration?
|
||||
* You should back it up and then delete all associated files.
|
||||
* This includes your existing init.lua and the Neovim files in `~/.local`
|
||||
which can be deleted with `rm -rf ~/.local/share/nvim/`
|
||||
* Can I keep my existing configuration in parallel to kickstart?
|
||||
* Yes! You can use [NVIM_APPNAME](https://neovim.io/doc/user/starting.html#%24NVIM_APPNAME)`=nvim-NAME`
|
||||
to maintain multiple configurations. For example, you can install the kickstart
|
||||
configuration in `~/.config/nvim-kickstart` and create an alias:
|
||||
```
|
||||
alias nvim-kickstart='NVIM_APPNAME="nvim-kickstart" nvim'
|
||||
```
|
||||
When you run Neovim using `nvim-kickstart` alias it will use the alternative
|
||||
config directory and the matching local directory
|
||||
`~/.local/share/nvim-kickstart`. You can apply this approach to any Neovim
|
||||
distribution that you would like to try out.
|
||||
* What if I want to "uninstall" this configuration:
|
||||
* See [lazy.nvim uninstall](https://lazy.folke.io/usage#-uninstalling) information
|
||||
* Why is the kickstart `init.lua` a single file? Wouldn't it make sense to split it into multiple files?
|
||||
* The main purpose of kickstart is to serve as a teaching tool and a reference
|
||||
configuration that someone can easily use to `git clone` as a basis for their own.
|
||||
As you progress in learning Neovim and Lua, you might consider splitting `init.lua`
|
||||
into smaller parts. A fork of kickstart that does this while maintaining the
|
||||
same functionality is available here:
|
||||
* [kickstart-modular.nvim](https://github.com/dam9000/kickstart-modular.nvim)
|
||||
* Discussions on this topic can be found here:
|
||||
* [Restructure the configuration](https://github.com/nvim-lua/kickstart.nvim/issues/218)
|
||||
* [Reorganize init.lua into a multi-file setup](https://github.com/nvim-lua/kickstart.nvim/pull/473)
|
||||
|
||||
### Install Recipes
|
||||
|
||||
Below you can find OS specific install instructions for Neovim and dependencies.
|
||||
|
||||
After installing all the dependencies continue with the [Install Kickstart](#Install-Kickstart) step.
|
||||
|
||||
#### Windows Installation
|
||||
|
||||
<details><summary>Windows with Microsoft C++ Build Tools and CMake</summary>
|
||||
Installation may require installing build tools and updating the run command for `telescope-fzf-native`
|
||||
|
||||
See `telescope-fzf-native` documentation for [more details](https://github.com/nvim-telescope/telescope-fzf-native.nvim#installation)
|
||||
|
||||
This requires:
|
||||
|
||||
- Install CMake and the Microsoft C++ Build Tools on Windows
|
||||
|
||||
```lua
|
||||
{'nvim-telescope/telescope-fzf-native.nvim', build = 'cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build' }
|
||||
```
|
||||
</details>
|
||||
<details><summary>Windows with gcc/make using chocolatey</summary>
|
||||
Alternatively, one can install gcc and make which don't require changing the config,
|
||||
the easiest way is to use choco:
|
||||
|
||||
1. install [chocolatey](https://chocolatey.org/install)
|
||||
either follow the instructions on the page or use winget,
|
||||
run in cmd as **admin**:
|
||||
```
|
||||
winget install --accept-source-agreements chocolatey.chocolatey
|
||||
```
|
||||
|
||||
2. install all requirements using choco, exit the previous cmd and
|
||||
open a new one so that choco path is set, and run in cmd as **admin**:
|
||||
```
|
||||
choco install -y neovim git ripgrep wget fd unzip gzip mingw make
|
||||
```
|
||||
</details>
|
||||
<details><summary>WSL (Windows Subsystem for Linux)</summary>
|
||||
|
||||
```
|
||||
wsl --install
|
||||
wsl
|
||||
sudo add-apt-repository ppa:neovim-ppa/unstable -y
|
||||
sudo apt update
|
||||
sudo apt install make gcc ripgrep unzip git xclip neovim
|
||||
```
|
||||
</details>
|
||||
|
||||
#### Linux Install
|
||||
<details><summary>Ubuntu Install Steps</summary>
|
||||
|
||||
```
|
||||
sudo add-apt-repository ppa:neovim-ppa/unstable -y
|
||||
sudo apt update
|
||||
sudo apt install make gcc ripgrep unzip git xclip neovim
|
||||
```
|
||||
</details>
|
||||
<details><summary>Debian Install Steps</summary>
|
||||
|
||||
```
|
||||
sudo apt update
|
||||
sudo apt install make gcc ripgrep unzip git xclip curl
|
||||
|
||||
# Now we install nvim
|
||||
curl -LO https://github.com/neovim/neovim/releases/latest/download/nvim-linux-x86_64.tar.gz
|
||||
sudo rm -rf /opt/nvim-linux-x86_64
|
||||
sudo mkdir -p /opt/nvim-linux-x86_64
|
||||
sudo chmod a+rX /opt/nvim-linux-x86_64
|
||||
sudo tar -C /opt -xzf nvim-linux-x86_64.tar.gz
|
||||
|
||||
# make it available in /usr/local/bin, distro installs to /usr/bin
|
||||
sudo ln -sf /opt/nvim-linux-x86_64/bin/nvim /usr/local/bin/
|
||||
```
|
||||
</details>
|
||||
<details><summary>Fedora Install Steps</summary>
|
||||
|
||||
```
|
||||
sudo dnf install -y gcc make git ripgrep fd-find unzip neovim
|
||||
```
|
||||
</details>
|
||||
|
||||
<details><summary>Arch Install Steps</summary>
|
||||
|
||||
```
|
||||
sudo pacman -S --noconfirm --needed gcc make git ripgrep fd unzip neovim
|
||||
```
|
||||
</details>
|
||||
|
||||
307
archive/SETUP-GUIDE.md
Normal file
307
archive/SETUP-GUIDE.md
Normal file
|
|
@ -0,0 +1,307 @@
|
|||
# VS Code-like Profile Setup for Neovim
|
||||
|
||||
This configuration implements a VS Code-like "profiles" system where language-specific plugins and tools only load when working with their respective file types.
|
||||
|
||||
## 🎯 Architecture
|
||||
|
||||
### File Structure
|
||||
```
|
||||
~/.config/nvim/
|
||||
├── init.lua # Main config with shared LSP, Treesitter, etc.
|
||||
└── lua/
|
||||
└── custom/
|
||||
└── plugins/
|
||||
├── init.lua # Common plugins (Copilot, Neo-tree)
|
||||
├── flutter.lua # Flutter/Dart profile
|
||||
├── python.lua # Python profile
|
||||
└── svelte.lua # Svelte/Web profile
|
||||
```
|
||||
|
||||
### How It Works
|
||||
- **lazy.nvim** loads plugins based on file types (`ft = { 'dart', 'python', 'svelte' }`)
|
||||
- When you open a `.dart` file → Flutter tools load
|
||||
- When you open a `.py` file → Python tools load
|
||||
- When you open a `.svelte` file → Svelte tools load
|
||||
- Common plugins (Copilot, Neo-tree) are always available
|
||||
|
||||
## 📦 What's Included
|
||||
|
||||
### Common (All Profiles)
|
||||
- **GitHub Copilot**: AI pair programming
|
||||
- **Neo-tree**: File explorer (commented out, enable if desired)
|
||||
- **Telescope**: Fuzzy finder
|
||||
- **Treesitter**: Syntax highlighting
|
||||
- **blink.cmp**: Autocompletion engine
|
||||
- **lua_ls**: LSP for Neovim config editing
|
||||
|
||||
### Flutter Profile (`flutter.lua`)
|
||||
**Loads on**: `.dart` files
|
||||
|
||||
**Tools**:
|
||||
- `flutter-tools.nvim`: Flutter development tools
|
||||
- `dartls`: Dart LSP server
|
||||
- Widget guides, closing tags, hot reload
|
||||
|
||||
**Keymaps** (under `<leader>f`):
|
||||
- `<leader>fr` - Flutter run
|
||||
- `<leader>fq` - Flutter quit
|
||||
- `<leader>fR` - Flutter restart
|
||||
- `<leader>fd` - Flutter devices
|
||||
- `<leader>fe` - Flutter emulators
|
||||
- `<leader>fo` - Flutter outline
|
||||
- `<leader>fc` - Copy profiler URL
|
||||
- `<leader>fl` - Restart LSP
|
||||
|
||||
### Python Profile (`python.lua`)
|
||||
**Loads on**: `.py` files
|
||||
|
||||
**Tools**:
|
||||
- `pyright`: Python LSP server with type checking
|
||||
- `ruff_format`: Fast Python formatter
|
||||
- `ruff_organize_imports`: Import sorting
|
||||
- Alternative: `black` + `isort` (commented out)
|
||||
|
||||
**Format on save**: Enabled for Python files
|
||||
|
||||
### Svelte Profile (`svelte.lua`)
|
||||
**Loads on**: `.svelte`, `.ts`, `.js` files
|
||||
|
||||
**Tools**:
|
||||
- `svelte-language-server`: Svelte LSP
|
||||
- `ts_ls`: TypeScript/JavaScript LSP
|
||||
- `tailwindcss`: Tailwind CSS LSP with completions
|
||||
- `prettier`: Code formatter for web files
|
||||
- `emmet-vim`: HTML/CSS abbreviation expansion
|
||||
|
||||
**Keymaps**:
|
||||
- `<C-e>,` - Expand Emmet abbreviation (e.g., `div.container` → full HTML)
|
||||
|
||||
**Treesitter parsers**: svelte, typescript, tsx, javascript, css, html, json
|
||||
|
||||
## 🚀 Installation Steps
|
||||
|
||||
### 1. Restart Neovim
|
||||
```bash
|
||||
nvim
|
||||
```
|
||||
|
||||
### 2. Install Plugins
|
||||
Once Neovim opens, lazy.nvim should automatically start installing plugins. If not:
|
||||
```vim
|
||||
:Lazy sync
|
||||
```
|
||||
|
||||
Wait for all plugins to install. This may take a few minutes.
|
||||
|
||||
### 3. Install LSP Servers & Tools
|
||||
```vim
|
||||
:Mason
|
||||
```
|
||||
|
||||
Press `g?` for help. Verify these are installed:
|
||||
- **Flutter**: `dart-language-server` (dartls)
|
||||
- **Python**: `pyright`, `ruff`, `black` (optional), `isort` (optional)
|
||||
- **Svelte**: `svelte-language-server`, `typescript-language-server`, `tailwindcss-language-server`, `prettier`
|
||||
- **Common**: `lua-language-server`, `stylua`
|
||||
|
||||
Mason will auto-install most of these via `mason-tool-installer`.
|
||||
|
||||
### 4. Install Treesitter Parsers
|
||||
Parsers should auto-install when you open files. To manually install:
|
||||
```vim
|
||||
:TSInstall dart python svelte typescript tsx javascript css html json
|
||||
```
|
||||
|
||||
Check status:
|
||||
```vim
|
||||
:TSInstallInfo
|
||||
```
|
||||
|
||||
### 5. Test Each Profile
|
||||
|
||||
#### Test Flutter Profile
|
||||
```bash
|
||||
nvim test.dart
|
||||
```
|
||||
|
||||
Inside Neovim:
|
||||
- Type some Dart code (e.g., `void main() {`)
|
||||
- Check LSP is active: `:LspInfo`
|
||||
- Try hot reload keymaps if in a Flutter project: `<leader>fr`
|
||||
|
||||
#### Test Python Profile
|
||||
```bash
|
||||
nvim test.py
|
||||
```
|
||||
|
||||
Inside Neovim:
|
||||
- Type some Python code (e.g., `def hello():`)
|
||||
- Check LSP is active: `:LspInfo`
|
||||
- Save file to trigger auto-formatting
|
||||
- Try hover: `K` on a function/variable
|
||||
|
||||
#### Test Svelte Profile
|
||||
```bash
|
||||
nvim test.svelte
|
||||
```
|
||||
|
||||
Inside Neovim:
|
||||
- Type Svelte component code
|
||||
- Check LSP is active: `:LspInfo`
|
||||
- Try Emmet: type `div.container>ul>li*3` then `<C-e>,`
|
||||
- Save file to trigger prettier formatting
|
||||
|
||||
## 🔧 Configuration Details
|
||||
|
||||
### Node.js for Copilot
|
||||
Node.js is configured via fnm (Fast Node Manager):
|
||||
- **Path**: `~/.local/share/fnm/aliases/default/bin`
|
||||
- **Version**: Currently v24.11.0 LTS
|
||||
- **Auto-update**: Using fnm aliases, so updating Node.js via `fnm install --lts` will automatically work
|
||||
|
||||
To update Node.js:
|
||||
```bash
|
||||
fnm install --lts
|
||||
fnm default lts-latest
|
||||
```
|
||||
|
||||
### Shared LSP Capabilities
|
||||
All language-specific LSPs use shared capabilities from `blink.cmp` for consistent completion behavior. This is configured automatically.
|
||||
|
||||
### Format on Save
|
||||
Enabled by default for all languages except C/C++. Language-specific formatters are defined in their respective profile files.
|
||||
|
||||
To disable for a specific file type, edit `init.lua`:
|
||||
```lua
|
||||
local disable_filetypes = { c = true, cpp = true, python = true } -- example
|
||||
```
|
||||
|
||||
## 📝 Customization
|
||||
|
||||
### Adding a New Language Profile
|
||||
|
||||
1. Create `lua/custom/plugins/mylang.lua`:
|
||||
```lua
|
||||
return {
|
||||
{
|
||||
'neovim/nvim-lspconfig',
|
||||
ft = { 'mylang' }, -- file type trigger
|
||||
config = function()
|
||||
local capabilities = require('blink.cmp').get_lsp_capabilities()
|
||||
require('lspconfig').mylang_ls.setup {
|
||||
capabilities = capabilities,
|
||||
}
|
||||
end,
|
||||
},
|
||||
|
||||
{
|
||||
'stevearc/conform.nvim',
|
||||
ft = { 'mylang' },
|
||||
opts = {
|
||||
formatters_by_ft = {
|
||||
mylang = { 'my_formatter' },
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
'nvim-treesitter/nvim-treesitter',
|
||||
ft = { 'mylang' },
|
||||
opts = {
|
||||
ensure_installed = { 'mylang' },
|
||||
},
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
2. Restart Neovim and open a `.mylang` file
|
||||
|
||||
### Enabling Neo-tree
|
||||
The file tree is currently commented out. To enable:
|
||||
|
||||
Edit `lua/custom/plugins/init.lua` and uncomment the Neo-tree section:
|
||||
```lua
|
||||
return {
|
||||
{
|
||||
'nvim-neo-tree/neo-tree.nvim',
|
||||
-- ... (uncomment the entire block)
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
Then `:Lazy sync` and use `<leader>e` to toggle the file tree.
|
||||
|
||||
### Changing Keymaps
|
||||
Edit the respective language file in `lua/custom/plugins/`.
|
||||
|
||||
Example: Change Flutter hot reload from `<leader>fr` to `<leader>h`:
|
||||
```lua
|
||||
-- In lua/custom/plugins/flutter.lua
|
||||
vim.keymap.set('n', '<leader>h', '<cmd>FlutterRun<cr>', { desc = '[H]ot reload' })
|
||||
```
|
||||
|
||||
## 🐛 Troubleshooting
|
||||
|
||||
### Plugins not loading
|
||||
```vim
|
||||
:Lazy check
|
||||
:Lazy sync
|
||||
```
|
||||
|
||||
### LSP not working
|
||||
```vim
|
||||
:LspInfo " Check if LSP is attached
|
||||
:Mason " Verify servers are installed
|
||||
:checkhealth lsp " Run LSP diagnostics
|
||||
```
|
||||
|
||||
### Copilot not working
|
||||
```vim
|
||||
:Copilot setup " Initial setup (if not done)
|
||||
:Copilot status " Check connection
|
||||
```
|
||||
|
||||
If Node.js path issues:
|
||||
```bash
|
||||
# Verify Node.js is in fnm default alias
|
||||
ls ~/.local/share/fnm/aliases/default/bin/node
|
||||
```
|
||||
|
||||
### Formatter not running on save
|
||||
Check if formatter is installed:
|
||||
```vim
|
||||
:Mason
|
||||
```
|
||||
|
||||
Check if file type has formatter configured:
|
||||
```vim
|
||||
:ConformInfo
|
||||
```
|
||||
|
||||
### Treesitter parsers missing
|
||||
```vim
|
||||
:TSInstall <parser_name>
|
||||
# Or install all at once:
|
||||
:TSInstall dart python svelte typescript tsx javascript css html json
|
||||
```
|
||||
|
||||
## 📚 Resources
|
||||
|
||||
- **Neovim LSP**: `:help lsp`
|
||||
- **lazy.nvim**: `:help lazy.nvim`
|
||||
- **Telescope**: `:help telescope.nvim`
|
||||
- **Treesitter**: `:help nvim-treesitter`
|
||||
- **conform.nvim**: `:help conform.nvim`
|
||||
- **Mason**: `:help mason.nvim`
|
||||
|
||||
## 🎉 What's Next?
|
||||
|
||||
Your setup is ready! Here are some next steps:
|
||||
|
||||
1. **Explore Copilot**: Try getting AI suggestions as you code
|
||||
2. **Learn Flutter Tools**: Use `<leader>fr` to run Flutter apps with hot reload
|
||||
3. **Try Emmet**: Speed up HTML/Svelte writing with abbreviations
|
||||
4. **Customize**: Add more keymaps, plugins, or language profiles as needed
|
||||
5. **Consider Neo-tree**: Uncomment if you prefer a file explorer sidebar
|
||||
|
||||
Enjoy your VS Code-like Neovim setup! 🚀
|
||||
128
archive/TESTING.md
Normal file
128
archive/TESTING.md
Normal file
|
|
@ -0,0 +1,128 @@
|
|||
# Profile Testing Instructions
|
||||
|
||||
## How to Test Each Profile
|
||||
|
||||
### 1. Flutter Profile (test.dart)
|
||||
```bash
|
||||
nvim test.dart
|
||||
```
|
||||
|
||||
**What to check:**
|
||||
- [ ] LSP loads automatically (check with `:LspInfo`)
|
||||
- [ ] You see dartls in the LSP list
|
||||
- [ ] Hover over `StatelessWidget` and press `K` - should show documentation
|
||||
- [ ] Try completion: type `Theme.of(` and see suggestions
|
||||
- [ ] Check Flutter keymaps work:
|
||||
- Press `<leader>` (space by default) and wait - should see Flutter commands
|
||||
- Try `<leader>fl` to restart LSP
|
||||
- [ ] Widget guides should show (vertical lines for nested widgets)
|
||||
- [ ] Closing tags should appear (e.g., `// MyApp` after closing brace)
|
||||
|
||||
### 2. Python Profile (test.py)
|
||||
```bash
|
||||
nvim test.py
|
||||
```
|
||||
|
||||
**What to check:**
|
||||
- [ ] LSP loads automatically (check with `:LspInfo`)
|
||||
- [ ] You see pyright in the LSP list
|
||||
- [ ] Hover over `calculate_fibonacci` and press `K` - should show type info
|
||||
- [ ] Try completion: type `fib.` and see list methods
|
||||
- [ ] **Test formatting on save:**
|
||||
1. Add some messy code: `x=1+2+3+4+5`
|
||||
2. Save the file (`:w`)
|
||||
3. Should auto-format to: `x = 1 + 2 + 3 + 4 + 5`
|
||||
- [ ] Add an unused import at the top: `import os`
|
||||
- Save the file - ruff should remove it or flag it
|
||||
- [ ] Lint errors should appear (the f-string and unused sys import)
|
||||
|
||||
### 3. Svelte Profile (test.svelte)
|
||||
```bash
|
||||
nvim test.svelte
|
||||
```
|
||||
|
||||
**What to check:**
|
||||
- [ ] LSP loads automatically (check with `:LspInfo`)
|
||||
- [ ] You should see svelte-language-server
|
||||
- [ ] Syntax highlighting works (script, template, style sections)
|
||||
- [ ] **Test Emmet expansion:**
|
||||
1. In the `<main>` section, type: `div.test>ul>li*3`
|
||||
2. Press `<C-e>,` (Ctrl+e then comma)
|
||||
3. Should expand to nested div/ul/li structure
|
||||
- [ ] **Test formatting on save:**
|
||||
1. Mess up some HTML: `<button class="btn" on:click={increment}>Text</button>`
|
||||
2. Save the file (`:w`)
|
||||
3. Should auto-format with prettier
|
||||
- [ ] Try completion on Tailwind classes: type `class="bg-` and see suggestions
|
||||
|
||||
### 4. Test Lazy Loading
|
||||
```bash
|
||||
nvim test.lua # or init.lua
|
||||
```
|
||||
|
||||
**What to check:**
|
||||
- [ ] Open a Lua file
|
||||
- [ ] Check `:LspInfo` - should only see lua_ls, NOT dartls, pyright, or svelte
|
||||
- [ ] Check `:Lazy` - Flutter, Python, Svelte plugins should be "not loaded"
|
||||
- [ ] Now open test.py in a split: `:split test.py`
|
||||
- [ ] Check `:Lazy` again - Python plugins should now be "loaded"
|
||||
|
||||
### 5. Verify Mason Tools
|
||||
```bash
|
||||
nvim
|
||||
```
|
||||
Then run `:Mason`
|
||||
|
||||
**Tools that should be installed:**
|
||||
- [x] lua-language-server (lua_ls)
|
||||
- [x] stylua
|
||||
- [ ] dart-language-server (dartls) # For Flutter
|
||||
- [ ] pyright # For Python
|
||||
- [ ] ruff # For Python
|
||||
- [ ] svelte-language-server
|
||||
- [ ] typescript-language-server (tsserver/ts_ls)
|
||||
- [ ] tailwindcss-language-server
|
||||
- [ ] prettier
|
||||
|
||||
**If any are missing:**
|
||||
1. Highlight the missing tool in Mason
|
||||
2. Press `i` to install
|
||||
3. Or wait - mason-tool-installer should install them automatically
|
||||
|
||||
## Common Issues
|
||||
|
||||
### LSP not loading
|
||||
```vim
|
||||
:checkhealth lsp
|
||||
:LspLog " Check for errors
|
||||
```
|
||||
|
||||
### Formatter not working
|
||||
```vim
|
||||
:ConformInfo " Check formatter config
|
||||
:Mason " Verify formatter is installed
|
||||
```
|
||||
|
||||
### Plugins not loading
|
||||
```vim
|
||||
:Lazy check " Check plugin status
|
||||
:Lazy sync " Re-sync plugins
|
||||
```
|
||||
|
||||
### Node.js issues with Copilot
|
||||
```vim
|
||||
:echo $PATH " Should include fnm path
|
||||
```
|
||||
|
||||
## Success Criteria
|
||||
|
||||
✅ All three language profiles should:
|
||||
1. Load their respective LSP automatically on file open
|
||||
2. Provide completions and hover info
|
||||
3. Auto-format on save
|
||||
4. NOT load when opening other file types (lazy loading works)
|
||||
|
||||
✅ Common plugins:
|
||||
1. Copilot should work in all file types (`:Copilot status`)
|
||||
2. Telescope should work (`:Telescope find_files`)
|
||||
3. Which-key should show keymaps when pressing `<leader>`
|
||||
Loading…
Add table
Add a link
Reference in a new issue