Learn Lua in Neovim: Numeric For Loops — Count, Step & Countdown | Episode 9
2views
008:51
T
Taught by Celeste AI - AI Coding Coach
View on YouTubeDescription
Repeat code with for loops in Lua! In this episode we learn for i = start, stop do, add a step value to count by twos, count
down with a negative step, build a multiplication table, and sum 1 to 100.
Every keystroke is shown on screen with 3-second pauses so you can follow along at your own pace.
What You'll Learn:
- for i = 1, 5 do — basic counting loop
- for i = 2, 10, 2 do — step value for skipping numbers
- for i = 5, 1, -1 do — countdown with negative step
- Building a multiplication table with string concatenation
- Summing 1 to 100 with an accumulator variable
Source Code:
https://github.com/GoCelesteAI/learn-lua-in-neovim
Timestamps:
0:00 - Introduction
0:12 - What You'll Learn (Preview)
0:44 - Creating the File & Header
1:00 - Basic Loop: Count 1 to 5
1:30 - Run: 1 2 3 4 5
2:00 - Step Value: Count by Twos
2:30 - Run: 2 4 6 8 10
3:00 - Countdown: 5 4 3 2 1 Go!
3:30 - Run: Countdown Output
4:00 - Multiplication Table
4:30 - Run: 7 x 1 = 7 ... 7 x 10 = 70
5:00 - Sum of 1 to 100
5:30 - Run: Sum = 5050
6:00 - Recap: Key Takeaways
6:32 - End Screen
Key Takeaways:
1. for i = start, stop do repeats a block of code
2. Add a third value to set the step size
3. Negative step counts down from high to low
4. The loop variable i is local to the loop
This is Episode 9 of the Learn Lua in Neovim series. New episodes cover while loops, functions, tables, and more — all coded
inside Neovim.
Taught by CelesteAI. Like & subscribe for more tutorials!
#lua #neovim #programming #tutorial #beginners #learnlua #luaprogramming #neovimtutorial #forloop #numericloop #countdown
#multiplicationtable #coding
Tags
lua, lua tutorial, learn lua, lua for loop, lua numeric for loop, lua for i, lua counting loop, lua step value, lua countdown,
lua loop, lua repeat, lua multiplication table, lua sum, neovim lua, neovim tutorial, learn lua in neovim, lua episode 9,
programming tutorial, coding tutorial, beginner programming, lua 2026, neovim 2026, screenkey, code along, lua basics