montychen / nvim_ssh

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

推荐使用Neovim, 安装说明详见

先备份nvim的配置

mv ~/.config/nvim ~/.config/NVIM.BAK

# 完全清理nvim的配置
rm -rf ~/.config/nvim       # 删除nvim&自定义配置
rm -rf ~/.local/share/nvim  # 清理旧的插件

mac系统先运行

xcode-select --install

安装 LunarVim

LV_BRANCH='release-1.2/neovim-0.8' bash <(curl -s https://raw.githubusercontent.com/lunarvim/lunarvim/master/utils/installer/install.sh)

加载LunarVim的自定义配置

LunarVim支持自定义配置, 自定义内容的入口文件是: ~/.config/lvim/config.lua。 自定义配置模板的例子是: ~/.local/share/lunarvim/lvim/utils/installer/config.example.lua

# 克隆拉取lunarvim 的自定义配置
git clone https://github.com/montychen/nvim  ~/.dj_soft/dj_nvim

# 通过ln软连接到  **`~/.config/lvim/config.lua`** 文件
ln -s ~/.dj_soft/dj_nvim/lunarvim_custom/config.lua  ~/.config/lvim/config.lua 

在终端下运行下面这个命令,会在当前目录下生成lv-settings.lua文件,里面包含LunarVim所有可用的配置项

lvim --headless +'lua require("lvim.utils").generate_settings()' +qa && sort -o lv-settings.lua{,}

运行LunarVim的执行文件 lvim

lvim所在的目录~/.local/bin/lvim加到PATH环境变量。在.bash_profile文件末尾加入一行:

$ echo "export PATH=~/.local/bin:\$PATH" >> ~/.bash_profile
$ source ~/.bash_profile
$ lvim

运行lvim后的配置

安装并运行lvim后,要运行一次 :TSUpdate,不然打开lua文件会提示

$ lunarvim treesitter/highlighter: Error execute  /nvim/runtime/lua/vim/treesitter/query.lua. invalid node type ....

LunarVim常用快捷键

查看快捷键映射 <Leader>Lk

卸载LunarVim

bash ~/.local/share/lunarvim/lvim/utils/installer/uninstall.sh
# or
bash <(curl -s https://raw.githubusercontent.com/lunarvim/lunarvim/master/utils/installer/uninstall.sh)

NvChad的安装目录是 ~/.config/nvim , 支持自定义,自定义的内容都在~/.config/nvim/lua/custome 目录。

安装 NvChad

git clone https://github.com/NvChad/NvChad ~/.config/nvim --depth 1 ; nvim

加载NvChad的自定义配置

# 克隆拉取NvChad的自定义配置
git clone https://github.com/montychen/nvim  ~/.dj_soft/dj_nvim

# 通过ln软连接到 **~/.config/nvim/lua/custome** 目录下
ln -s ~/.dj_soft/dj_nvim/custom  ~/.config/nvim/lua/custom

基本快捷按键

NvChad默认 Leader键映射的是空格键。 查看所有默认快捷键映射 <Leader> + tk

NvChad支持在线更新 <Leader> + uu

packer.nvim是nvim主流的插件管理器是, 添加删除插件配置后,在nvim内运行

  • :PackerClean 彻底清除不用的插件
  • :PackerSync 更新、安装或删除不用的插件

Install LSP Server 代码补全

Nvim内置LSP客户端支持, 安装nvim-lsp-installer插件后,通过:LspInstall 可以方便的安装对应语言的LSP服务器

:LspInstallInfo       查看已经安装了哪些LSP语言服务器
:LspInstall sumneko_lua 

Treesitter 语言解析&语法高亮&增量选择

Nvim内置TreeSitter支持,可以高效的解析编程语言,通过:TSInstall来安装对某个支持的编程语言

:TSInstallInfo       查看已经安装了那些语言
:TSInstall  rust     安装rust语言支持

About


Languages

Language:Lua 100.0%