Themes

Better Vim comes with 9 hand-picked themes:

Changing the theme

The default theme is Catppuccin. If you want to change the theme, just change the theme.name on the Better Vim config:

better-vim.lua
return {
  theme = {
    name = "dracula"
  }
}

Available themes:

  • catppuccin
  • dracula
  • ayu (and its variants, check here)
  • palenight
  • tokyonight
  • nord
  • onedarkpro
  • rose-pine
  • nightfox (and its variants, check here)

Changing the flavour

Some themes like Catppuccin or Ayu have theme flavours. These flavours can be changed using the flavour key for the respective theme. For example, if you’re using Catppuccin and want to change the flavour from the default flavour frappe to latte you can do this by changing your config to something like:

better-vim.lua
return {
  theme = {
    name = "catppuccin",
    // Add this line
    catppuccin_flavour = "latte"
  }
}

Or, if you’re using Ayu, you can change the theme flavour doing something like:

better-vim.lua
return {
  theme = {
    name = "ayu",
    ayucolor = "light"
  }
}

It’s important to notice that each theme has its own flavour key. For example: The flavour key for Catppuccin is catppuccin_flavour, but for Ayu is ayucolor. You can see all flavours and flavour keys below.

Available flavours

Each theme has its own flavour key. Here is the complete list of flavours grouped by theme:

  • For catppuccin

    • Flavour key: catppuccin_flavour
    • Flavours: frappe, latte, mocha and macchiato
  • For ayu

    • Flavour key: ayu_color
    • Flavours: dark and light
  • For rose-pine

    • You can use the field rose_pine to pass options:
better-vim.lua
return {
      theme = {
        name = "rose-pine",
        rose_pine = { variant_dark = "moon" },
      },
    }
  • For nightfox
    • You can use the field nightfox to pass options:
better-vim.lua
return {
      theme = {
        name = "nightfox",
        nightfox = {
          options = {
            colorblind = { enable = true },
          },
        },
      },
    }
  • For all other themes, just change theme.name.

Installing custom themes

You can install custom themes using lazy.nvim which is the default plugin manager for Better Vim. Let’s see how to install the Gruvbox theme:

1. Adding it the to the plugins list

Better vim allows you to install custom plugins using the plugins entry in better-vim.lua file. A neovim/vim theme is also considered a vim plugin. You can install the Gruvbox by adding this following code to the plugins entry in better-vim.lua file:



Reopen your Neovim and you’ll see that lazy.nvim is installing the theme automatically.

2. Setting up the theme

Now, open your Better Vim config and change the theme.name to gruvbox:

better-vim.lua
return {
  plugins = {
   "morhetz/gruvbox",
  },
  theme = {
    name = "gruvbox",
  }
}


Now, reopen your neovim and tada 🎉 you should see the new theme applied to your setup.