Skip to content

Commit

Permalink
iron: lazy load enable
Browse files Browse the repository at this point in the history
  • Loading branch information
khaneliman committed Feb 3, 2025
1 parent 6ec201c commit bc8320d
Showing 1 changed file with 50 additions and 49 deletions.
99 changes: 50 additions & 49 deletions modules/nixvim/plugins/iron/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,55 +9,56 @@
iron-nvim
];

extraConfigLua = # Lua
''
require ("iron.core").setup({
config = {
-- Whether a repl should be discarded or not
scratch_repl = true,
-- Your repl definitions come here
repl_definition = {
-- sh = {
-- command = {"zsh"}
-- },
python = {
command = { "${lib.getExe pkgs.python3}" },
format = require("iron.fts.common").bracketed_paste_python
},
nix = {
command = { "nix", "repl" }
}
},
-- How the repl window will be displayed
-- See below for more information
-- repl_open_cmd = require('iron.view').bottom(40),
},
-- Iron doesn't set keymaps by default anymore.
-- You can set them here or manually add keymaps to the functions in iron.core
keymaps = {
send_motion = "<space>sm",
visual_send = "<space>sv",
send_file = "<space>sf",
send_line = "<space>sl",
send_paragraph = "<space>sp",
send_until_cursor = "<space>su",
send_mark = "<space>ms",
mark_motion = "<space>mc",
mark_visual = "<space>mc",
remove_mark = "<space>md",
cr = "<space>s<cr>",
interrupt = "<space>s<space>",
exit = "<space>sq",
clear = "<space>sc",
},
-- If the highlight is on, you can change how it looks
-- For the available options, check nvim_set_hl
highlight = {
italic = true
},
ignore_blank_lines = true, -- ignore blank lines when sending visual select lines
})
'';
plugins.lz-n = {
plugins = [
{
__unkeyed-1 = "iron.nvim";
cmd = [
"IronRepl"
"IronReplHere"
];
after = # Lua
''
function()
require ("iron.core").setup({
config = {
scratch_repl = true,
repl_definition = {
python = {
command = { "${lib.getExe pkgs.python3}" },
format = require("iron.fts.common").bracketed_paste_python
},
nix = {
command = { "nix", "repl" }
}
},
},
keymaps = {
send_motion = "<space>sm",
visual_send = "<space>sv",
send_file = "<space>sf",
send_line = "<space>sl",
send_paragraph = "<space>sp",
send_until_cursor = "<space>su",
send_mark = "<space>ms",
mark_motion = "<space>mc",
mark_visual = "<space>mc",
remove_mark = "<space>md",
cr = "<space>s<cr>",
interrupt = "<space>s<space>",
exit = "<space>sq",
clear = "<space>sc",
},
highlight = {
italic = true
},
ignore_blank_lines = true,
})
end
'';
}
];
};

plugins.which-key.settings.spec =
lib.optionals (builtins.elem pkgs.vimPlugins.iron-nvim config.extraPlugins)
Expand Down

0 comments on commit bc8320d

Please sign in to comment.