# Introduction to Neovim
<img src="https://hackmd.io/_uploads/SynO2rjuA.png" width="200" />
---

---
# Vim
---
`Command` / `Alt` / `Shift` / ⬅️⬇️⬆️➡️
<img src="https://hackmd.io/_uploads/SyyvCH-t0.png" width="400" />
---
Use `a`~`z`, `0`~`9` for shortcuts

---
## Vim Modes
---
- Normal Mode
- Insert Mode
- Visual Mode
- ...
---
`h` `j` `k` `l`
⬅️⬇️⬆️➡️
---
`i`: enter insert mode
`<ESC>`: leave insert mode
---
1. `hjkl`
2. `i`
3. Typing...
4. `<ESC>`
---
## motion
move your cursor in Normal mode
---
`h` `j` `k` `l`
---
## number + motion
---
`7j`
`5k`
---
`w`: go forward a `w`ord
`b`: go `b`ackward a word
`e`: go to the `e`nd of a word
---
`f{char}`: `f`ind the occurance of `{char}`
`;`: go to next occurance
`,`: go to previous occurance
---
## operator
---
`d`: `d`elete
`c`: `c`hange
`y`: `y`ank (copy)
---
`dd`: `d`elete current line
`cc`: `c`hange current line
`yy`: `y`ank (copy) current line
---
## operator + motion
---
## operator + motion
`d`+`e`: `d`elete to the `e`nd of a word
`d`+`f{char}`: `d`elete until `f`ind the occurance of `{char}`
---
## text object
---
## operator + text object
`i'`: `i`nner `''`
`a'`: `a`round `''`
---
`ip`: `i`nner `p`aragraph
`ap`: `a`round `p`aragraph
---
## Recap
- move with motion
- `h j k l`
- `w` `b` `e`
- `f{char}` `;` `,`
- edit with operator
- `d`elete
- `c`hange
- `y`ank (copy)
- operator + motion `de`
- operator + text object `dap`
---
## Workflow Demo
---
# Neovim
---
- Lua support
- easy to learn and write
- encourage contributions
---
- better community
- Vim

- Neovim

---
- builtin LSP
- go to definition
- auto complete
- documentation on hover
---
## Plugins
---
`comment.nvim`
Introduce a new operator: `gc`
---
`nvim-treesitter-textobjects`
Introduce new text objects:
- `if`: `i`nner `f`unction
- `af`: `a`round `f`unction
---
operator + text object
---
`oil.nvim`
edit your filesystem like a buffer
---
`hardtime.nvim`
1. Block `hjkl`
2. Hint for better command
3. Disable ⬅️⬇️⬆️➡️/mouse
{"metaMigratedAt":"2023-06-17T19:09:26.037Z","metaMigratedFrom":"Content","breaks":true,"description":"View the slide with \"Slide Mode\".","title":"Neovim Introduction","contributors":"[{\"id\":\"325f6e75-8cc0-4f13-ab5e-122b0ec7f347\",\"add\":5807,\"del\":3424}]","slideOptions":"{\"theme\":\"white\"}"}