Neovim - Elixir Setup Configuration from Scratch Guide

Let me give my love to LazyVim (the Neovim distro) here too.

I used to use LunarVim, but switched to LazyVim when I saw that LazyVim (the distro) used lazy.nvim (the package manager). That was the killer feature. Now everybody is using lazy.nvim, even LunarVim and even the creator of packer (another package manager for nvim) has switched over to lazy.nvim.

lazy.nvim (the package manager) makes super easy to merge config options, so you can declare options for the same plugin in different files or stages. That may sound problematic but I found that’s actually more useful to organize your config files in a more ‘thematic’ way than to have a single point of configuration for each file.

LazyVim (the distro) takes this philosophy a step further and makes it super easy to add a config file for a new language. You “add” options (a lua table) to plugins (treesitter, lspconfig, linters, etc) that are probably already declared that will be merged by lazy.nvim (the package manager) and things work and are still organized.

To add Elixir to LazyVim, it was as simple as this: Add Elixir support and config by georgeguimaraes · Pull Request #993 · LazyVim/LazyVim · GitHub

Let me give you another example. I wanted to change Telescope to search for all hidden files, because I want to open .formatter.exs, for instance. I created a new file in my neovim config called plugins/editor.lua:

return {
  {
    "nvim-telescope/telescope.nvim",
    opts = {
      pickers = {
        find_files = {
          hidden = true,
          file_ignore_patterns = { ".git/" },
        },
      },
    },
  },
}

That was it. All the other defaults from the Telescope project, and all the other config that LazyVim adds to Telescope are still there.

In LunarVim, I was not fond searching if I needed to overwrite something in the lvim.builtin namespace or not. More overhead. (At least that was the case before they moved to lazy.nvim).

Btw, lua is a joy to use. Really enjoying it.

Anyway, my nvim-config is in GitHub - georgeguimaraes/nvim-config: My ~/.config/nvim files · GitHub. I love trying new plugins and new stuff on my config.

3 Likes