Neovim 全 Lua 配置
写这个是为了记录一下我新的VIM配置和VIM的快捷键,看起来lua的版本比之前的scripts要好的多, 无论是使用的方式还是启动的速度, 都比之前快。
我的需求:
- 打开代码, 会显示代码高亮。
- vim可以默认满足的要求, 尽可能少的使用鼠标。
- 代码错误提示 LSP , 挂了Language Server. ( Already Config, but not work. Thinking About this.
- 主题, 目前使用的是 catppuccin-frappe
- Markdown Preview ( Pending….
- 代码补全(Already Done.
我的快捷键清单:
| Mappings | Actions | 
|---|---|
|  <Leader-1> | 高亮第 1 列, 高亮列, 首字母缩进检查 | 
|  <Leader-2> | 高亮第 3 列, 高亮列, 双空格缩进检查 | 
|  <Leader-3> | 高亮第 5 列, 高亮列, 4空格缩进检查 | 
|  <Leader-4> | 高亮第 9 列, 高亮列, 8空格缩进检查 | 
|  <Leader-a> | 搭配Visual block mode 进行bash shell 的注释,行首添加# | 
|  <Leader-x> | 同上,删除注释。 | 
|  <Leader-r> | KubeApply (Fixed, Ready to use.) | 
|  <Leader-e> | KubeDelete (Fixed, Ready to use.) | 
| <Leader-dr> | KubeApplyDIr (Fixed, Ready to use.) | 
| <Leader-de> | KubeDeleteDir (Fixed, Ready to use.) | 
| <Leader-ff> | Telescope Find FIles 查找文件 | 
| <Leader-fg> | Telescope Find Live grep 过滤文件中的关键字 | 
| <Leader-fb> | Telescope Find Buffer 查看Buffer中的数据。VIMbuffer | 
| <Leader-fh> | Telescope Find Help( Maybe not use, Just record | 
| <Leader-ps> | This is Alias for :PackerSync. | 
| <Leader-ms> | This is Alias for :Mason. | 
| <C-n> | Telescope PageDown 在Insert模式下面的上下移动。 | 
| <C-p> | Telescope PageUp 在Insert模式下面的上下移动。 | 
| <j / k> | Telescope NORMAL Up/Down Normal模式下的上下移动。 | 
| <C-x> | Telescope Go to file selection as a split 找到的文件直接水平开新窗口(下方 | 
| <C-v> | Telescope Go to file selection as a vsplit 找到的文件直接垂直开新窗口(右侧 | 
| <C-t> | Telescope Go to a file in a new tab 找到的文件开新的VIM tab, 感觉不是非常的好用,垂直会经常被用到。 | 
| <C-/> | Telescope Show mappings for picker actions (insert mode) 帮助 | 
| ? | Telescope Show mappings for picker actions (normal mode) 帮助 | 
| <M-f> | Scroll left in results window | 
| <M-b> | Scroll right in results window | 
其他的还在配置和学习中, 先这样把。。 之前用的功能不太多, 有时间继续看。。。。
About NerdFonts.
Nerd 类型的字体实际代表了 带有Icon字符集的字体。
https://www.nerdfonts.com/#home
其他技巧
- 不换行显示文本或者代码 - set nowrap
- 直接grep文本的内容并替换当前buffer中的内容. 
 是的,当前打开的文件在VIM里面其实是叫buffer, 因为并未完成实际的写入。- :%! grep KEYWORD
- 粘贴的时候保留格式。 - set paste set nopaste- 或者是关闭autoindent - set ai set noai
- 压缩多个空格为一个 - :%s@ *@ @g
- 替换所有的空格 为 tab - :% s@ @\t@g
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 Liarlee's Notebook!



