Code Monkey home page Code Monkey logo

nvim-te's Introduction

nvim-TE

nvim-TE, structural config for neovim. it can works on WSL and Windows through Windows Terminal, or on iOS & iPadOS through Blink Shell.

目录

平台支持

平台 终端工具 系统版本
Windows Windows Terminal Windows 10
WSL Windows Terminal Ubuntu 20.+
iOS&iPadOS Blink Shell iOS15

安装

终端设置

  • Windows & WSL
  1. 安装 Windows Termainal

  2. 安装 nerd font

    https://www.nerdfonts.com/font-downloads中选择一个nerd font下载后解压,双击打开安装

  3. Windows Terminal设置中选择对应的终端,在外观的字体中进行选择设置并保存

  • iOS & iPadOS
  1. 安装Blink Shell

  2. 安装 nerd font

    https://github.com/blinksh/fonts中选择一个nerd font,复制它的"raw"地址,设置到Blink ShellSettings->Appeareance->FONTS->Add a new font中的CSS FONT-FAMILY STYLESHEET中,点击Import,并在FONT-FAMILY NAME设置一个字体名,再进行Save.在Settings->Appeareance->FONTS中选择这个设置的这个字体名

安装neovim

  • Windows
  1. PowerShell中打开远程权限
    Set-ExecutionPolicy RemoteSigned -scope CurrentUser;
    
  2. 下载并安装scoop
    iwr -useb get.scoop.sh | iex
    scoop update
    
  3. 下载并安装neovim
    scoop bucket add versions
    scoop install neovim
    
  • Ubuntu
  1. 需要安装ClangGCC 4.4+CMake 2.8.12+
  2. 安装依赖库
    sudo apt install ninja-build gettext libtool libtool-bin autoconf automake cmake g++ pkg-config unzip curl doxygen
    
  3. 下载并安装neovim
    sudo wget https://github.com/neovim/neovim/archive/refs/tags/v0.6.1.tar.gz
    tar -xzvf v0.6.1.tar.gz
    cd neovim-0.6.1 
    make CMAKE_BUILD_TYPE=Release
    sudo make install
    

安装依赖

插件需求依赖库ripgrep, fd

  • Windows

    scoop install ripgrep
    scoop install fd
    
  • Ubuntu

    sudo apt install ripgrep
    sudo apt install fd-find
    

C/C++语言LSP依赖库clangd,cmake,ccls

  • Windows

    scoop install llvm
    
    scoop install Python
    pip install cmake-language-server
    
    1. 需要使用Developer Command Prompt for VS中执行以下命令
    git clone https://github.com/llvm/llvm-project.git
    cd llvm-project
    cmake -Hllvm -BRelease -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=cl -DCMAKE_CXX_COMPILER=cl -DLLVM_TARGETS_TO_BUILD=X86 -DLLVM_ENABLE_PROJECTS=clang
    ninja -C Release clangFormat clangFrontendTool clangIndex clangTooling clang
       
    git clone --depth=1 --recursive https://github.com/MaskRay/ccls
    cd ccls
    cmake -H. -BRelease -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=cl -DCMAKE_PREFIX_PATH="llvm-project/Release"
    ninja -C Release
    
    1. 增加ccls\Release 到环境变量Path
  • Ubuntu

     sudo apt install clang-12
     sudo apt install clangd-12
    
    pip install cmake-language-server
    
    apt install ccls
    

Lua语言LSP依赖库sumneko_Lua

  • Windows
  1. Install ninja
    scoop install ninja
    
  2. Clone project
    mkdir (system disk):\Users\(you user name)\AppData\Local\nvim-data\lsp\ 
    cd (system disk):\Users\(you user name)\AppData\Local\nvim-data\lsp\
      
    git clone https://github.com/sumneko/lua-language-server
    cd lua-language-server
    git submodule update --init --recursive
    
  3. Build
    cd 3rd\luamake
    compile\install.bat
    cd ..\..
    3rd\luamake\luamake.exe rebuild
    
  • Ubuntu
  1. Install ninja
    sudo apt install ninja-build
    
  2. Clone project
    mkdir -p ~/.local/share/nvim/lsp/
    cd ~/.local/share/nvim/lsp/
    git clone https://github.com/sumneko/lua-language-server
    cd lua-language-server
    git submodule update --init --recursive
    
  3. Build
    cd 3rd/luamake
    ./compile/install.sh
    cd ../..
    ./3rd/luamake/luamake rebuild
    

安装nvim-TE

  • Windows

    git clone https://github.com/iPengBo/nvim-TE.git (system disk):\Users\(you user name)\AppData\Local\nvim
    
  • Ubuntu

    git clone https://github.com/iPengBo/nvim-TE.git ~/.config/nvim
    

插件快捷键

按键 模式 功能 来源插件
<A-h> insert 插入模式左移光标 neovim
<A-l> insert 插入模式右移光标 neovim
<A-k> insert 插入模式上移一行 neovim
<A-j> insert 插入模式下移一行 neovim
<A-d> insert 插入模式删除 neovim
<C-u> insert 插入模式向上移动半页 neovim
<C-d> insert 插入模式向下移动半页 neovim
<C-s> normal,insert 保存文件 neovim
<C-h> normal,insert 插入模式移动光标至行首 neovim
<C-l> normal,insert 插入模式移动光标至行尾 neovim
<leader>h normal c/c++头文件源文件切换 lspconfig
gd normal 转到定义 lspconfig
gs normal 转到声名 lspconfig
gt normal 转到类型定义 lspconfig
gr normal 转到引用 lspconfig
gi normal 转到实现 lspconfig
K normal 显示悬停文档 lspconfig
<space>f normal 自动格式化 lspconfig
gh normal 查找光标词定义和引用 lspsaga
[e normal 转到前一个诊断提示 lspsaga
]e normal 转到下一个诊断提示 lspsaga
<C-t> normal,tnoremap 悬浮终端 lspsaga
<leader>pd normal 预览定义 lspsaga
<leader>rf normal 重命名 lspsaga
]] normal,visual 移动至下一个函数开始行 treesitter-textobjects
][ normal,visual 移动至下一个函数结束行 treesitter-textobjects
[[ normal,visual 移动至上一个函数开始行 treesitter-textobjects
[] normal,visual 移动至上一个函数结束行 treesitter-textobjects
]m normal,visual 移动至下一个类开始行 treesitter-textobjects
]n normal,visual 移动至下一个类结束行 treesitter-textobjects
[m normal,visual 移动至上一个类开始行 treesitter-textobjects
[n normal,visual 移动至上一个类结束行 treesitter-textobjects
af select 选择整个函数 treesitter-textobjects
if select 只选择函数内部实现 treesitter-textobjects
ac select 选择整个类 treesitter-textobjects
ic select 只选择类内部实现 treesitter-textobjects
<C-n> normal 开关文件浏览器 nvim-tree
v nvim-tree action vsplit方式打开 nvim-tree
<C-x> nvim-tree action split方式打开 nvim-tree
<Tab> nvim-tree action 预览 nvim-tree
<BS> nvim-tree action 关闭文件夹 nvim-tree
R nvim-tree action 刷新 nvim-tree
a nvim-tree action 创建 nvim-tree
d nvim-tree action 删除 nvim-tree
r nvim-tree action 重命名 nvim-tree
x nvim-tree action 剪切 nvim-tree
c nvim-tree action 拷贝 nvim-tree
p nvim-tree action 粘贴 nvim-tree
y nvim-tree action 拷贝名称 nvim-tree
q nvim-tree action 关闭 nvim-tree
[b normal 下一个标签页 bufferline
b] normal 上一个标签页 bufferline
gb normal 激活标签页切换选取功能 bufferline
bd normal 激活标签页关闭选取功能 bufferline
bh normal 关材左侧标签页 bufferline
bl normal 关材右侧标签页 bufferline
<A-(1-9)> normal 按序号顺序切换标签页 bufferline
<leader>xx normal 激活诊断列表 trouble
<leader>xd normal 关闭诊断列表 bufferline
<leader>xr normal 刷新诊断列表 bufferline
<leader>fb normal 列出当前neovim实例中打开的缓冲区 telescope
<leader>ff normal 列出当前工作目录中的文件 telescope
<leader>fg normal 在当前工作目录中搜索字符串 telescope
<leader>fh normal 列出可用的帮助标签 telescope
<C-p> nvim-cmp action 选择上一个 nvim-cmp
<C-n> nvim-cmp action 选择下一个 nvim-cmp
<C-b> nvim-cmp action 前上滚动文档 nvim-cmp
<C-f> nvim-cmp action 前后下动文档 nvim-cmp
<C-y> nvim-cmp action 完成 nvim-cmp
<C-e> nvim-cmp action 关闭 nvim-cmp
<CR> nvim-cmp action 确认 nvim-cmp
<C-j> nvim-cmp action 跳下一个 nvim-cmp
<C-k> nvim-cmp action 跳上一个 nvim-cmp
m normal,visual 代码注释 nvim-comment
<A-m> insert 代码注释 nvim-comment
jk insert 退出插入模式 better-escape

注意事项

**区域用户无法访问GitHub或是访问不稳定问题

  1. 使用代理进行访问,如下
git clone https://github.com/iPengBo/nvim-TE.git

修改为

git clone https://mirror.ghproxy.com/https://github.com/iPengBo/nvim-TE.git
  1. git clone到本地的nvim-TE中的init.lua,解开以下注释代码
proxyMirror.proxyURL = "https://mirror.ghproxy.com/"

插件说明

配置插件说明

插件查寻地址

基础配置说明

  • encode encoding 内部使用的编码方式 filenecoding 多行文本的文件编码
  • file backup 覆盖文件时保留备份文件 swapfile 缓冲区是否使用交换文件 autoreadVim之外改动时会自动重读文件 autowrite 使切换文件时,修改的文件被自动保存
  • cursor line cursorline 高亮光标所在屏幕行 relativenumber 每行前显示相对行号 number 行前显示行号 scrolloff 光标上下的最少行数 sidesrolloff 光标左右最少出现列数
  • tab expandtab 键入<Tab>时使用空格 shiftwidth 自动缩进使用的步进空格数 tabstop <Tab>在文件中使用的空格数 smarttab 插入<Tab>时使用shiftwidth
  • search ignorecase 搜索模式时忽略大小写 insearch 输入搜索模式时同时高亮部份的匹配 wrapscan 搜索在文件尾折回文件头
  • ui showmode 在状态行上显示当前模式 showtagline 是否显示标签页行 showcmd 在状态行里显示命令 splitbelow 分割窗口时新窗口在当前窗口之下 splitright 新窗口在肖前窗口之右 pumheight 弹出窗口的最大高度 foldenable 显示所用打开的折叠 foldmethod 折叠类型 foldexpr 折叠表达式
  • other backspace 退格键的处理模式 completeopt 插入补全使用的选项 conceallevel 是否显示可隐藏文本 history 记住的命令行的行数 smartcase 模式中有大写字母时不忽略大小写 smartindent 智能缩进 clipboard 使用剪切板 mouse 允许使用鼠标 redrawtimehlsearchmatch时高亮超时 timeout 映射和键盘代码等待超时 timeoutlen 超时时间 timeout 映射等待超时 ttimeoutlen 键盘代码超时时间 wildignorecase 匹配文件名时忽略大小写 wrap 长行回绕并在下一行继续

自定义扩展

扩展插件

lua/pluginList.lua中增加扩展插件配置

扩展语言

  1. lua/languageServer/目录下可增加对应所需的扩展语言服务。
  2. lua/languageConfig.lua中的setup方法中加入扩展语言服务设置,在list方法中加入需nvim-treesitter安装的扩展语言。

nvim-te's People

Contributors

impengb avatar

Watchers

 avatar

Forkers

infinityhacks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.