Skip to content

Installation

Requirements

Setting Up The Globals

Some of the configuration is required to be put into a global variable since some amount of state needs to be known at the time lazy.nvim loads the plugins which is done before the setup function of the plugin is called. So this global needs to be set up before the setup function of lazy.nvim is called.

lua
vim.g.lazylangs = {
  -- '.' separated path relative to the lua directory in this case from
  -- the neovim config directory it's 'lua/languages'. 'foo.bar' would
  -- make the path 'lua/foo/bar'
  ---@type string
  override_path = 'languages',
  ---List of strings of language names/aliases. See Language Support.
  ---@type string[]
  langs = { 'lua', 'markdown', 'python' },
  ---Optional completion engine plugin to be used
  ---@type "nvim-cmp"|"blink.cmp"
  completion_plugin = "nvim-cmp",
  ---Optional formatting plugin is used.
  ---@type "conform"
  formatting_plugin = 'conform',
  ---Optional linting plugin to be used
  ---@type "nvim-lint"
  linting_plugin = 'nvim-lint',
  ---Optional debugging plugin to be used
  ---@type "nvim-dap"
  debugging_plugin = 'nvim-dap',
}

For more tips see the recipes.

Lazy

lua
{
  'lcroberts/lazylangs.nvim',
  event = 'VeryLazy',
  dependencies = {
    'neovim/nvim-lspconfig',
    'mfussenegger/nvim-dap',
    -- Optional
    'williamboman/mason.nvim',
    'stevearc/conform.nvim',
    'hrsh7th/nvim-cmp', -- If using blink.cmp put that here
    'mfussenegger/nvim-lint',
  },
  ---@module 'lazylangs'
  ---@type ll.Config
  opts = {}, -- Setup options go here
  import = 'lazylangs.plugins', -- Imports plugins from the language configurations
}