Skip to content

Writing an inital configuration

Let’s start by creating some very simple settings that you might want for your Lua configuration. Open up your init.lua file and add the following code:

local opt = vim.opt
opt.cursorline = true
opt.number = true
opt.relativenumber = true
opt.termguicolors = true

What Does It Do?

This code:

  • Creates a variable called opt, which maps to the global options available in vim
  • Sets a cursorline
  • Sets (relative) line numbers which are useful
  • Uses true colors for the terminal