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.
In my daily tasks, I've streamlined my workflow by integrating several powerful tools:
- Terminal: I use
Kitty
for its blend of performance and rich features. - Session Management:
tmux
helps me manage multiple terminal sessions within a single window. - File Manager:
yazi
is my terminal-based file manager, fitting seamlessly into my terminal-centric workflow.
Additionally, this configuration is compatible with neovide
, so no extra setup is required.
This combination of tools significantly enhances my productivity, providing a robust and efficient terminal experience.
This configuration supports development in the following languages:
- TypeScript: Using
vtsls
withvolar2
. - Python:
basedpyright
is the LSP of choice. - Go: With
gopher.nvim
, supporting the Go Zero framework. - Rust: Powered by
mrcjkb/rustaceanvim
. - Markdown: Integrated with
iamcco/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 mercurial ast-grep lazydocker
# Node.js packages
npm install -g tree-sitter-cli neovim @styled/typescript-styled-plugin
# Python packages
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 pillow
Python package:
pip install pillow
To automatically switch input methods when entering and exiting insert mode in Neovim:
-
Install
im-select
:brew tap laishulu/macism 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", set_previous_events = { "InsertEnter", "FocusLost" }, }, }
For an alternative input method, you can install squirrel
:
brew install --cask squirrel
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! π