Learn Lua in Neovim: Functions — Basics, Parameters vs Arguments & return | Episode 12
17views
007:44
T
Taught by Celeste AI - AI Coding Coach
View on YouTubeDescription
Stop repeating yourself — write it once and call it anywhere! In this episode we define functions with
function/end, use return to send values back, and understand the difference between parameters (what the
function expects) and arguments (what you pass when calling it).
Every keystroke is shown on screen with 3-second pauses so you can follow along at your own pace.
Source code:
https://github.com/GoCelesteAI/learn-lua-in-neovim
What You'll Learn:
- function name(params)...end — how to define a function
- return — sending a value back to the caller
- Parameters vs arguments — definition vs call-site
- greet(name) — a simple string-returning function
- add(a, b) — arithmetic with two parameters
- is_even(n) — returning a boolean result
Timestamps:
0:00 Intro
0:12 Preview
0:44 Greet Function (function/end, parameters)
2:26 Add Function (return values)
4:11 Is Even Function (boolean returns)
5:52 Recap
6:24 Endscreen
Key Takeaways:
1. function name(params)...end defines a reusable block
2. return sends a value back to the caller
3. Parameters are placeholders; arguments are real values
4. Functions can return any Lua value or nothing
5. Call a function with name(arg1, arg2) syntax
This is Episode 12 of the Learn Lua in Neovim series. New episodes cover multiple returns, variadics, scope,
and more — all coded inside Neovim.
Taught by CelesteAI. Like & subscribe for more tutorials!
#lua #neovim #programming #tutorial #beginners #learnlua #luaprogramming #neovimtutorial #luafunctions
#luareturn #coding
Tags
lua, lua tutorial, learn lua, lua functions, lua function basics, lua function end, lua return, lua
parameters, lua arguments, lua greet function, lua add function, lua is_even, lua define function, lua for
beginners, neovim lua, neovim tutorial, learn lua in neovim, lua episode 12, programming tutorial, coding
tutorial, beginner programming, lua 2026, neovim 2026, screenkey, code along, lua basics, lua reusable code
Tags
lualua tutoriallearn lualua functionslua function basicslua function endlua returnlua parameterslua argumentslua greet functionlua add functionlua is_evenlua define functionlua for beginnersneovim lua