diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -6,3 +6,7 @@ require("config.autocmds") require("config.user_commands") require("config.keymaps") + +vim.filetype.add({ + extension = { rn = "rune" }, +}) diff --git a/.config/oyui/config.rn b/.config/oyui/config.rn --- 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)); + }, + ); } diff --git a/.config/nvim/plugin/nvim-lspconfig.lua b/.config/nvim/plugin/nvim-lspconfig.lua --- a/.config/nvim/plugin/nvim-lspconfig.lua +++ b/.config/nvim/plugin/nvim-lspconfig.lua @@ -131,3 +131,11 @@ 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 --- a/.config/nvim/plugin/nvim-treesitter.lua +++ b/.config/nvim/plugin/nvim-treesitter.lua @@ -37,6 +37,7 @@ 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 = "*",