Welcome to my customized AstroNvimV5 configuration! This setup has been optimized for an efficient and powerful development workflow. Below, you'll find all the details on how to install, configure, and use this setup, along with some helpful tips and tricks.
This configuration supports development in the following languages:
Language | AutoCompletion | Debug |
---|---|---|
Typescript | β | β |
Vue | β | β |
React | β | β |
Solid | β | β |
Angular | β | β |
Node | β | β |
Python | β | β |
Rust | β | β |
Go | β | β |
- TypeScript:
vtsls
. - Vue:
volar2
. - React:
vtsls
. - Angular:
angular server
. - Node:
vtsls
. - Python:
basedpyright
. - Go:
gopls
. - Rust:
rust-analyzer
. - Markdown:
markdown-preview.nvim
.
Neovim requires LuaJIT, so Lua 5.1 is currently the best version to use. Why Neovim uses Lua 5.1.
wget https://luarocks.github.io/luarocks/releases/luarocks-3.11.1.tar.gz
tar zxpf luarocks-3.11.1.tar.gz
cd luarocks-3.11.1
./configure --lua-version=5.1 --lua-suffix=5.1
make
sudo make install
luarocks --version
wget https://www.lua.org/ftp/lua-5.1.5.tar.gz
tar zxpf lua-5.1.5.tar.gz
cd lua-5.1.5
# For macOS
make macosx
make test
sudo make install
which lua
lua -v
Make sure the following commands are installed on your system:
npm
rustc
go
tmux
Use brew
, npm
, and pip
to install the necessary dependencies:
# Homebrew packages
brew install fzf fd lazygit ripgrep gdu bottom protobuf gnu-sed ast-grep lazydocker trash imagemagick chafa delta coreutils
# Node.js packages
npm install -g tree-sitter-cli neovim @styled/typescript-styled-plugin
# Python packages, for render-markdown.nvim
pip install pynvim pylatexenc
Backup your existing Neovim configuration and clone the customized AstroNvim setup:
mv ~/.config/nvim ~/.config/nvim.bak
rm -rf ~/.local/share/nvim
rm -rf ~/.local/state/nvim
rm -rf ~/.cache/nvim
# Clone the customized AstroNvim configuration
git clone https://github.com/chaozwn/astronvim_with_coc_or_mason ~/.config/nvim
Here are some screenshots showcasing the workflow with kitty
, tmux
, yazi
, and AstroNvim.
- Kitty: https://github.com/chaozwn/kitty
- tmux: https://github.com/chaozwn/tmux
- yazi: https://github.com/chaozwn/yazi
When working with Rust, note that rustup
and mason
install rust-analyzer
differently, which may cause some bugs. Manual installation is recommended:
rustup component add rust-analyzer
Press <F2>
to open the NVcheatsheet.
Trigger command: <leader>tl
Trigger command: <Leader>tt
brew install bottom
Ensure Neovim dependencies are installed
# Install Neovim dependencies
npm install -g neovim
pip install pynvim
To enable image pasting in Markdown files, install the pngpaste
Python package:
brew install pngpaste
Add to .zshrc
and .bashrc
export DYLD_FALLBACK_LIBRARY_PATH="$(brew --prefix)/lib:$DYLD_FALLBACK_LIBRARY_PATH"
To automatically switch input methods when entering and exiting insert mode in Neovim:
-
Install
im-select
:brew tap laishulu/homebrew brew install macism
-
Run
im-select
and copy the result to yourim-select.lua
configuration:macism
-
Add the following configuration to your
im-select.lua
file:return { "chaozwn/im-select.nvim", lazy = false, opts = { default_command = "macism", default_main_select = "im.rime.inputmethod.Squirrel.Hans", -- replace with you result in step 2 set_previous_events = { "InsertEnter", "FocusLost" }, }, }
For an alternative input method, you can install squirrel
:
brew install --cask squirrel
nvim -u /Users/jayce.zhao/.config/nvim/mini_astronvim.lua .
Here are the general key mappings for this configuration:
Action | Keybinding |
---|---|
Leader key | Space |
Resize up | Ctrl + Up |
Resize down | Ctrl + Down |
Resize left | Ctrl + Left |
Resize right | Ctrl + Right |
Move to upper window | Ctrl + k |
Move to lower window | Ctrl + j |
Move to left window | Ctrl + h |
Move to right window | Ctrl + l |
Force write | Ctrl + s |
Force quit | Ctrl + q |
New file | Leader + n |
Close buffer | Leader + c |
Next tab (real Vim tab) | ]t |
Previous tab (real Vim tab) | [t |
Toggle comment | Leader + / |
Horizontal split | \ |
Vertical split | | |
You can use vim.lsp.buf.hover()
to display hover information about the symbol under the cursor in a floating window. Calling the function twice will jump into the floating window.
- Keybinding:
KK
To quickly set a DAP (Debug Adapter Protocol) breakpoint, use <Ctrl-LeftClick>
on the line number.
This configuration supports Neovim version >= 0.10
.
This configuration is open-source and available under the MIT License.
Feel free to explore, customize, and enjoy this powerful Neovim setup! If you have any questions or encounter issues, don't hesitate to reach out.
Happy coding! π