Neovim plugin for LUMOS schema language with Tree-sitter syntax highlighting and LSP support.
- Syntax Highlighting: Full Tree-sitter grammar for
.lumosfiles - LSP Integration: Auto-completion, diagnostics, hover, and more via
lumos-lsp - Smart Keybindings: Pre-configured keymaps for common LSP operations
- Formatting: Format on save support
- Neovim 0.9+ (for Tree-sitter and LSP support)
- lumos-lsp: LUMOS Language Server
cargo install lumos-lsp
- nvim-treesitter: Tree-sitter integration for Neovim
- nvim-lspconfig: LSP configuration framework
{
"getlumos/nvim-lumos",
dependencies = {
"nvim-treesitter/nvim-treesitter",
"neovim/nvim-lspconfig",
},
config = function()
require("lumos").setup()
end,
}use {
"getlumos/nvim-lumos",
requires = {
"nvim-treesitter/nvim-treesitter",
"neovim/nvim-lspconfig",
},
config = function()
require("lumos").setup()
end,
}-
Clone this repository:
git clone https://github.com/getlumos/nvim-lumos ~/.local/share/nvim/site/pack/lumos/start/nvim-lumos -
Install Tree-sitter parser:
cd ~/.local/share/nvim/site/pack/lumos/start/nvim-lumos git clone https://github.com/getlumos/tree-sitter-lumos
-
Add to your
init.lua:require("lumos").setup()
require("lumos").setup()require("lumos").setup({
-- Custom options (currently none, reserved for future)
})If you want to manually configure Tree-sitter:
require("nvim-treesitter.configs").setup({
ensure_installed = { "lumos" },
highlight = {
enable = true,
},
})To customize LSP behavior:
local lspconfig = require("lspconfig")
lspconfig.lumos.setup({
on_attach = function(client, bufnr)
-- Your custom on_attach logic
vim.keymap.set("n", "gd", vim.lsp.buf.definition, { buffer = bufnr })
vim.keymap.set("n", "K", vim.lsp.buf.hover, { buffer = bufnr })
end,
capabilities = require("cmp_nvim_lsp").default_capabilities(),
})These keybindings are automatically set up for .lumos files:
| Key | Mode | Action |
|---|---|---|
gd |
Normal | Go to definition |
K |
Normal | Show hover documentation |
<leader>rn |
Normal | Rename symbol |
<leader>ca |
Normal | Code actions |
gr |
Normal | Find references |
<leader>f |
Normal | Format document |
nvim-lumos/
├── ftdetect/
│ └── lumos.lua # File type detection for .lumos files
├── lua/
│ └── lumos/
│ ├── init.lua # Main plugin entry point
│ └── lsp.lua # LSP configuration
├── queries/
│ └── lumos/
│ └── highlights.scm # Syntax highlighting queries
├── LICENSE-MIT
├── LICENSE-APACHE
└── README.md
The plugin provides syntax highlighting and LSP support for:
- Structs:
struct Player { ... } - Enums:
enum GameState { ... } - Attributes:
#[solana],#[account],#[deprecated] - Types:
- Primitives:
u8,u16,u32,u64,u128,i8,i16,i32,i64,i128,bool,String - Solana:
PublicKey,Signature - Collections:
Vec<T>,Option<T>,[T]
- Primitives:
- Comments:
//line comments,/* */block comments
#[solana]
#[account]
struct PlayerAccount {
wallet: PublicKey,
level: u16,
experience: u64,
inventory: Vec<Item>,
}
#[solana]
enum GameState {
Active,
Paused { reason: String },
Finished(u64),
}-
Verify
lumos-lspis installed:which lumos-lsp
-
Check LSP logs:
:LspLog
-
Restart LSP:
:LspRestart
-
Ensure nvim-treesitter is installed
-
Check Tree-sitter parser status:
:TSInstallInfo lumos
-
Force reinstall parser:
:TSInstall lumos
- lumos - Core LUMOS compiler and CLI
- tree-sitter-lumos - Tree-sitter grammar for LUMOS
- vscode-lumos - VSCode extension for LUMOS
- intellij-lumos - IntelliJ IDEA plugin for LUMOS
Contributions are welcome! Please feel free to submit a Pull Request.
Dual-licensed under:
- MIT License (LICENSE-MIT)
- Apache License 2.0 (LICENSE-APACHE)
- GitHub Issues: https://github.com/getlumos/nvim-lumos/issues
- Documentation: https://lumos-lang.org