From 03436a47918c8c5229e435481cafdae61dd67fc5 Mon Sep 17 00:00:00 2001 From: Ariel D'Alessandro Date: Fri, 3 Jun 2022 08:47:16 +0200 Subject: fix more iron config, add some comments for ideas --- after/plugin/iron.lua | 89 +++++++++++++++++++++++++++++++-------------------- 1 file changed, 54 insertions(+), 35 deletions(-) diff --git a/after/plugin/iron.lua b/after/plugin/iron.lua index 401c23b..972ccbc 100644 --- a/after/plugin/iron.lua +++ b/after/plugin/iron.lua @@ -1,42 +1,61 @@ local ok, iron = pcall(require, "iron.core") if not ok then - return + return end iron.setup({ - config = { - highlight_last = "IronLastSent", - -- Whether a repl should be discarded or not - scratch_repl = true, - close_window_on_exit = true, - -- Your repl definitions come here - repl_definition = { - sh = { - command = { "zsh" }, - }, - javascript = { - command = { "node" }, - }, - php = { - command = { "psysh" }, - }, - tinker = { - command = { "sail", "tinker" }, - }, - }, - repl_open_cmd = "rightbelow vertical 100 split", - -- how the REPL window will be opened, the default is opening - -- a float window of height 40 at the bottom. - }, - keymaps = { - send_motion = "sc", - visual_send = "sc", - send_line = "sl", - send_mark = "s.", - cr = "s", - interrupt = "s", - exit = "sq", - clear = "cl", - }, + config = { + should_map_plug = false, + -- Whether a repl should be discarded or not + scratch_repl = true, + close_window_on_exit = true, + -- Your repl definitions come here + repl_definition = { + sh = { + command = { "zsh" }, + }, + javascript = { + command = { "node" }, + }, + php = { + command = { "psysh" }, + }, + tinker = { + command = { "php", "artisan", "tinker" }, + }, + sail = { + command = { "sail", "tinker" }, + }, + }, + repl_open_cmd = "rightbelow vertical 100 split", + -- how the REPL window will be opened, the default is opening + -- a float window of height 40 at the bottom. + }, + keymaps = { + send_motion = "sc", + visual_send = "sc", + send_file = "sf", + send_line = "sl", + send_mark = "sm", + mark_motion = "mc", + mark_visual = "mc", + remove_mark = "md", + cr = "s", + interrupt = "s", + exit = "sq", + clear = "cl", + }, + highlight = { + italic = true, + }, }) + +-- Idea +-- create a menu to ask which console wants to start +-- for php example we have +-- psysh | tinker | tinker on sail +-- base on that save the expected filetype on a buffer variable +-- add the parameter to the command for the IronRepl and all commands to send +-- or beter use my own functions useing the core.* functions +-- not all functions takes the ft as parameter -- cgit v1.2.3