Compare commits

..

1 commit

Author SHA1 Message Date
diniamo
591c845193 languages/odin: init 2024-12-21 01:27:38 +01:00
5 changed files with 35 additions and 31 deletions

View file

@ -13,8 +13,4 @@
[haskell-tools.nvim]: https://github.com/MrcJkb/haskell-tools.nvim [haskell-tools.nvim]: https://github.com/MrcJkb/haskell-tools.nvim
- Add Haskell support under `vim.languages.haskell` using [haskell-tools.nvim]. - Add Haskell support under `vim.languages.haskell` using [haskell-tools.nvim]
[diniamo](https://github.com/diniamo):
- Add Odin support under `vim.languages.odin`.

View file

@ -92,7 +92,7 @@ in {
cmd = ${ cmd = ${
if isList cfg.dap.package if isList cfg.dap.package
then expToLua cfg.dap.package then expToLua cfg.dap.package
else ''{"${cfg.dap.package}/bin/haskell-debug-adapter"}'' else ''${cfg.dap.package}/bin/haskell-debug-adapter''
}, },
}, },
''} ''}

View file

@ -4,33 +4,51 @@
... ...
}: let }: let
inherit (lib.modules) mkIf; inherit (lib.modules) mkIf;
inherit (lib.nvim.dag) entryAnywhere;
inherit (lib.nvim.lua) toLuaObject;
cfg = config.vim.utility.surround; cfg = config.vim.utility.surround;
mkLznKey = mode: key: { mkLznKey = mode: key: {
inherit mode key; inherit key mode;
}; };
in { in {
config = mkIf cfg.enable { config = mkIf cfg.enable {
vim = { vim = {
startPlugins = ["nvim-surround"];
pluginRC.surround = entryAnywhere "require('nvim-surround').setup(${toLuaObject cfg.setupOpts})";
lazy.plugins.nvim-surround = { lazy.plugins.nvim-surround = {
package = "nvim-surround"; package = "nvim-surround";
setupModule = "nvim-surround"; setupModule = "nvim-surround";
inherit (cfg) setupOpts; inherit (cfg) setupOpts;
keys = [ keys =
(mkLznKey "i" cfg.setupOpts.keymaps.insert) [
(mkLznKey "i" cfg.setupOpts.keymaps.insert_line) (mkLznKey ["i"] cfg.setupOpts.keymaps.insert)
(mkLznKey "x" cfg.setupOpts.keymaps.visual) (mkLznKey ["i"] cfg.setupOpts.keymaps.insert_line)
(mkLznKey "x" cfg.setupOpts.keymaps.visual_line) (mkLznKey ["x"] cfg.setupOpts.keymaps.visual)
(mkLznKey "n" cfg.setupOpts.keymaps.normal) (mkLznKey ["x"] cfg.setupOpts.keymaps.visual_line)
(mkLznKey "n" cfg.setupOpts.keymaps.normal_cur) (mkLznKey ["n"] cfg.setupOpts.keymaps.normal)
(mkLznKey "n" cfg.setupOpts.keymaps.normal_line) (mkLznKey ["n"] cfg.setupOpts.keymaps.normal_cur)
(mkLznKey "n" cfg.setupOpts.keymaps.normal_cur_line) (mkLznKey ["n"] cfg.setupOpts.keymaps.normal_line)
(mkLznKey "n" cfg.setupOpts.keymaps.delete) (mkLznKey ["n"] cfg.setupOpts.keymaps.normal_cur_line)
(mkLznKey "n" cfg.setupOpts.keymaps.change) (mkLznKey ["n"] cfg.setupOpts.keymaps.delete)
(mkLznKey "n" cfg.setupOpts.keymaps.change_line) (mkLznKey ["n"] cfg.setupOpts.keymaps.change)
]; (mkLznKey ["n"] cfg.setupOpts.keymaps.change_line)
]
++ map (mkLznKey ["n" "i" "v"]) [
"<Plug>(nvim-surround-insert)"
"<Plug>(nvim-surround-insert-line)"
"<Plug>(nvim-surround-normal)"
"<Plug>(nvim-surround-normal-cur)"
"<Plug>(nvim-surround-normal-line)"
"<Plug>(nvim-surround-normal-cur-line)"
"<Plug>(nvim-surround-visual)"
"<Plug>(nvim-surround-visual-line)"
"<Plug>(nvim-surround-delete)"
"<Plug>(nvim-surround-change)"
"<Plug>(nvim-surround-change-line)"
];
}; };
}; };
}; };

View file

@ -76,7 +76,6 @@
else else
mkLuaInline '' mkLuaInline ''
function() function()
${optionalString (spec.beforeSetup != null) spec.beforeSetup}
${ ${
optionalString (spec.setupModule != null) optionalString (spec.setupModule != null)
"require(${toJSON spec.setupModule}).setup(${toLuaObject spec.setupOpts})" "require(${toJSON spec.setupModule}).setup(${toLuaObject spec.setupOpts})"

View file

@ -74,15 +74,6 @@
''; '';
}; };
beforeSetup = mkOption {
type = nullOr lines;
default = null;
description = ''
Lua code to run after the plugin is loaded, but before the setup
function is called.
'';
};
setupModule = mkOption { setupModule = mkOption {
type = nullOr str; type = nullOr str;
default = null; default = null;