Neovim
The official LUMOS plugin for Neovim provides syntax highlighting via Tree-sitter and full LSP integration.
Installation
Section titled “Installation”Using lazy.nvim (Recommended)
Section titled “Using lazy.nvim (Recommended)”{ "getlumos/nvim-lumos", dependencies = { "nvim-treesitter/nvim-treesitter", "neovim/nvim-lspconfig", }, config = function() require("lumos").setup() end,}Using packer.nvim
Section titled “Using packer.nvim”use { "getlumos/nvim-lumos", requires = { "nvim-treesitter/nvim-treesitter", "neovim/nvim-lspconfig", }, config = function() require("lumos").setup() end,}Manual Installation
Section titled “Manual Installation”# Clone to your plugins directorygit clone https://github.com/getlumos/nvim-lumos \ ~/.local/share/nvim/site/pack/plugins/start/nvim-lumos
# Install Tree-sitter grammar:TSInstall lumosRequirements
Section titled “Requirements”- Neovim 0.9+ (required)
- nvim-treesitter - For syntax highlighting
- nvim-lspconfig - For LSP features
- lumos-lsp - LSP server
Terminal window cargo install lumos-lsp
Features
Section titled “Features”Syntax Highlighting
Section titled “Syntax Highlighting”Tree-sitter-based syntax highlighting for:
- Keywords, types, and attributes
- Comments (line and block)
- String literals and numbers
- Enum variants
LSP Integration
Section titled “LSP Integration”Full Language Server Protocol support:
- Real-time diagnostics
- Auto-completion
- Hover documentation
- Go to definition
- Find references
- Code actions
Pre-configured Keybindings
Section titled “Pre-configured Keybindings”| Key | Action |
|---|---|
gd | Go to definition |
K | Hover documentation |
gr | Find references |
<leader>rn | Rename symbol |
<leader>ca | Code actions |
<leader>f | Format document |
Configuration
Section titled “Configuration”Basic Setup
Section titled “Basic Setup”require("lumos").setup({ -- LSP server path (auto-detected if on PATH) lsp_cmd = { "lumos-lsp" },
-- Enable diagnostics diagnostics = true,
-- Format on save format_on_save = true,})Advanced Configuration
Section titled “Advanced Configuration”require("lumos").setup({ lsp_cmd = { "lumos-lsp" },
-- Custom keybindings on_attach = function(client, bufnr) local opts = { buffer = bufnr }
vim.keymap.set("n", "gd", vim.lsp.buf.definition, opts) vim.keymap.set("n", "K", vim.lsp.buf.hover, opts) vim.keymap.set("n", "<leader>rn", vim.lsp.buf.rename, opts) vim.keymap.set("n", "<leader>ca", vim.lsp.buf.code_action, opts) vim.keymap.set("n", "gr", vim.lsp.buf.references, opts) vim.keymap.set("n", "<leader>f", function() vim.lsp.buf.format({ async = true }) end, opts) end,
-- Custom capabilities (for nvim-cmp integration) capabilities = require("cmp_nvim_lsp").default_capabilities(),})Integration with nvim-cmp
Section titled “Integration with nvim-cmp”local cmp = require("cmp")
cmp.setup({ sources = cmp.config.sources({ { name = "nvim_lsp" }, -- LUMOS completions { name = "buffer" }, { name = "path" }, }),})Troubleshooting
Section titled “Troubleshooting”LSP not starting
Section titled “LSP not starting”-
Verify
lumos-lspis installed:Terminal window lumos-lsp --version -
Check LSP logs:
:LspLog -
Manually start LSP:
:LspStart lumos
Tree-sitter not highlighting
Section titled “Tree-sitter not highlighting”-
Verify grammar is installed:
:TSInstallInfo lumos -
Reinstall grammar:
:TSInstall lumos
File type not detected
Section titled “File type not detected”Add to your config:
vim.filetype.add({ extension = { lumos = "lumos", },})