Get the latest tech news

Highlighting Parts of Lua as Bash


Using Treesitter in neovim to conditionally highlight code snippets

Since i am currently working on a little tool for synching my old macbook pro, my workstation at home and my work thinkpad - I want to highlight a part of the lua configuration for said tool as bash, not as a lua string. :PackerSync will synchronise your neovim instance to your configuration and install treesitter. The injection works by quering the treesitter tree (inspectable via:InspectTree) for a field where its value is a string and its name is equal to"script".

Get the Android app

Or read this on Hacker News

Read more on:

Photo of parts

parts

Photo of Bash

Bash

Photo of lua

lua

Related news:

News photo

Programming in Lua (first edition) (2003)

News photo

Today I learned that bash has hashmaps (2024)

News photo

I made a tiny library for switches and sum types in Lua