migration complete
This commit is contained in:
parent
c0c1148fde
commit
88d84fee4c
422
README.md
422
README.md
|
|
@ -1,241 +1,263 @@
|
|||
# kickstart.nvim
|
||||
# 🚀 Kickstart.nvim - Professional Edition
|
||||
|
||||
## Introduction
|
||||
> A powerful, modular Neovim configuration built on kickstart.nvim, enhanced with LazyVim-style organization and comprehensive language support.
|
||||
|
||||
A starting point for Neovim that is:
|
||||
[](https://neovim.io/)
|
||||
[](https://www.lua.org/)
|
||||
[](./LICENSE.md)
|
||||
|
||||
* Small
|
||||
* Single-file
|
||||
* Completely Documented
|
||||
---
|
||||
|
||||
**NOT** a Neovim distribution, but instead a starting point for your configuration.
|
||||
## ✨ Features
|
||||
|
||||
## Installation
|
||||
### 🎨 **LazyVim-Style Interface**
|
||||
- Beautiful which-key menu with icons and intuitive groupings
|
||||
- Consistent keybindings across all plugins (Telescope, Neo-tree, etc.)
|
||||
- Comprehensive searchable cheatsheet with 200+ keymaps (`<Leader>sc`)
|
||||
|
||||
### Install Neovim
|
||||
### 🛠️ **Language Support**
|
||||
- **Flutter/Dart**: Full Flutter tools integration with device management
|
||||
- **Rust**: rust-analyzer + Crates.io integration for dependency management
|
||||
- **Python**: Pyright LSP with virtual environment support
|
||||
- **Svelte**: Complete web development setup
|
||||
- **Go, TypeScript, Lua**: Pre-configured LSP servers
|
||||
|
||||
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.
|
||||
### 🔍 **Advanced Tooling**
|
||||
- **Telescope**: Fuzzy finder for files, git, LSP, and more
|
||||
- **Neo-tree**: File explorer with git integration
|
||||
- **nvim-dap**: Full debugging support for all languages
|
||||
- **Gitsigns**: Git integration with blame, hunk navigation, and staging
|
||||
- **Mini.nvim**: Surround, autopairs, comments, and more
|
||||
|
||||
### Install External Dependencies
|
||||
### 📚 **Comprehensive Documentation**
|
||||
- In-editor cheatsheet accessible anytime
|
||||
- Progressive learning path from basics to advanced
|
||||
- Vim mastery tips to build your skills over time
|
||||
|
||||
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
|
||||
## 📋 Requirements
|
||||
|
||||
### Install Kickstart
|
||||
### Core Dependencies
|
||||
- **Neovim** 0.11.4+ (stable or nightly)
|
||||
- **Git** for plugin management
|
||||
- **C Compiler** (gcc/clang) for TreeSitter
|
||||
- **Make** and **unzip**
|
||||
|
||||
> [!NOTE]
|
||||
> [Backup](#FAQ) your previous configuration (if any exists)
|
||||
### Recommended Tools
|
||||
- **ripgrep** - Fast file searching (required for Telescope)
|
||||
- **fd** - Fast file finding
|
||||
- **Nerd Font** - Icons support (set `vim.g.have_nerd_font = true`)
|
||||
- **Clipboard tool** - xclip (Linux), pbcopy (macOS), win32yank (Windows)
|
||||
|
||||
Neovim's configurations are located under the following paths, depending on your OS:
|
||||
### Language-Specific
|
||||
- **Node.js** & **npm** - TypeScript, Svelte, web development
|
||||
- **Python 3** - Python development
|
||||
- **Rust** & **Cargo** - Rust development
|
||||
- **Flutter SDK** - Flutter/Dart development
|
||||
- **Go** - Go development
|
||||
|
||||
| OS | PATH |
|
||||
| :- | :--- |
|
||||
| Linux, MacOS | `$XDG_CONFIG_HOME/nvim`, `~/.config/nvim` |
|
||||
| Windows (cmd)| `%localappdata%\nvim\` |
|
||||
| Windows (powershell)| `$env:LOCALAPPDATA\nvim\` |
|
||||
---
|
||||
|
||||
#### Recommended Step
|
||||
## 🚀 Quick Start
|
||||
|
||||
[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
|
||||
### 1. Backup Existing Config
|
||||
```bash
|
||||
# macOS/Linux
|
||||
mv ~/.config/nvim ~/.config/nvim.backup
|
||||
mv ~/.local/share/nvim ~/.local/share/nvim.backup
|
||||
mv ~/.local/state/nvim ~/.local/state/nvim.backup
|
||||
mv ~/.cache/nvim ~/.cache/nvim.backup
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
<details><summary> Windows </summary>
|
||||
|
||||
If you're using `cmd.exe`:
|
||||
|
||||
```
|
||||
git clone https://github.com/nvim-lua/kickstart.nvim.git "%localappdata%\nvim"
|
||||
### 2. Clone This Configuration
|
||||
```bash
|
||||
git clone https://github.com/anupjsebastian/kickstart.nvim.git ~/.config/nvim
|
||||
cd ~/.config/nvim
|
||||
```
|
||||
|
||||
If you're using `powershell.exe`
|
||||
### 3. Install Dependencies
|
||||
```bash
|
||||
# macOS (using Homebrew)
|
||||
brew install neovim ripgrep fd
|
||||
|
||||
```
|
||||
git clone https://github.com/nvim-lua/kickstart.nvim.git "${env:LOCALAPPDATA}\nvim"
|
||||
# Ubuntu/Debian
|
||||
sudo apt install neovim ripgrep fd-find
|
||||
|
||||
# Arch Linux
|
||||
sudo pacman -S neovim ripgrep fd
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
### Post Installation
|
||||
|
||||
Start Neovim
|
||||
|
||||
```sh
|
||||
### 4. Launch Neovim
|
||||
```bash
|
||||
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.
|
||||
On first launch:
|
||||
- Lazy.nvim will automatically install all plugins
|
||||
- TreeSitter will compile language parsers
|
||||
- LSP servers will be installed via Mason
|
||||
- Wait for all installations to complete (check bottom right)
|
||||
|
||||
#### 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
|
||||
### 5. Verify Installation
|
||||
```vim
|
||||
:checkhealth
|
||||
```
|
||||
|
||||
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>
|
||||
---
|
||||
|
||||
## 📖 Documentation
|
||||
|
||||
### Essential Reading
|
||||
- **[Getting Started](docs/getting-started/README.md)** - First-time setup and orientation
|
||||
- **[Installation Guide](docs/getting-started/installation.md)** - Detailed installation steps
|
||||
- **[Quick Reference](docs/getting-started/quick-reference.md)** - Most common commands
|
||||
|
||||
### Core Guides
|
||||
- **[Keymaps Reference](docs/keymaps/README.md)** - Complete keymap documentation
|
||||
- [Core Keymaps](docs/keymaps/core.md) - Leader key organization
|
||||
- [LSP Keymaps](docs/keymaps/lsp.md) - Language Server Protocol commands
|
||||
- [Plugin Keymaps](docs/keymaps/plugins.md) - Telescope, Neo-tree, etc.
|
||||
- [Duplicates Guide](docs/keymaps/duplicates.md) - Understanding multiple keys for same action
|
||||
|
||||
- **[Plugins Guide](docs/plugins/README.md)** - Plugin documentation
|
||||
- [Core Plugins](docs/plugins/core.md) - Essential plugins (Telescope, Neo-tree, which-key)
|
||||
- [Editor Plugins](docs/plugins/editor.md) - Editing enhancements
|
||||
- [LSP & Completion](docs/plugins/lsp.md) - Language features
|
||||
- [Debug Adapter](docs/plugins/debug.md) - Debugging setup
|
||||
|
||||
- **[Language Setup](docs/languages/README.md)** - Language-specific configuration
|
||||
- [Flutter/Dart](docs/languages/flutter.md)
|
||||
- [Rust](docs/languages/rust.md)
|
||||
- [Python](docs/languages/python.md)
|
||||
- [Svelte](docs/languages/svelte.md)
|
||||
- [Other Languages](docs/languages/others.md)
|
||||
|
||||
### Advanced Topics
|
||||
- **[Vim Mastery](docs/vim-mastery/README.md)** - Progressive skill building
|
||||
- [Week 1: Motion Basics](docs/vim-mastery/week-01-motions.md)
|
||||
- [Week 2: Text Objects](docs/vim-mastery/week-02-text-objects.md)
|
||||
- [Week 3: Advanced Editing](docs/vim-mastery/week-03-advanced.md)
|
||||
- [Week 4: Macros & Registers](docs/vim-mastery/week-04-macros.md)
|
||||
- [Tips & Tricks](docs/vim-mastery/tips-and-tricks.md)
|
||||
- [Workflow Optimization](docs/vim-mastery/workflows.md)
|
||||
|
||||
- **[Customization](docs/customization.md)** - Making it your own
|
||||
- **[Troubleshooting](docs/troubleshooting.md)** - Common issues and solutions
|
||||
- **[FAQ](docs/faq.md)** - Frequently asked questions
|
||||
|
||||
---
|
||||
|
||||
## 🎯 Quick Access Cheatsheet
|
||||
|
||||
### In-Editor Help
|
||||
- `<Leader>sc` - Open comprehensive cheatsheet (searchable!)
|
||||
- `<Leader>sk` - Search all keymaps with Telescope
|
||||
- `<Leader>?` - Quick keymap search
|
||||
- `<Leader>sK` - Which-key command palette
|
||||
|
||||
### Essential Keymaps
|
||||
| Keymap | Action | Category |
|
||||
|--------|--------|----------|
|
||||
| `<Leader>sf` | Find files | Search |
|
||||
| `<Leader>sg` | Live grep | Search |
|
||||
| `<Leader>bb` | List buffers | Buffer |
|
||||
| `\` | Toggle Neo-tree | Files |
|
||||
| `<Leader>gg` | LazyGit | Git |
|
||||
| `<Leader>dc` or `F5` | Start debugging | Debug |
|
||||
| `K` | Hover documentation | LSP |
|
||||
| `gra` | Code actions | LSP |
|
||||
|
||||
> **Pro Tip**: Press `<Leader>` and wait - which-key will show you all available keymaps!
|
||||
|
||||
---
|
||||
|
||||
## 🏗️ Project Structure
|
||||
|
||||
```
|
||||
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
|
||||
~/.config/nvim/
|
||||
├── init.lua # Entry point
|
||||
├── lua/
|
||||
│ ├── config/
|
||||
│ │ ├── keymaps.lua # Global keymaps
|
||||
│ │ ├── lazy.lua # Plugin manager setup
|
||||
│ │ └── options.lua # Neovim options
|
||||
│ ├── plugins/
|
||||
│ │ ├── core/ # Essential plugins
|
||||
│ │ │ ├── editor.lua # Telescope, which-key
|
||||
│ │ │ ├── neo-tree.lua # File explorer
|
||||
│ │ │ ├── debug.lua # Debug adapter
|
||||
│ │ │ └── cheatsheet.lua # In-editor help
|
||||
│ │ └── lang/ # Language-specific
|
||||
│ │ ├── flutter.lua
|
||||
│ │ ├── rust.lua
|
||||
│ │ ├── python.lua
|
||||
│ │ └── svelte.lua
|
||||
│ └── kickstart/
|
||||
│ └── plugins/ # Additional plugins
|
||||
└── docs/ # Documentation
|
||||
├── getting-started/
|
||||
├── keymaps/
|
||||
├── plugins/
|
||||
├── languages/
|
||||
└── vim-mastery/
|
||||
```
|
||||
</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>
|
||||
## 🎨 Philosophy
|
||||
|
||||
```
|
||||
sudo apt update
|
||||
sudo apt install make gcc ripgrep unzip git xclip curl
|
||||
This configuration follows these principles:
|
||||
|
||||
# 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
|
||||
1. **Modular**: Each plugin in its own file, easy to enable/disable
|
||||
2. **Discoverable**: Comprehensive which-key menus and cheatsheet
|
||||
3. **Consistent**: Same keys work the same way across plugins
|
||||
4. **Progressive**: Learn at your own pace with structured guides
|
||||
5. **Documented**: Every keymap and feature explained
|
||||
6. **Extensible**: Easy to customize and add your own plugins
|
||||
|
||||
# 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>
|
||||
## 🤝 Contributing
|
||||
|
||||
<details><summary>Arch Install Steps</summary>
|
||||
Found a bug? Have a suggestion? Contributions are welcome!
|
||||
|
||||
```
|
||||
sudo pacman -S --noconfirm --needed gcc make git ripgrep fd unzip neovim
|
||||
```
|
||||
</details>
|
||||
1. Fork the repository
|
||||
2. Create a feature branch (`git checkout -b feature/amazing-feature`)
|
||||
3. Commit your changes (`git commit -m 'Add amazing feature'`)
|
||||
4. Push to the branch (`git push origin feature/amazing-feature`)
|
||||
5. Open a Pull Request
|
||||
|
||||
---
|
||||
|
||||
## 📝 License
|
||||
|
||||
This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details.
|
||||
|
||||
---
|
||||
|
||||
## 🙏 Acknowledgments
|
||||
|
||||
- **[kickstart.nvim](https://github.com/nvim-lua/kickstart.nvim)** - The foundation of this config
|
||||
- **[LazyVim](https://www.lazyvim.org/)** - Inspiration for keybinding organization
|
||||
- **[AstroVim](https://astronvim.com/)** - Cheatsheet inspiration
|
||||
- **Neovim Community** - Amazing plugins and support
|
||||
|
||||
---
|
||||
|
||||
## 📚 Learn More
|
||||
|
||||
- [Neovim Documentation](https://neovim.io/doc/)
|
||||
- [Lua Guide for Neovim](https://github.com/nanotee/nvim-lua-guide)
|
||||
- [Awesome Neovim Plugins](https://github.com/rockerBOO/awesome-neovim)
|
||||
- [This Configuration's Full Documentation](docs/README.md)
|
||||
|
||||
---
|
||||
|
||||
<div align="center">
|
||||
|
||||
**Built with ❤️ using Neovim**
|
||||
|
||||
[Get Started](docs/getting-started/README.md) • [Keymaps](docs/keymaps/README.md) • [Plugins](docs/plugins/README.md) • [Languages](docs/languages/README.md)
|
||||
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
@ -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.
|
||||
|
|
@ -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
|
||||
|
|
@ -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>
|
||||
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
================================================================================
|
||||
INTRODUCTION *kickstart.nvim*
|
||||
|
||||
Kickstart.nvim is a project to help you get started on your neovim journey.
|
||||
|
||||
*kickstart-is-not*
|
||||
It is not:
|
||||
- Complete framework for every plugin under the sun
|
||||
- Place to add every plugin that could ever be useful
|
||||
|
||||
*kickstart-is*
|
||||
It is:
|
||||
- Somewhere that has a good start for the most common "IDE" type features:
|
||||
- autocompletion
|
||||
- goto-definition
|
||||
- find references
|
||||
- fuzzy finding
|
||||
- and hinting at what more can be done :)
|
||||
- A place to _kickstart_ your journey.
|
||||
- You should fork this project and use/modify it so that it matches your
|
||||
style and preferences. If you don't want to do that, there are probably
|
||||
other projects that would fit much better for you (and that's great!)!
|
||||
|
||||
vim:tw=78:ts=8:ft=help:norl:
|
||||
3
doc/tags
3
doc/tags
|
|
@ -1,3 +0,0 @@
|
|||
kickstart-is kickstart.txt /*kickstart-is*
|
||||
kickstart-is-not kickstart.txt /*kickstart-is-not*
|
||||
kickstart.nvim kickstart.txt /*kickstart.nvim*
|
||||
|
|
@ -0,0 +1,316 @@
|
|||
# 📋 Documentation Plan & Status
|
||||
|
||||
## ✅ Completed
|
||||
|
||||
### 1. Changed <Space> to <Leader> in Cheatsheet
|
||||
- Updated `lua/plugins/core/cheatsheet.lua`
|
||||
- All 105 instances of `<Space>` changed to `<Leader>`
|
||||
- Ensures consistency with which-key display
|
||||
|
||||
### 2. Created New Professional README.md
|
||||
- Location: `README.new.md` (ready to replace README.md)
|
||||
- Features: Badges, features list, requirements, quick start
|
||||
- Links to comprehensive documentation structure
|
||||
- Professional appearance with emojis and formatting
|
||||
|
||||
### 3. Created Documentation Structure
|
||||
```
|
||||
docs/
|
||||
├── README.md # Main documentation index ✅
|
||||
├── getting-started/
|
||||
│ ├── README.md # Getting started overview ✅
|
||||
│ ├── installation.md # Detailed install steps (TODO)
|
||||
│ ├── first-steps.md # First hour tutorial (TODO)
|
||||
│ ├── quick-reference.md # Essential commands (TODO)
|
||||
│ └── philosophy.md # Design principles (TODO)
|
||||
├── keymaps/
|
||||
│ ├── README.md # Keymaps overview ✅
|
||||
│ ├── core.md # Leader key bindings (TODO)
|
||||
│ ├── lsp.md # LSP commands (TODO)
|
||||
│ ├── plugins.md # Plugin-specific (TODO)
|
||||
│ ├── debug.md # Debug keymaps (TODO)
|
||||
│ ├── consistency.md # Cross-plugin patterns ✅ (copied)
|
||||
│ └── duplicates.md # Duplicate keys guide ✅ (copied)
|
||||
├── plugins/
|
||||
│ ├── README.md # Plugins overview (TODO)
|
||||
│ ├── core.md # Telescope, Neo-tree, which-key (TODO)
|
||||
│ ├── editor.md # TreeSitter, mini.nvim, etc (TODO)
|
||||
│ ├── lsp.md # LSP & completion (TODO)
|
||||
│ ├── debug.md # nvim-dap (TODO)
|
||||
│ ├── git.md # Git integration (TODO)
|
||||
│ └── ui.md # UI enhancements (TODO)
|
||||
├── languages/
|
||||
│ ├── README.md # Languages overview (TODO)
|
||||
│ ├── flutter.md # Flutter/Dart guide (TODO)
|
||||
│ ├── rust.md # Rust guide (TODO)
|
||||
│ ├── python.md # Python guide (TODO)
|
||||
│ ├── svelte.md # Svelte guide (TODO)
|
||||
│ ├── typescript.md # TypeScript guide (TODO)
|
||||
│ ├── go.md # Go guide (TODO)
|
||||
│ └── others.md # Other languages (TODO)
|
||||
├── vim-mastery/
|
||||
│ ├── README.md # Vim mastery overview ✅
|
||||
│ ├── week-01-motions.md # Motion basics ✅
|
||||
│ ├── week-02-text-objects.md # Text objects (TODO)
|
||||
│ ├── week-03-advanced.md # Advanced editing (TODO)
|
||||
│ ├── week-04-macros.md # Macros & registers (TODO)
|
||||
│ ├── week-05-cmdline.md # Command line (TODO)
|
||||
│ ├── week-06-windows.md # Windows & tabs (TODO)
|
||||
│ ├── week-07-search.md # Search & replace (TODO)
|
||||
│ ├── week-08-marks.md # Marks & jumps (TODO)
|
||||
│ ├── tips-and-tricks.md # Productivity tips (TODO)
|
||||
│ ├── workflows.md # Real-world patterns (TODO)
|
||||
│ └── advanced.md # Advanced topics (TODO)
|
||||
├── customization.md # Customization guide (TODO)
|
||||
├── plugin-development.md # Plugin dev (TODO)
|
||||
├── performance.md # Performance tuning (TODO)
|
||||
├── troubleshooting.md # Troubleshooting (TODO)
|
||||
├── migration.md # Migration guide (TODO)
|
||||
└── faq.md # FAQ (TODO)
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 📝 Files to Remove/Consolidate
|
||||
|
||||
### Remove (Redundant)
|
||||
- `NEO-TREE-CHEATSHEET.md` - Incorporated into docs/keymaps/plugins.md
|
||||
- `ORGANIZATION.md` - Internal planning doc, not needed for users
|
||||
|
||||
### Move to Archive or Remove
|
||||
- `TESTING.md` - Move to docs/development/ or remove
|
||||
- `MIGRATION.md` - Move to docs/migration.md
|
||||
- `SETUP-GUIDE.md` - Consolidate into docs/getting-started/installation.md
|
||||
- `INSTALLATION.md` - Consolidate into docs/getting-started/installation.md
|
||||
|
||||
### Keep but Update
|
||||
- `LICENSE.md` - Keep at root
|
||||
- `README.md` - Replace with README.new.md
|
||||
- `lazy-lock.json` - Keep (Lazy.nvim uses this)
|
||||
|
||||
---
|
||||
|
||||
## 🎯 Next Steps (Priority Order)
|
||||
|
||||
### Phase 1: Core Documentation (High Priority)
|
||||
1. **Replace README.md** with README.new.md
|
||||
2. **Complete getting-started/**
|
||||
- installation.md (consolidate INSTALLATION.md + SETUP-GUIDE.md)
|
||||
- first-steps.md (interactive tutorial)
|
||||
- quick-reference.md (one-page cheat sheet)
|
||||
- philosophy.md (design decisions)
|
||||
|
||||
3. **Complete keymaps/core.md**
|
||||
- Consolidate KEYMAPS.md
|
||||
- Organize by category
|
||||
- Add examples
|
||||
|
||||
4. **Complete keymaps/lsp.md** and **keymaps/plugins.md**
|
||||
- Document all LSP keymaps
|
||||
- Document Telescope, Neo-tree, Git, etc.
|
||||
|
||||
### Phase 2: Plugin Documentation (Medium Priority)
|
||||
5. **Create plugins/core.md**
|
||||
- Telescope deep dive
|
||||
- Neo-tree features
|
||||
- which-key customization
|
||||
|
||||
6. **Create plugins/lsp.md** and **plugins/debug.md**
|
||||
- LSP configuration
|
||||
- Mason setup
|
||||
- Debug adapter setup
|
||||
|
||||
### Phase 3: Language Guides (Medium Priority)
|
||||
7. **Create language guides**
|
||||
- flutter.md (full Flutter tools guide)
|
||||
- rust.md (Crates.io integration)
|
||||
- python.md (virtual envs, testing)
|
||||
- Others as needed
|
||||
|
||||
### Phase 4: Vim Mastery (Ongoing)
|
||||
8. **Complete Vim mastery weeks 2-8**
|
||||
- week-02-text-objects.md
|
||||
- week-03-advanced.md
|
||||
- week-04-macros.md
|
||||
- week-05-cmdline.md
|
||||
- week-06-windows.md
|
||||
- week-07-search.md
|
||||
- week-08-marks.md
|
||||
|
||||
9. **Create supplementary guides**
|
||||
- tips-and-tricks.md
|
||||
- workflows.md
|
||||
- advanced.md
|
||||
|
||||
### Phase 5: Advanced Topics (Low Priority)
|
||||
10. **Create advanced guides**
|
||||
- customization.md
|
||||
- plugin-development.md
|
||||
- performance.md
|
||||
- troubleshooting.md
|
||||
- faq.md
|
||||
|
||||
---
|
||||
|
||||
## 🎨 Documentation Style Guide
|
||||
|
||||
### Writing Principles
|
||||
1. **Clear and Concise**: Get to the point quickly
|
||||
2. **Example-Driven**: Show, don't just tell
|
||||
3. **Progressive Disclosure**: Basic → Intermediate → Advanced
|
||||
4. **Actionable**: Every guide includes exercises
|
||||
5. **Searchable**: Good headers, keywords, cross-references
|
||||
|
||||
### Formatting Standards
|
||||
- **Emojis for visual hierarchy**: 🎯 🔥 💡 ⚠️ 📚
|
||||
- **Code blocks with language**: ```vim, ```lua, ```bash
|
||||
- **Tables for comparisons**: Keymap tables, feature matrices
|
||||
- **Callouts**: Tips, Warnings, Notes
|
||||
- **Navigation**: Links at top and bottom of every page
|
||||
|
||||
### File Naming
|
||||
- Use kebab-case: `week-01-motions.md`
|
||||
- Be descriptive: `lsp-configuration.md` not `lsp.md`
|
||||
- Group by prefix: `week-01-`, `week-02-`, etc.
|
||||
|
||||
---
|
||||
|
||||
## 📊 Estimated Completion Times
|
||||
|
||||
### Already Done (4 hours)
|
||||
- ✅ Cheatsheet <Space> → <Leader>
|
||||
- ✅ README.new.md
|
||||
- ✅ docs/README.md
|
||||
- ✅ docs/getting-started/README.md
|
||||
- ✅ docs/keymaps/README.md
|
||||
- ✅ docs/vim-mastery/README.md
|
||||
- ✅ docs/vim-mastery/week-01-motions.md
|
||||
- ✅ Copied consistency.md and duplicates.md
|
||||
|
||||
### Phase 1 (8 hours)
|
||||
- getting-started/ guides (4 hours)
|
||||
- keymaps/core.md (2 hours)
|
||||
- keymaps/lsp.md (1 hour)
|
||||
- keymaps/plugins.md (1 hour)
|
||||
|
||||
### Phase 2 (6 hours)
|
||||
- plugins/ guides (6 hours total)
|
||||
|
||||
### Phase 3 (8 hours)
|
||||
- language guides (8 hours total)
|
||||
|
||||
### Phase 4 (12 hours)
|
||||
- Vim mastery weeks 2-8 (9 hours)
|
||||
- tips/workflows/advanced (3 hours)
|
||||
|
||||
### Phase 5 (6 hours)
|
||||
- Advanced topics (6 hours)
|
||||
|
||||
**Total Estimated**: ~44 hours of documentation writing
|
||||
|
||||
---
|
||||
|
||||
## 🎯 Immediate Action Items
|
||||
|
||||
### Right Now
|
||||
1. **Backup old README.md**
|
||||
```bash
|
||||
mv README.md README.old.md
|
||||
mv README.new.md README.md
|
||||
```
|
||||
|
||||
2. **Remove redundant files**
|
||||
```bash
|
||||
rm NEO-TREE-CHEATSHEET.md
|
||||
rm ORGANIZATION.md
|
||||
```
|
||||
|
||||
3. **Clean up root directory**
|
||||
```bash
|
||||
mkdir archive
|
||||
mv KEYMAPS.md archive/
|
||||
mv CONSISTENCY.md archive/ # Now in docs/keymaps/
|
||||
mv DUPLICATES.md archive/ # Now in docs/keymaps/
|
||||
```
|
||||
|
||||
### Next Session
|
||||
4. **Write getting-started/installation.md**
|
||||
- Consolidate INSTALLATION.md and SETUP-GUIDE.md
|
||||
- Add macOS, Linux, Windows sections
|
||||
- Include troubleshooting
|
||||
|
||||
5. **Write getting-started/first-steps.md**
|
||||
- Interactive 30-minute tutorial
|
||||
- Essential keymaps only
|
||||
- Real code examples
|
||||
|
||||
6. **Write getting-started/quick-reference.md**
|
||||
- One-page PDF-printable guide
|
||||
- 50 most-used commands
|
||||
- Organized by category
|
||||
|
||||
---
|
||||
|
||||
## 💡 Content Sources
|
||||
|
||||
### From Existing Files
|
||||
- KEYMAPS.md → docs/keymaps/core.md
|
||||
- CONSISTENCY.md → docs/keymaps/consistency.md ✅
|
||||
- DUPLICATES.md → docs/keymaps/duplicates.md ✅
|
||||
- INSTALLATION.md + SETUP-GUIDE.md → docs/getting-started/installation.md
|
||||
- lua/ plugin files → docs/plugins/ and docs/languages/
|
||||
|
||||
### From Configuration
|
||||
- lua/config/keymaps.lua → keymap docs
|
||||
- lua/plugins/ → plugin guides
|
||||
- lua/plugins/lang/ → language guides
|
||||
- Comments in code → feature documentation
|
||||
|
||||
### Original Content Needed
|
||||
- Vim mastery guides (weeks 2-8)
|
||||
- Tips and tricks
|
||||
- Workflows
|
||||
- Troubleshooting
|
||||
- FAQ
|
||||
- Customization guide
|
||||
|
||||
---
|
||||
|
||||
## 🔄 Maintenance Plan
|
||||
|
||||
### Weekly
|
||||
- Update any changed keymaps
|
||||
- Add new plugin documentation
|
||||
- Review and improve based on feedback
|
||||
|
||||
### Monthly
|
||||
- Check all links still work
|
||||
- Update screenshots if needed
|
||||
- Add new tips discovered
|
||||
|
||||
### Per Release
|
||||
- Update version numbers
|
||||
- Document new features
|
||||
- Archive old migration guides
|
||||
|
||||
---
|
||||
|
||||
## 🎊 Success Criteria
|
||||
|
||||
Documentation is complete when:
|
||||
- ✅ New users can install and be productive in 1 hour
|
||||
- ✅ All keymaps are documented with examples
|
||||
- ✅ All plugins have usage guides
|
||||
- ✅ Complete Vim mastery path (8 weeks)
|
||||
- ✅ Troubleshooting covers common issues
|
||||
- ✅ Users say "I found it in the docs" instead of asking
|
||||
|
||||
---
|
||||
|
||||
<div align="center">
|
||||
|
||||
**Documentation is a journey, not a destination!**
|
||||
|
||||
This plan provides the structure. Now we execute, one file at a time.
|
||||
|
||||
</div>
|
||||
|
|
@ -0,0 +1,256 @@
|
|||
# 📚 Complete Documentation Guide
|
||||
|
||||
Welcome to the comprehensive documentation for this Neovim configuration. This guide is organized to help you progress from beginner to advanced user.
|
||||
|
||||
---
|
||||
|
||||
## 🗺️ Documentation Structure
|
||||
|
||||
### 🚀 Getting Started
|
||||
**Start here if you're new or just installed the config**
|
||||
|
||||
- [**Installation**](getting-started/installation.md) - Step-by-step setup guide
|
||||
- [**First Steps**](getting-started/first-steps.md) - Your first hour with this config
|
||||
- [**Quick Reference**](getting-started/quick-reference.md) - Essential commands cheat sheet
|
||||
- [**Philosophy**](getting-started/philosophy.md) - Design principles and organization
|
||||
|
||||
### ⌨️ Keymaps
|
||||
**Complete keymap documentation with examples**
|
||||
|
||||
- [**Overview**](keymaps/README.md) - Keymap organization philosophy
|
||||
- [**Core Keymaps**](keymaps/core.md) - Leader key bindings (buffer, window, search, etc.)
|
||||
- [**LSP Keymaps**](keymaps/lsp.md) - Language Server Protocol commands
|
||||
- [**Plugin Keymaps**](keymaps/plugins.md) - Telescope, Neo-tree, Git, etc.
|
||||
- [**Debug Keymaps**](keymaps/debug.md) - Debugging commands
|
||||
- [**Duplicates Guide**](keymaps/duplicates.md) - Understanding multiple keys for same action
|
||||
- [**Consistency Guide**](keymaps/consistency.md) - Cross-plugin key patterns
|
||||
|
||||
### 🔌 Plugins
|
||||
**Understanding each plugin and how to use it**
|
||||
|
||||
- [**Overview**](plugins/README.md) - All plugins explained
|
||||
- [**Core Plugins**](plugins/core.md) - Telescope, Neo-tree, which-key, lazy.nvim
|
||||
- [**Editor Plugins**](plugins/editor.md) - TreeSitter, mini.nvim, autopairs, etc.
|
||||
- [**LSP & Completion**](plugins/lsp.md) - Language servers, nvim-cmp, snippets
|
||||
- [**Debug Adapter**](plugins/debug.md) - nvim-dap setup and usage
|
||||
- [**Git Integration**](plugins/git.md) - Gitsigns, LazyGit, fugitive
|
||||
- [**UI Enhancements**](plugins/ui.md) - Colorscheme, statusline, bufferline
|
||||
|
||||
### 💻 Language Setup
|
||||
**Language-specific configuration and features**
|
||||
|
||||
- [**Overview**](languages/README.md) - All supported languages
|
||||
- [**Flutter/Dart**](languages/flutter-dart.md) - Flutter tools, device management, hot reload
|
||||
- [**Rust**](languages/rust.md) - rust-analyzer, Crates.io integration
|
||||
- [**Python**](languages/python.md) - Pyright, virtual environments, testing
|
||||
- [**Svelte**](languages/svelte.md) - Svelte LSP, web development
|
||||
- [**TypeScript/JavaScript**](languages/typescript.md) - tsserver, ESLint, Prettier
|
||||
- [**Go**](languages/go.md) - gopls, testing, debugging
|
||||
- [**Other Languages**](languages/others.md) - Lua, JSON, YAML, Markdown, etc.
|
||||
|
||||
### 🎓 Vim Mastery
|
||||
**Progressive learning path to master Vim**
|
||||
|
||||
- [**Overview**](vim-mastery/README.md) - Learning philosophy and roadmap
|
||||
- [**Week 1: Motion Basics**](vim-mastery/week-01-motions.md) - hjkl, word motions, searching
|
||||
- [**Week 2: Text Objects**](vim-mastery/week-02-text-objects.md) - iw, ap, at, etc.
|
||||
- [**Week 3: Advanced Editing**](vim-mastery/week-03-advanced.md) - Visual mode, macros intro
|
||||
- [**Week 4: Macros & Registers**](vim-mastery/week-04-macros.md) - Recording and replay
|
||||
- [**Week 5: Command Line**](vim-mastery/week-05-cmdline.md) - Ex commands, ranges, substitution
|
||||
- [**Week 6: Windows & Tabs**](vim-mastery/week-06-windows.md) - Managing your workspace
|
||||
- [**Tips & Tricks**](vim-mastery/tips-and-tricks.md) - Productivity boosters
|
||||
- [**Workflows**](vim-mastery/workflows.md) - Real-world editing patterns
|
||||
- [**Advanced Topics**](vim-mastery/advanced.md) - Vim script, Lua, custom commands
|
||||
|
||||
### 🛠️ Advanced Topics
|
||||
|
||||
- [**Customization**](customization.md) - Make this config your own
|
||||
- [**Plugin Development**](plugin-development.md) - Create your own plugins
|
||||
- [**Performance Tuning**](performance.md) - Optimize startup time
|
||||
- [**Troubleshooting**](troubleshooting.md) - Common issues and solutions
|
||||
- [**Migration Guide**](migration.md) - Coming from other configs
|
||||
- [**FAQ**](faq.md) - Frequently asked questions
|
||||
|
||||
---
|
||||
|
||||
## 📖 How to Use This Documentation
|
||||
|
||||
### For Beginners
|
||||
1. Start with [Getting Started](getting-started/README.md)
|
||||
2. Learn [Quick Reference](getting-started/quick-reference.md) commands
|
||||
3. Follow [Vim Mastery Week 1](vim-mastery/week-01-motions.md)
|
||||
4. Use the [in-editor cheatsheet](#in-editor-help) constantly
|
||||
|
||||
### For Intermediate Users
|
||||
1. Review [Keymaps documentation](keymaps/README.md) to discover new commands
|
||||
2. Explore [Plugin guides](plugins/README.md) for advanced features
|
||||
3. Continue [Vim Mastery](vim-mastery/README.md) progression
|
||||
4. Learn language-specific features in [Languages](languages/README.md)
|
||||
|
||||
### For Advanced Users
|
||||
1. Study [Customization](customization.md) to extend the config
|
||||
2. Optimize with [Performance Tuning](performance.md)
|
||||
3. Master [Advanced Topics](vim-mastery/advanced.md)
|
||||
4. Contribute improvements back to the project
|
||||
|
||||
---
|
||||
|
||||
## 🎯 In-Editor Help
|
||||
|
||||
You don't need to leave Neovim to access help:
|
||||
|
||||
### Built-in Cheatsheet
|
||||
- `<Leader>sc` - Comprehensive searchable cheatsheet (200+ keymaps)
|
||||
- `<Leader>sk` - Telescope keymap search
|
||||
- `<Leader>?` - Quick keymap fuzzy search
|
||||
- `<Leader>sK` - Which-key command palette
|
||||
|
||||
### Context-Sensitive Help
|
||||
- `K` - Hover documentation (LSP)
|
||||
- `<Leader>k` - Signature help
|
||||
- `?` (in Telescope/Neo-tree) - Show plugin-specific help
|
||||
- `:help <topic>` - Vim's built-in help system
|
||||
|
||||
### Discovery Tools
|
||||
- Press `<Leader>` and wait - which-key shows all available keymaps
|
||||
- Press `g` and wait - see all "go to" commands
|
||||
- Press `]` or `[` and wait - see all next/previous commands
|
||||
|
||||
---
|
||||
|
||||
## 💡 Learning Philosophy
|
||||
|
||||
This documentation follows a **progressive disclosure** approach:
|
||||
|
||||
1. **Start Simple**: Basic commands to be productive immediately
|
||||
2. **Build Gradually**: Add one new technique per week
|
||||
3. **Practice Deliberately**: Focus on mastering before moving on
|
||||
4. **Apply Immediately**: Use new skills in real work
|
||||
5. **Iterate**: Return to earlier topics with new understanding
|
||||
|
||||
### The One-Trick-Per-Week Method
|
||||
|
||||
Instead of trying to learn everything at once:
|
||||
- Pick ONE new command/technique each week
|
||||
- Use it consciously until it becomes muscle memory
|
||||
- Track your progress in [Vim Mastery](vim-mastery/README.md)
|
||||
- After a year, you'll have 52 new tricks!
|
||||
|
||||
---
|
||||
|
||||
## 🗺️ Learning Paths
|
||||
|
||||
### Path 1: Productive in One Day
|
||||
*Goal: Get work done immediately*
|
||||
|
||||
1. [Installation](getting-started/installation.md) - 30 min
|
||||
2. [Quick Reference](getting-started/quick-reference.md) - 15 min
|
||||
3. [Core Keymaps](keymaps/core.md) - Learn `<Leader>sf`, `<Leader>sg`, `<Leader>bb`
|
||||
4. Start coding with LSP features (K, gra, gd)
|
||||
|
||||
### Path 2: Vim Proficiency in 6 Weeks
|
||||
*Goal: Become efficient with Vim motions*
|
||||
|
||||
1. Week 1: [Motion Basics](vim-mastery/week-01-motions.md)
|
||||
2. Week 2: [Text Objects](vim-mastery/week-02-text-objects.md)
|
||||
3. Week 3: [Advanced Editing](vim-mastery/week-03-advanced.md)
|
||||
4. Week 4: [Macros & Registers](vim-mastery/week-04-macros.md)
|
||||
5. Week 5: [Command Line](vim-mastery/week-05-cmdline.md)
|
||||
6. Week 6: [Windows & Tabs](vim-mastery/week-06-windows.md)
|
||||
|
||||
### Path 3: Master All Features
|
||||
*Goal: Unlock the full power of this config*
|
||||
|
||||
1. Complete Path 2 (Vim Proficiency)
|
||||
2. Deep dive into [All Plugins](plugins/README.md)
|
||||
3. Master your primary language setup
|
||||
4. Learn [Advanced Workflows](vim-mastery/workflows.md)
|
||||
5. Customize and extend ([Customization Guide](customization.md))
|
||||
|
||||
---
|
||||
|
||||
## 🎓 Recommended External Resources
|
||||
|
||||
### Books
|
||||
- **Practical Vim** by Drew Neil - The best Vim book
|
||||
- **Modern Vim** by Drew Neil - Neovim-specific features
|
||||
- **Learning the Vi and Vim Editors** - Comprehensive reference
|
||||
|
||||
### Video Courses
|
||||
- **ThePrimeagen's Vim Course** - Entertaining and informative
|
||||
- **Vim Casts** - Short, focused video tutorials
|
||||
- **TJ DeVries' Neovim YouTube** - Creator of kickstart.nvim
|
||||
|
||||
### Interactive Learning
|
||||
- **vimtutor** - Run `:Tutor` in Neovim
|
||||
- **Vim Adventures** - Game to learn Vim
|
||||
- **OpenVim** - Interactive tutorial
|
||||
|
||||
### Community
|
||||
- **r/neovim** - Reddit community
|
||||
- **Neovim Discourse** - Official forum
|
||||
- **Matrix/Discord** - Real-time chat
|
||||
|
||||
---
|
||||
|
||||
## 📝 Documentation Conventions
|
||||
|
||||
### Notation
|
||||
- `<Leader>` - Your leader key (default: Space)
|
||||
- `<C-x>` - Control + x
|
||||
- `<M-x>` - Alt/Meta + x
|
||||
- `<CR>` - Enter/Return key
|
||||
- `{motion}` - Any motion command (w, e, $, etc.)
|
||||
- `[count]` - Optional number prefix
|
||||
|
||||
### Visual Cues
|
||||
- 💡 **Tip** - Helpful suggestion
|
||||
- ⚠️ **Warning** - Important caution
|
||||
- 📌 **Note** - Additional information
|
||||
- 🎯 **Pro Tip** - Advanced technique
|
||||
- 🔍 **Example** - Practical demonstration
|
||||
|
||||
---
|
||||
|
||||
## 🔄 Keeping Documentation Updated
|
||||
|
||||
This documentation evolves with the configuration:
|
||||
|
||||
- **Check for updates**: `git pull` in `~/.config/nvim`
|
||||
- **Version**: Documentation matches config version
|
||||
- **Feedback**: Open issues for unclear docs
|
||||
- **Contribute**: Submit PRs for improvements
|
||||
|
||||
---
|
||||
|
||||
## 🎯 Quick Navigation
|
||||
|
||||
### By Topic
|
||||
- **Need to find a file?** → [Telescope Guide](plugins/core.md#telescope)
|
||||
- **Want to understand a keymap?** → [Keymaps Overview](keymaps/README.md)
|
||||
- **LSP not working?** → [Troubleshooting LSP](troubleshooting.md#lsp-issues)
|
||||
- **Adding a language?** → [Language Setup](languages/README.md)
|
||||
- **Config too slow?** → [Performance Tuning](performance.md)
|
||||
|
||||
### By Skill Level
|
||||
- **Beginner** → [Getting Started](getting-started/README.md)
|
||||
- **Intermediate** → [Vim Mastery](vim-mastery/README.md)
|
||||
- **Advanced** → [Customization](customization.md)
|
||||
|
||||
### By Plugin
|
||||
- [Telescope](plugins/core.md#telescope)
|
||||
- [Neo-tree](plugins/core.md#neo-tree)
|
||||
- [which-key](plugins/core.md#which-key)
|
||||
- [nvim-cmp](plugins/lsp.md#completion)
|
||||
- [nvim-dap](plugins/debug.md)
|
||||
- [Gitsigns](plugins/git.md)
|
||||
|
||||
---
|
||||
|
||||
<div align="center">
|
||||
|
||||
**Happy Coding! 🚀**
|
||||
|
||||
[Back to Main README](../README.md) | [Get Started →](getting-started/README.md)
|
||||
|
||||
</div>
|
||||
|
|
@ -0,0 +1,195 @@
|
|||
# 🚀 Getting Started
|
||||
|
||||
Welcome! This guide will help you get up and running with this Neovim configuration.
|
||||
|
||||
---
|
||||
|
||||
## 📚 Guide Structure
|
||||
|
||||
1. **[Installation](installation.md)** - Set up Neovim and this configuration
|
||||
2. **[First Steps](first-steps.md)** - Your first hour with the config
|
||||
3. **[Quick Reference](quick-reference.md)** - Essential commands you'll use daily
|
||||
4. **[Philosophy](philosophy.md)** - Understanding the design principles
|
||||
|
||||
---
|
||||
|
||||
## ⚡ Quick Start (5 Minutes)
|
||||
|
||||
### 1. Install Neovim 0.11.4+
|
||||
```bash
|
||||
# macOS
|
||||
brew install neovim
|
||||
|
||||
# Ubuntu/Debian
|
||||
sudo apt install neovim
|
||||
|
||||
# Arch Linux
|
||||
sudo pacman -S neovim
|
||||
```
|
||||
|
||||
### 2. Backup Old Config
|
||||
```bash
|
||||
mv ~/.config/nvim ~/.config/nvim.backup
|
||||
mv ~/.local/share/nvim ~/.local/share/nvim.backup
|
||||
```
|
||||
|
||||
### 3. Clone This Config
|
||||
```bash
|
||||
git clone https://github.com/anupjsebastian/kickstart.nvim.git ~/.config/nvim
|
||||
```
|
||||
|
||||
### 4. Install Dependencies
|
||||
```bash
|
||||
# macOS
|
||||
brew install ripgrep fd
|
||||
|
||||
# Ubuntu
|
||||
sudo apt install ripgrep fd-find
|
||||
|
||||
# Arch
|
||||
sudo pacman -S ripgrep fd
|
||||
```
|
||||
|
||||
### 5. Launch Neovim
|
||||
```bash
|
||||
nvim
|
||||
```
|
||||
|
||||
Wait for all plugins to install (watch bottom right corner).
|
||||
|
||||
### 6. Verify Everything Works
|
||||
```vim
|
||||
:checkhealth
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 🎯 What You'll Learn
|
||||
|
||||
### Immediate (Day 1)
|
||||
- Opening and editing files
|
||||
- Basic navigation with Telescope
|
||||
- Using LSP features (autocomplete, go to definition)
|
||||
- Essential keymaps you'll use every day
|
||||
|
||||
### Short Term (Week 1)
|
||||
- Vim motion basics
|
||||
- Using the file explorer (Neo-tree)
|
||||
- Git integration
|
||||
- Debugging basics
|
||||
|
||||
### Medium Term (Month 1)
|
||||
- Advanced Vim motions and text objects
|
||||
- Customizing keymaps
|
||||
- Language-specific features
|
||||
- Efficient workflows
|
||||
|
||||
### Long Term (Ongoing)
|
||||
- Mastering Vim commands
|
||||
- Building your own plugins
|
||||
- Optimizing your workflow
|
||||
- One new trick per week approach
|
||||
|
||||
---
|
||||
|
||||
## 🗺️ Learning Path
|
||||
|
||||
```
|
||||
Installation (15 min)
|
||||
↓
|
||||
First Steps (30 min) - Learn the absolute basics
|
||||
↓
|
||||
Quick Reference (ongoing) - Your daily command sheet
|
||||
↓
|
||||
Week 1: Basic Motions - hjkl, word motions, searching
|
||||
↓
|
||||
Week 2: Text Objects - iw, ap, it, edit intelligently
|
||||
↓
|
||||
Week 3: Advanced Editing - Visual mode, macros
|
||||
↓
|
||||
Continue with Vim Mastery guides...
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 💡 Key Concepts
|
||||
|
||||
### Leader Key = Space
|
||||
Almost all custom keymaps start with `<Leader>` (the Space key). Press Space and wait - you'll see a menu!
|
||||
|
||||
### Which-key is Your Friend
|
||||
When you press a key prefix (like `<Leader>` or `g`), a menu appears showing all available commands.
|
||||
|
||||
### Everything is Searchable
|
||||
- Files: `<Leader>sf`
|
||||
- Text: `<Leader>sg`
|
||||
- Keymaps: `<Leader>sc`
|
||||
- Help: `<Leader>sh`
|
||||
|
||||
### LSP Powers Your Editing
|
||||
- `K` - Documentation
|
||||
- `gd` - Go to definition
|
||||
- `gr` - Find references
|
||||
- `gra` - Code actions
|
||||
|
||||
---
|
||||
|
||||
## 🆘 Getting Help
|
||||
|
||||
### In-Editor
|
||||
- `<Leader>sc` - Comprehensive cheatsheet
|
||||
- `<Leader>sk` - Search all keymaps
|
||||
- `<Leader>` (wait) - Which-key menu
|
||||
- `:help <topic>` - Vim help
|
||||
|
||||
### External
|
||||
- [Full Documentation](../README.md)
|
||||
- [Troubleshooting Guide](../troubleshooting.md)
|
||||
- [FAQ](../faq.md)
|
||||
- [GitHub Issues](https://github.com/anupjsebastian/kickstart.nvim/issues)
|
||||
|
||||
---
|
||||
|
||||
## ⚠️ Common First-Day Issues
|
||||
|
||||
### Plugins Not Installing
|
||||
```vim
|
||||
:Lazy sync
|
||||
```
|
||||
|
||||
### LSP Not Working
|
||||
```vim
|
||||
:Mason
|
||||
:LspInfo
|
||||
:checkhealth
|
||||
```
|
||||
|
||||
### Fonts Look Broken
|
||||
Install a [Nerd Font](https://www.nerdfonts.com/) and set `vim.g.have_nerd_font = true` in `init.lua`.
|
||||
|
||||
### Keymaps Not Working
|
||||
Check your terminal doesn't intercept keys:
|
||||
```vim
|
||||
:checkhealth which-key
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 🎓 Next Steps
|
||||
|
||||
1. Complete [Installation Guide](installation.md)
|
||||
2. Follow [First Steps Tutorial](first-steps.md)
|
||||
3. Bookmark [Quick Reference](quick-reference.md)
|
||||
4. Start [Vim Mastery Week 1](../vim-mastery/week-01-motions.md)
|
||||
|
||||
---
|
||||
|
||||
<div align="center">
|
||||
|
||||
**Ready to dive in?**
|
||||
|
||||
[Installation Guide →](installation.md)
|
||||
|
||||
[Back to Documentation](../README.md) | [Back to Main README](../../README.md)
|
||||
|
||||
</div>
|
||||
|
|
@ -0,0 +1,226 @@
|
|||
# ⌨️ Keymaps Reference
|
||||
|
||||
Complete guide to all keymaps in this configuration, organized by category.
|
||||
|
||||
---
|
||||
|
||||
## 📋 Quick Navigation
|
||||
|
||||
- **[Core Keymaps](core.md)** - Leader-key organization (buffer, window, search, git, etc.)
|
||||
- **[LSP Keymaps](lsp.md)** - Language Server Protocol commands
|
||||
- **[Plugin Keymaps](plugins.md)** - Telescope, Neo-tree, Git, Debug
|
||||
- **[Duplicates Guide](duplicates.md)** - Understanding multiple keys for same action
|
||||
- **[Consistency Guide](consistency.md)** - Cross-plugin key patterns
|
||||
|
||||
---
|
||||
|
||||
## 🎯 Keymap Philosophy
|
||||
|
||||
### 1. Leader-Based Organization
|
||||
Almost all custom keymaps start with `<Leader>` (Space key):
|
||||
- `<Leader>b` - **Buffer** operations
|
||||
- `<Leader>s` - **Search** (Telescope)
|
||||
- `<Leader>f` - **Flutter** (Dart files)
|
||||
- `<Leader>r` - **Rust** operations
|
||||
- `<Leader>d` - **Debug** commands
|
||||
- `<Leader>g` - **Git** operations
|
||||
- And more...
|
||||
|
||||
### 2. Mnemonic Design
|
||||
Keys are chosen to be memorable:
|
||||
- `<Leader>sf` = **S**earch **F**iles
|
||||
- `<Leader>bb` = **B**uffer **B**rowse
|
||||
- `<Leader>gg` = Open Lazy**G**it
|
||||
- `<Leader>db` = **D**ebug **B**reakpoint
|
||||
|
||||
### 3. Which-key Discovery
|
||||
Press `<Leader>` and wait - a menu shows all available commands!
|
||||
|
||||
### 4. Consistent Across Plugins
|
||||
Same keys work the same way everywhere:
|
||||
- `Ctrl-x` = Horizontal split (Telescope, Neo-tree)
|
||||
- `Ctrl-v` = Vertical split (Telescope, Neo-tree)
|
||||
- `Ctrl-t` = New tab (Telescope, Neo-tree)
|
||||
- `?` = Show help (Telescope, Neo-tree)
|
||||
|
||||
---
|
||||
|
||||
## 🗺️ Keymap Categories
|
||||
|
||||
### Core Editor
|
||||
| Prefix | Category | Example |
|
||||
|--------|----------|---------|
|
||||
| `<Leader>b` | Buffer operations | `<Leader>bd` = Delete buffer |
|
||||
| `<Leader>w` | Window operations | `<Leader>wv` = Vertical split |
|
||||
| `<Leader>u` | UI toggles | `<Leader>uw` = Toggle wrap |
|
||||
| `<Leader>s` | Search/Telescope | `<Leader>sf` = Find files |
|
||||
| `<Leader>g` | Git operations | `<Leader>gg` = LazyGit |
|
||||
|
||||
### LSP (Language Features)
|
||||
| Prefix | Category | Example |
|
||||
|--------|----------|---------|
|
||||
| `gr*` | Go to... | `grd` = Go to definition |
|
||||
| `K` | Hover | `K` = Show documentation |
|
||||
| `<Leader>c` | Code | `<Leader>ca` = Code actions |
|
||||
|
||||
### Debug
|
||||
| Prefix | Category | Example |
|
||||
|--------|----------|---------|
|
||||
| `<Leader>d` | Debug commands | `<Leader>db` = Breakpoint |
|
||||
| `F5-F12` | Debug quick keys | `F5` = Continue |
|
||||
|
||||
### Language-Specific
|
||||
| Prefix | Language | Example |
|
||||
|--------|----------|---------|
|
||||
| `<Leader>f` | Flutter/Dart | `<Leader>fr` = Run app |
|
||||
| `<Leader>r` | Rust | `<Leader>ra` = Code actions |
|
||||
| `<Leader>rc` | Rust Crates | `<Leader>rct` = Toggle |
|
||||
| `<Leader>p` | Python | `<Leader>pr` = Run |
|
||||
| `<Leader>v` | Svelte | `<Leader>vf` = Format |
|
||||
|
||||
---
|
||||
|
||||
## 📚 Detailed Documentation
|
||||
|
||||
### [Core Keymaps](core.md)
|
||||
Complete reference for all leader-key bindings:
|
||||
- Buffer management
|
||||
- Window operations
|
||||
- Search/Telescope
|
||||
- Git integration
|
||||
- UI toggles
|
||||
- Session management
|
||||
|
||||
### [LSP Keymaps](lsp.md)
|
||||
Language Server Protocol commands that work in all languages:
|
||||
- Go to definition, references, implementation
|
||||
- Hover documentation
|
||||
- Rename symbol
|
||||
- Code actions
|
||||
- Signature help
|
||||
- Diagnostics navigation
|
||||
|
||||
### [Plugin Keymaps](plugins.md)
|
||||
Plugin-specific keymaps:
|
||||
- **Telescope**: Fuzzy finding, live grep, file browser
|
||||
- **Neo-tree**: File explorer navigation and operations
|
||||
- **Git**: Gitsigns hunks, staging, blame
|
||||
- **Debug**: nvim-dap debugging commands
|
||||
- **Mini.nvim**: Surround, comments, pairs
|
||||
|
||||
### [Duplicates Guide](duplicates.md)
|
||||
Understanding why some actions have multiple keymaps:
|
||||
- Vim defaults + modern alternatives
|
||||
- Function keys + leader keys for debugging
|
||||
- Single keys + Ctrl combos for consistency
|
||||
- Default plugin keys + consistent alternatives
|
||||
|
||||
### [Consistency Guide](consistency.md)
|
||||
Cross-plugin key patterns:
|
||||
- Same split/tab keys in Telescope and Neo-tree
|
||||
- Consistent navigation patterns
|
||||
- Unified help access
|
||||
|
||||
---
|
||||
|
||||
## 🎓 Learning Strategy
|
||||
|
||||
### Week 1: Essential Commands
|
||||
Focus on these 10 keymaps:
|
||||
1. `<Leader>sf` - Find files
|
||||
2. `<Leader>sg` - Search text (grep)
|
||||
3. `<Leader>bb` - Browse buffers
|
||||
4. `\` - Toggle file explorer
|
||||
5. `gd` - Go to definition
|
||||
6. `K` - Show documentation
|
||||
7. `<Leader>ca` - Code actions
|
||||
8. `<Leader>gg` - Git interface
|
||||
9. `<C-h/l>` - Switch windows
|
||||
10. `<Leader>sc` - Open cheatsheet!
|
||||
|
||||
### Week 2: Expand Your Arsenal
|
||||
Add these:
|
||||
- `<Leader>s/` - Search in open files
|
||||
- `<Leader>bd` - Delete buffer
|
||||
- `<Leader>wv` - Split vertical
|
||||
- `gr` - Find references
|
||||
- `[d` / `]d` - Next/prev diagnostic
|
||||
|
||||
### Ongoing: One Per Week
|
||||
Pick ONE new keymap each week from the [full documentation](core.md) and practice it until it's muscle memory.
|
||||
|
||||
---
|
||||
|
||||
## 🔍 Finding Keymaps
|
||||
|
||||
### In-Editor Tools
|
||||
```vim
|
||||
" Comprehensive searchable cheatsheet
|
||||
<Leader>sc
|
||||
|
||||
" Search all keymaps with Telescope
|
||||
<Leader>sk
|
||||
|
||||
" Which-key command palette
|
||||
<Leader>sK
|
||||
|
||||
" Quick fuzzy search
|
||||
<Leader>?
|
||||
|
||||
" Press any prefix and wait
|
||||
<Leader> " Shows all leader keymaps
|
||||
g " Shows all 'go to' commands
|
||||
[ " Shows all 'next' commands
|
||||
] " Shows all 'previous' commands
|
||||
```
|
||||
|
||||
### By Category
|
||||
- **Buffer commands**: `<Leader>b` (then wait for menu)
|
||||
- **Search commands**: `<Leader>s` (then wait)
|
||||
- **Git commands**: `<Leader>g` (then wait)
|
||||
- **Debug commands**: `<Leader>d` (then wait)
|
||||
|
||||
### By Plugin
|
||||
Inside a plugin (like Telescope or Neo-tree), press `?` for help.
|
||||
|
||||
---
|
||||
|
||||
## 💡 Tips
|
||||
|
||||
### Discovering Features
|
||||
1. Press `<Leader>` and wait - explore the which-key menu
|
||||
2. Open cheatsheet with `<Leader>sc` and search
|
||||
3. Check plugin-specific help with `?`
|
||||
|
||||
### Customizing Keymaps
|
||||
See [Customization Guide](../customization.md) to:
|
||||
- Change existing keymaps
|
||||
- Add your own keymaps
|
||||
- Disable unwanted keymaps
|
||||
|
||||
### Resolving Conflicts
|
||||
If a keymap doesn't work:
|
||||
```vim
|
||||
:verbose map <Leader>sf
|
||||
:checkhealth which-key
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 📖 External Resources
|
||||
|
||||
- [Vim Cheat Sheet](https://vim.rtorr.com/)
|
||||
- [Interactive Vim Tutorial](https://www.openvim.com/)
|
||||
- [Practical Vim Book](https://pragprog.com/titles/dnvim2/practical-vim-second-edition/)
|
||||
|
||||
---
|
||||
|
||||
<div align="center">
|
||||
|
||||
**Master your keymaps, master your editor!**
|
||||
|
||||
[Core Keymaps →](core.md) | [LSP Keymaps →](lsp.md) | [Plugin Keymaps →](plugins.md)
|
||||
|
||||
[Back to Documentation](../README.md)
|
||||
|
||||
</div>
|
||||
|
|
@ -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
|
||||
|
|
@ -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.
|
||||
|
|
@ -0,0 +1,295 @@
|
|||
# Flutter & Dart Development
|
||||
|
||||
Complete reference for Flutter and Dart development in Neovim.
|
||||
|
||||
## Quick Start
|
||||
|
||||
1. Open any `.dart` file to activate Flutter tools
|
||||
2. Select device: `<Space>fd`
|
||||
3. Run app: `<Space>fr`
|
||||
4. Hot reload during development: `<Space>fh`
|
||||
|
||||
## Essential Keymaps
|
||||
|
||||
### App Lifecycle
|
||||
|
||||
| Key | Command | Description |
|
||||
|-----|---------|-------------|
|
||||
| `<Space>fr` | FlutterRun | Run the app (auto-selects last used device) |
|
||||
| `<Space>fh` | FlutterReload | Hot reload (faster, preserves state) |
|
||||
| `<Space>fR` | FlutterRestart | Hot restart (full reload, resets state) |
|
||||
| `<Space>fq` | FlutterQuit | Stop the running app |
|
||||
|
||||
**Workflow**: First time, use `<Space>fd` to select a device, then `<Space>fr` to run. Subsequent runs remember your device.
|
||||
|
||||
### Device Management
|
||||
|
||||
| Key | Command | Description |
|
||||
|-----|---------|-------------|
|
||||
| `<Space>fd` | FlutterDevices | List and select connected devices |
|
||||
| `<Space>fe` | FlutterEmulators | Launch an emulator |
|
||||
| `<Space>fa` | FlutterAttach | Attach to an already running app |
|
||||
| `<Space>fD` | FlutterDetach | Detach from app (keeps it running) |
|
||||
|
||||
### Developer Tools
|
||||
|
||||
| Key | Command | Description |
|
||||
|-----|---------|-------------|
|
||||
| `<Space>ft` | FlutterDevTools | Start Dart DevTools server |
|
||||
| `<Space>fc` | FlutterCopyProfilerUrl | Copy profiler URL to clipboard |
|
||||
| `<Space>fo` | FlutterOutlineToggle | Toggle widget tree outline |
|
||||
| `<Space>fL` | FlutterLogToggle | Show/hide application logs |
|
||||
|
||||
**DevTools Workflow**:
|
||||
1. Run your app: `<Space>fr`
|
||||
2. Start DevTools: `<Space>ft`
|
||||
3. Copy profiler URL: `<Space>fc`
|
||||
4. Open URL in browser for full DevTools experience
|
||||
|
||||
### Code Actions & Refactoring
|
||||
|
||||
| Key | Command | Description |
|
||||
|-----|---------|-------------|
|
||||
| `<Space>.` | Code Actions | Quick actions (like Cmd+. in VS Code) |
|
||||
| `gra` | Code Actions | Alternative LSP keymap |
|
||||
|
||||
**Common Code Actions**:
|
||||
- Wrap widget with Padding, Center, Column, etc.
|
||||
- Remove widget (unwrap)
|
||||
- Extract widget to new class
|
||||
- Extract method
|
||||
- Add import
|
||||
- Organize imports
|
||||
|
||||
### LSP & Language Server
|
||||
|
||||
| Key | Command | Description |
|
||||
|-----|---------|-------------|
|
||||
| `<Space>fl` | FlutterLspRestart | Restart Dart language server |
|
||||
| `K` | Hover | Show documentation |
|
||||
| `grd` | Go to Definition | Jump to definition |
|
||||
| `grr` | Go to References | Find all references |
|
||||
| `grn` | Rename | Rename symbol |
|
||||
|
||||
## Flutter-Specific Features
|
||||
|
||||
### Widget Tree Outline
|
||||
|
||||
The outline window shows your widget tree structure:
|
||||
|
||||
```
|
||||
<Space>fo # Toggle outline window
|
||||
```
|
||||
|
||||
The outline updates as you edit and shows:
|
||||
- Widget hierarchy
|
||||
- Widget types
|
||||
- Quick navigation to widgets
|
||||
|
||||
### Closing Tags
|
||||
|
||||
Automatically shows closing tags for deeply nested widgets:
|
||||
|
||||
```dart
|
||||
Container( // Container
|
||||
child: Column( // Column
|
||||
children: [
|
||||
Text('Hello'),
|
||||
Text('World'),
|
||||
],
|
||||
), // Column
|
||||
), // Container
|
||||
```
|
||||
|
||||
### Color Preview
|
||||
|
||||
Material Design colors show inline preview:
|
||||
|
||||
```dart
|
||||
Colors.red # Shows red color indicator
|
||||
Color(0xFF42A5F5) # Shows the actual color
|
||||
```
|
||||
|
||||
### Hot Reload vs Hot Restart
|
||||
|
||||
| Hot Reload (`<Space>fh`) | Hot Restart (`<Space>fR`) |
|
||||
|---------------------------|---------------------------|
|
||||
| Fast (< 1 second) | Slower (few seconds) |
|
||||
| Preserves app state | Resets app state |
|
||||
| UI changes only | Can handle code structure changes |
|
||||
| Use during active development | Use after changing initState, constructors |
|
||||
|
||||
## Debugging
|
||||
|
||||
### Debug Keymaps
|
||||
|
||||
Available when debugging (after `<F5>` or breakpoint hit):
|
||||
|
||||
| Key | Description |
|
||||
|-----|-------------|
|
||||
| `F5` | Start/Continue |
|
||||
| `F10` | Step over |
|
||||
| `F11` | Step into |
|
||||
| `F12` | Step out |
|
||||
| `<Space>db` | Toggle breakpoint |
|
||||
| `<Space>dB` | Conditional breakpoint |
|
||||
| `<Space>dt` | Terminate debug session |
|
||||
| `<Space>dr` | Toggle REPL |
|
||||
| `<Space>du` | Toggle debug UI |
|
||||
|
||||
### Debug Workflow
|
||||
|
||||
1. Set breakpoints: Position cursor, press `<Space>db`
|
||||
2. Start debugging: `F5` (launches app in debug mode)
|
||||
3. App pauses at breakpoint
|
||||
4. Inspect variables in debug UI panels
|
||||
5. Step through code: `F10`, `F11`, `F12`
|
||||
6. Continue execution: `F5`
|
||||
|
||||
### Debug UI Panels
|
||||
|
||||
When debugging starts, you get:
|
||||
- **Scopes**: Local and global variables
|
||||
- **Breakpoints**: All breakpoints in your project
|
||||
- **Call Stack**: Function call hierarchy
|
||||
- **Watches**: Custom expressions to monitor
|
||||
- **REPL**: Evaluate Dart expressions live
|
||||
- **Console**: Debug output and print statements
|
||||
|
||||
## Logs
|
||||
|
||||
```
|
||||
<Space>fL # Toggle log buffer
|
||||
```
|
||||
|
||||
The log buffer shows:
|
||||
- `print()` statements
|
||||
- Flutter framework messages
|
||||
- Hot reload/restart confirmations
|
||||
- Error messages and stack traces
|
||||
|
||||
## Tips & Tricks
|
||||
|
||||
### Fast Development Loop
|
||||
|
||||
```
|
||||
1. Make UI changes
|
||||
2. <Space>fh for instant hot reload
|
||||
3. See changes immediately
|
||||
4. Repeat
|
||||
```
|
||||
|
||||
### When Hot Reload Fails
|
||||
|
||||
If hot reload shows unexpected behavior:
|
||||
|
||||
```
|
||||
<Space>fR # Hot restart (full reload)
|
||||
```
|
||||
|
||||
If issues persist:
|
||||
|
||||
```
|
||||
<Space>fq # Quit app
|
||||
<Space>fl # Restart LSP
|
||||
<Space>fr # Run again
|
||||
```
|
||||
|
||||
### Multiple Devices
|
||||
|
||||
Switch between devices without restarting:
|
||||
|
||||
```
|
||||
<Space>fq # Quit current
|
||||
<Space>fd # Select new device
|
||||
<Space>fr # Run on new device
|
||||
```
|
||||
|
||||
### Widget Extraction
|
||||
|
||||
To extract a widget to a new class:
|
||||
|
||||
1. Visual select the widget code
|
||||
2. Press `<Space>.` or `gra`
|
||||
3. Choose "Extract Widget"
|
||||
4. Enter new widget name
|
||||
|
||||
### Attach to Running App
|
||||
|
||||
If your app is already running (started outside Neovim):
|
||||
|
||||
```
|
||||
<Space>fa # Attach to running process
|
||||
```
|
||||
|
||||
This enables hot reload and debugging for external apps.
|
||||
|
||||
## Configuration
|
||||
|
||||
Flutter tools are configured in `lua/custom/plugins/flutter.lua`.
|
||||
|
||||
Key settings:
|
||||
- **Auto-start DevTools**: `dev_tools.autostart = false` (manual start)
|
||||
- **Widget guides**: `widget_guides.enabled = true` (visual nesting guides)
|
||||
- **Closing tags**: `closing_tags.enabled = true` (shows widget closing comments)
|
||||
- **Color preview**: `lsp.color.enabled = true` (inline color indicators)
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### LSP Not Working
|
||||
|
||||
```
|
||||
:FlutterLspRestart
|
||||
# or
|
||||
<Space>fl
|
||||
```
|
||||
|
||||
### Can't Select Device
|
||||
|
||||
Ensure Flutter can see your devices:
|
||||
|
||||
```
|
||||
:!flutter devices
|
||||
```
|
||||
|
||||
If devices don't show, check:
|
||||
- Android emulator is running
|
||||
- iOS simulator is running
|
||||
- Physical device is connected and authorized
|
||||
- Chrome is installed (for web)
|
||||
|
||||
### Hot Reload Not Responding
|
||||
|
||||
```
|
||||
<Space>fR # Force hot restart
|
||||
```
|
||||
|
||||
If still not working:
|
||||
|
||||
```
|
||||
<Space>fq # Quit
|
||||
<Space>fr # Restart fresh
|
||||
```
|
||||
|
||||
### Dart Analysis Errors
|
||||
|
||||
Force re-analysis:
|
||||
|
||||
```
|
||||
:FlutterReanalyze
|
||||
```
|
||||
|
||||
Or restart LSP: `<Space>fl`
|
||||
|
||||
## Resources
|
||||
|
||||
- [Flutter Documentation](https://flutter.dev/docs)
|
||||
- [Dart Language Tour](https://dart.dev/guides/language/language-tour)
|
||||
- [Widget Catalog](https://flutter.dev/docs/development/ui/widgets)
|
||||
- [flutter-tools.nvim GitHub](https://github.com/akinsho/flutter-tools.nvim)
|
||||
|
||||
## See Also
|
||||
|
||||
- [Debug Keymaps](../keymaps/README.md#debugging) - Complete debugging reference
|
||||
- [LSP Features](../plugins/lsp.md) - Language Server Protocol features
|
||||
- [Code Actions](../keymaps/README.md#lsp) - All code action keymaps
|
||||
|
|
@ -0,0 +1,272 @@
|
|||
# 🎓 Vim Mastery - Progressive Learning Path
|
||||
|
||||
Master Vim one technique at a time, building real skill over months instead of trying to learn everything at once.
|
||||
|
||||
---
|
||||
|
||||
## 🎯 Philosophy: The One-Trick-Per-Week Method
|
||||
|
||||
Instead of overwhelming yourself with hundreds of commands:
|
||||
1. **Learn ONE new command/technique each week**
|
||||
2. **Practice it consciously** in your daily work
|
||||
3. **Use it until it becomes muscle memory**
|
||||
4. **Move to the next technique**
|
||||
|
||||
After one year: **52 new powerful techniques!**
|
||||
|
||||
---
|
||||
|
||||
## 🗺️ Learning Roadmap
|
||||
|
||||
### Weeks 1-4: Foundation
|
||||
Build essential motion and editing skills
|
||||
- **[Week 1: Motion Basics](week-01-motions.md)** - Move efficiently
|
||||
- **[Week 2: Text Objects](week-02-text-objects.md)** - Edit intelligently
|
||||
- **[Week 3: Advanced Editing](week-03-advanced.md)** - Visual mode & macros intro
|
||||
- **[Week 4: Macros & Registers](week-04-macros.md)** - Automate repetitive tasks
|
||||
|
||||
### Weeks 5-8: Power User
|
||||
Master Vim's unique features
|
||||
- **[Week 5: Command Line](week-05-cmdline.md)** - Ex commands & substitution
|
||||
- **[Week 6: Windows & Tabs](week-06-windows.md)** - Workspace management
|
||||
- **[Week 7: Search & Replace](week-07-search.md)** - Advanced patterns
|
||||
- **[Week 8: Marks & Jumps](week-08-marks.md)** - Navigate large codebases
|
||||
|
||||
### Ongoing: Mastery
|
||||
Continuous improvement
|
||||
- **[Tips & Tricks](tips-and-tricks.md)** - Productivity boosters
|
||||
- **[Workflows](workflows.md)** - Real-world patterns
|
||||
- **[Advanced Topics](advanced.md)** - Vim script, Lua, custom commands
|
||||
|
||||
---
|
||||
|
||||
## 📊 Skill Progression
|
||||
|
||||
```
|
||||
Week 0: hjkl, basic editing [Beginner]
|
||||
↓
|
||||
Week 2: Word motions, text objects [Functional]
|
||||
↓
|
||||
Week 4: Visual mode, basic macros [Comfortable]
|
||||
↓
|
||||
Week 6: Ex commands, window management [Efficient]
|
||||
↓
|
||||
Week 8: Advanced searching, marks [Proficient]
|
||||
↓
|
||||
Month 3: Custom workflows [Advanced]
|
||||
↓
|
||||
Month 6: Vim expert, teaching others [Master]
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 🎯 Learning Objectives
|
||||
|
||||
### By Week 4
|
||||
You will be able to:
|
||||
- Navigate code without arrow keys
|
||||
- Edit text objects (change word, delete paragraph)
|
||||
- Use visual mode for selections
|
||||
- Record and replay simple macros
|
||||
- Be MORE productive than with mouse + arrow keys
|
||||
|
||||
### By Week 8
|
||||
You will be able to:
|
||||
- Refactor code efficiently
|
||||
- Use advanced search patterns
|
||||
- Manage multiple windows and tabs
|
||||
- Navigate large codebases with marks
|
||||
- Automate repetitive tasks with macros
|
||||
|
||||
### By Month 6
|
||||
You will be able to:
|
||||
- Edit at the speed of thought
|
||||
- Teach Vim to others
|
||||
- Create custom workflows
|
||||
- Write your own Vim scripts
|
||||
- Never want to use another editor
|
||||
|
||||
---
|
||||
|
||||
## 📖 Weekly Structure
|
||||
|
||||
Each week follows this pattern:
|
||||
|
||||
### Monday: Learn
|
||||
- Read the week's guide (15 minutes)
|
||||
- Watch any linked videos
|
||||
- Understand the concepts
|
||||
|
||||
### Tuesday-Friday: Practice
|
||||
- Pick 2-3 commands from the week's list
|
||||
- Use them consciously in real work
|
||||
- Don't worry about speed yet
|
||||
- Focus on correctness
|
||||
|
||||
### Weekend: Review
|
||||
- What did you learn?
|
||||
- What felt natural?
|
||||
- What needs more practice?
|
||||
- Pick next week's focus
|
||||
|
||||
---
|
||||
|
||||
## 💡 Learning Tips
|
||||
|
||||
### 1. Deliberate Practice
|
||||
Don't just read - **use** the commands in real code.
|
||||
|
||||
### 2. Start Slow
|
||||
Speed comes with muscle memory. Focus on correctness first.
|
||||
|
||||
### 3. One Thing at a Time
|
||||
Master one command before adding another.
|
||||
|
||||
### 4. Keep a Cheat Sheet
|
||||
Write down your current week's commands somewhere visible.
|
||||
|
||||
### 5. Use the In-Editor Cheatsheet
|
||||
`<Leader>sc` is your friend!
|
||||
|
||||
### 6. Don't Rush
|
||||
It's okay to spend 2 weeks on one topic if needed.
|
||||
|
||||
### 7. Apply Immediately
|
||||
Learn Monday, use in real work Tuesday.
|
||||
|
||||
### 8. Embrace Mistakes
|
||||
Undo (`u`) is your safety net. Experiment!
|
||||
|
||||
---
|
||||
|
||||
## 🎮 Practice Exercises
|
||||
|
||||
Each week includes:
|
||||
- **Focused drills** - Specific command practice
|
||||
- **Real-world scenarios** - Apply to actual code
|
||||
- **Challenge tasks** - Test your skills
|
||||
- **Cheat sheet** - Quick reference
|
||||
|
||||
---
|
||||
|
||||
## 📚 Recommended Schedule
|
||||
|
||||
### If You're New to Vim
|
||||
- **Pace**: 1 week per topic
|
||||
- **Time**: 30 minutes/day practice
|
||||
- **Duration**: 8 weeks to proficiency
|
||||
|
||||
### If You Know Basic Vim
|
||||
- **Pace**: 2-3 topics per week
|
||||
- **Time**: 15 minutes/day practice
|
||||
- **Duration**: 4 weeks to level up
|
||||
|
||||
### If You Want to Master Vim
|
||||
- **Pace**: All topics + advanced
|
||||
- **Time**: 1 hour/day practice
|
||||
- **Duration**: 3-6 months to mastery
|
||||
|
||||
---
|
||||
|
||||
## 🗺️ Your Journey Starts Here
|
||||
|
||||
### Absolute Beginner?
|
||||
Start with **[Week 1: Motion Basics](week-01-motions.md)**
|
||||
|
||||
### Know hjkl Already?
|
||||
Jump to **[Week 2: Text Objects](week-02-text-objects.md)**
|
||||
|
||||
### Comfortable with Vim?
|
||||
Explore **[Tips & Tricks](tips-and-tricks.md)** and **[Workflows](workflows.md)**
|
||||
|
||||
### Want to Master Everything?
|
||||
Follow the full 8-week program, then **[Advanced Topics](advanced.md)**
|
||||
|
||||
---
|
||||
|
||||
## 📈 Track Your Progress
|
||||
|
||||
Create a file to track what you've learned:
|
||||
|
||||
```vim
|
||||
:e ~/vim-mastery-log.md
|
||||
```
|
||||
|
||||
Template:
|
||||
```markdown
|
||||
# My Vim Mastery Journey
|
||||
|
||||
## Week 1: Motion Basics
|
||||
- Started: 2025-11-01
|
||||
- Mastered: w, b, e, 0, $
|
||||
- Still practicing: f/F, t/T
|
||||
- Favorite new trick: dt, (delete till comma)
|
||||
|
||||
## Week 2: Text Objects
|
||||
...
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 🎯 Success Metrics
|
||||
|
||||
You're making progress when:
|
||||
- ✅ You reach for hjkl instead of arrow keys
|
||||
- ✅ You think "change inner word" instead of selecting with mouse
|
||||
- ✅ You prefer Vim commands over GUI operations
|
||||
- ✅ You can edit without looking at keyboard
|
||||
- ✅ You start teaching others
|
||||
- ✅ You feel frustrated using non-Vim editors
|
||||
|
||||
---
|
||||
|
||||
## 💬 Community
|
||||
|
||||
Share your progress:
|
||||
- **Reddit**: r/vim, r/neovim
|
||||
- **Discord**: Neovim community server
|
||||
- **GitHub**: Open issues with questions
|
||||
|
||||
---
|
||||
|
||||
## 📚 Additional Resources
|
||||
|
||||
### Books
|
||||
- **Practical Vim** by Drew Neil (highly recommended!)
|
||||
- **Modern Vim** by Drew Neil
|
||||
- **Learning the Vi and Vim Editors**
|
||||
|
||||
### Videos
|
||||
- **ThePrimeagen's Vim Course**
|
||||
- **Vim Casts** (vimcasts.org)
|
||||
- **TJ DeVries' Neovim streams**
|
||||
|
||||
### Interactive
|
||||
- `:Tutor` - Built into Neovim
|
||||
- **Vim Adventures** - Learn through gaming
|
||||
- **OpenVim** - Interactive tutorial
|
||||
|
||||
### References
|
||||
- `:help` - Vim's excellent documentation
|
||||
- **vim.rtorr.com** - Quick reference
|
||||
- **This config's cheatsheet** - `<Leader>sc`
|
||||
|
||||
---
|
||||
|
||||
## 🎊 Ready to Begin?
|
||||
|
||||
Remember: **Progress > Perfection**
|
||||
|
||||
Every expert was once a beginner. The only difference is they kept practicing.
|
||||
|
||||
---
|
||||
|
||||
<div align="center">
|
||||
|
||||
**Your journey to Vim mastery starts now!**
|
||||
|
||||
[Week 1: Motion Basics →](week-01-motions.md)
|
||||
|
||||
[Back to Documentation](../README.md) | [Tips & Tricks](tips-and-tricks.md)
|
||||
|
||||
</div>
|
||||
|
|
@ -0,0 +1,380 @@
|
|||
# 🎯 Week 1: Motion Basics
|
||||
|
||||
Master efficient navigation - the foundation of Vim proficiency.
|
||||
|
||||
---
|
||||
|
||||
## 🎓 Learning Objectives
|
||||
|
||||
By the end of this week, you will:
|
||||
- Navigate without arrow keys
|
||||
- Move by words, not characters
|
||||
- Jump to specific characters on a line
|
||||
- Understand the power of count + motion
|
||||
- Be faster than mouse + arrow keys
|
||||
|
||||
---
|
||||
|
||||
## 📚 Core Commands
|
||||
|
||||
### Basic Directional Movement
|
||||
```vim
|
||||
h " Left ←
|
||||
j " Down ↓
|
||||
k " Up ↑
|
||||
l " Right →
|
||||
```
|
||||
|
||||
**Practice Goal**: Use only hjkl for one full day. Unmap arrow keys if needed!
|
||||
|
||||
### Word Movement (Most Important!)
|
||||
```vim
|
||||
w " Next word (start)
|
||||
e " Next word (end)
|
||||
b " Previous word (start)
|
||||
ge " Previous word (end)
|
||||
|
||||
W " Next WORD (whitespace separated)
|
||||
E " Next WORD (end)
|
||||
B " Previous WORD
|
||||
```
|
||||
|
||||
**Difference**:
|
||||
- `word`: Stops at punctuation (my-function → 3 words)
|
||||
- `WORD`: Whitespace only (my-function → 1 WORD)
|
||||
|
||||
### Line Movement
|
||||
```vim
|
||||
0 " Start of line
|
||||
^ " First non-whitespace character
|
||||
$ " End of line
|
||||
g_ " Last non-whitespace character
|
||||
```
|
||||
|
||||
### Character Search (Super Powerful!)
|
||||
```vim
|
||||
f{char} " Find next {char} on line →
|
||||
F{char} " Find previous {char} on line ←
|
||||
t{char} " Till next {char} (stop before)
|
||||
T{char} " Till previous {char}
|
||||
|
||||
; " Repeat last f/F/t/T forward
|
||||
, " Repeat last f/F/t/T backward
|
||||
```
|
||||
|
||||
**Pro Tip**: `f` and `t` are game-changers for editing!
|
||||
|
||||
---
|
||||
|
||||
## 💪 Practice Exercises
|
||||
|
||||
### Exercise 1: Word Navigation (5 minutes)
|
||||
Open any code file:
|
||||
```vim
|
||||
:e ~/.config/nvim/init.lua
|
||||
```
|
||||
|
||||
Practice:
|
||||
1. Use `w` to move forward 10 words
|
||||
2. Use `b` to come back
|
||||
3. Use `e` to jump to word ends
|
||||
4. Compare speed: `wwwww` vs `5w` (count!)
|
||||
|
||||
### Exercise 2: Line Precision (5 minutes)
|
||||
In the same file:
|
||||
```vim
|
||||
" Jump to line start
|
||||
0
|
||||
|
||||
" Jump to first character
|
||||
^
|
||||
|
||||
" Jump to line end
|
||||
$
|
||||
|
||||
" Try this combo: Move to end, then back to start
|
||||
$^
|
||||
```
|
||||
|
||||
### Exercise 3: Character Hunting (10 minutes)
|
||||
Find a line with multiple parentheses or quotes:
|
||||
```lua
|
||||
local function test(arg1, arg2, arg3)
|
||||
```
|
||||
|
||||
Practice:
|
||||
```vim
|
||||
f( " Jump to first (
|
||||
; " Jump to next (
|
||||
; " Jump to next (
|
||||
, " Go back one (
|
||||
```
|
||||
|
||||
Try these scenarios:
|
||||
- Jump to the closing quote: `f"`
|
||||
- Delete till comma: `dt,`
|
||||
- Change till closing paren: `ct)`
|
||||
|
||||
### Exercise 4: Combine Motions (10 minutes)
|
||||
Real-world scenarios:
|
||||
|
||||
**Scenario 1**: Change the word "function" to "method"
|
||||
```vim
|
||||
" Position cursor on 'f' in function
|
||||
cw " Change word
|
||||
method<Esc>
|
||||
```
|
||||
|
||||
**Scenario 2**: Delete from cursor to end of line
|
||||
```vim
|
||||
d$ " or D
|
||||
```
|
||||
|
||||
**Scenario 3**: Change from here to next underscore
|
||||
```vim
|
||||
ct_
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 🎯 Daily Challenges
|
||||
|
||||
### Monday: Basic hjkl
|
||||
- Disable arrow keys: Add to `init.lua`:
|
||||
```lua
|
||||
vim.keymap.set('n', '<Up>', '<Nop>')
|
||||
vim.keymap.set('n', '<Down>', '<Nop>')
|
||||
vim.keymap.set('n', '<Left>', '<Nop>')
|
||||
vim.keymap.set('n', '<Right>', '<Nop>')
|
||||
```
|
||||
- Navigate only with hjkl for the entire day
|
||||
|
||||
### Tuesday: Word Motions
|
||||
- Practice `w`, `b`, `e` every time you move
|
||||
- Count your keystrokes: `www` = 3, `3w` = 2
|
||||
- Use counts!
|
||||
|
||||
### Wednesday: Line Jumps
|
||||
- Every time you need line start/end, use `^` or `$`
|
||||
- Stop using `0` (except when you really need column 0)
|
||||
|
||||
### Thursday: Character Search
|
||||
- Find 10 opportunities to use `f` or `t`
|
||||
- Practice `;` and `,` for repeating
|
||||
- Try `dt,` and `ct)` patterns
|
||||
|
||||
### Friday: Combinations
|
||||
- Combine everything: `d3w`, `c$`, `vf)`, etc.
|
||||
- Edit entire lines without arrow keys
|
||||
- Feel the power!
|
||||
|
||||
---
|
||||
|
||||
## 🔥 Real-World Patterns
|
||||
|
||||
### Pattern 1: Change Till Character
|
||||
```vim
|
||||
" Change from cursor to next comma
|
||||
ct,
|
||||
```
|
||||
**Use when**: Editing function arguments
|
||||
|
||||
### Pattern 2: Delete Word Forward
|
||||
```vim
|
||||
" Delete from cursor to end of word
|
||||
dw
|
||||
|
||||
" Delete 3 words
|
||||
d3w
|
||||
```
|
||||
**Use when**: Removing variable names
|
||||
|
||||
### Pattern 3: Jump and Edit
|
||||
```vim
|
||||
" Find opening paren, then change till closing
|
||||
f(ct)
|
||||
```
|
||||
**Use when**: Changing function parameters
|
||||
|
||||
### Pattern 4: End of Line Operations
|
||||
```vim
|
||||
" Append at end of line
|
||||
A
|
||||
|
||||
" Delete to end of line
|
||||
D
|
||||
|
||||
" Change to end of line
|
||||
C
|
||||
```
|
||||
**Use when**: Adding semicolons, removing trailing code
|
||||
|
||||
---
|
||||
|
||||
## 📊 Progress Checklist
|
||||
|
||||
Track your mastery:
|
||||
|
||||
```
|
||||
Day 1:
|
||||
[ ] Used hjkl instead of arrows at least 50% of time
|
||||
[ ] Felt uncomfortable (this is good!)
|
||||
|
||||
Day 2:
|
||||
[ ] Used w/b/e consciously 20+ times
|
||||
[ ] Started thinking in "words" not "characters"
|
||||
|
||||
Day 3:
|
||||
[ ] Used ^ and $ instead of Home/End
|
||||
[ ] Comfortable with 0/^/$ distinction
|
||||
|
||||
Day 4:
|
||||
[ ] Used f/t successfully 10+ times
|
||||
[ ] Discovered one "aha!" moment with dt or ct
|
||||
|
||||
Day 5:
|
||||
[ ] Combined motions (d3w, c$, etc.)
|
||||
[ ] Hjkl feels natural
|
||||
[ ] Ready for Week 2!
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 🎮 Speed Drills
|
||||
|
||||
### Drill 1: The Word Race (2 minutes)
|
||||
```vim
|
||||
" Open a file
|
||||
" Start at top: gg
|
||||
" Goal: Get to word "function" on line 50
|
||||
|
||||
" Slow way: jjjjjjjjwwwwwwww
|
||||
" Fast way: 50G/function<CR>
|
||||
" Week 1 way: 50G (jump to line) then use w/e
|
||||
```
|
||||
|
||||
### Drill 2: Line Ninja (2 minutes)
|
||||
```vim
|
||||
" Create test line:
|
||||
" the quick brown fox jumps over the lazy dog
|
||||
|
||||
" Tasks (as fast as possible):
|
||||
0 " Line start
|
||||
$ " Line end
|
||||
^ " First char
|
||||
fb " Find 'b'
|
||||
; " Next 'b'
|
||||
e " End of word
|
||||
```
|
||||
|
||||
### Drill 3: Edit Marathon (5 minutes)
|
||||
```lua
|
||||
-- Start with:
|
||||
local result = calculate(arg1, arg2, arg3, arg4)
|
||||
|
||||
-- Tasks:
|
||||
-- 1. Change "calculate" to "compute"
|
||||
-- Solution: /calc<CR>cw compute<Esc>
|
||||
--
|
||||
-- 2. Delete ", arg4"
|
||||
-- Solution: f4 (on '4') then dF, (delete back to comma)
|
||||
--
|
||||
-- 3. Change "result" to "output"
|
||||
-- Solution: 0 (start of line) cw output<Esc>
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 💡 Pro Tips
|
||||
|
||||
### Tip 1: Think in Motions
|
||||
Don't think: "I need to move 5 characters right"
|
||||
Think: "I need to move to the next word"
|
||||
|
||||
### Tip 2: Use Counts
|
||||
`5w` is faster than `wwwww` and requires less thought.
|
||||
|
||||
### Tip 3: f/t Are Superpowers
|
||||
Once you master `f` and `t`, you'll never want to use arrow keys for horizontal navigation.
|
||||
|
||||
### Tip 4: Learn the Difference
|
||||
- `w` stops at punctuation: `my-word` = 3 stops
|
||||
- `W` only stops at whitespace: `my-word` = 1 stop
|
||||
|
||||
### Tip 5: Combine with Operators
|
||||
Motions are 10x powerful with operators (d, c, y):
|
||||
- `dw` = delete word
|
||||
- `ct.` = change till period
|
||||
- `y$` = yank to end of line
|
||||
|
||||
---
|
||||
|
||||
## 🎯 Week 1 Goal
|
||||
|
||||
**By end of week, you should prefer hjkl + word motions over arrow keys.**
|
||||
|
||||
If you catch yourself reaching for arrows or mouse, that's your cue to practice more!
|
||||
|
||||
---
|
||||
|
||||
## 🔗 Quick Reference Card
|
||||
|
||||
Print this or keep it visible:
|
||||
|
||||
```
|
||||
┌─────────────────────────────────────┐
|
||||
│ Week 1: Motion Basics │
|
||||
├─────────────────────────────────────┤
|
||||
│ hjkl - Directions │
|
||||
│ w/b/e - Word motions │
|
||||
│ ^/$ - Line start/end │
|
||||
│ f/F - Find character │
|
||||
│ t/T - Till character │
|
||||
│ ;/, - Repeat find │
|
||||
│ │
|
||||
│ Combos: │
|
||||
│ dw - Delete word │
|
||||
│ dt, - Delete till comma │
|
||||
│ c$ - Change to end │
|
||||
│ 5w - Move 5 words │
|
||||
└─────────────────────────────────────┘
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## ❓ Common Questions
|
||||
|
||||
**Q: Why not use arrow keys?**
|
||||
A: They're far from home row. Hjkl is faster once trained.
|
||||
|
||||
**Q: When should I use w vs W?**
|
||||
A: Use `w` for code (stops at punctuation). Use `W` for prose (whitespace only).
|
||||
|
||||
**Q: I'm slower with hjkl!**
|
||||
A: Normal! Stick with it for 3 days. Speed comes after correctness.
|
||||
|
||||
**Q: Do I really need to learn f/t?**
|
||||
A: YES! They're the secret weapon. Worth the practice.
|
||||
|
||||
---
|
||||
|
||||
## 🎊 Graduation Criteria
|
||||
|
||||
You're ready for Week 2 when:
|
||||
- ✅ hjkl feels natural (no conscious thought)
|
||||
- ✅ You use w/b/e more than arrow keys
|
||||
- ✅ You've used f/t successfully in real work
|
||||
- ✅ You can navigate without looking at keyboard
|
||||
- ✅ You feel frustrated when using arrow keys
|
||||
|
||||
---
|
||||
|
||||
<div align="center">
|
||||
|
||||
**Congratulations on completing Week 1!**
|
||||
|
||||
Practice these daily, and they'll become second nature.
|
||||
|
||||
[← Back to Vim Mastery](README.md) | [Week 2: Text Objects →](week-02-text-objects.md)
|
||||
|
||||
</div>
|
||||
2
init.lua
2
init.lua
|
|
@ -8,7 +8,7 @@ and reorganized into a modular structure.
|
|||
For help:
|
||||
- Run `:Tutor` to learn Neovim basics
|
||||
- Run `:help` to access built-in documentation
|
||||
- Press `<space>sh` to search help with Telescope
|
||||
- Press `<Space>sh` to search help with Telescope
|
||||
- Run `:checkhealth` to diagnose issues
|
||||
- See ORGANIZATION.md for structure details
|
||||
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
"blink.cmp": { "branch": "main", "commit": "327fff91fe6af358e990be7be1ec8b78037d2138" },
|
||||
"conform.nvim": { "branch": "master", "commit": "9fd3d5e0b689ec1bf400c53cbbec72c6fdf24081" },
|
||||
"copilot.vim": { "branch": "release", "commit": "da369d90cfd6c396b1d0ec259836a1c7222fb2ea" },
|
||||
"crates.nvim": { "branch": "main", "commit": "ac9fa498a9edb96dc3056724ff69d5f40b898453" },
|
||||
"dressing.nvim": { "branch": "master", "commit": "2d7c2db2507fa3c4956142ee607431ddb2828639" },
|
||||
"emmet-vim": { "branch": "master", "commit": "e98397144982d1e75b20d94d55a82de3ec8f648d" },
|
||||
"fidget.nvim": { "branch": "main", "commit": "e32b672d8fd343f9d6a76944fedb8c61d7d8111a" },
|
||||
|
|
@ -26,6 +27,7 @@
|
|||
"nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" },
|
||||
"rustaceanvim": { "branch": "master", "commit": "e9c5aaba16fead831379d5f44617547a90b913c7" },
|
||||
"telescope-fzf-native.nvim": { "branch": "main", "commit": "1f08ed60cafc8f6168b72b80be2b2ea149813e55" },
|
||||
"telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" },
|
||||
"telescope.nvim": { "branch": "master", "commit": "b4da76be54691e854d3e0e02c36b0245f945c2c7" },
|
||||
|
|
|
|||
|
|
@ -56,3 +56,37 @@ vim.keymap.set('n', '<leader>Q', '<cmd>qa<CR>', { desc = '[Q]uit [A]ll' })
|
|||
-- vim.keymap.set("n", "<C-S-l>", "<C-w>L", { desc = "Move window to the right" })
|
||||
-- vim.keymap.set("n", "<C-S-j>", "<C-w>J", { desc = "Move window to the lower" })
|
||||
-- vim.keymap.set("n", "<C-S-k>", "<C-w>K", { desc = "Move window to the upper" })
|
||||
|
||||
-- ========================================================================
|
||||
-- BUFFER OPERATIONS (<leader>b)
|
||||
-- ========================================================================
|
||||
vim.keymap.set('n', '<leader>bd', '<cmd>bd<CR>', { desc = 'Delete buffer' })
|
||||
vim.keymap.set('n', '<leader>bD', '<cmd>bd!<CR>', { desc = 'Delete buffer (force)' })
|
||||
vim.keymap.set('n', '<leader>bn', '<cmd>bnext<CR>', { desc = 'Next buffer' })
|
||||
vim.keymap.set('n', '<leader>bp', '<cmd>bprevious<CR>', { desc = 'Previous buffer' })
|
||||
vim.keymap.set('n', '<leader>bo', '<cmd>%bd|e#|bd#<CR>', { desc = 'Delete other buffers' })
|
||||
|
||||
-- ========================================================================
|
||||
-- WINDOW OPERATIONS (<leader>w)
|
||||
-- ========================================================================
|
||||
vim.keymap.set('n', '<leader>ww', '<C-w>w', { desc = 'Other window' })
|
||||
vim.keymap.set('n', '<leader>wd', '<C-w>c', { desc = 'Delete window' })
|
||||
vim.keymap.set('n', '<leader>ws', '<C-w>s', { desc = 'Split window below' })
|
||||
vim.keymap.set('n', '<leader>wv', '<C-w>v', { desc = 'Split window right' })
|
||||
vim.keymap.set('n', '<leader>wm', '<C-w>_<C-w>|', { desc = 'Maximize window' })
|
||||
vim.keymap.set('n', '<leader>w=', '<C-w>=', { desc = 'Balance windows' })
|
||||
vim.keymap.set('n', '<leader>wh', '<C-w>h', { desc = 'Go to left window' })
|
||||
vim.keymap.set('n', '<leader>wj', '<C-w>j', { desc = 'Go to lower window' })
|
||||
vim.keymap.set('n', '<leader>wk', '<C-w>k', { desc = 'Go to upper window' })
|
||||
vim.keymap.set('n', '<leader>wl', '<C-w>l', { desc = 'Go to right window' })
|
||||
|
||||
-- ========================================================================
|
||||
-- UI OPERATIONS (<leader>u)
|
||||
-- ========================================================================
|
||||
vim.keymap.set('n', '<leader>ul', '<cmd>Lazy<CR>', { desc = 'Open Lazy' })
|
||||
vim.keymap.set('n', '<leader>um', '<cmd>Mason<CR>', { desc = 'Open Mason' })
|
||||
vim.keymap.set('n', '<leader>ui', vim.show_pos, { desc = 'Inspect position' })
|
||||
vim.keymap.set('n', '<leader>uI', '<cmd>InspectTree<CR>', { desc = 'Inspect tree' })
|
||||
vim.keymap.set('n', '<leader>un', function()
|
||||
require('noice').cmd 'dismiss'
|
||||
end, { desc = 'Dismiss notifications' })
|
||||
|
|
|
|||
|
|
@ -0,0 +1,485 @@
|
|||
-- ========================================================================
|
||||
-- FLUTTER/DART PROFILE - Language-specific plugins and LSP configuration
|
||||
-- ========================================================================
|
||||
--
|
||||
-- This file contains all Flutter and Dart-specific plugins and configurations.
|
||||
-- These plugins will ONLY load when you open a .dart file, keeping your
|
||||
-- startup time fast and avoiding conflicts with other languages.
|
||||
--
|
||||
-- Key features to configure here:
|
||||
-- - Flutter tools (hot reload, device management, widget inspector)
|
||||
-- - Dart LSP (dartls via flutter-tools)
|
||||
-- - Dart-specific formatters and linters
|
||||
-- - Flutter-specific keymaps (e.g., <leader>fr for Flutter Run)
|
||||
--
|
||||
-- Usage: Just open a .dart file and these plugins will automatically load!
|
||||
-- ========================================================================
|
||||
|
||||
return {
|
||||
-- ========================================================================
|
||||
-- NVIM-DAP - Debug Adapter Protocol for Flutter debugging
|
||||
-- ========================================================================
|
||||
-- Load DAP when opening Dart files to enable breakpoint debugging
|
||||
{
|
||||
'mfussenegger/nvim-dap',
|
||||
ft = 'dart',
|
||||
dependencies = {
|
||||
'rcarriga/nvim-dap-ui',
|
||||
'nvim-neotest/nvim-nio',
|
||||
},
|
||||
},
|
||||
|
||||
-- ========================================================================
|
||||
-- FLUTTER TOOLS - Complete Flutter development environment
|
||||
-- ========================================================================
|
||||
-- Provides Flutter-specific features like hot reload, device management,
|
||||
-- widget inspector, and integrates the Dart LSP server.
|
||||
--
|
||||
-- Flutter-specific keymaps (available in .dart files):
|
||||
-- <Space>fr - Flutter Run (start app)
|
||||
-- <Space>fq - Flutter Quit (stop app)
|
||||
-- <Space>fR - Flutter Hot Restart
|
||||
-- <Space>fh - Flutter Hot Reload
|
||||
-- <Space>fd - Flutter Devices (show connected devices)
|
||||
-- <Space>fe - Flutter Emulators (launch emulator)
|
||||
-- <Space>fo - Flutter Outline (toggle outline/widget tree)
|
||||
-- <Space>ft - Flutter DevTools (start DevTools server)
|
||||
-- <Space>fa - Flutter Attach (attach to running app)
|
||||
-- <Space>fD - Flutter Detach (detach from running app)
|
||||
-- <Space>fL - Flutter Log Toggle (show/hide logs)
|
||||
-- <Space>fc - Flutter Copy Profiler URL (for DevTools)
|
||||
--
|
||||
-- Debug keymaps:
|
||||
-- <F5> - Start/Continue debugging
|
||||
-- <F10> - Step over
|
||||
-- <F11> - Step into
|
||||
-- <F12> - Step out
|
||||
-- <leader>db - Toggle breakpoint
|
||||
-- <leader>dB - Set conditional breakpoint
|
||||
-- <leader>dc - Continue
|
||||
-- <leader>dt - Terminate debugging
|
||||
-- ========================================================================
|
||||
{
|
||||
'nvim-flutter/flutter-tools.nvim',
|
||||
ft = 'dart', -- Only load when opening Dart files
|
||||
dependencies = {
|
||||
'nvim-lua/plenary.nvim',
|
||||
'stevearc/dressing.nvim', -- Optional: better UI for Flutter commands
|
||||
'mfussenegger/nvim-dap',
|
||||
'rcarriga/nvim-dap-ui',
|
||||
'nvim-neotest/nvim-nio',
|
||||
},
|
||||
config = function()
|
||||
-- Get shared LSP capabilities from blink.cmp
|
||||
local capabilities = require('blink.cmp').get_lsp_capabilities()
|
||||
|
||||
require('flutter-tools').setup {
|
||||
-- UI configuration
|
||||
ui = {
|
||||
border = 'rounded', -- border type for floating windows
|
||||
notification_style = 'native', -- 'native' or 'plugin' (native uses vim.notify)
|
||||
},
|
||||
|
||||
-- Flutter SDK path (usually auto-detected, but you can specify if needed)
|
||||
-- flutter_path = '/path/to/flutter/bin/flutter',
|
||||
-- flutter_lookup_cmd = nil, -- example: "dirname $(which flutter)" or "asdf where flutter"
|
||||
|
||||
-- FVM support - takes priority over path, uses <workspace>/.fvm/flutter_sdk if enabled
|
||||
fvm = false,
|
||||
|
||||
-- Root patterns to find the root of your flutter project
|
||||
root_patterns = { '.git', 'pubspec.yaml' },
|
||||
|
||||
-- Uncomment to set a default device (get ID from `flutter devices`)
|
||||
-- device = {
|
||||
-- id = 'chrome', -- or 'macos', 'emulator-5554', etc.
|
||||
-- },
|
||||
|
||||
lsp = {
|
||||
capabilities = capabilities,
|
||||
|
||||
-- Suppress didChange errors during snippet expansion
|
||||
on_attach = function(client, bufnr)
|
||||
-- Reduce didChange notification frequency to prevent errors with snippets
|
||||
client.server_capabilities.textDocumentSync = vim.tbl_deep_extend('force', client.server_capabilities.textDocumentSync or {}, {
|
||||
change = 2, -- 2 = Incremental (less prone to errors than full sync)
|
||||
})
|
||||
|
||||
-- Filter out didChange error notifications (they're harmless during snippet expansion)
|
||||
-- We'll use an autocmd to do this after noice.nvim is loaded
|
||||
vim.api.nvim_create_autocmd('User', {
|
||||
pattern = 'VeryLazy',
|
||||
once = true,
|
||||
callback = function()
|
||||
local notify = vim.notify
|
||||
vim.notify = function(msg, level, opts)
|
||||
if type(msg) == 'string' and msg:match('textDocument/didChange') then
|
||||
return -- Suppress this specific error
|
||||
end
|
||||
notify(msg, level, opts)
|
||||
end
|
||||
end,
|
||||
})
|
||||
end,
|
||||
|
||||
-- Color preview for dart variables (Colors.red, Color(0xFF...), etc.)
|
||||
-- This shows the actual Material Design colors inline!
|
||||
color = {
|
||||
enabled = true, -- whether or not to highlight color variables at all, only supported on flutter >= 2.10
|
||||
background = true, -- highlight the background
|
||||
background_color = nil, -- required, when background is transparent (i.e. background_color = { r = 19, g = 17, b = 24},)
|
||||
foreground = false, -- highlight the foreground
|
||||
virtual_text = true, -- show the highlight using virtual text
|
||||
virtual_text_str = '■', -- the virtual text character to highlight
|
||||
},
|
||||
-- Settings passed to the Dart LSP
|
||||
settings = {
|
||||
-- Show TODOs in the problems pane
|
||||
showTodos = true,
|
||||
-- Completion settings
|
||||
completeFunctionCalls = true,
|
||||
-- Enable/disable specific lints
|
||||
-- analysisExcludedFolders = {},
|
||||
renameFilesWithClasses = 'prompt', -- "always" or "prompt"
|
||||
enableSnippets = true,
|
||||
updateImportsOnRename = true, -- Whether to update imports and other directives when files are renamed
|
||||
},
|
||||
},
|
||||
|
||||
-- Flutter-specific settings
|
||||
decorations = {
|
||||
statusline = {
|
||||
-- Set to true to show Flutter app info in statusline
|
||||
app_version = false,
|
||||
device = true, -- Show device name
|
||||
},
|
||||
},
|
||||
|
||||
widget_guides = {
|
||||
enabled = true, -- Show visual guides for widget nesting
|
||||
},
|
||||
|
||||
closing_tags = {
|
||||
highlight = 'Comment', -- Highlight color for closing tags
|
||||
prefix = '// ', -- Text to show before closing tag
|
||||
enabled = true, -- Show closing tags for widgets
|
||||
},
|
||||
|
||||
dev_log = {
|
||||
enabled = true,
|
||||
notify_errors = false, -- Don't show error notifications for log buffer issues
|
||||
open_cmd = 'tabedit', -- Open logs in a new tab
|
||||
focus_on_open = false, -- Don't auto-focus the log window
|
||||
},
|
||||
|
||||
dev_tools = {
|
||||
autostart = false, -- autostart devtools server if not detected
|
||||
auto_open_browser = false, -- Automatically opens devtools in the browser
|
||||
},
|
||||
|
||||
outline = {
|
||||
open_cmd = '30vnew', -- command to use to open the outline buffer
|
||||
auto_open = false, -- if true this will open the outline automatically when it is first populated
|
||||
},
|
||||
|
||||
debugger = {
|
||||
enabled = true, -- Enable Flutter debugger integration
|
||||
run_via_dap = true, -- Use DAP for debugging
|
||||
-- if empty dap will not stop on any exceptions, otherwise it will stop on those specified
|
||||
-- see |:help dap.set_exception_breakpoints()| for more info
|
||||
exception_breakpoints = {},
|
||||
-- Whether to call toString() on objects in debug views like hovers and the variables list.
|
||||
-- Invoking toString() has a performance cost and may introduce side-effects,
|
||||
-- although users may expected this functionality. null is treated like false.
|
||||
evaluate_to_string_in_debug_views = true,
|
||||
-- Flutter tools will automatically register DAP configurations
|
||||
-- No need to manually configure launch.json
|
||||
},
|
||||
}
|
||||
|
||||
-- ========================================================================
|
||||
-- DAP UI SETUP - Beautiful debugging interface
|
||||
-- ========================================================================
|
||||
local dap, dapui = require 'dap', require 'dapui'
|
||||
|
||||
-- Configure DAP UI to open in tabs for better half-width screen support
|
||||
dapui.setup {
|
||||
icons = { expanded = '▾', collapsed = '▸', current_frame = '*' },
|
||||
controls = {
|
||||
icons = {
|
||||
pause = '⏸',
|
||||
play = '▶',
|
||||
step_into = '⏎',
|
||||
step_over = '⏭',
|
||||
step_out = '⏮',
|
||||
step_back = 'b',
|
||||
run_last = '▶▶',
|
||||
terminate = '⏹',
|
||||
disconnect = '⏏',
|
||||
},
|
||||
},
|
||||
-- Open each element in a new tab instead of side panels
|
||||
-- This prevents layout issues on small/half-width screens
|
||||
layouts = {
|
||||
{
|
||||
elements = {
|
||||
{ id = 'scopes', size = 0.25 },
|
||||
{ id = 'breakpoints', size = 0.25 },
|
||||
{ id = 'stacks', size = 0.25 },
|
||||
{ id = 'watches', size = 0.25 },
|
||||
},
|
||||
size = 40,
|
||||
position = 'right',
|
||||
},
|
||||
{
|
||||
elements = {
|
||||
{ id = 'repl', size = 0.5 },
|
||||
{ id = 'console', size = 0.5 },
|
||||
},
|
||||
size = 10,
|
||||
position = 'bottom',
|
||||
},
|
||||
},
|
||||
-- Override element window commands to open in tabs
|
||||
element_mappings = {},
|
||||
windows = { indent = 1 },
|
||||
}
|
||||
|
||||
-- Custom function to open DAP UI elements in tabs
|
||||
local function open_dapui_in_tabs()
|
||||
-- Save current tab to return to it
|
||||
local current_tab = vim.fn.tabpagenr()
|
||||
|
||||
-- Create new tab with a named buffer for debug views
|
||||
vim.cmd 'tabnew'
|
||||
local debug_buf = vim.api.nvim_create_buf(false, true)
|
||||
vim.api.nvim_buf_set_name(debug_buf, 'Flutter Debug')
|
||||
vim.api.nvim_set_current_buf(debug_buf)
|
||||
|
||||
-- Open DAP UI in this tab
|
||||
dapui.open()
|
||||
|
||||
-- Return to original tab so user continues coding there
|
||||
vim.cmd('tabnext ' .. current_tab)
|
||||
end
|
||||
|
||||
-- Custom function to close DAP UI tabs
|
||||
local function close_dapui_tabs()
|
||||
dapui.close()
|
||||
|
||||
-- Find and close the Flutter Debug tab
|
||||
local current_tab = vim.fn.tabpagenr()
|
||||
for i = 1, vim.fn.tabpagenr '$' do
|
||||
vim.cmd('tabnext ' .. i)
|
||||
local bufname = vim.api.nvim_buf_get_name(0)
|
||||
if bufname:match('Flutter Debug') then
|
||||
vim.cmd 'tabclose'
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
-- Return to original tab
|
||||
if vim.fn.tabpagenr '$' >= current_tab then
|
||||
vim.cmd('tabnext ' .. current_tab)
|
||||
end
|
||||
end
|
||||
|
||||
-- Automatically open/close DAP UI in tabs
|
||||
dap.listeners.after.event_initialized['dapui_config'] = open_dapui_in_tabs
|
||||
dap.listeners.before.event_terminated['dapui_config'] = close_dapui_tabs
|
||||
dap.listeners.before.event_exited['dapui_config'] = close_dapui_tabs
|
||||
|
||||
-- Fix for Flutter Tools log buffer - make it non-saveable
|
||||
-- This prevents Vim from asking to save changes to the log file on exit
|
||||
vim.api.nvim_create_autocmd({ 'BufEnter', 'BufWinEnter' }, {
|
||||
pattern = '*',
|
||||
callback = function(args)
|
||||
local bufname = vim.api.nvim_buf_get_name(args.buf)
|
||||
-- Check if this is a Flutter log buffer
|
||||
if bufname:match('__FLUTTER_DEV_LOG__') or vim.bo[args.buf].filetype == 'log' then
|
||||
vim.bo[args.buf].modifiable = true -- Allow Flutter to write to it
|
||||
vim.bo[args.buf].modified = false -- Mark as unmodified
|
||||
vim.bo[args.buf].buftype = 'nofile' -- Don't associate with a file (prevents save prompt)
|
||||
vim.bo[args.buf].swapfile = false -- Don't create swap file
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
-- Keep log buffer marked as unmodified whenever it changes
|
||||
-- This prevents the "save changes?" prompt on exit
|
||||
vim.api.nvim_create_autocmd('BufModifiedSet', {
|
||||
pattern = '*',
|
||||
callback = function(args)
|
||||
local bufname = vim.api.nvim_buf_get_name(args.buf)
|
||||
if bufname:match('__FLUTTER_DEV_LOG__') then
|
||||
vim.bo[args.buf].modifiable = true
|
||||
vim.bo[args.buf].modified = false -- Keep it marked as unmodified
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
-- ========================================================================
|
||||
-- ENABLE TREESITTER FOLDING FOR DART FILES
|
||||
-- ========================================================================
|
||||
-- Set fold method to use Treesitter for Flutter widgets
|
||||
-- Using multiple autocmds to ensure it sticks (some plugins override it)
|
||||
local fold_augroup = vim.api.nvim_create_augroup('DartFolding', { clear = true })
|
||||
|
||||
vim.api.nvim_create_autocmd({ 'BufRead', 'BufEnter', 'BufWinEnter' }, {
|
||||
group = fold_augroup,
|
||||
pattern = '*.dart',
|
||||
callback = function()
|
||||
vim.opt_local.foldmethod = 'expr'
|
||||
vim.opt_local.foldexpr = 'nvim_treesitter#foldexpr()'
|
||||
vim.opt_local.foldlevel = 99 -- High level = everything unfolded
|
||||
vim.opt_local.foldlevelstart = 99 -- Start with everything unfolded
|
||||
|
||||
-- Hide fold column (no extra column, folds still work!)
|
||||
vim.opt_local.foldcolumn = '0'
|
||||
|
||||
-- Minimal fold display (VS Code style - just shows first line)
|
||||
vim.opt_local.foldtext = ''
|
||||
end,
|
||||
})
|
||||
|
||||
-- Also set after LSP attaches (flutter-tools might reset it)
|
||||
vim.api.nvim_create_autocmd('LspAttach', {
|
||||
group = fold_augroup,
|
||||
callback = function(args)
|
||||
local client = vim.lsp.get_client_by_id(args.data.client_id)
|
||||
if client and client.name == 'dartls' then
|
||||
vim.opt_local.foldmethod = 'expr'
|
||||
vim.opt_local.foldexpr = 'nvim_treesitter#foldexpr()'
|
||||
vim.opt_local.foldlevel = 99 -- Everything unfolded
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
-- ========================================================================
|
||||
-- FLUTTER-SPECIFIC KEYMAPS
|
||||
-- ========================================================================
|
||||
-- These keymaps are only available when editing Dart files
|
||||
-- They provide quick access to common Flutter commands
|
||||
-- ========================================================================
|
||||
vim.api.nvim_create_autocmd('FileType', {
|
||||
pattern = 'dart',
|
||||
callback = function()
|
||||
local opts = { buffer = true, silent = true }
|
||||
|
||||
-- ========================================================================
|
||||
-- ENABLE TREESITTER FOLDING FOR DART FILES
|
||||
-- ========================================================================
|
||||
-- Set fold method to use Treesitter for Flutter widgets
|
||||
vim.opt_local.foldmethod = 'expr'
|
||||
vim.opt_local.foldexpr = 'nvim_treesitter#foldexpr()'
|
||||
vim.opt_local.foldenable = false -- Start with folds open
|
||||
vim.opt_local.foldlevel = 99
|
||||
vim.opt_local.foldlevelstart = 99
|
||||
|
||||
-- Flutter run/quit
|
||||
-- WORKFLOW:
|
||||
-- 1. First time: <leader>fd to select device
|
||||
-- 2. Then: <leader>fr to run (uses selected device)
|
||||
-- 3. Subsequent runs: <leader>fr uses same device
|
||||
vim.keymap.set('n', '<leader>fr', '<cmd>FlutterRun<cr>', vim.tbl_extend('force', opts, { desc = 'Flutter: Run app' }))
|
||||
vim.keymap.set('n', '<leader>fR', '<cmd>FlutterRestart<cr>', vim.tbl_extend('force', opts, { desc = 'Flutter: Hot restart' }))
|
||||
vim.keymap.set('n', '<leader>fh', '<cmd>FlutterReload<cr>', vim.tbl_extend('force', opts, { desc = 'Flutter: Hot reload' }))
|
||||
vim.keymap.set('n', '<leader>fq', '<cmd>FlutterQuit<cr>', vim.tbl_extend('force', opts, { desc = 'Flutter: Quit app' }))
|
||||
|
||||
-- Code Actions (Cmd+. equivalent) - wrap, remove, extract widgets, etc.
|
||||
vim.keymap.set('n', '<leader>.', vim.lsp.buf.code_action, vim.tbl_extend('force', opts, { desc = 'Flutter: Code actions (Cmd+.)' }))
|
||||
vim.keymap.set('v', '<leader>.', vim.lsp.buf.code_action, vim.tbl_extend('force', opts, { desc = 'Flutter: Code actions (Cmd+.)' }))
|
||||
-- Alternative: use the default LSP keymap
|
||||
vim.keymap.set('n', 'gra', vim.lsp.buf.code_action, vim.tbl_extend('force', opts, { desc = '[G]oto Code [A]ction' }))
|
||||
vim.keymap.set('v', 'gra', vim.lsp.buf.code_action, vim.tbl_extend('force', opts, { desc = '[G]oto Code [A]ction' }))
|
||||
|
||||
-- Device management
|
||||
-- Use <leader>fd to see/select devices FIRST, then <leader>fr will use that device
|
||||
vim.keymap.set('n', '<leader>fd', '<cmd>FlutterDevices<cr>', vim.tbl_extend('force', opts, { desc = 'Flutter: Select device' }))
|
||||
vim.keymap.set('n', '<leader>fe', '<cmd>FlutterEmulators<cr>', vim.tbl_extend('force', opts, { desc = 'Flutter: Launch emulator' }))
|
||||
|
||||
-- Dev tools and debugging
|
||||
vim.keymap.set('n', '<leader>fo', '<cmd>FlutterOutlineToggle<cr>', vim.tbl_extend('force', opts, { desc = 'Flutter: Toggle outline' }))
|
||||
vim.keymap.set('n', '<leader>ft', '<cmd>FlutterDevTools<cr>', vim.tbl_extend('force', opts, { desc = 'Flutter: Start DevTools' }))
|
||||
vim.keymap.set(
|
||||
'n',
|
||||
'<leader>fc',
|
||||
'<cmd>FlutterCopyProfilerUrl<cr>',
|
||||
vim.tbl_extend('force', opts, { desc = 'Flutter: Copy profiler URL' })
|
||||
)
|
||||
|
||||
-- Attach/Detach
|
||||
vim.keymap.set('n', '<leader>fa', '<cmd>FlutterAttach<cr>', vim.tbl_extend('force', opts, { desc = 'Flutter: Attach to app' }))
|
||||
vim.keymap.set('n', '<leader>fD', '<cmd>FlutterDetach<cr>', vim.tbl_extend('force', opts, { desc = 'Flutter: Detach from app' }))
|
||||
|
||||
-- Logs
|
||||
vim.keymap.set('n', '<leader>fL', '<cmd>FlutterLogToggle<cr>', vim.tbl_extend('force', opts, { desc = 'Flutter: Toggle logs' }))
|
||||
|
||||
-- LSP
|
||||
vim.keymap.set('n', '<leader>fl', '<cmd>FlutterLspRestart<cr>', vim.tbl_extend('force', opts, { desc = 'Flutter: Restart LSP' }))
|
||||
|
||||
-- ========================================================================
|
||||
-- DEBUG KEYMAPS - Available only in Dart files
|
||||
-- ========================================================================
|
||||
-- Function key shortcuts (standard debugging)
|
||||
vim.keymap.set('n', '<F5>', function()
|
||||
require('dap').continue()
|
||||
end, vim.tbl_extend('force', opts, { desc = 'Debug: Start/Continue' }))
|
||||
|
||||
vim.keymap.set('n', '<F10>', function()
|
||||
require('dap').step_over()
|
||||
end, vim.tbl_extend('force', opts, { desc = 'Debug: Step Over' }))
|
||||
|
||||
vim.keymap.set('n', '<F11>', function()
|
||||
require('dap').step_into()
|
||||
end, vim.tbl_extend('force', opts, { desc = 'Debug: Step Into' }))
|
||||
|
||||
vim.keymap.set('n', '<F12>', function()
|
||||
require('dap').step_out()
|
||||
end, vim.tbl_extend('force', opts, { desc = 'Debug: Step Out' }))
|
||||
|
||||
-- Leader-based debug commands
|
||||
vim.keymap.set('n', '<leader>db', function()
|
||||
require('dap').toggle_breakpoint()
|
||||
end, vim.tbl_extend('force', opts, { desc = '[D]ebug: Toggle [B]reakpoint' }))
|
||||
|
||||
vim.keymap.set('n', '<leader>dB', function()
|
||||
require('dap').set_breakpoint(vim.fn.input 'Breakpoint condition: ')
|
||||
end, vim.tbl_extend('force', opts, { desc = '[D]ebug: Set Conditional [B]reakpoint' }))
|
||||
|
||||
vim.keymap.set('n', '<leader>dc', function()
|
||||
require('dap').continue()
|
||||
end, vim.tbl_extend('force', opts, { desc = '[D]ebug: [C]ontinue' }))
|
||||
|
||||
vim.keymap.set('n', '<leader>dt', function()
|
||||
require('dap').terminate()
|
||||
end, vim.tbl_extend('force', opts, { desc = '[D]ebug: [T]erminate' }))
|
||||
|
||||
vim.keymap.set('n', '<leader>du', function()
|
||||
require('dapui').toggle()
|
||||
end, vim.tbl_extend('force', opts, { desc = '[D]ebug: Toggle [U]I' }))
|
||||
|
||||
-- Register groups with which-key
|
||||
require('which-key').add {
|
||||
{ '<leader>f', group = '[F]lutter', mode = 'n' },
|
||||
{ '<leader>d', group = '[D]ebug', mode = 'n' },
|
||||
}
|
||||
end,
|
||||
})
|
||||
end,
|
||||
},
|
||||
|
||||
-- ========================================================================
|
||||
-- DART TREESITTER - Ensure dart parser is installed for proper folding
|
||||
-- ========================================================================
|
||||
{
|
||||
'nvim-treesitter/nvim-treesitter',
|
||||
ft = 'dart',
|
||||
opts = function(_, opts)
|
||||
-- Ensure Dart parser is installed
|
||||
opts.ensure_installed = opts.ensure_installed or {}
|
||||
vim.list_extend(opts.ensure_installed, { 'dart' })
|
||||
return opts
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
|
@ -0,0 +1,396 @@
|
|||
-- ========================================================================
|
||||
-- CHEATSHEET - Comprehensive keymap reference
|
||||
-- ========================================================================
|
||||
-- Complete cheatsheet including:
|
||||
-- - Vim default keymaps
|
||||
-- - Custom leader keymaps
|
||||
-- - Plugin-specific keymaps (Telescope, Neo-tree, etc.)
|
||||
-- - LSP keymaps
|
||||
-- - Language-specific keymaps
|
||||
-- ========================================================================
|
||||
|
||||
return {
|
||||
-- Enhanced cheatsheet with custom data
|
||||
{
|
||||
'nvim-telescope/telescope.nvim',
|
||||
keys = {
|
||||
{
|
||||
'<leader>sc',
|
||||
function()
|
||||
-- Create a custom cheatsheet picker
|
||||
local pickers = require 'telescope.pickers'
|
||||
local finders = require 'telescope.finders'
|
||||
local conf = require('telescope.config').values
|
||||
local actions = require 'telescope.actions'
|
||||
local action_state = require 'telescope.actions.state'
|
||||
|
||||
-- Comprehensive keymap data
|
||||
local cheatsheet = {
|
||||
-- ============================================================
|
||||
-- VIM ESSENTIALS
|
||||
-- ============================================================
|
||||
{ category = 'Vim: Motion', key = 'h/j/k/l', desc = 'Left/Down/Up/Right' },
|
||||
{ category = 'Vim: Motion', key = 'w/b/e', desc = 'Word forward/backward/end' },
|
||||
{ category = 'Vim: Motion', key = '0/$', desc = 'Start/end of line' },
|
||||
{ category = 'Vim: Motion', key = 'gg/G', desc = 'First/last line' },
|
||||
{ category = 'Vim: Motion', key = '{/}', desc = 'Previous/next paragraph' },
|
||||
{ category = 'Vim: Motion', key = '%', desc = 'Jump to matching bracket' },
|
||||
{ category = 'Vim: Motion', key = 'f/F{char}', desc = 'Find char forward/backward' },
|
||||
{ category = 'Vim: Motion', key = 't/T{char}', desc = 'Till char forward/backward' },
|
||||
{ category = 'Vim: Motion', key = ';/,', desc = 'Repeat f/t forward/backward' },
|
||||
{ category = 'Vim: Motion', key = '*/#', desc = 'Search word under cursor' },
|
||||
{ category = 'Vim: Motion', key = 'n/N', desc = 'Next/previous search result' },
|
||||
|
||||
{ category = 'Vim: Editing', key = 'i/a', desc = 'Insert before/after cursor' },
|
||||
{ category = 'Vim: Editing', key = 'I/A', desc = 'Insert at line start/end' },
|
||||
{ category = 'Vim: Editing', key = 'o/O', desc = 'New line below/above' },
|
||||
{ category = 'Vim: Editing', key = 'x/X', desc = 'Delete char under/before cursor' },
|
||||
{ category = 'Vim: Editing', key = 'd{motion}', desc = 'Delete (dw, dd, d$)' },
|
||||
{ category = 'Vim: Editing', key = 'c{motion}', desc = 'Change (cw, cc, c$)' },
|
||||
{ category = 'Vim: Editing', key = 'y{motion}', desc = 'Yank/copy (yw, yy, y$)' },
|
||||
{ category = 'Vim: Editing', key = 'p/P', desc = 'Paste after/before cursor' },
|
||||
{ category = 'Vim: Editing', key = 'u/Ctrl-r', desc = 'Undo/redo' },
|
||||
{ category = 'Vim: Editing', key = '.', desc = 'Repeat last change' },
|
||||
{ category = 'Vim: Editing', key = 'r{char}', desc = 'Replace character' },
|
||||
{ category = 'Vim: Editing', key = 'J', desc = 'Join lines' },
|
||||
{ category = 'Vim: Editing', key = '~', desc = 'Toggle case' },
|
||||
{ category = 'Vim: Editing', key = '>>/<<', desc = 'Indent/unindent line' },
|
||||
|
||||
{ category = 'Vim: Visual', key = 'v/V/Ctrl-v', desc = 'Visual/line/block mode' },
|
||||
{ category = 'Vim: Visual', key = 'o', desc = 'Go to other end of selection' },
|
||||
{ category = 'Vim: Visual', key = 'gv', desc = 'Reselect last visual' },
|
||||
|
||||
{ category = 'Vim: Search', key = '/{pattern}', desc = 'Search forward' },
|
||||
{ category = 'Vim: Search', key = '?{pattern}', desc = 'Search backward' },
|
||||
{ category = 'Vim: Search', key = ':s/old/new/g', desc = 'Substitute in line' },
|
||||
{ category = 'Vim: Search', key = ':%s/old/new/g', desc = 'Substitute in file' },
|
||||
{ category = 'Vim: Search', key = ':noh', desc = 'Clear search highlight' },
|
||||
|
||||
{ category = 'Vim: Windows', key = 'Ctrl-w s', desc = 'Split horizontal' },
|
||||
{ category = 'Vim: Windows', key = 'Ctrl-w v', desc = 'Split vertical' },
|
||||
{ category = 'Vim: Windows', key = 'Ctrl-w c', desc = 'Close window' },
|
||||
{ category = 'Vim: Windows', key = 'Ctrl-w o', desc = 'Close other windows' },
|
||||
{ category = 'Vim: Windows', key = 'Ctrl-w =', desc = 'Balance windows' },
|
||||
{ category = 'Vim: Windows', key = 'Ctrl-h/j/k/l', desc = 'Navigate windows' },
|
||||
|
||||
{ category = 'Vim: Tabs', key = ':tabnew', desc = 'New tab' },
|
||||
{ category = 'Vim: Tabs', key = ':tabc', desc = 'Close tab' },
|
||||
{ category = 'Vim: Tabs', key = 'gt/gT', desc = 'Next/previous tab' },
|
||||
|
||||
{ category = 'Vim: Files', key = ':w', desc = 'Save file' },
|
||||
{ category = 'Vim: Files', key = ':q', desc = 'Quit' },
|
||||
{ category = 'Vim: Files', key = ':wq or ZZ', desc = 'Save and quit' },
|
||||
{ category = 'Vim: Files', key = ':q! or ZQ', desc = 'Quit without saving' },
|
||||
|
||||
-- ============================================================
|
||||
-- LEADER KEYMAPS (CORE)
|
||||
-- ============================================================
|
||||
{ category = 'Core: Quit', key = '<Space>Q', desc = 'Quit all' },
|
||||
{ category = 'Core: Quit', key = '<Space>q', desc = 'Quickfix diagnostics' },
|
||||
{ category = 'Core: Files', key = '\\', desc = 'Toggle Neo-tree' },
|
||||
{ category = 'Core: Terminal', key = 'Esc Esc', desc = 'Exit terminal mode (in terminal)' },
|
||||
|
||||
-- ============================================================
|
||||
-- BUFFER OPERATIONS
|
||||
-- ============================================================
|
||||
{ category = 'Buffer', key = '<Space>bd', desc = 'Delete buffer' },
|
||||
{ category = 'Buffer', key = '<Space>bD', desc = 'Delete buffer (force)' },
|
||||
{ category = 'Buffer', key = '<Space>bn', desc = 'Next buffer' },
|
||||
{ category = 'Buffer', key = '<Space>bp', desc = 'Previous buffer' },
|
||||
{ category = 'Buffer', key = '<Space>bo', desc = 'Delete other buffers' },
|
||||
{ category = 'Buffer', key = '<Space><Space>', desc = 'Find buffers (Telescope)' },
|
||||
|
||||
-- ============================================================
|
||||
-- WINDOW OPERATIONS
|
||||
-- ============================================================
|
||||
{ category = 'Window', key = '<Space>ww', desc = 'Other window' },
|
||||
{ category = 'Window', key = '<Space>wd', desc = 'Delete window' },
|
||||
{ category = 'Window', key = '<Space>ws', desc = 'Split below' },
|
||||
{ category = 'Window', key = '<Space>wv', desc = 'Split right' },
|
||||
{ category = 'Window', key = '<Space>wm', desc = 'Maximize' },
|
||||
{ category = 'Window', key = '<Space>w=', desc = 'Balance windows' },
|
||||
{ category = 'Window', key = '<Space>wh/j/k/l', desc = 'Navigate windows' },
|
||||
|
||||
-- ============================================================
|
||||
-- SEARCH (TELESCOPE)
|
||||
-- ============================================================
|
||||
{ category = 'Search', key = '<Space>sh', desc = 'Help' },
|
||||
{ category = 'Search', key = '<Space>sk', desc = 'Keymaps' },
|
||||
{ category = 'Search', key = '<Space>sf', desc = 'Files' },
|
||||
{ category = 'Search', key = '<Space>ss', desc = 'Select Telescope' },
|
||||
{ category = 'Search', key = '<Space>sw', desc = 'Current word' },
|
||||
{ category = 'Search', key = '<Space>sg', desc = 'Grep' },
|
||||
{ category = 'Search', key = '<Space>sd', desc = 'Diagnostics' },
|
||||
{ category = 'Search', key = '<Space>sr', desc = 'Resume' },
|
||||
{ category = 'Search', key = '<Space>s.', desc = 'Recent files' },
|
||||
{ category = 'Search', key = '<Space>s/', desc = 'In open files' },
|
||||
{ category = 'Search', key = '<Space>sn', desc = 'Neovim config' },
|
||||
{ category = 'Search', key = '<Space>sc', desc = 'Cheatsheet (this!)' },
|
||||
{ category = 'Search', key = '<Space>sK', desc = 'All keymaps (which-key)' },
|
||||
{ category = 'Search', key = '<Space>/', desc = 'Fuzzy find in buffer' },
|
||||
|
||||
-- ============================================================
|
||||
-- SESSION
|
||||
-- ============================================================
|
||||
{ category = 'Session', key = '<Space>Ss', desc = 'Save session' },
|
||||
{ category = 'Session', key = '<Space>Sr', desc = 'Restore session' },
|
||||
{ category = 'Session', key = '<Space>Sd', desc = 'Delete session' },
|
||||
|
||||
-- ============================================================
|
||||
-- UI OPERATIONS
|
||||
-- ============================================================
|
||||
{ category = 'UI', key = '<Space>ul', desc = 'Open Lazy' },
|
||||
{ category = 'UI', key = '<Space>um', desc = 'Open Mason' },
|
||||
{ category = 'UI', key = '<Space>ui', desc = 'Inspect position' },
|
||||
{ category = 'UI', key = '<Space>uI', desc = 'Inspect tree' },
|
||||
{ category = 'UI', key = '<Space>un', desc = 'Dismiss notifications' },
|
||||
|
||||
-- ============================================================
|
||||
-- TOGGLE
|
||||
-- ============================================================
|
||||
{ category = 'Toggle', key = '<Space>th', desc = 'Inlay hints' },
|
||||
|
||||
-- ============================================================
|
||||
-- DIAGNOSTICS
|
||||
-- ============================================================
|
||||
{ category = 'Diagnostics', key = '<Space>xx', desc = 'Toggle diagnostics (Trouble)' },
|
||||
{ category = 'Diagnostics', key = '<Space>xX', desc = 'Buffer diagnostics (Trouble)' },
|
||||
{ category = 'Diagnostics', key = '<Space>xs', desc = 'Symbols (Trouble)' },
|
||||
|
||||
-- ============================================================
|
||||
-- GIT
|
||||
-- ============================================================
|
||||
{ category = 'Git', key = '<Space>hs', desc = 'Stage hunk' },
|
||||
{ category = 'Git', key = '<Space>hr', desc = 'Reset hunk' },
|
||||
{ category = 'Git', key = '<Space>hS', desc = 'Stage buffer' },
|
||||
{ category = 'Git', key = '<Space>hu', desc = 'Undo stage hunk' },
|
||||
{ category = 'Git', key = '<Space>hR', desc = 'Reset buffer' },
|
||||
{ category = 'Git', key = '<Space>hp', desc = 'Preview hunk' },
|
||||
{ category = 'Git', key = '<Space>hb', desc = 'Blame line' },
|
||||
{ category = 'Git', key = '<Space>hd', desc = 'Diff this' },
|
||||
{ category = 'Git', key = '<Space>hD', desc = 'Diff this ~' },
|
||||
|
||||
-- ============================================================
|
||||
-- LSP (ALL LANGUAGES)
|
||||
-- ============================================================
|
||||
{ category = 'LSP', key = 'K', desc = 'Hover documentation' },
|
||||
{ category = 'LSP', key = 'grd', desc = 'Go to definition' },
|
||||
{ category = 'LSP', key = 'grD', desc = 'Go to declaration' },
|
||||
{ category = 'LSP', key = 'gri', desc = 'Go to implementation' },
|
||||
{ category = 'LSP', key = 'grr', desc = 'Go to references' },
|
||||
{ category = 'LSP', key = 'grt', desc = 'Go to type definition' },
|
||||
{ category = 'LSP', key = 'grn', desc = 'Rename' },
|
||||
{ category = 'LSP', key = 'gra', desc = 'Code action' },
|
||||
{ category = 'LSP', key = 'gO', desc = 'Document symbols' },
|
||||
{ category = 'LSP', key = 'gW', desc = 'Workspace symbols' },
|
||||
|
||||
-- ============================================================
|
||||
-- DEBUG (ALL LANGUAGES)
|
||||
-- ============================================================
|
||||
{ category = 'Debug', key = 'F5 or <Space>dc', desc = 'Start/Continue' },
|
||||
{ category = 'Debug', key = 'F10 or <Space>dO', desc = 'Step over' },
|
||||
{ category = 'Debug', key = 'F11 or <Space>di', desc = 'Step into' },
|
||||
{ category = 'Debug', key = 'F12 or <Space>do', desc = 'Step out' },
|
||||
{ category = 'Debug', key = '<Space>db', desc = 'Toggle breakpoint' },
|
||||
{ category = 'Debug', key = '<Space>dB', desc = 'Conditional breakpoint' },
|
||||
{ category = 'Debug', key = '<Space>dc or F5', desc = 'Continue' },
|
||||
{ category = 'Debug', key = '<Space>di or F11', desc = 'Step into' },
|
||||
{ category = 'Debug', key = '<Space>do or F12', desc = 'Step out' },
|
||||
{ category = 'Debug', key = '<Space>dO or F10', desc = 'Step over' },
|
||||
{ category = 'Debug', key = '<Space>dt', desc = 'Terminate' },
|
||||
{ category = 'Debug', key = '<Space>dr', desc = 'Toggle REPL' },
|
||||
{ category = 'Debug', key = '<Space>dl', desc = 'Run last' },
|
||||
{ category = 'Debug', key = '<Space>dC', desc = 'Run to cursor' },
|
||||
{ category = 'Debug', key = '<Space>du', desc = 'Toggle UI' },
|
||||
{ category = 'Debug', key = '<Space>de', desc = 'Eval expression' },
|
||||
|
||||
-- ============================================================
|
||||
-- FLUTTER (DART FILES)
|
||||
-- ============================================================
|
||||
{ category = 'Flutter', key = '<Space>fr', desc = 'Run app' },
|
||||
{ category = 'Flutter', key = '<Space>fR', desc = 'Hot restart' },
|
||||
{ category = 'Flutter', key = '<Space>fh', desc = 'Hot reload' },
|
||||
{ category = 'Flutter', key = '<Space>fq', desc = 'Quit app' },
|
||||
{ category = 'Flutter', key = '<Space>fd', desc = 'Select device' },
|
||||
{ category = 'Flutter', key = '<Space>fe', desc = 'Launch emulator' },
|
||||
{ category = 'Flutter', key = '<Space>fo', desc = 'Toggle outline' },
|
||||
{ category = 'Flutter', key = '<Space>ft', desc = 'Start DevTools' },
|
||||
{ category = 'Flutter', key = '<Space>fa', desc = 'Attach to app' },
|
||||
{ category = 'Flutter', key = '<Space>fD', desc = 'Detach from app' },
|
||||
{ category = 'Flutter', key = '<Space>fL', desc = 'Toggle logs' },
|
||||
{ category = 'Flutter', key = '<Space>fc', desc = 'Copy profiler URL' },
|
||||
{ category = 'Flutter', key = '<Space>fl', desc = 'Restart LSP' },
|
||||
{ category = 'Flutter', key = '<Space>. or gra', desc = 'Code actions (Cmd+.)' },
|
||||
|
||||
-- ============================================================
|
||||
-- RUST (RUST FILES)
|
||||
-- ============================================================
|
||||
{ category = 'Rust', key = '<Space>rh', desc = 'Hover actions' },
|
||||
{ category = 'Rust', key = '<Space>ra', desc = 'Code actions' },
|
||||
{ category = 'Rust', key = '<Space>re', desc = 'Explain error' },
|
||||
{ category = 'Rust', key = '<Space>rC', desc = 'Open Cargo.toml' },
|
||||
{ category = 'Rust', key = '<Space>rp', desc = 'Parent module' },
|
||||
{ category = 'Rust', key = '<Space>rj', desc = 'Join lines' },
|
||||
{ category = 'Rust', key = '<Space>rr', desc = 'Runnables' },
|
||||
{ category = 'Rust', key = '<Space>rd', desc = 'Debuggables' },
|
||||
{ category = 'Rust', key = '<Space>rm', desc = 'Expand macro' },
|
||||
|
||||
-- ============================================================
|
||||
-- RUST CRATES (CARGO.TOML)
|
||||
-- ============================================================
|
||||
{ category = 'Rust: Crates', key = '<Space>rct', desc = 'Toggle' },
|
||||
{ category = 'Rust: Crates', key = '<Space>rcr', desc = 'Reload' },
|
||||
{ category = 'Rust: Crates', key = '<Space>rcv', desc = 'Show versions' },
|
||||
{ category = 'Rust: Crates', key = '<Space>rcf', desc = 'Show features' },
|
||||
{ category = 'Rust: Crates', key = '<Space>rcd', desc = 'Show dependencies' },
|
||||
{ category = 'Rust: Crates', key = '<Space>rcu', desc = 'Update crate' },
|
||||
{ category = 'Rust: Crates', key = '<Space>rca', desc = 'Update all' },
|
||||
{ category = 'Rust: Crates', key = '<Space>rcU', desc = 'Upgrade crate' },
|
||||
{ category = 'Rust: Crates', key = '<Space>rcA', desc = 'Upgrade all' },
|
||||
|
||||
-- ============================================================
|
||||
-- PYTHON (PYTHON FILES)
|
||||
-- ============================================================
|
||||
{ category = 'Python', key = '<Space>pr', desc = 'Run file' },
|
||||
{ category = 'Python', key = '<Space>pR', desc = 'Run with args' },
|
||||
{ category = 'Python', key = '<Space>pe', desc = 'Select venv' },
|
||||
{ category = 'Python', key = '<Space>pl', desc = 'Restart LSP' },
|
||||
{ category = 'Python', key = '<Space>pi', desc = 'Organize imports' },
|
||||
{ category = 'Python', key = '<Space>pf', desc = 'Format code' },
|
||||
|
||||
-- ============================================================
|
||||
-- SVELTE (SVELTE FILES)
|
||||
-- ============================================================
|
||||
{ category = 'Svelte', key = '<Space>vf', desc = 'Format with prettier' },
|
||||
{ category = 'Svelte', key = '<Space>vl', desc = 'Restart Svelte LSP' },
|
||||
{ category = 'Svelte', key = '<Space>vt', desc = 'Restart TypeScript LSP' },
|
||||
{ category = 'Svelte', key = '<Space>vo', desc = 'Open component in split' },
|
||||
|
||||
-- ============================================================
|
||||
-- TELESCOPE (INSIDE TELESCOPE)
|
||||
-- ============================================================
|
||||
{ category = 'Telescope', key = 'Ctrl-j/k or j/k', desc = 'Next/previous item' },
|
||||
{ category = 'Telescope', key = 'Ctrl-d/u', desc = 'Scroll preview down/up' },
|
||||
{ category = 'Telescope', key = 'Enter', desc = 'Open in current window' },
|
||||
{ category = 'Telescope', key = 'Ctrl-x', desc = 'Open in horizontal split' },
|
||||
{ category = 'Telescope', key = 'Ctrl-v', desc = 'Open in vertical split' },
|
||||
{ category = 'Telescope', key = 'Ctrl-t', desc = 'Open in new tab' },
|
||||
{ category = 'Telescope', key = 'Ctrl-c/Esc/q', desc = 'Close' },
|
||||
{ category = 'Telescope', key = 'Tab/Shift-Tab', desc = 'Toggle selection' },
|
||||
{ category = 'Telescope', key = 'Ctrl-q', desc = 'Send all to quickfix' },
|
||||
{ category = 'Telescope', key = 'Alt-q', desc = 'Send selected to quickfix' },
|
||||
{ category = 'Telescope', key = '? (normal)', desc = 'Show help' },
|
||||
{ category = 'Telescope', key = 'gg/G (normal)', desc = 'First/last item' },
|
||||
|
||||
-- ============================================================
|
||||
-- NEO-TREE (INSIDE NEO-TREE)
|
||||
-- ============================================================
|
||||
{ category = 'Neo-tree', key = '\\, q, or Esc', desc = 'Close Neo-tree' },
|
||||
{ category = 'Neo-tree', key = 'Enter, o, or 2-click', desc = 'Open file' },
|
||||
{ category = 'Neo-tree', key = 'Ctrl-x or S', desc = 'Open in horizontal split' },
|
||||
{ category = 'Neo-tree', key = 'Ctrl-v or s', desc = 'Open in vertical split' },
|
||||
{ category = 'Neo-tree', key = 'Ctrl-t or t', desc = 'Open in new tab' },
|
||||
{ category = 'Neo-tree', key = 'w', desc = 'Open with window picker' },
|
||||
{ category = 'Neo-tree', key = 'Ctrl-j or >', desc = 'Next source (files/buffers/git)' },
|
||||
{ category = 'Neo-tree', key = 'Ctrl-k or <', desc = 'Previous source' },
|
||||
{ category = 'Neo-tree', key = 'P', desc = 'Toggle preview (float)' },
|
||||
{ category = 'Neo-tree', key = 'l', desc = 'Focus preview' },
|
||||
{ category = 'Neo-tree', key = 'R', desc = 'Refresh' },
|
||||
{ category = 'Neo-tree', key = 'H', desc = 'Toggle hidden files' },
|
||||
{ category = 'Neo-tree', key = '-', desc = 'Navigate up (parent dir)' },
|
||||
{ category = 'Neo-tree', key = '.', desc = 'Set root (cd into directory)' },
|
||||
{ category = 'Neo-tree', key = 'C', desc = 'Close node (collapse folder)' },
|
||||
{ category = 'Neo-tree', key = 'z', desc = 'Close all nodes' },
|
||||
{ category = 'Neo-tree', key = 'e', desc = 'Toggle auto expand width' },
|
||||
{ category = 'Neo-tree', key = 'a', desc = 'Add file' },
|
||||
{ category = 'Neo-tree', key = 'A', desc = 'Add directory' },
|
||||
{ category = 'Neo-tree', key = 'd', desc = 'Delete' },
|
||||
{ category = 'Neo-tree', key = 'r', desc = 'Rename' },
|
||||
{ category = 'Neo-tree', key = 'y', desc = 'Copy to clipboard' },
|
||||
{ category = 'Neo-tree', key = 'x', desc = 'Cut to clipboard' },
|
||||
{ category = 'Neo-tree', key = 'p', desc = 'Paste from clipboard' },
|
||||
{ category = 'Neo-tree', key = 'c', desc = 'Copy (with path input)' },
|
||||
{ category = 'Neo-tree', key = 'm', desc = 'Move (with path input)' },
|
||||
{ category = 'Neo-tree', key = '?', desc = 'Show help (in Neo-tree)' },
|
||||
{ category = 'Neo-tree', key = '<Space>sf', desc = 'Telescope find from this dir' },
|
||||
{ category = 'Neo-tree', key = '<Space>sg', desc = 'Telescope grep from this dir' },
|
||||
|
||||
-- ============================================================
|
||||
-- MINI.AI (TEXT OBJECTS)
|
||||
-- ============================================================
|
||||
{ category = 'Text Objects', key = 'a/i + object', desc = 'Around/inside (w, p, [, {, ", \', `, t)' },
|
||||
{ category = 'Text Objects', key = 'daw', desc = 'Delete around word' },
|
||||
{ category = 'Text Objects', key = 'ciw', desc = 'Change inside word' },
|
||||
{ category = 'Text Objects', key = 'di"', desc = 'Delete inside quotes' },
|
||||
{ category = 'Text Objects', key = 'da(', desc = 'Delete around parentheses' },
|
||||
{ category = 'Text Objects', key = 'vit', desc = 'Visual inside tag' },
|
||||
|
||||
-- ============================================================
|
||||
-- MINI.SURROUND
|
||||
-- ============================================================
|
||||
{ category = 'Surround', key = 'sa{motion}{char}', desc = 'Add surround' },
|
||||
{ category = 'Surround', key = 'sd{char}', desc = 'Delete surround' },
|
||||
{ category = 'Surround', key = 'sr{old}{new}', desc = 'Replace surround' },
|
||||
{ category = 'Surround', key = 'sf{char}', desc = 'Find right surround' },
|
||||
{ category = 'Surround', key = 'sF{char}', desc = 'Find left surround' },
|
||||
{ category = 'Surround', key = 'sh', desc = 'Highlight surround' },
|
||||
}
|
||||
|
||||
-- Create picker
|
||||
pickers
|
||||
.new({}, {
|
||||
prompt_title = ' Complete Cheatsheet',
|
||||
finder = finders.new_table {
|
||||
results = cheatsheet,
|
||||
entry_maker = function(entry)
|
||||
return {
|
||||
value = entry,
|
||||
display = string.format('%-20s %-25s %s', entry.category, entry.key, entry.desc),
|
||||
ordinal = entry.category .. ' ' .. entry.key .. ' ' .. entry.desc,
|
||||
}
|
||||
end,
|
||||
},
|
||||
sorter = conf.generic_sorter {},
|
||||
attach_mappings = function(prompt_bufnr, map)
|
||||
actions.select_default:replace(function()
|
||||
actions.close(prompt_bufnr)
|
||||
local selection = action_state.get_selected_entry()
|
||||
if selection then
|
||||
vim.notify(
|
||||
string.format('%s: %s\n%s', selection.value.category, selection.value.key, selection.value.desc),
|
||||
vim.log.levels.INFO,
|
||||
{ title = 'Keymap' }
|
||||
)
|
||||
end
|
||||
end)
|
||||
return true
|
||||
end,
|
||||
})
|
||||
:find()
|
||||
end,
|
||||
desc = 'Cheatsheet (complete reference)',
|
||||
},
|
||||
{
|
||||
'<leader>?',
|
||||
function()
|
||||
require('telescope.builtin').keymaps()
|
||||
end,
|
||||
desc = 'Search keymaps',
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- Which-key can also show a searchable list
|
||||
{
|
||||
'folke/which-key.nvim',
|
||||
keys = {
|
||||
{
|
||||
'<leader>sK',
|
||||
function()
|
||||
require('which-key').show { global = true }
|
||||
end,
|
||||
desc = 'All keymaps (which-key)',
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
@ -0,0 +1,49 @@
|
|||
-- ========================================================================
|
||||
-- DEBUG CONFIGURATION - Global DAP keymaps
|
||||
-- ========================================================================
|
||||
-- These keymaps are available whenever nvim-dap is loaded
|
||||
-- Works for all languages: Flutter, Rust, Python, etc.
|
||||
-- ========================================================================
|
||||
|
||||
return {
|
||||
-- nvim-dap: Debug Adapter Protocol client
|
||||
{
|
||||
'mfussenegger/nvim-dap',
|
||||
optional = true,
|
||||
keys = {
|
||||
-- Function key shortcuts (standard debugging across all editors)
|
||||
{ '<F5>', function() require('dap').continue() end, desc = 'Debug: Start/Continue' },
|
||||
{ '<F10>', function() require('dap').step_over() end, desc = 'Debug: Step over' },
|
||||
{ '<F11>', function() require('dap').step_into() end, desc = 'Debug: Step into' },
|
||||
{ '<F12>', function() require('dap').step_out() end, desc = 'Debug: Step out' },
|
||||
|
||||
-- Leader-based debug commands (more discoverable)
|
||||
{ '<leader>db', function() require('dap').toggle_breakpoint() end, desc = 'Toggle breakpoint' },
|
||||
{ '<leader>dB', function() require('dap').set_breakpoint(vim.fn.input('Breakpoint condition: ')) end, desc = 'Conditional breakpoint' },
|
||||
{ '<leader>dc', function() require('dap').continue() end, desc = 'Continue' },
|
||||
{ '<leader>di', function() require('dap').step_into() end, desc = 'Step into' },
|
||||
{ '<leader>do', function() require('dap').step_out() end, desc = 'Step out' },
|
||||
{ '<leader>dO', function() require('dap').step_over() end, desc = 'Step over' },
|
||||
{ '<leader>dt', function() require('dap').terminate() end, desc = 'Terminate' },
|
||||
{ '<leader>dr', function() require('dap').repl.toggle() end, desc = 'Toggle REPL' },
|
||||
{ '<leader>dl', function() require('dap').run_last() end, desc = 'Run last' },
|
||||
{ '<leader>dC', function() require('dap').run_to_cursor() end, desc = 'Run to cursor' },
|
||||
},
|
||||
config = function()
|
||||
-- Register which-key group
|
||||
require('which-key').add {
|
||||
{ '<leader>d', group = ' debug' },
|
||||
}
|
||||
end,
|
||||
},
|
||||
|
||||
-- nvim-dap-ui: UI for nvim-dap
|
||||
{
|
||||
'rcarriga/nvim-dap-ui',
|
||||
optional = true,
|
||||
keys = {
|
||||
{ '<leader>du', function() require('dapui').toggle() end, desc = 'Toggle UI' },
|
||||
{ '<leader>de', function() require('dapui').eval() end, desc = 'Eval', mode = { 'n', 'v' } },
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
@ -33,10 +33,64 @@ return {
|
|||
defaults = {
|
||||
mappings = {
|
||||
i = {
|
||||
-- Navigation (consistent with Neo-tree)
|
||||
['<C-j>'] = require('telescope.actions').move_selection_next,
|
||||
['<C-k>'] = require('telescope.actions').move_selection_previous,
|
||||
|
||||
-- Preview scrolling
|
||||
['<C-d>'] = require('telescope.actions').preview_scrolling_down,
|
||||
['<C-u>'] = require('telescope.actions').preview_scrolling_up,
|
||||
|
||||
-- Open actions (consistent with Neo-tree)
|
||||
['<CR>'] = require('telescope.actions').select_default, -- Open in current window
|
||||
['<C-x>'] = require('telescope.actions').select_horizontal, -- Open in horizontal split
|
||||
['<C-v>'] = require('telescope.actions').select_vertical, -- Open in vertical split
|
||||
['<C-t>'] = require('telescope.actions').select_tab, -- Open in new tab
|
||||
|
||||
-- Close
|
||||
['<C-c>'] = require('telescope.actions').close,
|
||||
['<Esc>'] = require('telescope.actions').close,
|
||||
|
||||
-- Cycle history
|
||||
['<C-n>'] = require('telescope.actions').cycle_history_next,
|
||||
['<C-p>'] = require('telescope.actions').cycle_history_prev,
|
||||
|
||||
-- Selection
|
||||
['<Tab>'] = require('telescope.actions').toggle_selection + require('telescope.actions').move_selection_worse,
|
||||
['<S-Tab>'] = require('telescope.actions').toggle_selection + require('telescope.actions').move_selection_better,
|
||||
|
||||
-- Send to quickfix
|
||||
['<C-q>'] = require('telescope.actions').send_to_qflist + require('telescope.actions').open_qflist,
|
||||
['<M-q>'] = require('telescope.actions').send_selected_to_qflist + require('telescope.actions').open_qflist,
|
||||
},
|
||||
n = {
|
||||
-- Same mappings in normal mode
|
||||
['<C-j>'] = require('telescope.actions').move_selection_next,
|
||||
['<C-k>'] = require('telescope.actions').move_selection_previous,
|
||||
['<C-d>'] = require('telescope.actions').preview_scrolling_down,
|
||||
['<C-u>'] = require('telescope.actions').preview_scrolling_up,
|
||||
|
||||
['<CR>'] = require('telescope.actions').select_default,
|
||||
['<C-x>'] = require('telescope.actions').select_horizontal,
|
||||
['<C-v>'] = require('telescope.actions').select_vertical,
|
||||
['<C-t>'] = require('telescope.actions').select_tab,
|
||||
|
||||
['q'] = require('telescope.actions').close,
|
||||
['<Esc>'] = require('telescope.actions').close,
|
||||
|
||||
['<Tab>'] = require('telescope.actions').toggle_selection + require('telescope.actions').move_selection_worse,
|
||||
['<S-Tab>'] = require('telescope.actions').toggle_selection + require('telescope.actions').move_selection_better,
|
||||
|
||||
['<C-q>'] = require('telescope.actions').send_to_qflist + require('telescope.actions').open_qflist,
|
||||
['<M-q>'] = require('telescope.actions').send_selected_to_qflist + require('telescope.actions').open_qflist,
|
||||
|
||||
-- Vim-like navigation
|
||||
['j'] = require('telescope.actions').move_selection_next,
|
||||
['k'] = require('telescope.actions').move_selection_previous,
|
||||
['gg'] = require('telescope.actions').move_to_top,
|
||||
['G'] = require('telescope.actions').move_to_bottom,
|
||||
|
||||
['?'] = require('telescope.actions').which_key, -- Show help
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
@ -88,6 +142,24 @@ return {
|
|||
event = 'VimEnter',
|
||||
opts = {
|
||||
delay = 0,
|
||||
-- Floating window configuration (bottom right)
|
||||
win = {
|
||||
width = { min = 30, max = 60 }, -- Width range for the popup
|
||||
height = { min = 4, max = 0.9 }, -- Max 90% of screen height - fits all items
|
||||
col = 0.99, -- Position close to right edge
|
||||
row = 0.95, -- Position close to bottom
|
||||
border = 'rounded', -- Border style
|
||||
padding = { 1, 2 }, -- Padding inside window
|
||||
title = true, -- Show title
|
||||
title_pos = 'center', -- Center the title
|
||||
wo = {
|
||||
winblend = 0, -- No transparency (0-100)
|
||||
},
|
||||
},
|
||||
layout = {
|
||||
width = { min = 30 }, -- Minimum column width
|
||||
spacing = 3, -- Spacing between columns
|
||||
},
|
||||
icons = {
|
||||
mappings = vim.g.have_nerd_font,
|
||||
keys = vim.g.have_nerd_font and {} or {
|
||||
|
|
@ -122,13 +194,28 @@ return {
|
|||
},
|
||||
},
|
||||
spec = {
|
||||
{ '<leader>Q', group = '[Q]uit' },
|
||||
{ '<leader>c', group = '[c]ode' },
|
||||
{ '<leader>s', group = '[s]earch' },
|
||||
{ '<leader>S', group = '[S]ession' },
|
||||
{ '<leader>t', group = '[T]oggle' },
|
||||
{ '<leader>x', group = 'diagnostics/quickfi[x]' },
|
||||
{ '<leader>h', group = 'Git [H]unk', mode = { 'n', 'v' } },
|
||||
-- Core groups with icons
|
||||
{ '<leader>b', group = ' buffer', icon = '' },
|
||||
{ '<leader>c', group = ' code', icon = '' },
|
||||
{ '<leader>d', group = ' debug', icon = '' },
|
||||
{ '<leader>f', group = ' flutter', icon = '' }, -- Only visible in Dart files
|
||||
{ '<leader>g', group = ' git', icon = '' },
|
||||
{ '<leader>p', group = ' python', icon = '' }, -- Only visible in Python files
|
||||
{ '<leader>r', group = ' rust', icon = '' }, -- Only visible in Rust files
|
||||
{ '<leader>s', group = ' search', icon = '' },
|
||||
{ '<leader>S', group = ' session', icon = '' },
|
||||
{ '<leader>t', group = ' toggle', icon = '' },
|
||||
{ '<leader>u', group = ' ui', icon = '' },
|
||||
{ '<leader>v', group = ' svelte', icon = '' }, -- Only visible in Svelte files
|
||||
{ '<leader>w', group = ' window', icon = '' },
|
||||
{ '<leader>x', group = ' diagnostics', icon = '' },
|
||||
|
||||
-- Special groups
|
||||
{ '<leader>q', desc = ' Quickfix diagnostics' },
|
||||
{ '<leader>Q', desc = ' Quit all' },
|
||||
|
||||
-- Git hunks (normal and visual mode)
|
||||
{ '<leader>h', group = ' git hunk', mode = { 'n', 'v' }, icon = '' },
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
|
|||
|
|
@ -53,9 +53,50 @@ return {
|
|||
width = 30,
|
||||
mappings = {
|
||||
['\\'] = 'close_window',
|
||||
-- Make <leader>sf work the same in Neo-tree as in editor
|
||||
|
||||
-- Consistent with Telescope: <C-x> = split, <C-v> = vsplit, <C-t> = tabnew
|
||||
['<C-x>'] = 'split_with_window_picker',
|
||||
['<C-v>'] = 'vsplit_with_window_picker',
|
||||
['<C-t>'] = 'open_tabnew',
|
||||
|
||||
-- Open file (consistent with Telescope <CR>)
|
||||
['<CR>'] = 'open',
|
||||
['o'] = 'open',
|
||||
|
||||
-- Navigation
|
||||
['<C-j>'] = 'next_source', -- Match Telescope down navigation
|
||||
['<C-k>'] = 'prev_source', -- Match Telescope up navigation
|
||||
|
||||
-- Preview (like Telescope)
|
||||
['P'] = { 'toggle_preview', config = { use_float = true } },
|
||||
|
||||
-- Telescope integration from Neo-tree
|
||||
['<leader>sf'] = 'telescope_find',
|
||||
['<leader>sg'] = 'telescope_grep',
|
||||
|
||||
-- Refresh
|
||||
['R'] = 'refresh',
|
||||
|
||||
-- Toggle hidden files
|
||||
['H'] = 'toggle_hidden',
|
||||
|
||||
-- Navigation
|
||||
['-'] = 'navigate_up',
|
||||
['.'] = 'set_root',
|
||||
|
||||
-- File operations
|
||||
['a'] = 'add',
|
||||
['A'] = 'add_directory',
|
||||
['d'] = 'delete',
|
||||
['r'] = 'rename',
|
||||
['y'] = 'copy_to_clipboard',
|
||||
['x'] = 'cut_to_clipboard',
|
||||
['p'] = 'paste_from_clipboard',
|
||||
['c'] = 'copy', -- Copy (takes a path as input)
|
||||
['m'] = 'move', -- Move (takes a path as input)
|
||||
|
||||
-- Help
|
||||
['?'] = 'show_help',
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
|
|||
|
|
@ -358,7 +358,7 @@ return {
|
|||
-- ========================================================================
|
||||
vim.api.nvim_create_autocmd('FileType', {
|
||||
pattern = 'dart',
|
||||
callback = function()
|
||||
callback = function(event)
|
||||
local opts = { buffer = true, silent = true }
|
||||
|
||||
-- ========================================================================
|
||||
|
|
@ -402,51 +402,9 @@ return {
|
|||
)
|
||||
vim.keymap.set('n', '<leader>fl', '<cmd>FlutterLspRestart<cr>', vim.tbl_extend('force', opts, { desc = '[F]lutter [L]SP Restart' }))
|
||||
|
||||
-- ========================================================================
|
||||
-- DEBUG KEYMAPS - Available only in Dart files
|
||||
-- ========================================================================
|
||||
-- Function key shortcuts (standard debugging)
|
||||
vim.keymap.set('n', '<F5>', function()
|
||||
require('dap').continue()
|
||||
end, vim.tbl_extend('force', opts, { desc = 'Debug: Start/Continue' }))
|
||||
|
||||
vim.keymap.set('n', '<F10>', function()
|
||||
require('dap').step_over()
|
||||
end, vim.tbl_extend('force', opts, { desc = 'Debug: Step Over' }))
|
||||
|
||||
vim.keymap.set('n', '<F11>', function()
|
||||
require('dap').step_into()
|
||||
end, vim.tbl_extend('force', opts, { desc = 'Debug: Step Into' }))
|
||||
|
||||
vim.keymap.set('n', '<F12>', function()
|
||||
require('dap').step_out()
|
||||
end, vim.tbl_extend('force', opts, { desc = 'Debug: Step Out' }))
|
||||
|
||||
-- Leader-based debug commands
|
||||
vim.keymap.set('n', '<leader>db', function()
|
||||
require('dap').toggle_breakpoint()
|
||||
end, vim.tbl_extend('force', opts, { desc = '[D]ebug: Toggle [B]reakpoint' }))
|
||||
|
||||
vim.keymap.set('n', '<leader>dB', function()
|
||||
require('dap').set_breakpoint(vim.fn.input 'Breakpoint condition: ')
|
||||
end, vim.tbl_extend('force', opts, { desc = '[D]ebug: Set Conditional [B]reakpoint' }))
|
||||
|
||||
vim.keymap.set('n', '<leader>dc', function()
|
||||
require('dap').continue()
|
||||
end, vim.tbl_extend('force', opts, { desc = '[D]ebug: [C]ontinue' }))
|
||||
|
||||
vim.keymap.set('n', '<leader>dt', function()
|
||||
require('dap').terminate()
|
||||
end, vim.tbl_extend('force', opts, { desc = '[D]ebug: [T]erminate' }))
|
||||
|
||||
vim.keymap.set('n', '<leader>du', function()
|
||||
require('dapui').toggle()
|
||||
end, vim.tbl_extend('force', opts, { desc = '[D]ebug: Toggle [U]I' }))
|
||||
|
||||
-- Register groups with which-key
|
||||
-- Register which-key group for Flutter
|
||||
require('which-key').add {
|
||||
{ '<leader>f', group = '[F]lutter', mode = 'n' },
|
||||
{ '<leader>d', group = '[D]ebug', mode = 'n' },
|
||||
{ '<leader>f', group = ' flutter', mode = 'n', buffer = event.buf },
|
||||
}
|
||||
end,
|
||||
})
|
||||
|
|
|
|||
|
|
@ -173,4 +173,54 @@ return {
|
|||
return opts
|
||||
end,
|
||||
},
|
||||
|
||||
-- Python keymaps (loaded only for Python files)
|
||||
{
|
||||
'nvim-lspconfig',
|
||||
ft = 'python',
|
||||
config = function()
|
||||
vim.api.nvim_create_autocmd('FileType', {
|
||||
pattern = 'python',
|
||||
callback = function(event)
|
||||
local bufnr = event.buf
|
||||
|
||||
-- Register which-key group for Python
|
||||
require('which-key').add {
|
||||
{ '<leader>p', group = ' python', buffer = bufnr },
|
||||
}
|
||||
|
||||
-- Run current file
|
||||
vim.keymap.set('n', '<leader>pr', function()
|
||||
vim.cmd('!python3 %')
|
||||
end, { buffer = bufnr, desc = 'Run file' })
|
||||
|
||||
-- Run with arguments
|
||||
vim.keymap.set('n', '<leader>pR', function()
|
||||
local args = vim.fn.input 'Arguments: '
|
||||
vim.cmd('!python3 % ' .. args)
|
||||
end, { buffer = bufnr, desc = 'Run with args' })
|
||||
|
||||
-- Select virtual environment
|
||||
vim.keymap.set('n', '<leader>pe', function()
|
||||
vim.cmd 'PythonSelectVenv'
|
||||
end, { buffer = bufnr, desc = 'Select venv' })
|
||||
|
||||
-- Restart Python LSP
|
||||
vim.keymap.set('n', '<leader>pl', function()
|
||||
vim.cmd 'PythonRestart'
|
||||
end, { buffer = bufnr, desc = 'Restart LSP' })
|
||||
|
||||
-- Import organization (via Ruff)
|
||||
vim.keymap.set('n', '<leader>pi', function()
|
||||
require('conform').format { formatters = { 'ruff_organize_imports' } }
|
||||
end, { buffer = bufnr, desc = 'Organize imports' })
|
||||
|
||||
-- Format with Ruff
|
||||
vim.keymap.set('n', '<leader>pf', function()
|
||||
require('conform').format { formatters = { 'ruff_format' } }
|
||||
end, { buffer = bufnr, desc = 'Format code' })
|
||||
end,
|
||||
})
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,272 @@
|
|||
-- Rust Development Configuration
|
||||
-- Loaded only for Rust files (*.rs)
|
||||
|
||||
return {
|
||||
-- Rust Tools - Enhanced rust-analyzer integration
|
||||
{
|
||||
'mrcjkb/rustaceanvim',
|
||||
version = '^5',
|
||||
lazy = false, -- Already lazy-loaded by filetype
|
||||
ft = { 'rust' },
|
||||
opts = {
|
||||
server = {
|
||||
on_attach = function(client, bufnr)
|
||||
-- Register which-key group for Rust
|
||||
require('which-key').add {
|
||||
{ '<leader>r', group = ' rust', buffer = bufnr },
|
||||
}
|
||||
|
||||
-- Hover actions
|
||||
vim.keymap.set('n', '<leader>rh', function()
|
||||
vim.cmd.RustLsp { 'hover', 'actions' }
|
||||
end, { buffer = bufnr, desc = 'Hover actions' })
|
||||
|
||||
-- Code actions
|
||||
vim.keymap.set('n', '<leader>ra', function()
|
||||
vim.cmd.RustLsp('codeAction')
|
||||
end, { buffer = bufnr, desc = 'Code actions' })
|
||||
|
||||
-- Explain error
|
||||
vim.keymap.set('n', '<leader>re', function()
|
||||
vim.cmd.RustLsp('explainError')
|
||||
end, { buffer = bufnr, desc = 'Explain error' })
|
||||
|
||||
-- Open Cargo.toml
|
||||
vim.keymap.set('n', '<leader>rC', function()
|
||||
vim.cmd.RustLsp('openCargo')
|
||||
end, { buffer = bufnr, desc = 'Open Cargo.toml' })
|
||||
|
||||
-- Parent module
|
||||
vim.keymap.set('n', '<leader>rp', function()
|
||||
vim.cmd.RustLsp('parentModule')
|
||||
end, { buffer = bufnr, desc = 'Parent module' })
|
||||
|
||||
-- Join lines
|
||||
vim.keymap.set('n', '<leader>rj', function()
|
||||
vim.cmd.RustLsp('joinLines')
|
||||
end, { buffer = bufnr, desc = 'Join lines' })
|
||||
|
||||
-- Runnables
|
||||
vim.keymap.set('n', '<leader>rr', function()
|
||||
vim.cmd.RustLsp('runnables')
|
||||
end, { buffer = bufnr, desc = 'Runnables' })
|
||||
|
||||
-- Debuggables
|
||||
vim.keymap.set('n', '<leader>rd', function()
|
||||
vim.cmd.RustLsp('debuggables')
|
||||
end, { buffer = bufnr, desc = 'Debuggables' })
|
||||
|
||||
-- Expand macro
|
||||
vim.keymap.set('n', '<leader>rm', function()
|
||||
vim.cmd.RustLsp('expandMacro')
|
||||
end, { buffer = bufnr, desc = 'Expand macro' })
|
||||
end,
|
||||
default_settings = {
|
||||
-- rust-analyzer language server configuration
|
||||
['rust-analyzer'] = {
|
||||
cargo = {
|
||||
allFeatures = true,
|
||||
loadOutDirsFromCheck = true,
|
||||
buildScripts = {
|
||||
enable = true,
|
||||
},
|
||||
},
|
||||
-- Add clippy lints for Rust
|
||||
checkOnSave = {
|
||||
allFeatures = true,
|
||||
command = 'clippy',
|
||||
extraArgs = { '--no-deps' },
|
||||
},
|
||||
procMacro = {
|
||||
enable = true,
|
||||
ignored = {
|
||||
['async-trait'] = { 'async_trait' },
|
||||
['napi-derive'] = { 'napi' },
|
||||
['async-recursion'] = { 'async_recursion' },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
-- DAP configuration
|
||||
dap = {
|
||||
adapter = {
|
||||
type = 'executable',
|
||||
command = 'lldb-vscode', -- or 'lldb-dap' on newer versions
|
||||
name = 'lldb',
|
||||
},
|
||||
},
|
||||
},
|
||||
config = function(_, opts)
|
||||
vim.g.rustaceanvim = vim.tbl_deep_extend('keep', vim.g.rustaceanvim or {}, opts or {})
|
||||
end,
|
||||
},
|
||||
|
||||
-- Crates.io integration
|
||||
{
|
||||
'saecki/crates.nvim',
|
||||
event = { 'BufRead Cargo.toml' },
|
||||
opts = {
|
||||
completion = {
|
||||
cmp = {
|
||||
enabled = true,
|
||||
},
|
||||
},
|
||||
lsp = {
|
||||
enabled = true,
|
||||
actions = true,
|
||||
completion = true,
|
||||
hover = true,
|
||||
},
|
||||
},
|
||||
config = function(_, opts)
|
||||
local crates = require 'crates'
|
||||
crates.setup(opts)
|
||||
|
||||
-- Crates keymaps (only in Cargo.toml)
|
||||
vim.api.nvim_create_autocmd('BufRead', {
|
||||
pattern = 'Cargo.toml',
|
||||
callback = function()
|
||||
local bufnr = vim.api.nvim_get_current_buf()
|
||||
|
||||
-- Register which-key group for Rust Crates
|
||||
require('which-key').add {
|
||||
{ '<leader>rc', group = ' crates', buffer = bufnr },
|
||||
}
|
||||
|
||||
vim.keymap.set('n', '<leader>rct', function()
|
||||
crates.toggle()
|
||||
end, { buffer = bufnr, desc = 'Toggle crates' })
|
||||
|
||||
vim.keymap.set('n', '<leader>rcr', function()
|
||||
crates.reload()
|
||||
end, { buffer = bufnr, desc = 'Reload crates' })
|
||||
|
||||
vim.keymap.set('n', '<leader>rcv', function()
|
||||
crates.show_versions_popup()
|
||||
end, { buffer = bufnr, desc = 'Show versions' })
|
||||
|
||||
vim.keymap.set('n', '<leader>rcf', function()
|
||||
crates.show_features_popup()
|
||||
end, { buffer = bufnr, desc = 'Show features' })
|
||||
|
||||
vim.keymap.set('n', '<leader>rcd', function()
|
||||
crates.show_dependencies_popup()
|
||||
end, { buffer = bufnr, desc = 'Show dependencies' })
|
||||
|
||||
vim.keymap.set('n', '<leader>rcu', function()
|
||||
crates.update_crate()
|
||||
end, { buffer = bufnr, desc = 'Update crate' })
|
||||
|
||||
vim.keymap.set('v', '<leader>rcu', function()
|
||||
crates.update_crates()
|
||||
end, { buffer = bufnr, desc = 'Update selected' })
|
||||
|
||||
vim.keymap.set('n', '<leader>rca', function()
|
||||
crates.update_all_crates()
|
||||
end, { buffer = bufnr, desc = 'Update all' })
|
||||
|
||||
vim.keymap.set('n', '<leader>rcU', function()
|
||||
crates.upgrade_crate()
|
||||
end, { buffer = bufnr, desc = 'Upgrade crate' })
|
||||
|
||||
vim.keymap.set('v', '<leader>rcU', function()
|
||||
crates.upgrade_crates()
|
||||
end, { buffer = bufnr, desc = 'Upgrade selected' })
|
||||
|
||||
vim.keymap.set('n', '<leader>rcA', function()
|
||||
crates.upgrade_all_crates()
|
||||
end, { buffer = bufnr, desc = 'Upgrade all' })
|
||||
|
||||
vim.keymap.set('n', '<leader>rce', function()
|
||||
crates.expand_plain_crate_to_inline_table()
|
||||
end, { buffer = bufnr, desc = 'Expand to inline' })
|
||||
|
||||
vim.keymap.set('n', '<leader>rcE', function()
|
||||
crates.extract_crate_into_table()
|
||||
end, { buffer = bufnr, desc = 'Extract to table' })
|
||||
|
||||
vim.keymap.set('n', '<leader>rcH', function()
|
||||
crates.open_homepage()
|
||||
end, { buffer = bufnr, desc = 'Open homepage' })
|
||||
|
||||
vim.keymap.set('n', '<leader>rcR', function()
|
||||
crates.open_repository()
|
||||
end, { buffer = bufnr, desc = 'Open repository' })
|
||||
|
||||
vim.keymap.set('n', '<leader>rcD', function()
|
||||
crates.open_documentation()
|
||||
end, { buffer = bufnr, desc = 'Open documentation' })
|
||||
|
||||
vim.keymap.set('n', '<leader>rcC', function()
|
||||
crates.open_crates_io()
|
||||
end, { buffer = bufnr, desc = 'Open crates.io' })
|
||||
end,
|
||||
})
|
||||
end,
|
||||
},
|
||||
|
||||
-- Mason tool installations for Rust
|
||||
{
|
||||
'williamboman/mason.nvim',
|
||||
opts = function(_, opts)
|
||||
opts.ensure_installed = opts.ensure_installed or {}
|
||||
vim.list_extend(opts.ensure_installed, {
|
||||
'rust-analyzer',
|
||||
'codelldb', -- For debugging
|
||||
})
|
||||
end,
|
||||
},
|
||||
|
||||
-- Treesitter for Rust
|
||||
{
|
||||
'nvim-treesitter/nvim-treesitter',
|
||||
opts = function(_, opts)
|
||||
opts.ensure_installed = opts.ensure_installed or {}
|
||||
vim.list_extend(opts.ensure_installed, {
|
||||
'rust',
|
||||
'ron', -- Rusty Object Notation
|
||||
'toml', -- For Cargo.toml
|
||||
})
|
||||
end,
|
||||
},
|
||||
|
||||
-- DAP configuration for Rust
|
||||
{
|
||||
'mfussenegger/nvim-dap',
|
||||
optional = true,
|
||||
opts = function()
|
||||
local dap = require 'dap'
|
||||
|
||||
dap.configurations.rust = {
|
||||
{
|
||||
name = 'Launch',
|
||||
type = 'codelldb',
|
||||
request = 'launch',
|
||||
program = function()
|
||||
return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/target/debug/', 'file')
|
||||
end,
|
||||
cwd = '${workspaceFolder}',
|
||||
stopOnEntry = false,
|
||||
args = {},
|
||||
},
|
||||
{
|
||||
name = 'Attach to process',
|
||||
type = 'codelldb',
|
||||
request = 'attach',
|
||||
pid = require('dap.utils').pick_process,
|
||||
args = {},
|
||||
},
|
||||
}
|
||||
|
||||
dap.adapters.codelldb = {
|
||||
type = 'server',
|
||||
port = '${port}',
|
||||
executable = {
|
||||
command = vim.fn.exepath 'codelldb',
|
||||
args = { '--port', '${port}' },
|
||||
},
|
||||
}
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
|
@ -180,4 +180,48 @@ return {
|
|||
})
|
||||
end,
|
||||
},
|
||||
|
||||
-- ========================================================================
|
||||
-- SVELTE-SPECIFIC KEYMAPS
|
||||
-- ========================================================================
|
||||
-- Additional Svelte-specific settings and keymaps
|
||||
-- ========================================================================
|
||||
{
|
||||
'nvim-lspconfig',
|
||||
ft = 'svelte',
|
||||
config = function()
|
||||
vim.api.nvim_create_autocmd('FileType', {
|
||||
pattern = 'svelte',
|
||||
callback = function(event)
|
||||
local bufnr = event.buf
|
||||
|
||||
-- Register which-key group for Svelte
|
||||
require('which-key').add {
|
||||
{ '<leader>v', group = ' svelte', buffer = bufnr },
|
||||
}
|
||||
|
||||
-- Format with Prettier
|
||||
vim.keymap.set('n', '<leader>vf', function()
|
||||
require('conform').format { formatters = { 'prettier' } }
|
||||
end, { buffer = bufnr, desc = 'Format with prettier' })
|
||||
|
||||
-- Restart Svelte LSP
|
||||
vim.keymap.set('n', '<leader>vl', function()
|
||||
vim.cmd 'LspRestart svelte'
|
||||
end, { buffer = bufnr, desc = 'Restart LSP' })
|
||||
|
||||
-- Restart TypeScript LSP (often needed in Svelte projects)
|
||||
vim.keymap.set('n', '<leader>vt', function()
|
||||
vim.cmd 'LspRestart ts_ls'
|
||||
end, { buffer = bufnr, desc = 'Restart TypeScript LSP' })
|
||||
|
||||
-- Open component in split
|
||||
vim.keymap.set('n', '<leader>vo', function()
|
||||
local word = vim.fn.expand '<cfile>'
|
||||
vim.cmd('split ' .. word)
|
||||
end, { buffer = bufnr, desc = 'Open component in split' })
|
||||
end,
|
||||
})
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue