+
Skip to content

bwan3150/nvim-config

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Neovim Config

个人Neovim配置, 基于 NvChad 进行定制, 用于设备间同步

安装

前置

  • Neovim >= 0.9.0
  • Git
  • Nerd Font
  • ripgrep (用于 telescope 搜索)
  • Node.js (用于某些 LSP 服务器)
  • 输入法工具(用于退出insert模式时切换回英文输入法以使用nvim命令):
    • Linux: fcitx5 (sudo apt install fcitx5)
    • macOS: macism (brew tap laishulu/homebrew && brew install macism)

步骤

  1. 克隆:
git clone https://github.com/bwan3150/nvim-config.git ~/.config/nvim
  1. 安装LSP解释器依赖(基础提供lua, rust, python, type/javascript)
chmod +x lsp_requirements.sh
./lsp_requirements.sh
  1. 安装其他系统依赖:

如要在 nvim 中显示图片, 安装以下依赖(示例基于debian):

# 基础
sudo apt update
sudo apt install -y libreadline-dev liblua5.1-0-dev pkg-config libmagickwand-dev luarocks

# 通过luarocks安装依赖
luarocks install magick

注意:

  • image.nvim 插件需要支持图片显示的终端,如 Ghostty, Kitty
  1. 启动 Neovim:
nvim

Lazy.nvim 会自动安装所有插件
如果没有成功安装或需要重新安装, 通过以下指令手动同步:

:Lazy clean
:Lazy sync

结构

~/.config/nvim/
├── init.lua                 # 入口文件
├── lua/
│   ├── chadrc.lua          # NvChad 主题和 UI 配置
│   ├── options.lua         # Neovim 选项设置
│   ├── mappings.lua        # 按键映射
│   ├── autocmds.lua        # 自动命令
│   ├── configs/
│   │   ├── lspconfig.lua   # LSP 配置
│   │   ├── conform.lua     # 代码格式化配置
│   │   └── lazy.lua        # 插件管理器配置
│   └── plugins/
│       └── init.lua        # 插件列表和配置
│── lazy-lock.json          # 插件版本锁定文件
└── lsp_requirements.sh     # LSP依赖解释器安装脚本(for Macos and GNU/Linux) 

更新

要更新插件,在 Neovim 中运行:

:Lazy sync

NvChad Fix

当前版本NvChad的Colorify与LSP同时运行会出现Bug, 使用:

nvim +35 ~/.local/share/nvim/lazy/ui/lua/nvchad/colorify/methods.lua

打开文件后, 将client:request改为client.request, 之后报错就解决了

Credits

About

Personal nvim config based on Nvchard for multi-device sync

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载