From f1a49b8ca59f9f4645a9ad361464157e8b97744d Mon Sep 17 00:00:00 2001 From: Botond Kalocsai Date: Sat, 6 Apr 2024 23:01:29 +0200 Subject: [PATCH] feat(neovim): setting python repl with pylab imports and matplotlib qt backend --- .../dot_config/nvim/lua/plugins/iron-repl.lua | 108 +++++++++--------- 1 file changed, 54 insertions(+), 54 deletions(-) diff --git a/home/dot_config/nvim/lua/plugins/iron-repl.lua b/home/dot_config/nvim/lua/plugins/iron-repl.lua index 8846eca..7439560 100644 --- a/home/dot_config/nvim/lua/plugins/iron-repl.lua +++ b/home/dot_config/nvim/lua/plugins/iron-repl.lua @@ -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 = "rc", - visual_send = "rc", - send_file = "rf", - send_line = "rl", - send_mark = "rm", - mark_motion = "rmc", - mark_visual = "rmc", - remove_mark = "rmd", - cr = "r", - interrupt = "r", - exit = "rq", - clear = "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 = "rc", + visual_send = "rc", + send_file = "rf", + send_line = "rl", + send_mark = "rm", + mark_motion = "rmc", + mark_visual = "rmc", + remove_mark = "rmd", + cr = "r", + interrupt = "r", + exit = "rq", + clear = "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, }