Skip to content

zlj-zz/nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

246 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Neovim Config

Personal Neovim configuration, migrated to lazy.nvim + Lua.

demo

Tested on macOS / Linux. Windows support is partial (g.isWin checks).

Requirements

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.

Structure

.
├── 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

Plugins

Core

Plugin Purpose
lazy.nvim Plugin manager
nvim-treesitter Syntax highlighting, folding, indentation
nvim-lspconfig Built-in LSP configurations
nvim-cmp Completion engine
LuaSnip Snippet engine

UI

Plugin Purpose
nordic.nvim Color scheme (Nord enhanced)
lualine.nvim Status line + tabline
alpha-nvim Startup dashboard
indent-blankline.nvim Indent guides with scope highlighting
rainbow-delimiters.nvim Rainbow parentheses (Treesitter)

Editor

Plugin Purpose
telescope.nvim Fuzzy finder (files, grep, buffers, etc.)
vim-commentary Toggle comments
vim-visual-multi Multi-cursor editing
vim-easy-align Text alignment
wildfire.vim Fast text object selection
splitjoin.vim Split/join code blocks

Language Support

Plugin Purpose
nvim-lspconfig Built-in LSP (Go, Vim, Bash, ...)
flutter-tools.nvim Flutter / Dart (LSP, hot reload, outline)
vim-css3-syntax CSS3 syntax
markdown-preview.nvim Markdown preview in browser

Terminal & AI

Plugin Purpose
toggleterm.nvim Terminal (bottom / right / float)
agent-bridge Send code context to AI agents (Claude / tmux / clipboard)
supermaven-nvim AI inline code completion

Other

Plugin Purpose
undotree Undo history tree
nvim-tree.lua File explorer
aerial.nvim Code outline (LSP / Treesitter)
trouble.nvim Diagnostics / symbols list
gitsigns.nvim Git decorations, blame, hunk actions
yanky.nvim Yank history, telescope integration
conform.nvim Formatting (prettier, black, stylua, etc.)
which-key.nvim Keymap discovery popup
goyo.vim Distraction-free mode
vim-table-mode Markdown table editing

Key Mappings

<LEADER> is set to <Space>.

Basic

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

Cursor Movement

Key Action
K / J Up / down 5 lines
H / L Left / right 5 chars
<C-k> Scroll view up 5 lines (cursor stays)

Window Management

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

Tab / Buffer

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

Telescope (Search)

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

LSP (Go files, built-in)

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

Gitsigns

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

Format (conform.nvim)

Key Action
<leader>cf Format document / selection
:FormatToggle Toggle format-on-save

Yanky

Key Action
<space>y Yank history (Telescope)
<c-p> / <c-n> Cycle yank history after paste

Flutter

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

Other

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

Built-in LSP Setup

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.

macOS / Platform Notes

  • 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.

Configuration for vim

ln -s xxx/nvim ~/.vim
ln -s xxx/nvim/init.vim ./vimrc

About

This is my neovim, good vim configuration.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors