Ptrzl
dfc4ddef13
|
3 years ago | |
---|---|---|
lua | 3 years ago | |
plugin | 3 years ago | |
.gitignore | 3 years ago | |
LICENSE | 3 years ago | |
README.md | 3 years ago | |
init.vim | 3 years ago |
README.md
My personal modern NeoVim config
Setup
- Use the latest version of NVIM
- This setup uses packer.nvim for the package manager, so first install packer.nvim by following the official instructions
- Clone this repo into
~/.config/nvim
:
git clone https://github.com/p-z-l/nvim-config.git ~/.config/nvim
- When you first enter
nvim
, you will see a bunch of mess because the plugins aren't installed yet, so run:PackerInstall
to install the plugins
Note that there is a chance that the download would timeout and
packer.nvim
would report install failed, in this case run:PackerInstall
again
- This setup uses the modern LSP system for langauge support, things like auto-complete, symbols tree, etc..., which requires a LSP server outside the editor. Fortunately nvim-lspconfig manages to configure most of the LSP server options for us, all we need to do is to install the LSP servers themselves:
Inlua/configs/autocomplete.lua
, line51
, edit the list of LSP servers, a complete list of supported LSP servers is listed here. After that install the corresponding servers on your OS, auto-complete should pop up for supported languages now :) - Final step, smart highlighting using treesitter!
The default vim regex-based highlighting is pretty lame, for NVIM, treesitter offered an advanced code highlighting that can make your code much cleaner
You can use the:TSInstall <lang>
command to install a parser for a language
Alternatively, inlua/configs/treesitter.lua
, line6
, you can have a list of parsers that will be updated everytime you use the:TSUpdate
or:TSUpdateSync
command (the latter is for synchronized updating), or you can just install all maintained parsers by uncommenting line5
and commenting line6
Usage
TODO: for now read
lua/core/keymaps.lua
for reference
Note that the config uses ;
as the leader key by default, you can of course change it in lua/core/keymaps.lua
, line 1
Most keymaps in this setup are what I call declarative keymaps, for example, everything related to terminal emulator starts with ;t
, so ;tt
means "terminal toggle", and ;tn
means "terminal new"
Btw, tryout ;lb
in files with LSP support, it's really fancy!
Contributing
Having troubles
If you have issues while installing or using my this setup, report an issue,
don't just DM me on social media because others may run into the same problem and they can use the existing issues as a reference
Discussions could be in either English or Chinese, although English is preferred
Adding more things
For now, you don't, this is my personal config, although do leave suggestions if you have any
TODOs
- Better git integration
- Clean up Lua config code
- Optimize startup time