My personal AstroVim configuration
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Micah Halter 1b91881a1d
Personal AstroVim config
3 months ago
colors Create onedark.vim 4 months ago
lua Personal AstroVim config 3 months ago
utils Use a permalink to point into the code from the documentation 3 months ago
.gitignore Personal AstroVim config 3 months ago
.luacheckrc Fix typo in luacheckrc 3 months ago
.pre-commit-config.yaml [] pre-commit autoupdate 3 months ago
.stylua.toml Create .stylua.toml 4 months ago
LICENSE Initial commit 4 months ago Add arbitrary user configuration of default plugins 3 months ago
init.lua Make `main` pre-commit clean again 3 months ago


AstroVim is an aesthetic and feature-rich neovim config that is extensible and easy to use with a great set of plugins

🌟 Preview

Preview1 Preview2 Preview33


🛠 Installation


Make a backup of your current nvim folder

mv ~/.config/nvim ~/.config/nvimbackup

Clone the repository

git clone ~/.config/nvim
nvim +PackerSync

📦 Setup

Install LSP

Enter :LspInstall followed by the name of the server you want to install
Example: :LspInstall pyright

Install language parser

Enter :TSInstall followed by the name of the language you want to install
Example: :TSInstall python

Manage plugins

Run :PackerClean to remove any disabled or unused plugins
Run :PackerSync to update and clean plugins

Update AstroVim

Run :AstroUpdate to get the latest updates from the repository



User directory is given for custom configuration

-- Set colorscheme
colorscheme = "onedark",

-- Add plugins
plugins = {
  { "andweeb/presence.nvim" },
    event = "BufRead",
    config = function()

-- Overrides
overrides = {
  treesitter = {
    ensure_installed = { "lua" },

-- On/off virtual diagnostics text
virtual_text = true,

-- Set options
set.relativenumber = true

-- Set key bindings
map("n", "<C-s>", ":w!<CR>", opts)

-- Set autocommands
vim.cmd [[
  augroup packer_conf
    autocmd bufwritepost plugins.lua source <afile> | PackerSync
  augroup end

-- Add formatters and linters
null_ls.setup {
  debug = false,
  sources = {
    -- Set a formatter
    -- Set a linter
  -- NOTE: You can remove this on attach function to disable format on save
  on_attach = function(client)
    if client.resolved_capabilities.document_formatting then
      vim.cmd "autocmd BufWritePre <buffer> lua vim.lsp.buf.formatting_sync()"

Extending AstroVim

AstroVim should allow you to extend its functionality without going outside of the user directory!

Please get in contact when you run into some setup issue where that is not the case.

Add more Plugins

Just copy the packer configuration without the use and with a , after the last closing } into the plugins key of your user/settings.lua file.

See the example above.

Change Default Plugin Configurations

AstroVim allows you to easily override the setup of any pre-configured plugins. Simply add a table to the overrides table with a key the same name as the plugin package and return a table with the new options or overrides that you want. For an example see the included overrides entry for treesitter which lets you extend the default treesitter configuration.

Change Default Packer Configuration

AstroVim provides a polish_plugins function in the user settings that can be used to override the packer configuration for all plugins, user plugins as well as plugins configured by AstroVim.

E.g. this code in your settings.lua will globally disable the lazy loading that is used by AstroVim by default:

  polish_plugins = function(plugins)
    local result = {}
    for _, plugin in pairs(plugins) do
      plugin["cmd"] = nil
      plugin["event"] = nil
      table.insert(result, plugin)
    return result

Adding sources to nvim-cmp

To add new completion sources to nvim-cmp you can add the plugin (see above) providing that source like this:

      after = "nvim-cmp",
      config = function()

        local cmp = require "cmp"
        local config = cmp.get_config()
        table.insert(config.sources, { name = "crates" })

Use the options provided by nvim-cmp to change the order, etc. as you see fit.

Add Custom LSP Server Settings

You might want to override the default LSP settings for some servers to enable advanced features. This can be achieved by making a server-settings folder inside of your user config and creating lua files named for the LSP server. Examples of this can be found in /lua/configs/lsp/server-settings.

For example, if you want to add schemas to the yamlls LSP server, you can create the file yamlls.lua inside of a server-settings/ folder in /lua/user/ with the contents (/lua/user/server-settings/yamlls.lua):

local opts = {
  settings = {
    yaml = {
      schemas = {
        [""] = ".github/workflows/*.{yml,yaml}",
        [""] = ".github/action.{yml,yaml}",
        [""] = "roles/tasks/*.{yml,yaml}",

return opts

Compley LSP server setup

Some plugins need to do special magic to the LSP configuration to enable advanced features. One example for this is the rust-tools.nvim plugin.

Those can override overrides.lsp_installer.server_registration_override.

For example the rust-tools.nvim plugin can be set up like this:

    -- Plugin definition:
      requires = { "nvim-lspconfig", "nvim-lsp-installer", "nvim-dap", "Comment.nvim" },
      -- Is configured via the server_registration_override installed below!

and then wired up with:

  overrides = {
    lsp_installer = {
      server_registration_override = function(server, server_opts)
        -- Special code for!
        if == "rust_analyzer" then
          local extension_path = vim.fn.stdpath "data" .. "/dapinstall/codelldb/extension/"
          local codelldb_path = extension_path .. "adapter/codelldb"
          local liblldb_path = extension_path .. "lldb/lib/"

          require("rust-tools").setup {
            server = server_opts,
            dap = {
              adapter = require("rust-tools.dap").get_codelldb_adapter(codelldb_path, liblldb_path),

🗒 Note

Guide is given for basic usage
Learn more about the default key bindings
Watch a review video to know about the out of the box experience


Sincere appreciation to the following repositories, plugin authors and the entire neovim community out there that made the development of AstroVim possible.