Iron.nvim and lazyvim #319
-
New to neovim (coming from vsc) and trying to figure out how to make iron.nvim work with lazyvim. The plugin loads but I am struggling to figure out how to configure the setup to work for julia, python and r. Any example config files that can be shared using lazyvim? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
Hey! I had asked this over at the LazyVim repo discussions and got this answer which worked for me: You can use the following code to setup iron.nvim in the LazyVim config with the default iron.nvim config:
|
Beta Was this translation helpful? Give feedback.
-
Sure, here's an example configuration for lazyvim that includes iron.nvim and sets it up for Julia, Python, and R: " Iron.nvim settings " Julia setup " Python setup " R setup " Lazyvim autoloads This sets up the iron.nvim plugin with the mapleader set to ,. The g:iron_map_defaults variable is set to 0 to allow custom key mappings for each language. The g:iron_map_julia, g:iron_map_python, and g:iron_map_r variables are set to the key mappings you want to use for each language. Finally, the g:iron_*_cmd variables are set to the command to run for each language. This assumes that you have Julia, Python, and R installed on your system. |
Beta Was this translation helpful? Give feedback.
-
For anyone else interested, you can continue to use the {
'Vigemus/iron.nvim',
cmd = {
'IronRepl',
'IronReplHere',
'IronRestart',
'IronSend',
'IronFocus',
'IronHide',
'IronWatch',
'IronAttach',
},
keys = {
'<space>sc',
'<space>sc',
'<space>sf',
'<space>sl',
'<space>su',
'<space>sm',
'<space>mc',
'<space>mc',
'<space>md',
'<space>s<cr>',
'<space>s<space>',
'<space>sq',
'<space>cl',
{ '<space>rs', '<cmd>IronRepl<cr>' },
{ '<space>rr', '<cmd>IronRestart<cr>' },
{ '<space>rf', '<cmd>IronFocus<cr>' },
{ '<space>rh', '<cmd>IronHide<cr>' },
},
main = 'iron.core', -- <== This informs lazy.nvim to use the entrypoint of `iron.core` to load the configuration.
opts = {
config = {
-- Whether a repl should be discarded or not
scratch_repl = true,
-- Your repl definitions come here
repl_definition = {
sh = {
-- Can be a table or a function that
-- returns a table (see below)
command = { 'fish' },
},
},
-- 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>sc',
visual_send = '<space>sc',
send_file = '<space>sf',
send_line = '<space>sl',
send_until_cursor = '<space>su',
send_mark = '<space>sm',
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>cl',
},
-- 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
},
}
I've added the |
Beta Was this translation helpful? Give feedback.
Hey! I had asked this over at the LazyVim repo discussions and got this answer which worked for me:
You can use the following code to setup iron.nvim in the LazyVim config with the default iron.nvim config: