Neovim
sudo pacman -S neovim
brew install neovim
winget install Neovim.Neovim
LazyVim
LazyVim setup:
mv ~/.config/nvim{,.bak}
mv ~/.local/share/nvim{,.bak}
mv ~/.local/state/nvim{,.bak}
mv ~/.cache/nvim{,.bak}
git clone --depth=1 https://github.com/LazyVim/starter ~/.config/nvim
AstroNvim
AstroNvim setup:
mv ~/.config/nvim{,.bak}
mv ~/.local/share/nvim{,.bak}
mv ~/.local/state/nvim{,.bak}
mv ~/.cache/nvim{,.bak}
git clone --depth=1 https://github.com/AstroNvim/template ~/.config/nvim
Extras Plugins
Config LazyVim extras plugins ~/.config/nvim/lazyvim.json,
installed in ~/.local/share/nvim/lazy/LazyVim/lua/lazyvim/plugins/extras.
Community Plugins
AstroNvim community plugins (~/.config/nvim/lua/community.lua):
return {
"AstroNvim/astrocommunity",
{ import = "astrocommunity.pack.lua" },
{ import = "astrocommunity.colorscheme.catppuccin" },
{ import = "astrocommunity.completion.copilot-lua-cmp" },
-- import/override with your plugins folder
}
See plugins list on Astro Community.
Language Server
:LspInstall typescript
K:vim.lsp.buf.hover()show types.
Linter
Config ESLint LSP server
~/.config/nvim/lua/plugins/lsp.lua:
<Sapce>xq: show quick fix list.]q: jump to next quick fix.<Space>xx: show diagnostics list.]d: jump to next diagnostic.<C-w>d: show diagnostics under the cursor.
Spell
Grammar
:LspInstall harper_ls Grammarly LSP with <Leader>ca LSP code action.
Option
Enable spell options
~/.config/nvim/lua/config/options.lua:
vim.opt.spelllang = { "en", "cjk" }
vim.opt.spell = true
vim.opt.spelloptions = "camel"
Dictionary
zg添加到字典 (~/.config/nvim/spell/en.utf-8.add或~/.vim/spell/en.utf-8.add).- Rebuild dictionary with
mkspell!~/.config/nvim/lua/config/keymaps.lua.
Markdown
关闭 render ~/.config/nvim/lua/plugins/markdown.lua
和 conceal ~/.config/nvim/lua/config/autocmds.lua.
Clipboard
sudo pacman -S wl-clipboard
:checkhealth vim.provider
flash.nvim
flash.nvim key bindings:
| Key | Command |
|---|---|
s | Search character |
f | Find character forwards |
F | Find character backwards |
t | Til character forwards |
T | Til character backwards |
Telescope
<Esc>/<C-[ enter normal mode:
?: help menu.<M-w>: cycle window.<C-Q>: send to quick fix list.
Quick Traverse
Use <C-Q> to send to quick fix list,
then use ]q to quick traverse.
Debugging
:help显示文档: e.g.:help vim.opt.:Inspect(<Space>ui) 显示 highlight group.:messages显示日志信息.