Finally neovim 0.5.0 has been released.
This release represents ~4000 commits since v0.4.4, the previous non-maintenance release. Highlights include builtin support for Lanugage Server Protocol (LSP), new APIs for extended marks (with byte resolution tracking of changes) and buffer decorations, as well as vast improvements to lua as a plugin and configuration language. Experimental support for tree-sitter as a syntax engine is also included, building on the new core APIs for byte tracking and decorations.
https://github.com/neovim/neovim/commit/a5ac2f45ff84a688a09479f357a9909d5b914294
Till now your config was going to init.nvim. As Vimscript is an interpredted language and slow, neovim supports lua for config files now (init.lua). This makes a lot of stuff faster. However vimscript support will not go away.
A lot of modules have been rewritten in lua in the meantime. Below is a summary of cool new features I started to use.
My config files:
https://git.cryptomilk.org/users/asn/dotfiles.git/
I've moved my neovim config to lua already!
There are a lot of package manager out there. However I think the best one is Packer now:
https://github.com/wbthomason/packer.nvim
If you don't have a mapleader set yet, add one! I use <space>:
or in lua:
We will see later how to use it.
The must-have plugin! Displays which keys are available with the mapleader.
https://github.com/folke/which-key.nvim
I used ftplugin/gitcommit.vim for a long time to show the diff you're committing. This isn't needed anymore as there is:
To make it the default you can do:
https://github.com/lewis6991/gitsigns.nvim
I want to see what lines changed in a neovim buffer. You can display this using
The nice thing is you can jump from one hunk to the next using [c
and ]c
If you need a quick git annotate
for one line, you can do that with: <leader>hb
. If you configured comma as the mapleader you type in the command mode ,hb
This is one of the new feature in neovim 0.5.0! Tree-sitter is a parser generator tool and an incremental parsing library. It can build a concrete syntax tree for a source file and efficiently update the syntax tree as the source file is edited.
https://github.com/nvim-treesitter/nvim-treesitter
neovim gained language server support. This allows you to talk to a language server for code completion and also showing programming errors directly in the buffer.
You can also use the build in LSP support. For this you need lsp configs and an completion engine
https://github.com/nvim-lua/completion-nvim
https://github.com/neovim/nvim-lspconfig
https://github.com/ray-x/lsp_signature.nvim
My lsp configuration is here (clangd, rls, python-language-server):
https://git.cryptomilk.org/users/asn/dotfiles.git/tree/nvim/.config/nvim/lua/lsp.lua
neovim 0.5.0 has support for tree-sitter. This allows to do better syntax highlighting. You need configureation files for that.
Next you need to configure it:
Tree-sitter also has support for rainbow paranthesis if you have a plugin which can handle it:
neovim allows you to store data in a shared database. This means several neovim instances can access this shared data and use it e.g. to copy/paste stuff or store data like cursor positions in a file.
Setting up shada:
See also :help mksession
and :help sessionoptions
If you reopen a file you and want to go to the cursor position as before, use:
https://github.com/ethanholz/nvim-lastplace
https://github.com/nanotee/nvim-lua-guide/
https://github.com/rockerBOO/awesome-neovim