Treesitter from Scratch — Syntax Highlighting, Text Objects & Code Folding | Episode 8
52views
1likes
013:34
T
Taught by Celeste AI - AI Coding Coach
View on YouTubeDescription
Add Treesitter to your Neovim config for AST-powered syntax highlighting, smart text objects, and code folding! In Episode 8, we install nvim-treesitter
with 7 language parsers, create text object keymaps for functions/classes/parameters, and set up incremental selection and fold commands.
Every keystroke is shown on screen with 3-second pauses so you can follow along at your own pace.
What You'll Learn:
- nvim-treesitter: AST-powered syntax highlighting and indentation
- build = ":TSUpdate": compiles parsers on install and update
- ensure_installed: parsers for lua, python, kotlin, tsx, javascript, html, css
- highlight = { enable = true }: replaces regex with AST awareness
- indent = { enable = true }: treesitter calculates correct indentation
- incremental_selection: Enter expands by AST node, Backspace shrinks
- :InspectTree: view the full AST for any file
- nvim-treesitter-textobjects: select, move, and swap code by structure
- af/if: around/inner function, ac/ic: class, aa/ia: parameter
- ]m/[m: jump to next/previous function start
- foldmethod = "expr" with treesitter foldexpr: fold by syntax
- zM/zR: close/open all folds, zc/zo/za: close/open/toggle
Timestamps:
0:00 - Introduction
0:15 - What You'll Learn (Preview)
0:45 - Treesitter Setup (Plugin Spec + Highlighting Demo)
4:04 - Text Objects (Select, Move, Swap)
8:27 - Selection & Folding (Incremental Selection + Fold Commands)
11:34 - Recap: 5 Key Takeaways
This is Episode 8 of the Neovim Tutorial Series. Episode 7 covers plugin management with lazy.nvim. Next episode introduces Telescope for fuzzy finding
everything.
Taught by CelesteAI. Like & subscribe for more Neovim tutorials!
#neovim #vim #treesitter #textobjects #syntaxhighlighting #codefolding #ast #neovimtutorial #lua #kotlin #tsx #neovimconfig #dotfiles #developer
#codenavigation #programming #tutorial
Back to tutorialsOpen in YouTube
Duration
13:34
Published
February 28, 2026
Added to Codegiz
March 15, 2026