From 72617a8fc16e5b76e699c296ecfe4fa56f8c59f2 Mon Sep 17 00:00:00 2001 From: "kacaii.dev" Date: Tue, 11 Aug 2026 21:17:38 -0300 Subject: [PATCH] nvim: use oyui_ls --- .config/nvim/init.lua | 4 ++ .config/nvim/plugin/nvim-lspconfig.lua | 8 ++++ .config/nvim/plugin/nvim-treesitter.lua | 1 + .config/oyui/config.rn | 50 ++++++++++++++----------- 4 files changed, 41 insertions(+), 22 deletions(-) diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index 9339dab..aa0de77 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -6,3 +6,7 @@ require("config.options") require("config.autocmds") require("config.user_commands") require("config.keymaps") + +vim.filetype.add({ + extension = { rn = "rune" }, +}) diff --git a/.config/nvim/plugin/nvim-lspconfig.lua b/.config/nvim/plugin/nvim-lspconfig.lua index 4b9ee1f..b04e856 100644 --- a/.config/nvim/plugin/nvim-lspconfig.lua +++ b/.config/nvim/plugin/nvim-lspconfig.lua @@ -131,3 +131,11 @@ vim.lsp.config["elp"] = { filetypes = { "erlang" }, } vim.lsp.enable("elp") + +-- rust / rune +vim.lsp.config["oyui_ls"] = { + cmd = { "oyui", "language-server" }, + filetypes = { "rune" }, + root_markers = { "config.rn" }, +} +vim.lsp.enable("oyui_ls") diff --git a/.config/nvim/plugin/nvim-treesitter.lua b/.config/nvim/plugin/nvim-treesitter.lua index 821f26f..af32de2 100644 --- a/.config/nvim/plugin/nvim-treesitter.lua +++ b/.config/nvim/plugin/nvim-treesitter.lua @@ -37,6 +37,7 @@ vim.wo[0][0].foldexpr = "v:lua.vim.treesitter.foldexpr()" vim.wo[0][0].foldmethod = "expr" vim.treesitter.language.register("markdown", "djot") +vim.treesitter.language.register("rust", "rune") vim.api.nvim_create_autocmd("FileType", { pattern = "*", diff --git a/.config/oyui/config.rn b/.config/oyui/config.rn index 208c049..85d54cd 100644 --- a/.config/oyui/config.rn +++ b/.config/oyui/config.rn @@ -1,30 +1,36 @@ // Rune language documentation at: https://rune-rs.github.io/ // this is your entrypoint... pub fn config() { - // Oyui comes with 40+ built-in themes out of the box: - // aura, ayu, catppuccin-mocha, dracula, gruvbox-dark, nord, - // one-dark, everforest-light... - // - // Full list at: - // https://github.com/emilien-jegou/oyui/tree/main/docs/themes.md - // theme::set("everforest-dark"); + // Oyui comes with 40+ built-in themes out of the box: + // aura, ayu, catppuccin-mocha, dracula, gruvbox-dark, nord, + // one-dark, everforest-light... + // + // Full list at: + // https://github.com/emilien-jegou/oyui/tree/main/docs/themes.md + // theme::set("everforest-dark"); - // Overwritting theme specific config. + // Overwritting theme specific config. - // 50+ actions and settings to configure, check the documentation: - // https://github.com/emilien-jegou/oyui/wiki/Actions-API - // theme::bg::set("#1d2428") - // theme::file_staged_highlight::set(LineHighlightMode::Gradient(0.05)); + // 50+ actions and settings to configure, check the documentation: + // https://github.com/emilien-jegou/oyui/wiki/Actions-API + // theme::bg::set("#1d2428") + // theme::file_staged_highlight::set(LineHighlightMode::Gradient(0.05)); - // You can nest config per view with on_mode: - on_mode("file", || { - // keybind can take modifiers: "ctrl", "shift" or "alt" - keybind("ctrl-j", || view::file::cursor::down(5)); - keybind("ctrl-k", || view::file::cursor::up(5)); - }); + // You can nest config per view with on_mode: + on_mode( + "file", + || { + // keybind can take modifiers: "ctrl", "shift" or "alt" + keybind("ctrl-j", || view::file::cursor::down(5)); + keybind("ctrl-k", || view::file::cursor::up(5)); + }, + ); - on_mode("tree", || { - keybind("ctrl-j", || view::tree::cursor::down(5)); - keybind("ctrl-k", || view::tree::cursor::up(5)); - }); + on_mode( + "tree", + || { + keybind("ctrl-j", || view::tree::cursor::down(5)); + keybind("ctrl-k", || view::tree::cursor::up(5)); + }, + ); } -- 2.51.2