Lemmy.one
  • Communities
  • Create Post
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
hallettj@leminal.space to Nix / NixOS@programming.devEnglish · 3 months ago

Embedded SQL highlighting in Neovim, a look into Treesitter, and some NixOS patching

sitr.us

external-link
message-square
0
fedilink
  • cross-posted to:
  • neovim@programming.dev
10
external-link

Embedded SQL highlighting in Neovim, a look into Treesitter, and some NixOS patching

sitr.us

hallettj@leminal.space to Nix / NixOS@programming.devEnglish · 3 months ago
message-square
0
fedilink
  • cross-posted to:
  • neovim@programming.dev
This is the story of the rabbit hole I went down because I wanted pretty syntax highlighting for embedded SQL queries in my Rust code. I’m a fan of sqlx, which provides macros for writing inline SQL with real-time type checking. Because the queries are in Rust strings the whole query is highlighted uniform green by default. That’s not acceptable! By the end of my journey I had highlighting looking like this: In most cases this kind of embedded syntax highlighting is easy in Neovim, and it’s often set up by default if you use the nvim-treesitter plugin. But I ran into some issues in this particular case. That led me to learn some things about Treesitter, and about how nixpkgs packages Neovim plugins, and Treesitter packages. If you care to follow along, you’ll hear a tale of Neovim, Treesitter, injection queries, patching, NixOS, and more patching!…
alert-triangle
You must log in or # to comment.

Nix / NixOS@programming.dev

nix@programming.dev

Subscribe from Remote Instance

Create a post
You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: !nix@programming.dev

Main links

  • website
  • wiki
  • matrix

Videos

  • Linux Experiment about NixOS
  • Chris Titus Tech
  • Mental Outlaw
Visibility: Public
globe

This community can be federated to other instances and be posted/commented in by their users.

  • 1 user / day
  • 9 users / week
  • 52 users / month
  • 384 users / 6 months
  • 12 local subscribers
  • 2.81K subscribers
  • 382 Posts
  • 1.48K Comments
  • Modlog
  • mods:
  • Erlingur@programming.dev
  • ballmerpeaking@programming.dev
  • WhiteBlackGoose@programming.dev
  • BE: 0.19.7
  • Modlog
  • Legal
  • Instances
  • Docs
  • Code
  • join-lemmy.org