Building a Real Daily Workflow

Vim Intermediate/Advanced

Chapter 8 — Building a Real Daily Workflow

Bringing It All Together

Seven chapters, seven genuinely separate skills: macros, registers, text objects, search/substitution, plugins, Lua configuration, LSP. Each one is useful in isolation — but a real daily workflow is where they stop being separate topics and start reinforcing each other mid-task, without you consciously switching between "macro mode" and "text object mode." This closing chapter is two realistic scenarios that draw on several chapters at once, a consolidated init.lua, and a cheat sheet distilled from the whole course.

Scenario 1 — Refactoring a Data File Into Code

Starting point: a plain-text list of user records, one per line. Goal: a properly formatted array of objects in a source file.

# before:
Ada Lovelace, ada@example.com
Grace Hopper, grace@example.com
Alan Turing, alan@example.com

# after:
{ name: "Ada Lovelace", email: "ada@example.com" },
{ name: "Grace Hopper", email: "grace@example.com" },
{ name: "Alan Turing", email: "alan@example.com" },

Workflow — combining search/substitute, text objects, and macros

Ch.4 :%s/\v(.*), (.*)/{ name: "\1", email: "\2" },/ One global substitution with capture groups handles the bulk of the reformatting across every line at once.
Ch.3 ci" One record has a typo'd email. Land anywhere inside its quotes and change inner quotes directly — no manual selection needed.
Ch.1 / Ch.2 qa ... q, then "ap A later batch of records arrives in a different raw format. Record a macro handling that shape, then paste-and-inspect it (Ch.2's register-editing trick) before trusting it at scale.

Scenario 2 — Navigating and Fixing a Bug Across Files

Workflow — combining plugins, LSP, text objects, and a macro

Ch.5 :Files fzf finds the file mentioned in a bug report by a few letters of its name — no need to know its exact path.
Ch.7 gd Cursor on the suspect function call, jump straight to where it's actually defined via the LSP client.
Ch.3 ci( The bug is a wrong default argument. Change inner parens to fix it, regardless of exactly where inside them the cursor landed.
Ch.7 gr List every reference to this function — several other call sites turn out to have the identical bug.
Ch.1 qa ci( newvalue <Esc> q, then @a Record the fix once as a macro, then replay it at each remaining reference found in the previous step.

Neither scenario needed a "special mode" to move between chapters — the tools composed because they were all designed around the same underlying model from the start (an editable buffer, targetable by motions and text objects, actionable by operators and macros alike).

Assembling a Complete, Minimal init.lua

A consolidated config drawing on Chapters 5–7, small enough to actually read top to bottom:

-- init.lua
vim.g.mapleader = " "
vim.opt.number = true
vim.opt.ignorecase = true

-- Ch.5/6 — plugins, lazy-loaded
require('lazy').setup({
  { 'tpope/vim-surround' },
  { 'tpope/vim-commentary' },
  { 'junegunn/fzf.vim' },
  { 'neovim/nvim-lspconfig' },
  { 'hrsh7th/nvim-cmp' },
})

-- Ch.7 — LSP, with navigation keymaps
local on_attach = function(client, bufnr)
  vim.keymap.set('n', 'gd', vim.lsp.buf.definition, { buffer = bufnr })
  vim.keymap.set('n', 'K',  vim.lsp.buf.hover,      { buffer = bufnr })
  vim.keymap.set('n', 'gr', vim.lsp.buf.references, { buffer = bufnr })
end
require('lspconfig').pyright.setup({ on_attach = on_attach })

-- Ch.6 — a couple of everyday keymaps
vim.keymap.set('n', '<leader>ff', ':Files<CR>')
vim.keymap.set('n', '<leader>w',  ':w<CR>')

Where to Go From Here

:help is the single most complete reference for anything this course didn't cover — Vim and Neovim's built-in documentation is genuinely thorough, and :help {topic} (e.g. :help text-objects) jumps straight to the relevant section.

Don't adopt everything from this course at once. Text objects (Chapter 3) and one or two plugins (Chapter 5) are worth internalizing first — they pay off immediately and rewire how you think about editing. LSP and Lua configuration (Chapters 6–7) are worth adding once that foundation is solid, not on day one. Copying someone else's large, fully-loaded "distro" config wholesale skips the part where you actually understand what each piece does — growing your own init.lua a few lines at a time, as a real need comes up, builds configuration you can actually debug later.

Course Cheat Sheet — One Command to Remember Per Chapter

If You Only Remember One Thing Per Chapter

Ch.1 — Macros
qa ... q, then @aRecord once, replay as many times as needed
Ch.2 — Registers
"ayiw / "apYank into a named register, paste from it — nothing gets silently overwritten
Ch.3 — Text Objects
ci( / di" / dapAct on "what," not "where" — works from anywhere inside the object
Ch.4 — Search & Substitution
:%s/\vpattern/replacement/g\v for sane regex, g for every match, not just the first per line
Ch.5 — Plugins
ysiw" / cs"' / :Filesvim-surround extends text objects; fzf makes navigation instant
Ch.6 — Neovim & Lua
vim.keymap.set('n', lhs, rhs)The Lua equivalent of nnoremap — config as a real language
Ch.7 — LSP
gd / K / grDefinition, hover, references — install the server binary first
Reference
:help {topic}The built-in documentation — the real answer to "how do I..."

Course Complete

That's all 8 chapters of Vim Intermediate/Advanced — macros, registers, text objects, search & substitution, the plugin ecosystem, Neovim & Lua configuration, LSP integration, and this closing workflow chapter. Combined with the 8 foundational chapters of Learning Vim, that's a complete path from first keystrokes to a genuinely modern, LSP-powered editing setup.