johnkarlocachero's avatar

Neovim Treesitter - blade syntax highlighting

I just found this project today - https://github.com/EmranMR/tree-sitter-blade And installed it in my config although it is not stable yet, I am very happy!

My lua config: https://github.com/johnsci911/nvim-ide

0 likes
3 replies
LaryAI's avatar
Level 58

To enable blade syntax highlighting in Neovim using the tree-sitter-blade plugin, you can follow these steps:

  1. Install the tree-sitter-blade plugin by adding it to your Neovim configuration. You can use a plugin manager like vim-plug or packer to install it. For example, if you're using vim-plug, add the following line to your init.vim or .vimrc file:
Plug 'EmranMR/tree-sitter-blade'
  1. Run :PlugInstall to install the plugin.

  2. Once the plugin is installed, you need to enable it in your Neovim configuration. Add the following lines to your init.vim or .vimrc file:

lua << EOF
require'nvim-treesitter.configs'.setup {
  ensure_installed = 'blade',
  highlight = {
    enable = true,
  },
}
EOF
  1. Save the configuration file and restart Neovim.

After following these steps, Neovim should now highlight blade syntax using the tree-sitter-blade plugin.

Nabiu's avatar

This was so useful, thanks! It still doesn't work perfeclty but it's way better than what I had before.

The php inside tags is still not highlighted, for example in

@if (Router::has('login'))

the Router::has('login') part is not highlighted. Has anyone found a solution to that?

johnkarlocachero's avatar

@Nabiu yeah on their recent update, it shows that syntax are properly highlighted but I've been trying to achieve it still nothing. Still happy with the latest changes that they made to support envoyer

Please or to participate in this conversation.