2023-11-21 10:31:34 +01:00
# My Neovim configuration
## Motivation
After doing my first steps with <https://github.com/nvim-lua/kickstart.nvim>,
2023-11-21 13:29:49 +01:00
I decided to roll my own, custom, "lightweight" Neovim configuration in order to
better understand Neovim and its configuration/customization, package managers,
LSP etc. and have "my own" config that only includes things I really need.
2023-11-21 10:31:34 +01:00
2023-11-21 13:29:49 +01:00
## Installation
2023-11-21 10:31:34 +01:00
2023-11-21 13:29:49 +01:00
1. Install Neovim 0.9.x
1. Install OS dependencies documented in `init.lua`
1. Clone this Git repository to `~/.config/nvim`
2023-11-21 10:31:34 +01:00
2023-11-21 13:29:49 +01:00
### Finishing touches
- Install Treesitter comment parser (to highlight `FIXME:/NOTE:/TODO:/XXX:` ) with `:TSInstall comment`
- Create a `$HOME/.ignore` file and add big, useless directories to it, so Telescope/ripgrep/fd can ignore those. Details in `lua/weeheavy/plugins/telescope-fzf-native.lua`
2023-11-21 10:31:34 +01:00
## Speed
2023-11-21 10:39:20 +01:00
Output from lazy.nvim profiling (`:Lazy` , then `P` ):
2023-11-21 10:31:34 +01:00
```bash
2023-11-21 10:39:20 +01:00
Startuptime: 33.68ms
2023-11-21 10:31:34 +01:00
Based on the actual CPU time of the Neovim process till UIEnter.
This is more accurate than `nvim --startuptime` .
2023-11-21 10:39:20 +01:00
LazyStart 10.87ms
LazyDone 31.22ms (+20.35ms)
UIEnter 33.68ms (+2.45ms)
2023-11-21 10:31:34 +01:00
```
## Plugins
| Name | Purpose | URL |
2023-11-21 10:36:07 +01:00
| --- | --- | --- |
2023-11-21 10:31:34 +01:00
| **lazy.nvim ** | Package manager | <https://github.com/folke/lazy.nvim> |
| **telescope.nvim ** | Find, Filter, Preview, Pick | <https://github.com/nvim-telescope/telescope.nvim> |
2023-11-21 13:54:47 +01:00
| **telescope-fzf-native.nvim ** | Fuzzy finder for Telescope | <https://github.com/nvim-telescope/telescope-fzf-native.nvim> |
2023-11-21 10:31:34 +01:00
| **nvim-treesitter ** | Parser/syntax highlighting | <https://github.com/nvim-treesitter/nvim-treesitter> |
| **nvim-treesitter-context ** | Shows current line context | <https://github.com/nvim-treesitter/nvim-treesitter-context> |
| **nvim-treesitter-textobjects ** | ? | <https://github.com/nvim-treesitter/nvim-treesitter-textobjects> |
| **vim-sleuth ** | Heuristically set tab/shift mode | <https://github.com/tpope/vim-sleuth> |
2023-11-21 13:54:47 +01:00
| **nightfox.nvim ** | Theme with treesitter/lsp support | <https://github.com/EdenEast/nightfox.nvim> |
| **lualine.nvim ** | Status line | <https://github.com/nvim-lualine/lualine.nvim> |
2023-11-21 10:31:34 +01:00
| **nvim-web-devicons ** | filetype glyphs (icons) for plugins | <https://github.com/nvim-tree/nvim-web-devicons> |
| **which-key.nvim ** | Shows contextual key bindings | <https://github.com/folke/which-key.nvim> |
## Command cheat sheet
### Vim/Neovim
#### Basics
- `Space` is the leader key and shows key combinations thanks to `which-key.nvim`
#### Plugin fiddling/changes
- `:so` Source file
- `:checkhealth <pluginname>` check for problems with plugin. Use `:checkhealth` to check base and all plugins
#### Navigation
- `Ctrl+t` to open a file in e.g. a Telescope finder in a new buffer
- `gt` or `gT` to navigate open buffers
- `Ctrl+wq` close window
- `Ctrl+ws` split window horizontally
- `Ctrl+wv` split window vertically
- `Ctrl+<h/j/k/l>` switch between split windows
### Lazy
- `:Lazy` to show the package manager UI
### Telescope
2023-11-21 13:29:49 +01:00
#### Telescope file search
2023-11-21 10:31:34 +01:00
- `Ctrl+n` scroll down (**n**ext) file list
- `Ctrl+p` scroll up (**p**revious) file list
- `Ctrl+d` scroll **d**own in preview
- `Ctrl+u` scroll **u**p in preview
### Treesitter
- `:TSUpdate` update all parsers
2023-11-21 13:29:49 +01:00
- `:TSModuleInfo` show installed parsers
## Open issues/TODOs
- Git handling in general
- Directory browsing with Telescope
- Solution to show short Git logs (potentially without fugitive)
- Hinting for trailing spaces (EOL) and blank space on line
2023-11-21 13:54:47 +01:00
- LSP setup/config (mason?), consume <https://blog.pabuisson.com/2022/08/neovim-modern-features-treesitter-and-lsp/>