Neovim Configuration from Scratch: init.lua, Keymaps & Autocmds | Episode 6
20views
2likes
010:53
T
Taught by Celeste AI - AI Coding Coach
View on YouTubeDescription
Build a modular Neovim configuration from scratch using pure Lua — no plugins needed! In Episode 6, we create init.lua as the entry point,
organize settings into separate modules with require(), and configure options, keymaps, and autocommands. Every setting is tested live so you
can see exactly what changes.
Every keystroke is shown on screen with 3-second pauses so you can follow along at your own pace.
What You'll Learn:
- Config structure: init.lua entry point with require() loading modules from lua/
- vim.g.mapleader: Set leader key (Space) before any leader mappings
- vim.opt.number / relativenumber: Line numbers that show jump distance
- vim.opt.tabstop / shiftwidth / expandtab: Control indentation (4 spaces)
- vim.opt.ignorecase / smartcase: Case-insensitive unless you type uppercase
- vim.opt.wrap / scrolloff: No wrapping, keep 8 lines of context
- vim.opt.clipboard / undofile: System clipboard sharing, persistent undo
- vim.keymap.set: Create keybindings with mode, key, action, and opts
- Leader keymaps: Space+w save, Space+q quit, Escape clear search highlight
- Scroll centering: Ctrl+d/u with zz keeps cursor centered on screen
- Visual mode line moving: J/K to move selected lines up/down as a block
- Split management: Leader+sv vertical, Leader+sh horizontal
- nvim_create_autocmd("TextYankPost"): Flash highlight on yanked text
- nvim_create_autocmd("BufWritePre"): Auto-trim trailing whitespace on save
- nvim_create_autocmd("FileType"): Per-language settings (2-space indent for Lua)
Timestamps:
0:00 - Introduction
0:15 - What You'll Learn (Preview)
0:45 - Config Setup (init.lua + options.lua)
3:45 - Keymaps (vim.keymap.set)
6:16 - Autocommands (nvim_create_autocmd)
8:54 - Recap: 5 Key Takeaways
9:54 - End Screen
Key Takeaways:
1. init.lua is the entry point — require() loads modules from lua/
2. vim.opt controls settings: numbers, tabs, search, clipboard
3. Set mapleader before defining any leader mappings
4. vim.keymap.set(mode, key, action, opts) creates bindings
5. nvim_create_autocmd(event, {callback}) automates actions on events
This is Episode 6 of the Neovim Tutorial Series. Episode 5 covers substitution and global commands. Next episode introduces plugin management
with lazy.nvim.
Taught by CelesteAI. Like & subscribe for more Neovim tutorials!
#neovim #vim #terminal #tutorial #programming #configuration #initlua #lua #keymaps #autocmds #vimopt #neovimconfig #dotfiles #linux #macos
#developer
Back to tutorialsOpen in YouTube
Duration
10:53
Published
February 28, 2026
Added to Codegiz
March 15, 2026