Lualine sections

You can override the lualine default options by passing a new configurations table to the better-vim.lua module. To customize the layout, use the lualine.sections field. Let’s see how to add a branch section to the statusline:

better-vim.lua
return {
  lualine = {
   sections = { c = { "branch" } },
  },
}

The lualine structure has 6 sections: | a, b, c ------- x, y, z |

You can use this example to explore the available options to customize the sections.

Lualine plugin options

To customize the Lualine plugin options, you can use the lualine.options field. Let’s see how to change the statusline theme from auto (default) to dracula:

better-vim.lua
return {
  lualine = {
   options = { theme = "dracula" },
  },
}

πŸ“’ Please, check out lualine’s official documentation to see more plugin options.

Nvimtree options (File explorer)

You can override the nvimtree options using the better-vim.lua module. Let’s see how to change the default filters to show all dotfiles on the file explorer:

better-vim.lua
return {
 nvim_tree = {
   filters = {
     dotfiles = false
   },
 },
}

πŸ“’ Please, check out nvimtree’s official documentation to see more plugin options.

Whichkey options (mappings autocomplete plugin)

You can override any whichkey plugin option by providing custom options on the better-vim.lua module. Let’s see an example:

better-vim.lua
return {
 whichkey = {
   spelling = {
     enabled = false,
   }
 }
}

πŸ“’ Please, check out whichkey’s official documentation to see more plugin options.

The whichkey options just works to override the plugin options, if you want to create your own custom mappings using whichkey and better-vim.lua, check out the mappings documentation.

Telescope options (File finder)

You can override any telescope plugin option by providing custom options on the better-vim.lua module. Let’s see an example:

better-vim.lua
return {
 telescope = {
  view = {
    width = 40
  }
 }
}

πŸ“’ Please, check out telescope’s official documentation to see more plugin options.

Treesitter

The goal of nvim-treesitter is both to provide a simple and easy way to use the interface for tree-sitter in Neovim and to provide some basic functionality such as highlighting based on it.

Better Vim does not have any treesitter plugin installed by default.

You can install them using the entry treesitter in better-vim.lua file.

This entry accepts two types of data:

  • A string "all" that will install all available treesitter plugins;
  • A table of strings containing only the languages you want to highlight with treesitter.

Using the first option, the first time you open Neovim after the configuration, you will see your CPU working as crazy. Don’t worry: treesitter will install the plugins using all available cores on your CPU, but just on the first time.

After this long installation, you will be fine πŸ˜…

Here is how to use this option:

better-vim.lua
return {
  treesitter = "all",
}

If you prefer, only install some hand picked plugins:

better-vim.lua
return {
  treesitter = { "javascript", "typescript", "lua", "rust" },
}

πŸ“’ Please, check out treesitter’s official documentation to see a list of all supported languages.

GitSigns

This plugin adds some signs based on git status of the project. You can configure the plugin from the entry gitsigns in better-vim.lua file:

better-vim.lua
return {
  gitsigns = {
    numhl = true,
  },
}

πŸ“’ Please, check out gitsigns’ official documentation to see more plugin options.

Noice

This plugin improves the UI for Neovim. You can configure the plugin from the entry noice in better-vim.lua file:

better-vim.lua
return {
  noice = {
    presets = {
      command_palette = false,
    },
  },
}

πŸ“’ Please, check out noice’s official documentation to see more plugin options.

Dashboard

When you open Neovim using nvim command, you’ll see a pretty simple dashboard:

You can customize the header of the dashboard by passing a table to dashboard.header entry in better-vim.lua file:

better-vim.lua
return {
  dashboard = {
    header = { "MY CUSTOM HEADER" },
  },
}

And you’ll see something like this:

You can use some ASCII Art to make this looks more like yourself:

better-vim.lua
return {
  dashboard = {
    header = {
      [[                                                                       ]],
      [[                                              ξ‚Ίξ‚Έ                       ]],
      [[       ξ‚Ίβ–ˆβ–ˆβ–ˆβ–ˆξ‚Έ ξ‚Ίβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆξ‚Ό           ξ‚Ύβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆξ‚Έ      ξ‚Ύβ–ˆβ–ˆξ‚Ό                     ]],
      [[      ξ‚Ίβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆξ‚Έξ‚Ύβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆξ‚Ό             ξ‚Ύβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆξ‚Έ ξ‚Έ                            ]],
      [[      ξ‚Ίβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆξ‚Έξ‚Ύβ–ˆβ–ˆξ‚Ό ξ‚Ίβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆξ‚Όξ‚Ίβ–ˆβ–ˆβ–ˆξ‚Έξ‚Ύβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆξ‚Έβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆξ‚Έ   ξ‚Ίβ–ˆβ–ˆβ–ˆξ‚Έβ–ˆβ–ˆβ–ˆβ–ˆξ‚Έβ–ˆβ–ˆβ–ˆβ–ˆξ‚Έ   ]],
      [[     ξ‚Ίβ–ˆξ‚Έξ‚Ύβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆξ‚Ό  ξ‚Ίβ–ˆβ–ˆβ–ˆξ‚Ό    ξ‚Ίβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆξ‚Έξ‚Ύβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆξ‚Ύβ–ˆβ–ˆβ–ˆβ–ˆξ‚Ύβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ   ]],
      [[    ξ‚Ίβ–ˆβ–ˆβ–ˆξ‚Έξ‚Ύβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆξ‚Ό ξ‚Ίβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆξ‚Όξ‚Ίβ–ˆβ–ˆξ‚Ό ξ‚Ύβ–ˆβ–ˆξ‚Έξ‚Ύβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ   ]],
      [[  ξ‚Ίβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆξ‚Όξ‚Ύβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆξ‚Ό ξ‚Ίβ–ˆβ–ˆβ–ˆξ‚Ό    ξ‚Ίβ–ˆβ–ˆβ–ˆξ‚Έ ξ‚Ίβ–ˆβ–ˆβ–ˆξ‚Έξ‚Ύβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆξ‚Έ  ]],
      [[ ξ‚Ίβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆξ‚Ό  ξ‚Ύβ–ˆβ–ˆβ–ˆξ‚Όξ‚Ίβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆξ‚Έξ‚Ύβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆξ‚Ό ξ‚Ύβ–ˆβ–ˆβ–ˆβ–ˆξ‚Ό β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆξ‚Έ ]],
      [[                                                                       ]],
    },
  },
}

And this is the result:

MaximilianLloyd/ascii.nvim plugin is the source of the above ASCII Art.

Be creative!

Unload plugins

Didn’t like some internal Better Vim plugin or want to remove in order to install a different one? You can use the option unload_plugins to remove some unessencial plugin from Better Vim:

better-vim.lua
return {
  unload_plugins = { "noice" },
}

With this code, the noice.nvim plugin will be unload.

List of plugins that can be unloaded

Here is the list of plugins you can unload from Better Vim: