Skip to content

Commit

Permalink
feat(neovim): setting python repl with pylab imports and matplotlib q…
Browse files Browse the repository at this point in the history
…t backend
  • Loading branch information
kalocsaibotond committed Apr 6, 2024
1 parent 254b761 commit f1a49b8
Showing 1 changed file with 54 additions and 54 deletions.
108 changes: 54 additions & 54 deletions home/dot_config/nvim/lua/plugins/iron-repl.lua
Original file line number Diff line number Diff line change
@@ -1,57 +1,57 @@
return { -- https://dev.to/rnrbarbosa/how-to-run-python-on-neovim-like-jupyter-3ln0
"Vigemus/iron.nvim",
config = function(plugins, opts)
local iron = require("iron.core")
"Vigemus/iron.nvim",
config = function(plugins, opts)
local iron = require("iron.core")

iron.setup({
config = {
-- Whether a repl should be discarded or not
scratch_repl = true,
-- Your repl definitions come here
repl_definition = {
python = {
command = { "ipython" },
-- format = require("iron.fts.common").bracketed_paste,
},
powershell = {
command = { "pwsh -ExecutionPolicy ByPass -NoExit" },
-- format = require("iron.fts.common").bracketed_paste,
},
sh = {
command = { "bash" },
-- format = require("iron.fts.common").bracketed_paste,
},
batch = {
command = { "cmd" },
-- format = require("iron.fts.common").bracketed_paste,
},
},
-- How the repl window will be displayed
-- See below for more information
repl_open_cmd = require("iron.view").right(85),
},
-- 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>rc",
visual_send = "<space>rc",
send_file = "<space>rf",
send_line = "<space>rl",
send_mark = "<space>rm",
mark_motion = "<space>rmc",
mark_visual = "<space>rmc",
remove_mark = "<space>rmd",
cr = "<space>r<cr>",
interrupt = "<space>r<space>",
exit = "<space>rq",
clear = "<space>rx",
},
-- 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
})
end,
iron.setup({
config = {
-- Whether a repl should be discarded or not
scratch_repl = false,
-- Your repl definitions come here
repl_definition = {
python = {
command = { "ipython", "--pylab=qt" },
-- format = require("iron.fts.common").bracketed_paste,
},
powershell = {
command = { "pwsh -ExecutionPolicy ByPass -NoExit" },
-- format = require("iron.fts.common").bracketed_paste,
},
sh = {
command = { "bash" },
-- format = require("iron.fts.common").bracketed_paste,
},
batch = {
command = { "cmd" },
-- format = require("iron.fts.common").bracketed_paste,
},
},
-- How the repl window will be displayed
-- See below for more information
repl_open_cmd = require("iron.view").right(85),
},
-- 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>rc",
visual_send = "<space>rc",
send_file = "<space>rf",
send_line = "<space>rl",
send_mark = "<space>rm",
mark_motion = "<space>rmc",
mark_visual = "<space>rmc",
remove_mark = "<space>rmd",
cr = "<space>r<cr>",
interrupt = "<space>r<space>",
exit = "<space>rq",
clear = "<space>rx",
},
-- 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
})
end,
}

0 comments on commit f1a49b8

Please sign in to comment.