Personal Neovim configuration, migrated to lazy.nvim + Lua .
Tested on macOS / Linux. Windows support is partial (g.isWin checks).
Install system dependencies:
brew install ripgrep gopls ctags node python3
Or use the bundled installer (macOS / Linux):
lua tools/install-dependent.lua
Install Python & Node packages:
pip3 install pynvim
npm install -g neovim
Install a Nerd Font for icons (optional but recommended):
brew install --cask font-hack-nerd-font
After installation, run :checkhealth in Neovim.
.
├── init.vim # Entry point
├── lua/
│ ├── env.lua # Environment, paths, machine-specific config
│ ├── utils.lua # Utility functions (map, opt, autocmd, etc.)
│ ├── funcs.lua # Custom functions (browser open, transparent bg, etc.)
│ ├── plugin.lua # lazy.nvim plugin specs
│ ├── settings/
│ │ ├── init.lua # Load options + mappings
│ │ ├── options.lua # Vim options
│ │ └── mappings.lua # Key mappings
│ └── plugincfg/ # Per-plugin configurations
│ ├── alpha-theme.lua
│ ├── toggleterm.lua
│ ├── lsp.lua # Built-in LSP configs
│ ├── cmp.lua # nvim-cmp completion
│ ├── telescope.lua
│ └── ...
├── augroups.vim # Autocmd groups (vimscript)
├── customplugins/ # Local vimscript plugins
│ ├── compile_run.vim
│ ├── md_quickmap.vim
│ └── replace.vim
└── tools/
└── install-dependent.lua
<LEADER> is set to <Space>.
Key
Action
S
Save (:w)
Q
Quit (:q)
<C-q>
Force quit (:q!)
Y
Yank to end of line (y$)
<C-a>
Select all (ggVG)
<leader>tr
Trim trailing whitespace
Key
Action
K / J
Up / down 5 lines
H / L
Left / right 5 chars
<C-k>
Scroll view up 5 lines (cursor stays)
Key
Action
sk / sj
Horizontal split
sh / sl
Vertical split
tk / tj / th / tl
Move between windows
<Up> / <Down> / <Left> / <Right>
Resize window
ck / ch
Rearrange splits
Key
Action
tn
New tab
t- / t=
Previous / next tab
b- / b=
Previous / next buffer
b#
Last buffer
b1 ~ b9
Switch to buffer 1~9
<m-1> ~ <m-9>
Switch to tab 1~9
Key
Action
,f
Live grep (search in project)
,h
Recent files
,b
Open buffers
,l
Search in current file
,c
Command history
,k
Keymaps
In telescope pickers, <C-d> deletes a buffer (in :Telescope buffers).
Comments
Key
Action
<leader>cc
Toggle comment (current line)
<leader>c + motion
Comment motion (e.g. <leader>cip for paragraph)
Visual <leader>c
Comment selected lines
Key
Action
gd
Go to definition
gr
Find references
gi
Go to implementation
gy
Go to type definition
K
Show hover documentation
<leader>rn
Rename symbol
<leader>a
Code action
<leader>qf
Quick fix
<Tab> / <S-Tab>
Next / prev completion item
<CR>
Confirm completion
<C-Space>
Trigger completion
Trouble (Diagnostics / Symbols)
Key
Action
<leader>xx
Toggle diagnostics panel
<leader>xs
Toggle symbols panel
Key
Action
[h / ]h
Prev / next hunk
<leader>hp
Preview hunk
<leader>hb
Blame line
<leader>hs
Stage hunk
<leader>hr
Reset hunk
<leader>hd
Diff this file
AI (agent-bridge + Supermaven)
Key
Action
<leader>ai
Open agent-bridge float (visual / normal)
<C-s>
Send prompt from float
<Tab> (in float)
Cycle sender mode (auto → tmux → claude → clipboard)
<C-l>
Accept Supermaven suggestion
<C-j>
Accept Supermaven next word
<C-\>
Clear Supermaven suggestion
Key
Action
<leader>cf
Format document / selection
:FormatToggle
Toggle format-on-save
Key
Action
<space>y
Yank history (Telescope)
<c-p> / <c-n>
Cycle yank history after paste
Key
Action
<leader>fr
Flutter run
<leader>fR
Flutter restart
<leader>fq
Flutter quit
<leader>fo
Toggle Flutter outline
<leader>fd
Flutter DevTools
<leader>fe
Flutter emulators
Key
Action
tt
Toggle file tree (nvim-tree)
<c-t>
Toggle bottom terminal (toggleterm)
<C-l>
Toggle right-side terminal
<A-1> ~ <A-3>
Toggle terminal 1~3
<Esc><Esc> (in terminal)
Exit terminal mode
<f4>
Toggle transparent background
<leader>z
Toggle full screen (zoom window)
<leader>go
Open current file in browser
<leader>sc
Toggle spell check
<leader>pm
Toggle paste mode
<leader>fc
Find git conflict markers
<leader><cr>
Clear search highlight
<leader>gy
Toggle Goyo (focus mode)
<leader>tm
Toggle table mode
ga
Align text (visual/normal)
<c-d>
Select next occurrence (multi-cursor)
ga + <symbol>
Easy align around symbol
All language servers are managed via built-in LSP.
Install language servers:
# Go
brew install gopls
# Lua
brew install lua-language-server
# Python
npm install -g pyright
# Vimscript, Bash
npm install -g vim-language-server bash-language-server
# HTML, CSS, JSON (single package)
npm install -g vscode-langservers-extracted
# TypeScript
npm install -g typescript-language-server
# YAML
npm install -g yaml-language-server
# Swift (macOS, comes with Xcode CLI)
xcode-select --install
# or: brew install sourcekit-lsp
Install formatters (used by conform.nvim):
brew install stylua shfmt
npm install -g prettier
pip3 install black
go install mvdan.cc/gofumpt@latest
go install golang.org/x/tools/cmd/goimports@latest
macOS Input Method (optional)
For automatic input method switching (English in Normal mode, restore in Insert mode):
brew tap daipeihust/tap && brew install im-select
If im-select is missing, Neovim will show a warning on startup. Run :IMSelectInstall to install it automatically.
Input method auto-switch : im-select is used to switch to ABC layout when leaving Insert mode. Only active on macOS.
AI integration : agent-bridge supports three sender modes:
tmux — sends prompt to a tmux pane running claude
claude — runs claude -p --continue and captures stdout into a result float
clipboard — copies prompt to system clipboard
Supermaven : Free AI inline completion. Run :SupermavenUseFree on first use.
ln -s xxx/nvim ~ /.vim
ln -s xxx/nvim/init.vim ./vimrc