安装Neovim
sudo apt install neovim
检查安装:nvim --version
配置Neovim
使用Lazyvim的默认配置进行快速配置
- Neovim >= 0.9.0 (needs to be built with LuaJIT)
- Git >= 2.19.0 (for partial clones support)
- a Nerd Font(v3.0 or greater) (optional, but needed to display some icons)
- lazygit (optional)
- a C compiler for nvim-treesitter
- curl for blink.cmp (completion engine)
- for fzf-lua (optional): fzf, ripgrep, fd
- a terminal that support true color and undercurl
安装lazygit
LAZYGIT_VERSION=$(curl -s \
"https://api.github.com/repos/jesseduffield/lazygit/releases/latest" \
| \grep -Po '"tag_name": *"v\K[^"]*')
curl -Lo lazygit.tar.gz \
"https://github.com/jesseduffield/lazygit/releases/download/ \
v${LAZYGIT_VERSION}/
lazygit_${LAZYGIT_VERSION}_Linux_x86_64.tar.gz"
tar xf lazygit.tar.gz lazygit
sudo install lazygit -D -t /usr/local/bin/
安装fzf
git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf
~/.fzf/install
重启终端或者source
使用cargo安装部分依赖
安装ripgrep
cargo install ripgrep
安装fd
cargo install fd-find
安装Lazyvim
安装 LazyVim Starter
对现有的Neovim文件进行备份
# required
mv ~/.config/nvim{,.bak}
# optional but recommended
mv ~/.local/share/nvim{,.bak}
mv ~/.local/state/nvim{,.bak}
mv ~/.cache/nvim{,.bak}
Clone the starter
git clone https://github.com/LazyVim/starter ~/.config/nvim
删除 .git 文件夹, 之后就可以将其添加到自己的配置仓库中
rm -rf ~/.config/nvim/.git
启动Neovim
nvim
其他配置
编辑~/.config/nvim/lua/config/options.lua
添加 vim.opt.spelllang={"en", "cjk"} 解决中文拼写检查
更换主题
创建~/.config/nvim/lua/plugins/rose-pine.lua 输入一下内容重启nvim
return {
"rose-pine/neovim",
name = "rose-pine",
config = function()
vim.cmd("colorscheme rose-pine-dawn")
end
}
评论