# NeoVim
@Gordon
---
只有 Terminal,能干啥?

---
- Editor history
- Vim and NeoVim
- Basic usage
- Tmux
---
## Editor history
---
- vi 1976 ~ 2005
- Emacs
- 1975 MIT AI Lab
- 1981 Gosling Emacs
- 1984 GNU Emacs
- Vim 1991 vi升级版
- Nano 1999
- NeoVim 2015 Vim重构版
---
### Editor war
> 合适自己的就是最好的

---
## Vim and NeoVim
---
### A story about “You can you up!”

---
1. 2014年,巴西程序员 Thiago de Arruda Padilha(aka tarruda)向 Vim 提交 PR,对 Vim 的架构进行大幅调整
2. Vim 作者 Bram Moolenaar 拒绝了
3. tarruda 觉得 Vim 历史遗留问题太多太老旧,fork 了 Vim 项目自己来,NeoVim 诞生了
---
### Long long years ago ... I use Vim
- only Vimscript
- synchronous load plugins
- [YouCompleteMe](https://github.com/ycm-core/YouCompleteMe)
- [coc](https://github.com/neoclide/coc.nvim)
---
### Now I use NeoVim
- support all programming languages
- asynchronous load plugins
- asynchronous I/O
- support lua using LuaJIT (😘 Wow very powerfull)
- built-in Language Server Protocol (LSP)
---
## Basic usage
---
- i 进入 INSERT 模式
- v 进入 VISUAL 模式
- Esc 回到 NORMAL 模式
- yy 复制一行
- p 粘贴
- u 撤销
- :redo 重做
- :w 保存
- :q 退出
- :wq 保存退出
- :%s/x/y/g 批量替换
---
- hjkl 向左下上右移动光标
- w 按word向后移动光标
- b 按word向前移动光标
- f+a 移动光标到第一个a字母的地方
- 0+gg 跳到第一行
- G 跳到最后一行
- Shift+\[ 向上按空行移动光标
- Shift+\] 向下按空行移动光标
- $ 移动光标到行尾
- 0或^ 移动光标到行首
- dd 删除一行
---
- c+i+w 删除一个word并进入 INSERT 模式
- c+i+\( 删除()中的内容并进入 INSERT 模式
- v+i+w 选择一个word
- v+i+\( 选择()块中的内容
---
## 景上添花 ... Tmux
> session --> window --> pane
- prefix Ctrl+s
- tns <name> 创建一个session
- prefix+s 查看sessions
- prefix+c 创建一个window
- prefix+, 重命名windows
- prefix+\= 垂直创建一个pane
- prefix+\- 水平创建一个pane
- prefix+上下左右 移动到上下左右pane
- t 列出所有sessions和windows
---
## 大哥你玩 Vim,你玩它有啥用?

---
> Fast, Small and Freedom, maybe easy?
- Pretty cool 😎
- Relax right hand 🫱
- Poor 😭
---
## 加餐 🍜
- [NeoVim](https://neovim.io/)
- [Tmux](https://github.com/tmux/tmux)
- [Editor war](https://en.wikipedia.org/wiki/Editor_war)
- [neovimcraft](https://neovimcraft.com/)
- How to set up Neovim for coding React, TypeScript, Tailwind CSS, etc on a new M2 MacBook Air {%youtube ajmK0ZNcM4Q %}
- Make TMUX Look Amazing in 3 Minutes! - complete tutorial {%youtube ceRYL271cao%}
---
## Thanks 👏
- GitHub [@Kevalin](https://github.com/Kevalin)
- Blog [举个栗子](https://blog.rrust.xyz/)
{"title":"My Productivity Tools","description":"@Gordon","contributors":"[{\"id\":\"ba03e57e-299f-423e-b0fa-18b9c8059f8b\",\"add\":17597,\"del\":14487}]"}