Skip to content
 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pest.nvim

Syntax highlighting for pest PEG grammar files.

Example (using the rose-pine color scheme):

Screenshot

Neovim LSP support

Installation

Requires nvim-treesitter

Using lazy.nvim

{
  'pest-parser/pest.nvim',
  dependencies = { 'nvim-treesitter/nvim-treesitter' },
  opts = {}
}
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 pest

If pest is not detected restart neovim and rerun the command.

Icon support

.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.

Install language server

If you're using mason.nvim, run:

:MasonInstall pest-language-server

Or install it manually:

cargo install pest-language-server

Set up language server

No 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' },
}

About

Neovim syntax highlighting for pest PEG grammar files.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages