Syntax highlighting for pest PEG grammar files.
Example (using the rose-pine color scheme):
Requires nvim-treesitter
Using lazy.nvim
{
'pest-parser/pest.nvim',
dependencies = { 'nvim-treesitter/nvim-treesitter' },
opts = {}
}Using packer.nvim
use {
'pest-parser/pest.nvim',
requires = { 'nvim-treesitter/nvim-treesitter' },
config = function()
require('pest-vim').setup()
end,
}Using vim-plug
Add the following to your vimrc or init.vim:
Plug 'nvim-treesitter/nvim-treesitter'
Plug 'pest-parser/pest.nvim'Then in your Lua config:
require('pest-vim').setup()Using dein.vim
call dein#add('nvim-treesitter/nvim-treesitter')
call dein#add('pest-parser/pest.nvim')Then in your Lua config:
require('pest-vim').setup()After the installation is complete run the command:
:TSInstall pestIf pest is not detected restart neovim and rerun the command.
.pest files can display a custom icon (nf-fa-sitemap) in file explorers
and status lines. This is optional and requires a Nerd Font
to be installed and set as your terminal font.
Icon support is available for nvim-web-devicons and mini.icons.
If you're using mason.nvim, run:
:MasonInstall pest-language-serverOr install it manually:
cargo install pest-language-serverNo LSP? Follow this setup tutorial to get one configured.
Create a new file pest_ls.lua on the lsp folder.
Then paste this code:
return {
cmd = { 'pest-language-server' },
filetypes = { 'pest' },
root_markers = {'Cargo.toml', '.git' },
}