From 117c8650178d02a632f90acd147a49fa09745834 Mon Sep 17 00:00:00 2001 From: Oliver Hartmann Date: Fri, 18 Oct 2024 21:35:39 +0200 Subject: [PATCH] added iron --- lua/plugins/iron.lua | 63 +++++++++++++++++++++++++++++++++++++++ lua/plugins/lspconfig.lua | 2 +- 2 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 lua/plugins/iron.lua diff --git a/lua/plugins/iron.lua b/lua/plugins/iron.lua new file mode 100644 index 0000000..3dfa469 --- /dev/null +++ b/lua/plugins/iron.lua @@ -0,0 +1,63 @@ +return { + 'Vigemus/iron.nvim', + branch = 'master', + config = function() + 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 = { + sh = { + -- Can be a table or a function that + -- returns a table (see below) + command = { 'zsh' }, + }, + python = { + command = { 'python3' }, -- or { "ipython", "--no-autoindent" } + format = require('iron.fts.common').bracketed_paste_python, + }, + }, + -- How the repl window will be displayed + -- See below for more information + repl_open_cmd = require('iron.view').split.vertical("50%") + }, + -- 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 = 'sc', + visual_send = 'sc', + send_file = 'sf', + send_line = 'sl', + send_paragraph = 'sp', + send_until_cursor = 'su', + send_mark = 'sm', + mark_motion = 'mc', + mark_visual = 'mc', + remove_mark = 'md', + cr = 's', + interrupt = 's', + exit = 'sq', + clear = '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 + }) + + -- iron also has a list of commands, see :h iron-commands for all available commands + end, + cmd = { + 'IronRepl', + 'IronRestart', + 'IronFocus', + 'IronHide', + 'IronRepl', + 'IronReplHere', + }, +} diff --git a/lua/plugins/lspconfig.lua b/lua/plugins/lspconfig.lua index d1b0c09..a6d549b 100644 --- a/lua/plugins/lspconfig.lua +++ b/lua/plugins/lspconfig.lua @@ -19,7 +19,7 @@ local lspKeys = function(client, bufnr) vim.keymap.set({ 'n', 'i', 'x' }, '', vim.lsp.buf.signature_help, vim.tbl_extend('error', options, { desc = 'Signature help' })) vim.keymap.set('n', 'r', fzf.lsp_references, vim.tbl_extend('error', options, { desc = 'References' })) vim.keymap.set('n', '', fzf.lsp_document_symbols, vim.tbl_extend('error', options, { desc = 'Document symbols' })) - vim.keymap.set('n', 's', fzf.lsp_live_workspace_symbols, vim.tbl_extend('error', options, { desc = 'Workspace symbols' })) + vim.keymap.set('n', 'w', fzf.lsp_live_workspace_symbols, vim.tbl_extend('error', options, { desc = 'Workspace symbols' })) vim.keymap.set('n', 'v', vim.diagnostic.open_float, vim.tbl_extend('error', options, { desc = 'Diagnostics Float' })) vim.keymap.set('n', 'V', fzf.diagnostics_document, vim.tbl_extend('error', options, { desc = 'Diagnostics' })) vim.keymap.set('n', '', 'ClangdSwitchSourceHeader', vim.tbl_extend('error', options, { desc = 'Switch Source/Header' }))