Change from toggleterm to slimux to send commands from neovim to a terminal #73

Merged
joao.dubas merged 4 commits from jpd-ide-improve-config into main 2024-09-17 11:33:00 +00:00
Showing only changes of commit 5e39fc19a8 - Show all commits

View File

@ -106,28 +106,41 @@ return {
},
{
'EvWilson/slimux.nvim',
lazy = true,
opts = function()
local slimux = require('slimux')
local status_ok, slimux = pcall(require, 'slimux')
if not status_ok then
return {}
end
return {
target_socket = slimux.get_tmux_socket(),
target_pane = string.format('%s.2', slimux.get_tmux_window()),
target_pane = string.format('%s.1', slimux.get_tmux_window()),
}
end,
keys = function()
local slimux = require('slimux')
local status_ok, which_key = pcall(require, 'which-key')
if status_ok then
which_key.add {
{ '<leader>m', group = 'Toggle ter[m]inal' },
}
end
local slimux_status_ok, slimux = pcall(require, 'slimux')
if not slimux_status_ok then
return {}
end
return {
{
'v',
'<leader>r',
'<leader>xr',
slimux.send_highlighted_text,
mode = 'v',
desc = 'Send currently highlighted text to configured tmux pane',
},
{
'n',
'<leader>r',
slimux.send_paragraph_text,
mode = 'n',
desc = 'Send paragraph under cursor to configured tmux pane',
}
},
}
end,
},