92 lines
1.0 KiB
Markdown
92 lines
1.0 KiB
Markdown
# Neovim Notes
|
|
|
|
## Splits
|
|
|
|
Horizontal split:
|
|
|
|
```vim
|
|
:sp
|
|
```
|
|
|
|
Vertical split:
|
|
|
|
```vim
|
|
:vs
|
|
```
|
|
|
|
Open a file in a horizontal split:
|
|
|
|
```vim
|
|
:sp path/to/file
|
|
```
|
|
|
|
Open a file in a vertical split:
|
|
|
|
```vim
|
|
:vs path/to/file
|
|
```
|
|
|
|
## Window Navigation
|
|
|
|
Move between windows with:
|
|
|
|
```vim
|
|
<C-w>h/j/k/l
|
|
```
|
|
|
|
Cycle through windows:
|
|
|
|
```vim
|
|
<C-w>w
|
|
```
|
|
|
|
## Terminal
|
|
|
|
Open a terminal in the current window:
|
|
|
|
```vim
|
|
:term
|
|
```
|
|
|
|
Open a terminal in a horizontal split:
|
|
|
|
```vim
|
|
:sp | term
|
|
```
|
|
|
|
Open a terminal in a vertical split:
|
|
|
|
```vim
|
|
:vs | term
|
|
```
|
|
|
|
Leave terminal mode and return to normal mode:
|
|
|
|
```vim
|
|
<Esc>
|
|
```
|
|
|
|
|
|
## Tree-sitter
|
|
|
|
Tree-sitter is managed with `nvim-treesitter` via `vim.pack`.
|
|
|
|
Installing missing parsers requires the external tools from the upstream README:
|
|
|
|
- `tar`
|
|
- `curl`
|
|
- `tree-sitter-cli`
|
|
- a C compiler
|
|
|
|
If `tree-sitter` is on your `PATH`, startup will try to install the configured parsers if they are missing.
|
|
|
|
Useful commands:
|
|
|
|
```vim
|
|
:TSUpdate
|
|
:TSInstall lua bash json
|
|
:TSInstallInfo
|
|
:InspectTree
|
|
:checkhealth vim.treesitter
|
|
```
|