Compare commits
10 Commits
8a24e8b847
...
2369df3446
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2369df3446 | ||
| fadc111739 | |||
| 6e8006d935 | |||
| 5011905109 | |||
| 0c218da55a | |||
| 5f8c78ba12 | |||
|
|
8d47a5a06a | ||
| d8d760e377 | |||
| c15c984730 | |||
| c2d52b9962 |
10
.bashrc
10
.bashrc
@ -651,4 +651,14 @@ export LESS_TERMCAP_so=$'\e[01;33m'
|
||||
export LESS_TERMCAP_ue=$'\e[0m'
|
||||
export LESS_TERMCAP_us=$'\e[1;4;31m'
|
||||
|
||||
alias ff='fastfetch'
|
||||
alias nuke='sudo bash /home/nicholai/Documents/obsidian-vault/02_Areas/Nuke-monitoring/scripts/nuke_isolated.sh'
|
||||
alias note='cd /mnt/work/dev/personal-projects/nicholai-work-2026 && pnpm notepad'
|
||||
alias comfy='cd /home/nicholai/ComfyUI && source .venv/bin/activate && python main.py'
|
||||
alias scripts='nvim .nuke/'
|
||||
|
||||
# opencode
|
||||
export PATH=/home/nicholai/.opencode/bin:$PATH
|
||||
|
||||
# OpenRouter API Key for oh-my-opencode
|
||||
export OPENROUTER_API_KEY="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"
|
||||
|
||||
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
CLAUDE.md
|
||||
lazy-lock.json
|
||||
64
README.md
64
README.md
@ -1,58 +1,26 @@
|
||||
# Neovim Configuration
|
||||
|
||||
A clean, modular Neovim setup focused on TypeScript/JavaScript development.
|
||||
Modular Neovim setup for TypeScript/JavaScript development.
|
||||
|
||||
## Structure
|
||||
## Installation
|
||||
|
||||
```
|
||||
~/.config/nvim/
|
||||
├── init.lua # Entry point
|
||||
└── lua/
|
||||
├── core/
|
||||
│ ├── options.lua # Vim settings
|
||||
│ └── keymaps.lua # Key bindings
|
||||
└── plugins/
|
||||
└── plugin.lua # Plugin specs & configs
|
||||
```bash
|
||||
# Clone to config directory
|
||||
git clone <repo-url> ~/.config/nvim
|
||||
|
||||
# Symlink dotfiles (optional)
|
||||
./setup.sh
|
||||
|
||||
# Launch Neovim - plugins install automatically
|
||||
nvim
|
||||
```
|
||||
|
||||
## Features
|
||||
|
||||
- **Package Manager**: lazy.nvim
|
||||
- **Color Scheme**: Catppuccin Mocha
|
||||
- **File Explorer**: nvim-tree
|
||||
- **Fuzzy Finder**: Telescope
|
||||
- **LSP**: Mason + nvim-lspconfig
|
||||
- **Autocompletion**: nvim-cmp with LSP support
|
||||
- **Syntax**: Treesitter
|
||||
- **Formatter**: Conform (Prettier)
|
||||
- **Snippets**: LuaSnip + friendly-snippets
|
||||
|
||||
## Key Bindings
|
||||
- LSP with TypeScript/JavaScript support
|
||||
- Autocompletion and snippets
|
||||
- Telescope fuzzy finder
|
||||
- Treesitter syntax highlighting
|
||||
- Format-on-save with Prettier
|
||||
|
||||
Leader key: `<Space>`
|
||||
|
||||
| Key | Action |
|
||||
|-----|--------|
|
||||
| `<leader>e` | Toggle file explorer |
|
||||
| `<leader>ff` | Find files |
|
||||
| `<leader>fg` | Live grep |
|
||||
| `<leader>fb` | Find buffers |
|
||||
| `<leader>w` | Save |
|
||||
| `<leader>q` | Quit |
|
||||
| `<C-h/j/k/l>` | Navigate windows |
|
||||
|
||||
## Installation
|
||||
|
||||
1. Clone this repo to `~/.config/nvim`
|
||||
2. Open Neovim - plugins will install automatically
|
||||
3. Restart Neovim
|
||||
|
||||
## LSP Servers
|
||||
|
||||
Mason will auto-install:
|
||||
- ts_ls (TypeScript)
|
||||
- eslint
|
||||
- jsonls
|
||||
- html
|
||||
- cssls
|
||||
- tailwindcss
|
||||
|
||||
153
docs/neovim-cheatsheet.md
Normal file
153
docs/neovim-cheatsheet.md
Normal file
@ -0,0 +1,153 @@
|
||||
# Neovim Cheatsheet
|
||||
|
||||
## Modes
|
||||
- `i` - Insert mode (start typing)
|
||||
- `v` - Visual mode (select text)
|
||||
- `V` - Visual line mode (select full lines)
|
||||
- `Ctrl+v` - Visual block mode (select columns)
|
||||
- `Esc` or `Ctrl+[` - Return to Normal mode
|
||||
- `:` - Command mode
|
||||
|
||||
## Basic Navigation
|
||||
- `h` `j` `k` `l` - Left, Down, Up, Right
|
||||
- `w` - Jump forward to start of word
|
||||
- `b` - Jump backward to start of word
|
||||
- `e` - Jump to end of word
|
||||
- `0` - Jump to start of line
|
||||
- `^` - Jump to first non-blank character
|
||||
- `$` - Jump to end of line
|
||||
- `gg` - Go to top of file
|
||||
- `G` - Go to bottom of file
|
||||
- `{number}G` - Go to line number (e.g., `42G`)
|
||||
- `Ctrl+d` - Scroll down half page
|
||||
- `Ctrl+u` - Scroll up half page
|
||||
- `Ctrl+f` - Scroll down full page
|
||||
- `Ctrl+b` - Scroll up full page
|
||||
- `%` - Jump to matching bracket/parenthesis
|
||||
|
||||
## Editing
|
||||
- `i` - Insert before cursor
|
||||
- `a` - Insert after cursor
|
||||
- `I` - Insert at start of line
|
||||
- `A` - Insert at end of line
|
||||
- `o` - Open new line below
|
||||
- `O` - Open new line above
|
||||
- `x` - Delete character under cursor
|
||||
- `dd` - Delete current line
|
||||
- `dw` - Delete word
|
||||
- `d$` or `D` - Delete to end of line
|
||||
- `d0` - Delete to start of line
|
||||
- `cc` - Change entire line (delete and enter insert mode)
|
||||
- `cw` - Change word
|
||||
- `u` - Undo
|
||||
- `Ctrl+r` - Redo
|
||||
- `yy` - Yank (copy) current line
|
||||
- `yw` - Yank word
|
||||
- `y$` - Yank to end of line
|
||||
- `p` - Paste after cursor
|
||||
- `P` - Paste before cursor
|
||||
- `r{char}` - Replace single character
|
||||
- `.` - Repeat last command
|
||||
|
||||
## Visual Mode
|
||||
- `v` - Start visual mode
|
||||
- `V` - Start visual line mode
|
||||
- `Ctrl+v` - Start visual block mode
|
||||
- `y` - Yank (copy) selection
|
||||
- `d` - Delete selection
|
||||
- `c` - Change selection
|
||||
- `>` - Indent selection
|
||||
- `<` - Unindent selection
|
||||
- `~` - Toggle case
|
||||
|
||||
## Search & Replace
|
||||
- `/pattern` - Search forward
|
||||
- `?pattern` - Search backward
|
||||
- `n` - Next search result
|
||||
- `N` - Previous search result
|
||||
- `*` - Search for word under cursor
|
||||
- `:%s/old/new/g` - Replace all occurrences in file
|
||||
- `:%s/old/new/gc` - Replace with confirmation
|
||||
- `:noh` - Clear search highlighting
|
||||
|
||||
## File Operations
|
||||
- `:w` - Save file
|
||||
- `:q` - Quit
|
||||
- `:wq` or `:x` - Save and quit
|
||||
- `:q!` - Quit without saving
|
||||
- `:e filename` - Open file
|
||||
- `:bn` - Next buffer
|
||||
- `:bp` - Previous buffer
|
||||
- `:bd` - Close buffer
|
||||
|
||||
## Window Management
|
||||
- `:sp` or `:split` - Split horizontally
|
||||
- `:vsp` or `:vsplit` - Split vertically
|
||||
- `Ctrl+w h/j/k/l` - Navigate between windows
|
||||
- `Ctrl+w w` - Cycle through windows
|
||||
- `Ctrl+w q` - Close current window
|
||||
- `Ctrl+w =` - Make windows equal size
|
||||
- `Ctrl+w _` - Maximize height
|
||||
- `Ctrl+w |` - Maximize width
|
||||
|
||||
## Custom Keybindings
|
||||
*Based on your config with `<leader>` = Space*
|
||||
|
||||
### File Explorer
|
||||
- `Space+e` - Toggle NvimTree file explorer
|
||||
|
||||
### Fuzzy Finder (Telescope)
|
||||
- `Space+ff` - Find files
|
||||
- `Space+fg` - Live grep (search in files)
|
||||
- `Space+fb` - Find buffers
|
||||
|
||||
### Window Navigation
|
||||
- `Ctrl+h` - Move to left window
|
||||
- `Ctrl+j` - Move to down window
|
||||
- `Ctrl+k` - Move to up window
|
||||
- `Ctrl+l` - Move to right window
|
||||
|
||||
### Quick Actions
|
||||
- `Space+w` - Save file
|
||||
- `Space+q` - Quit
|
||||
|
||||
### Autocompletion
|
||||
- `Ctrl+Space` - Trigger completion
|
||||
- `Enter` - Confirm completion
|
||||
- `Tab` - Next completion item
|
||||
- `Shift+Tab` - Previous completion item
|
||||
|
||||
## Useful Tips
|
||||
- **Repeat actions**: Number before command (e.g., `5dd` deletes 5 lines)
|
||||
- **Combine motions**: `d3w` deletes 3 words, `y2j` yanks 2 lines down
|
||||
- **Inside/Around**: `ci"` change inside quotes, `da(` delete around parentheses
|
||||
- **Jump to character**: `f{char}` jump forward to char, `F{char}` jump backward
|
||||
- `;` repeat last f/F/t/T, `,` repeat in opposite direction
|
||||
- **Macros**:
|
||||
- `q{letter}` start recording to register
|
||||
- `q` stop recording
|
||||
- `@{letter}` play macro
|
||||
- `@@` replay last macro
|
||||
|
||||
## Command Line Tricks
|
||||
- `:!command` - Run shell command
|
||||
- `:r !command` - Insert command output
|
||||
- `:%!command` - Filter file through command
|
||||
- `:term` - Open terminal in vim
|
||||
|
||||
## Marks & Jumps
|
||||
- `m{letter}` - Set mark
|
||||
- `'{letter}` - Jump to mark
|
||||
- `''` - Jump back to previous position
|
||||
- `Ctrl+o` - Jump to older position
|
||||
- `Ctrl+i` - Jump to newer position
|
||||
|
||||
## Pro Tips
|
||||
- Use `.` to repeat your last change - super powerful!
|
||||
- Learn to use `ci"`, `ci'`, `ci(`, `ci{` to change inside quotes/brackets
|
||||
- Combine counts with motions: `3w`, `5j`, `2dd`
|
||||
- Use relative line numbers (you have this enabled!) with counts: `5j` to jump 5 lines down
|
||||
- System clipboard integration: Just yank normally with `y` - it copies to system clipboard! (You have `clipboard=unnamedplus` set)
|
||||
|
||||
---
|
||||
*Last updated: November 2025*
|
||||
129
docs/tmux-cheatsheet.md
Normal file
129
docs/tmux-cheatsheet.md
Normal file
@ -0,0 +1,129 @@
|
||||
**All tmux commands start with:** `Ctrl + w` (custom config)
|
||||
### Starting & Managing Sessions
|
||||
|
||||
| Command | Action |
|
||||
| --------------------------- | --------------------------- |
|
||||
| `tmux` | Start new session |
|
||||
| `tmux new -s name` | Start new session with name |
|
||||
| `tmux ls` | List all sessions |
|
||||
| `tmux attach` | Attach to last session |
|
||||
| `tmux attach -t name` | Attach to named session |
|
||||
| `tmux kill-session -t name` | Kill named session |
|
||||
| `tmux kill-server` | Kill all sessions |
|
||||
### Inside tmux
|
||||
|
||||
| Command | Action |
|
||||
| ---------------- | ---------------------------------------- |
|
||||
| `Ctrl + w` → `d` | **Detach** from session (keeps running!) |
|
||||
| `Ctrl + w` → `s` | List and switch sessions |
|
||||
| `Ctrl + w` → `$` | Rename current session |
|
||||
|
||||
---
|
||||
## Windows
|
||||
|
||||
| Command | Action |
|
||||
| ------------------ | --------------------------------------- |
|
||||
| `Ctrl + w` → `c` | **Create** new window |
|
||||
| `Ctrl + w` → `n` | **Next** window |
|
||||
| `Ctrl + w` → `p` | **Previous** window |
|
||||
| `Ctrl + w` → `1-9` | Switch to window 1-9 |
|
||||
| `Ctrl + w` → `w` | List all windows |
|
||||
| `Ctrl + w` → `,` | **Rename** window |
|
||||
| `Ctrl + w` → `&` | **Kill** window (asks for confirmation) |
|
||||
| `Ctrl + w` → `l` | Last active window |
|
||||
|
||||
> **Note:** Window indexing starts at 1 (not 0) in this config
|
||||
|
||||
---
|
||||
|
||||
## Panes
|
||||
|
||||
### Creating Panes
|
||||
|
||||
| Command | Action |
|
||||
| ---------------- | ----------------------------------- |
|
||||
| `Ctrl + w` → `%` | Split **vertically** (left/right) |
|
||||
| `Ctrl + w` → `"` | Split **horizontally** (top/bottom) |
|
||||
|
||||
### Navigating Panes
|
||||
|
||||
| Command | Action |
|
||||
| ------------------------- | ---------------------------------------- |
|
||||
| `Ctrl + w` → `h/j/k/l` | **Move between panes (vim-style)** |
|
||||
| `Ctrl + w` → `arrow keys` | Move between panes (also works) |
|
||||
| `Ctrl + w` → `o` | Cycle through panes |
|
||||
| `Ctrl + w` → `q` | Show pane numbers (press number to jump) |
|
||||
| `Ctrl + w` → `;` | Toggle last active pane |
|
||||
|
||||
> **Vim keybindings:** `h` = left, `j` = down, `k` = up, `l` = right
|
||||
|
||||
### Managing Panes
|
||||
|
||||
| Command | Action |
|
||||
| --------------------------- | --------------------------------- |
|
||||
| `Ctrl + w` → `x` | **Kill** current pane |
|
||||
| `Ctrl + w` → `z` | **Zoom** pane (fullscreen toggle) |
|
||||
| `Ctrl + w` → `!` | Break pane into new window |
|
||||
| `Ctrl + w` → `{` | Swap with previous pane |
|
||||
| `Ctrl + w` → `}` | Swap with next pane |
|
||||
| `Ctrl + w` → `Ctrl + arrow` | Resize pane |
|
||||
| `Ctrl + w` → `Space` | Cycle through pane layouts |
|
||||
|
||||
---
|
||||
|
||||
## Copy Mode (Scrolling & Copying)
|
||||
|
||||
| Command | Action |
|
||||
| ---------------- | ---------------------------------------- |
|
||||
| `Ctrl + w` → `[` | Enter **copy mode** (scroll with arrows) |
|
||||
| `q` or `Esc` | Exit copy mode |
|
||||
| `Space` | Start selection (in copy mode) |
|
||||
| `Enter` | Copy selection |
|
||||
| `Ctrl + w` → `]` | Paste |
|
||||
| `/` | Search forward (in copy mode) |
|
||||
| `?` | Search backward (in copy mode) |
|
||||
| `n` | Next search result |
|
||||
| `N` | Previous search result |
|
||||
|
||||
**With mouse enabled:** Just scroll normally! (Mouse is enabled in this config)
|
||||
|
||||
---
|
||||
|
||||
## Help & Info
|
||||
|
||||
| Command | Action |
|
||||
| ---------------- | ----------------------------- |
|
||||
| `Ctrl + w` → `?` | **Show all keybindings** |
|
||||
| `Ctrl + w` → `t` | Show clock (any key to exit) |
|
||||
| `Ctrl + w` → `i` | Display pane info |
|
||||
| `tmux info` | Show tmux info (outside tmux) |
|
||||
|
||||
---
|
||||
|
||||
## Command Mode
|
||||
|
||||
| Command | Action |
|
||||
| ---------------- | ---------------------------------- |
|
||||
| `Ctrl + w` → `:` | Enter command mode |
|
||||
| `Ctrl + w` → `r` | **Reload config** (custom binding) |
|
||||
|
||||
### Useful Commands in Command Mode
|
||||
```
|
||||
:source-file ~/.tmux.conf # Reload config (or just use Ctrl+w r)
|
||||
:setw synchronize-panes on # Type in all panes at once
|
||||
:setw synchronize-panes off # Disable sync
|
||||
:resize-pane -D 10 # Resize down 10 lines
|
||||
:resize-pane -U 10 # Resize up 10 lines
|
||||
```
|
||||
|
||||
---
|
||||
## Troubleshooting
|
||||
|
||||
| Problem | Solution |
|
||||
| ------------------ | ----------------------------------------- |
|
||||
| Can't scroll | `Ctrl + w, [` for copy mode, or use mouse |
|
||||
| Lost in panes | `Ctrl + w, q` shows numbers |
|
||||
| Forgot command | `Ctrl + w, ?` shows all keybindings |
|
||||
| Session stuck | `tmux kill-session -t name` from outside |
|
||||
| Config not working | `Ctrl + w, r` to reload |
|
||||
| Wrong colors | Already set to `tmux-256color` in config |
|
||||
@ -1,25 +1,47 @@
|
||||
{
|
||||
"LuaSnip": { "branch": "master", "commit": "ccf25a5452b8697a823de3e5ecda63ed3d723b79" },
|
||||
"LuaSnip": { "branch": "master", "commit": "dae4f5aaa3574bd0c2b9dd20fb9542a02c10471c" },
|
||||
"alpha-nvim": { "branch": "main", "commit": "3979b01cb05734331c7873049001d3f2bb8477f4" },
|
||||
"catppuccin": { "branch": "main", "commit": "af58927c55c9f3272c940ff02b3cee94a1249f26" },
|
||||
"auto-session": { "branch": "main", "commit": "292492ab7af4bd8b9e37e28508bc8ce995722fd5" },
|
||||
"bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" },
|
||||
"catppuccin": { "branch": "main", "commit": "beaf41a30c26fd7d6c386d383155cbd65dd554cd" },
|
||||
"cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" },
|
||||
"cmp-nvim-lsp": { "branch": "main", "commit": "bd5a7d6db125d4654b50eeae9f5217f24bb22fd3" },
|
||||
"cmp-nvim-lsp": { "branch": "main", "commit": "cbc7b02bb99fae35cb42f514762b89b5126651ef" },
|
||||
"cmp-path": { "branch": "main", "commit": "c642487086dbd9a93160e1679a1327be111cbc25" },
|
||||
"cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" },
|
||||
"conform.nvim": { "branch": "master", "commit": "235dd79731c1dc51ec04abb4045cbc54727a172a" },
|
||||
"friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "1ea3c4085785f460fb0e46d2fe1ee895f5f9e7c1" },
|
||||
"lualine.nvim": { "branch": "master", "commit": "3946f0122255bc377d14a59b27b609fb3ab25768" },
|
||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "2304ff65ecc8cb2afc2484de3e2ed9a407edf0b9" },
|
||||
"mason.nvim": { "branch": "main", "commit": "ad7146aa61dcaeb54fa900144d768f040090bff0" },
|
||||
"nvim-cmp": { "branch": "main", "commit": "a7bcf1d88069fc67c9ace8a62ba480b8fe879025" },
|
||||
"nvim-colorizer.lua": { "branch": "master", "commit": "51cf7c995ed1eb6642aecf19067ee634fa1b6ba2" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "e5c61b02f33b5c6538be25b2696b33b4cc91e667" },
|
||||
"nvim-tree.lua": { "branch": "master", "commit": "64e2192f5250796aa4a7f33c6ad888515af50640" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" },
|
||||
"nvim-web-devicons": { "branch": "master", "commit": "b8221e42cf7287c4dcde81f232f58d7b947c210d" },
|
||||
"conform.nvim": { "branch": "master", "commit": "c2526f1cde528a66e086ab1668e996d162c75f4f" },
|
||||
"crates.nvim": { "branch": "main", "commit": "ac9fa498a9edb96dc3056724ff69d5f40b898453" },
|
||||
"diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" },
|
||||
"friendly-snippets": { "branch": "main", "commit": "6cd7280adead7f586db6fccbd15d2cac7e2188b9" },
|
||||
"gitsigns.nvim": { "branch": "main", "commit": "abf82a65f185bd54adc0679f74b7d6e1ada690c9" },
|
||||
"hererocks": { "branch": "master", "commit": "3856f1b4fb69a9f683f1eb146a4cd49a67478419" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" },
|
||||
"lualine.nvim": { "branch": "master", "commit": "47f91c416daef12db467145e16bed5bbfe00add8" },
|
||||
"markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" },
|
||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "4823a251e7578a835bb979c37df390fca692ba39" },
|
||||
"mason.nvim": { "branch": "main", "commit": "44d1e90e1f66e077268191e3ee9d2ac97cc18e65" },
|
||||
"noice.nvim": { "branch": "main", "commit": "7bfd942445fb63089b59f97ca487d605e715f155" },
|
||||
"nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" },
|
||||
"nvim-cmp": { "branch": "main", "commit": "da88697d7f45d16852c6b2769dc52387d1ddc45f" },
|
||||
"nvim-colorizer.lua": { "branch": "master", "commit": "81e676d3203c9eb6e4c0ccf1eba1679296ef923f" },
|
||||
"nvim-dap": { "branch": "master", "commit": "085386b9359ddf8d76ad89b98973b8e332dc5ba3" },
|
||||
"nvim-dap-python": { "branch": "master", "commit": "1808458eba2b18f178f990e01376941a42c7f93b" },
|
||||
"nvim-dap-ui": { "branch": "master", "commit": "cf91d5e2d07c72903d052f5207511bf7ecdb7122" },
|
||||
"nvim-dap-virtual-text": { "branch": "master", "commit": "fbdb48c2ed45f4a8293d0d483f7730d24467ccb6" },
|
||||
"nvim-dap-vscode-js": { "branch": "main", "commit": "03bd29672d7fab5e515fc8469b7d07cc5994bbf6" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "419b082102fa813739588dd82e19a8b6b2442855" },
|
||||
"nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" },
|
||||
"nvim-notify": { "branch": "master", "commit": "8701bece920b38ea289b457f902e2ad184131a5d" },
|
||||
"nvim-tree.lua": { "branch": "master", "commit": "5757bcf0447d22d8f78826bc5c59b28da2824c3b" },
|
||||
"nvim-treesitter": { "branch": "main", "commit": "88f1dfc211c3a2fb47f1451fd5edc972ec697e58" },
|
||||
"nvim-web-devicons": { "branch": "master", "commit": "803353450c374192393f5387b6a0176d0972b848" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" },
|
||||
"telescope.nvim": { "branch": "master", "commit": "b4da76be54691e854d3e0e02c36b0245f945c2c7" },
|
||||
"typescript-tools.nvim": { "branch": "master", "commit": "bf11d98ad5736e1cbc1082ca9a03196d45c701f1" },
|
||||
"rest.nvim": { "branch": "main", "commit": "714d5512aaec5565d55652480c16c26f8d95645d" },
|
||||
"telescope.nvim": { "branch": "master", "commit": "ad7d9580338354ccc136e5b8f0aa4f880434dcdc" },
|
||||
"toggleterm.nvim": { "branch": "main", "commit": "50ea089fc548917cc3cc16b46a8211833b9e3c7c" },
|
||||
"typescript-tools.nvim": { "branch": "master", "commit": "c2f5910074103705661e9651aa841e0d7eea9932" },
|
||||
"vim-dadbod": { "branch": "master", "commit": "6d1d41da4873a445c5605f2005ad2c68c99d8770" },
|
||||
"vim-dadbod-completion": { "branch": "master", "commit": "a8dac0b3cf6132c80dc9b18bef36d4cf7a9e1fe6" },
|
||||
"vim-dadbod-ui": { "branch": "master", "commit": "48c4f271da13d380592f4907e2d1d5558044e4e5" },
|
||||
"vscode-js-debug": { "branch": "main", "commit": "4330850d72ee5816914a3188d2a6771854e1c61f" },
|
||||
"which-key.nvim": { "branch": "main", "commit": "3aab2147e74890957785941f0c1ad87d0a44c15a" }
|
||||
}
|
||||
|
||||
@ -8,6 +8,13 @@ keymap('n', '<leader>e', ':NvimTreeToggle<CR>', { desc = "Toggle file explorer"
|
||||
keymap('n', '<leader>ff', '<cmd>Telescope find_files<cr>', { desc = "Find files" })
|
||||
keymap('n', '<leader>fg', '<cmd>Telescope live_grep<cr>', { desc = "Live grep" })
|
||||
keymap('n', '<leader>fb', '<cmd>Telescope buffers<cr>', { desc = "Find buffers" })
|
||||
keymap('n', '<leader>fr', '<cmd>Telescope oldfiles<cr>', { desc = "Recent files" })
|
||||
|
||||
-- Git (Telescope pickers)
|
||||
keymap('n', '<leader>gt', '<cmd>Telescope git_status<cr>', { desc = "Git status" })
|
||||
keymap('n', '<leader>gc', '<cmd>Telescope git_commits<cr>', { desc = "Git commits" })
|
||||
keymap('n', '<leader>gf', '<cmd>Telescope git_bcommits<cr>', { desc = "File commits" })
|
||||
keymap('n', '<leader>gw', '<cmd>Telescope git_branches<cr>', { desc = "Git branches" })
|
||||
|
||||
-- Better window navigation
|
||||
keymap('n', '<C-h>', '<C-w>h')
|
||||
@ -18,3 +25,74 @@ keymap('n', '<C-l>', '<C-w>l')
|
||||
-- Quick save and quit
|
||||
keymap('n', '<leader>w', ':w<CR>', { desc = "Save" })
|
||||
keymap('n', '<leader>q', ':q<CR>', { desc = "Quit" })
|
||||
|
||||
-- Buffer navigation (bufferline)
|
||||
keymap('n', '<leader>bp', '<cmd>BufferLineTogglePin<CR>', { desc = "Pin buffer" })
|
||||
keymap('n', '<leader>bP', '<cmd>BufferLineGroupClose ungrouped<CR>', { desc = "Close non-pinned" })
|
||||
keymap('n', '<leader>bo', '<cmd>BufferLineCloseOthers<CR>', { desc = "Close other buffers" })
|
||||
keymap('n', '<leader>bl', '<cmd>BufferLineCloseRight<CR>', { desc = "Close buffers to right" })
|
||||
keymap('n', '<leader>bh', '<cmd>BufferLineCloseLeft<CR>', { desc = "Close buffers to left" })
|
||||
keymap('n', '<leader>1', '<cmd>BufferLineGoToBuffer 1<CR>', { desc = "Go to buffer 1" })
|
||||
keymap('n', '<leader>2', '<cmd>BufferLineGoToBuffer 2<CR>', { desc = "Go to buffer 2" })
|
||||
keymap('n', '<leader>3', '<cmd>BufferLineGoToBuffer 3<CR>', { desc = "Go to buffer 3" })
|
||||
keymap('n', '<leader>4', '<cmd>BufferLineGoToBuffer 4<CR>', { desc = "Go to buffer 4" })
|
||||
keymap('n', '<leader>5', '<cmd>BufferLineGoToBuffer 5<CR>', { desc = "Go to buffer 5" })
|
||||
keymap('n', '<leader>bd', '<cmd>bdelete<CR>', { desc = "Delete buffer" })
|
||||
keymap('n', '<S-l>', '<cmd>BufferLineCycleNext<CR>', { desc = "Next buffer" })
|
||||
keymap('n', '<S-h>', '<cmd>BufferLineCyclePrev<CR>', { desc = "Previous buffer" })
|
||||
|
||||
-- Terminal (toggleterm)
|
||||
keymap('n', '<leader>tf', '<cmd>ToggleTerm direction=float<CR>', { desc = "Float terminal" })
|
||||
keymap('n', '<leader>th', '<cmd>ToggleTerm direction=horizontal<CR>', { desc = "Horizontal terminal" })
|
||||
keymap('n', '<leader>tv', '<cmd>ToggleTerm direction=vertical<CR>', { desc = "Vertical terminal" })
|
||||
keymap('n', '<leader>tt', '<cmd>ToggleTerm<CR>', { desc = "Toggle terminal" })
|
||||
keymap('n', '<leader>tg', '<cmd>lua _LAZYGIT_TOGGLE()<CR>', { desc = "Lazygit" })
|
||||
keymap('n', '<leader>tp', '<cmd>lua _PYTHON_TOGGLE()<CR>', { desc = "Python REPL" })
|
||||
keymap('n', '<leader>tn', '<cmd>lua _NODE_TOGGLE()<CR>', { desc = "Node REPL" })
|
||||
|
||||
-- Terminal mode escape
|
||||
keymap('t', '<Esc>', [[<C-\><C-n>]], { desc = "Exit terminal mode" })
|
||||
keymap('t', '<C-h>', [[<Cmd>wincmd h<CR>]], { desc = "Window left" })
|
||||
keymap('t', '<C-j>', [[<Cmd>wincmd j<CR>]], { desc = "Window down" })
|
||||
keymap('t', '<C-k>', [[<Cmd>wincmd k<CR>]], { desc = "Window up" })
|
||||
keymap('t', '<C-l>', [[<Cmd>wincmd l<CR>]], { desc = "Window right" })
|
||||
|
||||
-- Session management
|
||||
keymap('n', '<leader>ss', '<cmd>SessionSave<CR>', { desc = "Save session" })
|
||||
keymap('n', '<leader>sr', '<cmd>SessionRestore<CR>', { desc = "Restore session" })
|
||||
keymap('n', '<leader>sd', '<cmd>SessionDelete<CR>', { desc = "Delete session" })
|
||||
|
||||
-- DAP (debugging)
|
||||
keymap('n', '<leader>db', '<cmd>lua require("dap").toggle_breakpoint()<CR>', { desc = "Toggle breakpoint" })
|
||||
keymap('n', '<leader>dB', '<cmd>lua require("dap").set_breakpoint(vim.fn.input("Condition: "))<CR>', { desc = "Conditional breakpoint" })
|
||||
keymap('n', '<leader>dc', '<cmd>lua require("dap").continue()<CR>', { desc = "Continue" })
|
||||
keymap('n', '<leader>di', '<cmd>lua require("dap").step_into()<CR>', { desc = "Step into" })
|
||||
keymap('n', '<leader>do', '<cmd>lua require("dap").step_over()<CR>', { desc = "Step over" })
|
||||
keymap('n', '<leader>dO', '<cmd>lua require("dap").step_out()<CR>', { desc = "Step out" })
|
||||
keymap('n', '<leader>dr', '<cmd>lua require("dap").repl.toggle()<CR>', { desc = "Toggle REPL" })
|
||||
keymap('n', '<leader>dl', '<cmd>lua require("dap").run_last()<CR>', { desc = "Run last" })
|
||||
keymap('n', '<leader>du', '<cmd>lua require("dapui").toggle()<CR>', { desc = "Toggle DAP UI" })
|
||||
keymap('n', '<leader>dt', '<cmd>lua require("dap").terminate()<CR>', { desc = "Terminate" })
|
||||
keymap('n', '<F5>', '<cmd>lua require("dap").continue()<CR>', { desc = "Debug: Continue" })
|
||||
keymap('n', '<F10>', '<cmd>lua require("dap").step_over()<CR>', { desc = "Debug: Step Over" })
|
||||
keymap('n', '<F11>', '<cmd>lua require("dap").step_into()<CR>', { desc = "Debug: Step Into" })
|
||||
keymap('n', '<F12>', '<cmd>lua require("dap").step_out()<CR>', { desc = "Debug: Step Out" })
|
||||
|
||||
-- Noice (notifications)
|
||||
keymap('n', '<leader>nl', '<cmd>Noice last<CR>', { desc = "Last notification" })
|
||||
keymap('n', '<leader>nh', '<cmd>Noice history<CR>', { desc = "Notification history" })
|
||||
keymap('n', '<leader>na', '<cmd>Noice all<CR>', { desc = "All notifications" })
|
||||
keymap('n', '<leader>nd', '<cmd>Noice dismiss<CR>', { desc = "Dismiss notifications" })
|
||||
|
||||
-- Markdown preview
|
||||
keymap('n', '<leader>mp', '<cmd>MarkdownPreviewToggle<CR>', { desc = "Toggle markdown preview" })
|
||||
|
||||
-- Database
|
||||
keymap('n', '<leader>Du', '<cmd>DBUIToggle<CR>', { desc = "Toggle DBUI" })
|
||||
keymap('n', '<leader>Df', '<cmd>DBUIFindBuffer<CR>', { desc = "Find DB buffer" })
|
||||
keymap('n', '<leader>Da', '<cmd>DBUIAddConnection<CR>', { desc = "Add DB connection" })
|
||||
|
||||
-- HTTP client
|
||||
keymap('n', '<leader>hr', '<cmd>lua require("rest-nvim").run()<CR>', { desc = "Run HTTP request" })
|
||||
keymap('n', '<leader>hp', '<cmd>lua require("rest-nvim").run(true)<CR>', { desc = "Preview HTTP request" })
|
||||
keymap('n', '<leader>hl', '<cmd>lua require("rest-nvim").last()<CR>', { desc = "Re-run last request" })
|
||||
|
||||
@ -1,11 +1,63 @@
|
||||
return {
|
||||
-- Color scheme
|
||||
-- Color scheme (Catppuccin Mocha)
|
||||
{
|
||||
"catppuccin/nvim",
|
||||
name = "catppuccin",
|
||||
priority = 1000,
|
||||
config = function()
|
||||
vim.cmd.colorscheme "catppuccin-mocha"
|
||||
require("catppuccin").setup({
|
||||
flavour = "mocha",
|
||||
background = {
|
||||
light = "latte",
|
||||
dark = "mocha",
|
||||
},
|
||||
transparent_background = false,
|
||||
show_end_of_buffer = false,
|
||||
term_colors = true,
|
||||
dim_inactive = {
|
||||
enabled = false,
|
||||
shade = "dark",
|
||||
percentage = 0.15,
|
||||
},
|
||||
styles = {
|
||||
comments = { "italic" },
|
||||
conditionals = { "italic" },
|
||||
loops = {},
|
||||
functions = {},
|
||||
keywords = { "italic" },
|
||||
strings = {},
|
||||
variables = {},
|
||||
numbers = {},
|
||||
booleans = {},
|
||||
properties = {},
|
||||
types = {},
|
||||
operators = {},
|
||||
},
|
||||
integrations = {
|
||||
cmp = true,
|
||||
gitsigns = true,
|
||||
nvimtree = true,
|
||||
telescope = { enabled = true },
|
||||
treesitter = true,
|
||||
which_key = true,
|
||||
alpha = true,
|
||||
mason = true,
|
||||
noice = true,
|
||||
notify = true,
|
||||
dap = true,
|
||||
dap_ui = true,
|
||||
native_lsp = {
|
||||
enabled = true,
|
||||
underlines = {
|
||||
errors = { "undercurl" },
|
||||
hints = { "undercurl" },
|
||||
warnings = { "undercurl" },
|
||||
information = { "undercurl" },
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
vim.cmd.colorscheme("catppuccin")
|
||||
end,
|
||||
},
|
||||
|
||||
@ -18,6 +70,244 @@ return {
|
||||
end,
|
||||
},
|
||||
|
||||
-- Bufferline (tab management)
|
||||
{
|
||||
"akinsho/bufferline.nvim",
|
||||
version = "*",
|
||||
dependencies = { "nvim-tree/nvim-web-devicons", "catppuccin/nvim" },
|
||||
config = function()
|
||||
require("bufferline").setup({
|
||||
options = {
|
||||
mode = "buffers",
|
||||
themable = true,
|
||||
numbers = "ordinal",
|
||||
close_command = "bdelete! %d",
|
||||
right_mouse_command = "bdelete! %d",
|
||||
indicator = {
|
||||
icon = "| ",
|
||||
style = "icon",
|
||||
},
|
||||
buffer_close_icon = "",
|
||||
modified_icon = "●",
|
||||
close_icon = "",
|
||||
left_trunc_marker = "",
|
||||
right_trunc_marker = "",
|
||||
diagnostics = "nvim_lsp",
|
||||
diagnostics_indicator = function(count, level)
|
||||
local icon = level:match("error") and " " or " "
|
||||
return " " .. icon .. count
|
||||
end,
|
||||
offsets = {
|
||||
{
|
||||
filetype = "NvimTree",
|
||||
text = "File Explorer",
|
||||
highlight = "Directory",
|
||||
separator = true,
|
||||
},
|
||||
},
|
||||
color_icons = true,
|
||||
show_buffer_icons = true,
|
||||
show_buffer_close_icons = true,
|
||||
show_close_icon = true,
|
||||
show_tab_indicators = true,
|
||||
separator_style = "slant",
|
||||
always_show_bufferline = true,
|
||||
hover = {
|
||||
enabled = true,
|
||||
delay = 200,
|
||||
reveal = { "close" },
|
||||
},
|
||||
},
|
||||
highlights = require("catppuccin.groups.integrations.bufferline").get(),
|
||||
})
|
||||
end,
|
||||
},
|
||||
|
||||
-- Toggleterm (integrated terminal)
|
||||
{
|
||||
"akinsho/toggleterm.nvim",
|
||||
version = "*",
|
||||
config = function()
|
||||
require("toggleterm").setup({
|
||||
size = function(term)
|
||||
if term.direction == "horizontal" then
|
||||
return 15
|
||||
elseif term.direction == "vertical" then
|
||||
return vim.o.columns * 0.4
|
||||
end
|
||||
end,
|
||||
open_mapping = [[<C-\>]],
|
||||
hide_numbers = true,
|
||||
shade_terminals = true,
|
||||
shading_factor = 2,
|
||||
start_in_insert = true,
|
||||
insert_mappings = true,
|
||||
terminal_mappings = true,
|
||||
persist_size = true,
|
||||
persist_mode = true,
|
||||
direction = "float",
|
||||
close_on_exit = true,
|
||||
shell = vim.o.shell,
|
||||
auto_scroll = true,
|
||||
float_opts = {
|
||||
border = "curved",
|
||||
winblend = 0,
|
||||
},
|
||||
})
|
||||
|
||||
local Terminal = require("toggleterm.terminal").Terminal
|
||||
|
||||
-- Lazygit terminal
|
||||
local lazygit = Terminal:new({
|
||||
cmd = "lazygit",
|
||||
dir = "git_dir",
|
||||
direction = "float",
|
||||
float_opts = { border = "double" },
|
||||
on_open = function(term)
|
||||
vim.cmd("startinsert!")
|
||||
end,
|
||||
})
|
||||
|
||||
function _G._LAZYGIT_TOGGLE()
|
||||
lazygit:toggle()
|
||||
end
|
||||
|
||||
-- Python REPL
|
||||
local python = Terminal:new({
|
||||
cmd = "python3",
|
||||
direction = "horizontal",
|
||||
})
|
||||
|
||||
function _G._PYTHON_TOGGLE()
|
||||
python:toggle()
|
||||
end
|
||||
|
||||
-- Node REPL
|
||||
local node = Terminal:new({
|
||||
cmd = "node",
|
||||
direction = "horizontal",
|
||||
})
|
||||
|
||||
function _G._NODE_TOGGLE()
|
||||
node:toggle()
|
||||
end
|
||||
end,
|
||||
},
|
||||
|
||||
-- Session management
|
||||
{
|
||||
"rmagatti/auto-session",
|
||||
config = function()
|
||||
require("auto-session").setup({
|
||||
log_level = "error",
|
||||
auto_session_suppress_dirs = { "~/", "~/Projects", "~/Downloads", "/" },
|
||||
auto_session_use_git_branch = true,
|
||||
auto_save_enabled = true,
|
||||
auto_restore_enabled = true,
|
||||
auto_session_root_dir = vim.fn.stdpath("data") .. "/sessions/",
|
||||
})
|
||||
end,
|
||||
},
|
||||
|
||||
-- Notifications
|
||||
{
|
||||
"rcarriga/nvim-notify",
|
||||
config = function()
|
||||
require("notify").setup({
|
||||
background_colour = "#000000",
|
||||
fps = 60,
|
||||
render = "default",
|
||||
stages = "fade_in_slide_out",
|
||||
timeout = 3000,
|
||||
top_down = true,
|
||||
})
|
||||
vim.notify = require("notify")
|
||||
end,
|
||||
},
|
||||
|
||||
-- Noice (enhanced UI)
|
||||
{
|
||||
"folke/noice.nvim",
|
||||
event = "VeryLazy",
|
||||
dependencies = {
|
||||
"MunifTanjim/nui.nvim",
|
||||
"rcarriga/nvim-notify",
|
||||
},
|
||||
config = function()
|
||||
require("noice").setup({
|
||||
lsp = {
|
||||
override = {
|
||||
["vim.lsp.util.convert_input_to_markdown_lines"] = true,
|
||||
["vim.lsp.util.stylize_markdown"] = true,
|
||||
["cmp.entry.get_documentation"] = true,
|
||||
},
|
||||
hover = { enabled = true },
|
||||
signature = { enabled = true },
|
||||
},
|
||||
presets = {
|
||||
bottom_search = true,
|
||||
command_palette = true,
|
||||
long_message_to_split = true,
|
||||
inc_rename = false,
|
||||
lsp_doc_border = true,
|
||||
},
|
||||
views = {
|
||||
cmdline_popup = {
|
||||
position = { row = 5, col = "50%" },
|
||||
size = { width = 60, height = "auto" },
|
||||
},
|
||||
},
|
||||
routes = {
|
||||
{
|
||||
filter = { event = "msg_show", kind = "", find = "written" },
|
||||
opts = { skip = true },
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
|
||||
-- Git signs
|
||||
{
|
||||
"lewis6991/gitsigns.nvim",
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
config = function()
|
||||
require("gitsigns").setup({
|
||||
on_attach = function(bufnr)
|
||||
local gs = package.loaded.gitsigns
|
||||
local map = function(mode, l, r, opts)
|
||||
opts = opts or {}
|
||||
opts.buffer = bufnr
|
||||
vim.keymap.set(mode, l, r, opts)
|
||||
end
|
||||
-- Navigation
|
||||
map("n", "]c", function() gs.next_hunk() end, { desc = "Next hunk" })
|
||||
map("n", "[c", function() gs.prev_hunk() end, { desc = "Previous hunk" })
|
||||
-- Actions
|
||||
map("n", "<leader>gs", gs.stage_hunk, { desc = "Stage hunk" })
|
||||
map("n", "<leader>gr", gs.reset_hunk, { desc = "Reset hunk" })
|
||||
map("n", "<leader>gS", gs.stage_buffer, { desc = "Stage buffer" })
|
||||
map("n", "<leader>gu", gs.undo_stage_hunk, { desc = "Undo stage" })
|
||||
map("n", "<leader>gp", gs.preview_hunk, { desc = "Preview hunk" })
|
||||
map("n", "<leader>gb", function() gs.blame_line({ full = true }) end, { desc = "Blame line" })
|
||||
map("n", "<leader>gd", gs.diffthis, { desc = "Diff this" })
|
||||
end,
|
||||
})
|
||||
end,
|
||||
},
|
||||
|
||||
-- Diff view
|
||||
{
|
||||
"sindrets/diffview.nvim",
|
||||
cmd = { "DiffviewOpen", "DiffviewFileHistory" },
|
||||
keys = {
|
||||
{ "<leader>gv", "<cmd>DiffviewOpen<cr>", desc = "Diff view" },
|
||||
{ "<leader>gh", "<cmd>DiffviewFileHistory %<cr>", desc = "File history" },
|
||||
{ "<leader>gx", "<cmd>DiffviewClose<cr>", desc = "Close diff" },
|
||||
},
|
||||
config = true,
|
||||
},
|
||||
|
||||
-- Fuzzy finder
|
||||
{
|
||||
"nvim-telescope/telescope.nvim",
|
||||
@ -33,6 +323,7 @@ return {
|
||||
opts = {
|
||||
format_on_save = { timeout_ms = 1000, lsp_fallback = true },
|
||||
formatters_by_ft = {
|
||||
-- Web
|
||||
javascript = { "prettierd", "prettier" },
|
||||
javascriptreact = { "prettierd", "prettier" },
|
||||
typescript = { "prettierd", "prettier" },
|
||||
@ -41,6 +332,15 @@ return {
|
||||
css = { "prettierd", "prettier" },
|
||||
html = { "prettierd", "prettier" },
|
||||
markdown = { "prettierd", "prettier" },
|
||||
-- Rust
|
||||
rust = { "rustfmt" },
|
||||
-- Python
|
||||
python = { "ruff_format" },
|
||||
-- C/C++
|
||||
c = { "clang_format" },
|
||||
cpp = { "clang_format" },
|
||||
-- Lua
|
||||
lua = { "stylua" },
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -52,11 +352,32 @@ return {
|
||||
config = function()
|
||||
require("nvim-treesitter.configs").setup({
|
||||
ensure_installed = {
|
||||
"lua", "vim", "bash", "javascript", "typescript", "tsx", "json", "yaml", "html", "css", "prisma",
|
||||
"graphql"
|
||||
-- Existing
|
||||
"lua", "vim", "vimdoc", "bash",
|
||||
-- Web
|
||||
"javascript", "typescript", "tsx", "json", "yaml", "html", "css", "prisma", "graphql",
|
||||
-- Rust
|
||||
"rust", "toml",
|
||||
-- Python
|
||||
"python",
|
||||
-- C/C++
|
||||
"c", "cpp",
|
||||
-- Markdown
|
||||
"markdown", "markdown_inline",
|
||||
-- Tools
|
||||
"sql", "http",
|
||||
},
|
||||
highlight = { enable = true },
|
||||
indent = { enable = true },
|
||||
incremental_selection = {
|
||||
enable = true,
|
||||
keymaps = {
|
||||
init_selection = "<C-space>",
|
||||
node_incremental = "<C-space>",
|
||||
scope_incremental = false,
|
||||
node_decremental = "<bs>",
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
@ -82,16 +403,30 @@ return {
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
["<C-Space>"] = cmp.mapping.complete(),
|
||||
["<CR>"] = cmp.mapping.confirm({ select = true }),
|
||||
["<Tab>"] = cmp.mapping.select_next_item(),
|
||||
["<S-Tab>"] = cmp.mapping.select_prev_item(),
|
||||
["<C-n>"] = cmp.mapping.select_next_item(),
|
||||
["<C-p>"] = cmp.mapping.select_prev_item(),
|
||||
}),
|
||||
sources = {
|
||||
{ name = "nvim_lsp" },
|
||||
{ name = "path" },
|
||||
{ name = "buffer" },
|
||||
{ name = "luasnip" },
|
||||
{ name = "crates" },
|
||||
},
|
||||
})
|
||||
|
||||
-- SQL files completion
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
pattern = { "sql", "mysql", "plsql" },
|
||||
callback = function()
|
||||
cmp.setup.buffer({
|
||||
sources = {
|
||||
{ name = "vim-dadbod-completion" },
|
||||
{ name = "buffer" },
|
||||
},
|
||||
})
|
||||
end,
|
||||
})
|
||||
end,
|
||||
},
|
||||
|
||||
@ -106,7 +441,17 @@ return {
|
||||
dependencies = { "williamboman/mason.nvim" },
|
||||
config = function()
|
||||
require("mason-lspconfig").setup({
|
||||
ensure_installed = { "ts_ls", "eslint", "jsonls", "html", "cssls", "tailwindcss" },
|
||||
ensure_installed = {
|
||||
-- Web
|
||||
"ts_ls", "eslint", "jsonls", "html", "cssls", "tailwindcss",
|
||||
-- Rust
|
||||
"rust_analyzer",
|
||||
-- Python
|
||||
"pyright", "ruff",
|
||||
-- C/C++
|
||||
"clangd",
|
||||
},
|
||||
automatic_installation = true,
|
||||
})
|
||||
end,
|
||||
},
|
||||
@ -117,6 +462,111 @@ return {
|
||||
"williamboman/mason-lspconfig.nvim",
|
||||
"hrsh7th/cmp-nvim-lsp",
|
||||
},
|
||||
config = function()
|
||||
local capabilities = require("cmp_nvim_lsp").default_capabilities()
|
||||
|
||||
-- LSP keymaps on attach
|
||||
vim.api.nvim_create_autocmd("LspAttach", {
|
||||
callback = function(args)
|
||||
local opts = { buffer = args.buf, silent = true }
|
||||
vim.keymap.set("n", "gD", vim.lsp.buf.declaration, opts)
|
||||
vim.keymap.set("n", "gd", vim.lsp.buf.definition, opts)
|
||||
vim.keymap.set("n", "K", vim.lsp.buf.hover, opts)
|
||||
vim.keymap.set("n", "gi", vim.lsp.buf.implementation, opts)
|
||||
vim.keymap.set("n", "<C-k>", vim.lsp.buf.signature_help, opts)
|
||||
vim.keymap.set("n", "<leader>rn", vim.lsp.buf.rename, opts)
|
||||
vim.keymap.set("n", "<leader>ca", vim.lsp.buf.code_action, opts)
|
||||
vim.keymap.set("n", "gr", vim.lsp.buf.references, opts)
|
||||
vim.keymap.set("n", "<leader>lf", function()
|
||||
vim.lsp.buf.format({ async = true })
|
||||
end, opts)
|
||||
end,
|
||||
})
|
||||
|
||||
-- Rust
|
||||
vim.lsp.config("rust_analyzer", {
|
||||
capabilities = capabilities,
|
||||
settings = {
|
||||
["rust-analyzer"] = {
|
||||
cargo = { allFeatures = true },
|
||||
checkOnSave = { command = "clippy" },
|
||||
inlayHints = {
|
||||
bindingModeHints = { enable = true },
|
||||
chainingHints = { enable = true },
|
||||
closingBraceHints = { enable = true },
|
||||
closureReturnTypeHints = { enable = "always" },
|
||||
lifetimeElisionHints = { enable = "always" },
|
||||
parameterHints = { enable = true },
|
||||
typeHints = { enable = true },
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
-- Python (Pyright)
|
||||
vim.lsp.config("pyright", {
|
||||
capabilities = capabilities,
|
||||
settings = {
|
||||
python = {
|
||||
analysis = {
|
||||
autoSearchPaths = true,
|
||||
diagnosticMode = "workspace",
|
||||
useLibraryCodeForTypes = true,
|
||||
typeCheckingMode = "basic",
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
-- Python (Ruff for linting)
|
||||
vim.lsp.config("ruff", {
|
||||
capabilities = capabilities,
|
||||
on_attach = function(client, bufnr)
|
||||
client.server_capabilities.hoverProvider = false
|
||||
end,
|
||||
})
|
||||
|
||||
-- C/C++
|
||||
vim.lsp.config("clangd", {
|
||||
capabilities = capabilities,
|
||||
cmd = {
|
||||
"clangd",
|
||||
"--background-index",
|
||||
"--clang-tidy",
|
||||
"--header-insertion=iwyu",
|
||||
"--completion-style=detailed",
|
||||
"--function-arg-placeholders",
|
||||
},
|
||||
})
|
||||
|
||||
-- JSON
|
||||
vim.lsp.config("jsonls", { capabilities = capabilities })
|
||||
|
||||
-- HTML
|
||||
vim.lsp.config("html", { capabilities = capabilities })
|
||||
|
||||
-- CSS
|
||||
vim.lsp.config("cssls", { capabilities = capabilities })
|
||||
|
||||
-- Tailwind
|
||||
vim.lsp.config("tailwindcss", { capabilities = capabilities })
|
||||
|
||||
-- ESLint
|
||||
vim.lsp.config("eslint", { capabilities = capabilities })
|
||||
|
||||
-- Enable all configured servers
|
||||
vim.lsp.enable({
|
||||
"rust_analyzer",
|
||||
"pyright",
|
||||
"ruff",
|
||||
"clangd",
|
||||
"jsonls",
|
||||
"html",
|
||||
"cssls",
|
||||
"tailwindcss",
|
||||
"eslint",
|
||||
})
|
||||
end,
|
||||
},
|
||||
{
|
||||
"pmizio/typescript-tools.nvim",
|
||||
@ -133,6 +583,244 @@ return {
|
||||
end,
|
||||
},
|
||||
|
||||
-- Crates.nvim (Rust Cargo.toml)
|
||||
{
|
||||
"saecki/crates.nvim",
|
||||
event = { "BufRead Cargo.toml" },
|
||||
dependencies = { "nvim-lua/plenary.nvim" },
|
||||
config = function()
|
||||
require("crates").setup({
|
||||
smart_insert = true,
|
||||
insert_closing_quote = true,
|
||||
autoload = true,
|
||||
autoupdate = true,
|
||||
loading_indicator = true,
|
||||
popup = {
|
||||
autofocus = false,
|
||||
hide_on_select = false,
|
||||
copy_register = '"',
|
||||
style = "minimal",
|
||||
border = "rounded",
|
||||
show_version_date = true,
|
||||
max_height = 30,
|
||||
min_width = 20,
|
||||
},
|
||||
completion = {
|
||||
cmp = { enabled = true },
|
||||
},
|
||||
})
|
||||
|
||||
-- Crates keymaps
|
||||
vim.api.nvim_create_autocmd("BufRead", {
|
||||
pattern = "Cargo.toml",
|
||||
callback = function()
|
||||
local crates = require("crates")
|
||||
vim.keymap.set("n", "<leader>ct", crates.toggle, { buffer = true, desc = "Toggle crates" })
|
||||
vim.keymap.set("n", "<leader>cr", crates.reload, { buffer = true, desc = "Reload crates" })
|
||||
vim.keymap.set("n", "<leader>cv", crates.show_versions_popup, { buffer = true, desc = "Show versions" })
|
||||
vim.keymap.set("n", "<leader>cf", crates.show_features_popup, { buffer = true, desc = "Show features" })
|
||||
vim.keymap.set("n", "<leader>cd", crates.show_dependencies_popup, { buffer = true, desc = "Show dependencies" })
|
||||
vim.keymap.set("n", "<leader>cu", crates.update_crate, { buffer = true, desc = "Update crate" })
|
||||
vim.keymap.set("n", "<leader>cU", crates.upgrade_crate, { buffer = true, desc = "Upgrade crate" })
|
||||
end,
|
||||
})
|
||||
end,
|
||||
},
|
||||
|
||||
-- DAP (debugging)
|
||||
{
|
||||
"mfussenegger/nvim-dap",
|
||||
dependencies = {
|
||||
"rcarriga/nvim-dap-ui",
|
||||
"nvim-neotest/nvim-nio",
|
||||
"theHamsta/nvim-dap-virtual-text",
|
||||
},
|
||||
config = function()
|
||||
local dap = require("dap")
|
||||
local dapui = require("dapui")
|
||||
|
||||
dapui.setup({
|
||||
icons = { expanded = "", collapsed = "", current_frame = "" },
|
||||
mappings = {
|
||||
expand = { "<CR>", "<2-LeftMouse>" },
|
||||
open = "o",
|
||||
remove = "d",
|
||||
edit = "e",
|
||||
repl = "r",
|
||||
toggle = "t",
|
||||
},
|
||||
layouts = {
|
||||
{
|
||||
elements = {
|
||||
{ id = "scopes", size = 0.25 },
|
||||
"breakpoints",
|
||||
"stacks",
|
||||
"watches",
|
||||
},
|
||||
size = 40,
|
||||
position = "left",
|
||||
},
|
||||
{
|
||||
elements = { "repl", "console" },
|
||||
size = 0.25,
|
||||
position = "bottom",
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
require("nvim-dap-virtual-text").setup({
|
||||
enabled = true,
|
||||
enabled_commands = true,
|
||||
highlight_changed_variables = true,
|
||||
highlight_new_as_changed = false,
|
||||
show_stop_reason = true,
|
||||
commented = false,
|
||||
})
|
||||
|
||||
dap.listeners.after.event_initialized["dapui_config"] = function()
|
||||
dapui.open()
|
||||
end
|
||||
dap.listeners.before.event_terminated["dapui_config"] = function()
|
||||
dapui.close()
|
||||
end
|
||||
dap.listeners.before.event_exited["dapui_config"] = function()
|
||||
dapui.close()
|
||||
end
|
||||
|
||||
vim.fn.sign_define("DapBreakpoint", { text = "", texthl = "DiagnosticSignError" })
|
||||
vim.fn.sign_define("DapBreakpointCondition", { text = "", texthl = "DiagnosticSignWarn" })
|
||||
vim.fn.sign_define("DapLogPoint", { text = "", texthl = "DiagnosticSignInfo" })
|
||||
vim.fn.sign_define("DapStopped", { text = "", texthl = "DiagnosticSignHint", linehl = "Visual" })
|
||||
vim.fn.sign_define("DapBreakpointRejected", { text = "", texthl = "DiagnosticSignError" })
|
||||
end,
|
||||
},
|
||||
|
||||
-- Python DAP
|
||||
{
|
||||
"mfussenegger/nvim-dap-python",
|
||||
dependencies = { "mfussenegger/nvim-dap" },
|
||||
ft = "python",
|
||||
config = function()
|
||||
require("dap-python").setup("python3")
|
||||
end,
|
||||
},
|
||||
|
||||
-- JS/TS DAP
|
||||
{
|
||||
"mxsdev/nvim-dap-vscode-js",
|
||||
dependencies = {
|
||||
"mfussenegger/nvim-dap",
|
||||
{
|
||||
"microsoft/vscode-js-debug",
|
||||
build = "npm install --legacy-peer-deps && npx gulp vsDebugServerBundle && mv dist out",
|
||||
},
|
||||
},
|
||||
config = function()
|
||||
require("dap-vscode-js").setup({
|
||||
debugger_path = vim.fn.stdpath("data") .. "/lazy/vscode-js-debug",
|
||||
adapters = { "pwa-node", "pwa-chrome", "pwa-msedge", "node-terminal", "pwa-extensionHost" },
|
||||
})
|
||||
|
||||
for _, language in ipairs({ "typescript", "javascript", "typescriptreact", "javascriptreact" }) do
|
||||
require("dap").configurations[language] = {
|
||||
{
|
||||
type = "pwa-node",
|
||||
request = "launch",
|
||||
name = "Launch file",
|
||||
program = "${file}",
|
||||
cwd = "${workspaceFolder}",
|
||||
},
|
||||
{
|
||||
type = "pwa-node",
|
||||
request = "attach",
|
||||
name = "Attach",
|
||||
processId = require("dap.utils").pick_process,
|
||||
cwd = "${workspaceFolder}",
|
||||
},
|
||||
{
|
||||
type = "pwa-chrome",
|
||||
request = "launch",
|
||||
name = "Launch Chrome",
|
||||
url = "http://localhost:3000",
|
||||
webRoot = "${workspaceFolder}",
|
||||
},
|
||||
}
|
||||
end
|
||||
end,
|
||||
},
|
||||
|
||||
-- Markdown preview
|
||||
{
|
||||
"iamcco/markdown-preview.nvim",
|
||||
cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" },
|
||||
ft = { "markdown" },
|
||||
build = function() vim.fn["mkdp#util#install"]() end,
|
||||
config = function()
|
||||
vim.g.mkdp_auto_start = 0
|
||||
vim.g.mkdp_auto_close = 1
|
||||
vim.g.mkdp_refresh_slow = 0
|
||||
vim.g.mkdp_browser = ""
|
||||
vim.g.mkdp_preview_options = {
|
||||
mkit = {},
|
||||
katex = {},
|
||||
uml = {},
|
||||
maid = {},
|
||||
disable_sync_scroll = 0,
|
||||
sync_scroll_type = "middle",
|
||||
hide_yaml_meta = 1,
|
||||
}
|
||||
end,
|
||||
},
|
||||
|
||||
-- Database client
|
||||
{
|
||||
"tpope/vim-dadbod",
|
||||
cmd = { "DB", "DBUI", "DBUIToggle", "DBUIAddConnection" },
|
||||
},
|
||||
{
|
||||
"kristijanhusak/vim-dadbod-ui",
|
||||
dependencies = {
|
||||
{ "tpope/vim-dadbod", lazy = true },
|
||||
{ "kristijanhusak/vim-dadbod-completion", ft = { "sql", "mysql", "plsql" }, lazy = true },
|
||||
},
|
||||
cmd = { "DBUI", "DBUIToggle", "DBUIAddConnection", "DBUIFindBuffer" },
|
||||
init = function()
|
||||
vim.g.db_ui_use_nerd_fonts = 1
|
||||
vim.g.db_ui_save_location = vim.fn.stdpath("data") .. "/db_ui"
|
||||
end,
|
||||
},
|
||||
|
||||
-- HTTP client
|
||||
{
|
||||
"rest-nvim/rest.nvim",
|
||||
dependencies = { "nvim-lua/plenary.nvim" },
|
||||
ft = "http",
|
||||
config = function()
|
||||
require("rest-nvim").setup({
|
||||
result_split_horizontal = false,
|
||||
result_split_in_place = false,
|
||||
skip_ssl_verification = false,
|
||||
encode_url = true,
|
||||
highlight = {
|
||||
enabled = true,
|
||||
timeout = 150,
|
||||
},
|
||||
result = {
|
||||
show_url = true,
|
||||
show_curl_command = false,
|
||||
show_http_info = true,
|
||||
show_headers = true,
|
||||
formatters = {
|
||||
json = "jq",
|
||||
},
|
||||
},
|
||||
jump_to_request = false,
|
||||
env_file = ".env",
|
||||
yank_dry_run = true,
|
||||
})
|
||||
end,
|
||||
},
|
||||
|
||||
-- Colorizer
|
||||
{
|
||||
"NvChad/nvim-colorizer.lua",
|
||||
@ -161,13 +849,24 @@ return {
|
||||
})
|
||||
|
||||
wk.add({
|
||||
{ "<leader>e", desc = "Toggle file explorer" },
|
||||
{ "<leader>f", group = "Find" },
|
||||
{ "<leader>e", desc = "Toggle file explorer" },
|
||||
{ "<leader>f", group = "Find" },
|
||||
{ "<leader>ff", desc = "Find files" },
|
||||
{ "<leader>fg", desc = "Live grep" },
|
||||
{ "<leader>fb", desc = "Find buffers" },
|
||||
{ "<leader>w", desc = "Save" },
|
||||
{ "<leader>q", desc = "Quit" },
|
||||
{ "<leader>g", group = "Git" },
|
||||
{ "<leader>w", desc = "Save" },
|
||||
{ "<leader>q", desc = "Quit" },
|
||||
{ "<leader>b", group = "Buffers" },
|
||||
{ "<leader>t", group = "Terminal" },
|
||||
{ "<leader>d", group = "Debug" },
|
||||
{ "<leader>l", group = "LSP" },
|
||||
{ "<leader>c", group = "Crates (Rust)" },
|
||||
{ "<leader>s", group = "Session" },
|
||||
{ "<leader>n", group = "Notifications" },
|
||||
{ "<leader>h", group = "HTTP" },
|
||||
{ "<leader>D", group = "Database" },
|
||||
{ "<leader>m", group = "Markdown" },
|
||||
})
|
||||
end,
|
||||
},
|
||||
@ -187,14 +886,14 @@ return {
|
||||
|
||||
dashboard.section.buttons.val = {
|
||||
dashboard.button("e", " New file", ":ene <BAR> startinsert <CR>"),
|
||||
dashboard.button("f", " Find file", ":lua require('fzf-lua').files() <CR>"),
|
||||
dashboard.button("f", " Find file", ":Telescope find_files<CR>"),
|
||||
dashboard.button("r", " Recent files", ":Telescope oldfiles<CR>"),
|
||||
dashboard.button("t", " Browse cwd", ":NvimTreeOpen<CR>"),
|
||||
dashboard.button("r", " Browse src", ":e ~/.local/src/<CR>"),
|
||||
dashboard.button("s", " Browse scripts", ":e ~/scripts/<CR>"),
|
||||
dashboard.button("s", " Restore session", ":SessionRestore<CR>"),
|
||||
dashboard.button("g", " Lazygit", ":lua _LAZYGIT_TOGGLE()<CR>"),
|
||||
dashboard.button("c", " Config", ":e ~/.config/nvim/<CR>"),
|
||||
dashboard.button("m", " Mappings", ":e ~/.config/nvim/lua/core/keymaps.lua<CR>"),
|
||||
dashboard.button("p", " Plugins", ":PlugInstall<CR>"),
|
||||
dashboard.button("q", " Quit", ":q!<CR>"),
|
||||
dashboard.button("p", " Plugins", ":Lazy<CR>"),
|
||||
dashboard.button("q", " Quit", ":qa<CR>"),
|
||||
}
|
||||
|
||||
dashboard.section.footer.val = function()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user