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', 'EvWilson/slimux.nvim',
lazy = true,
opts = function() opts = function()
local slimux = require('slimux') local status_ok, slimux = pcall(require, 'slimux')
if not status_ok then
return {}
end
return { return {
target_socket = slimux.get_tmux_socket(), 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, end,
keys = function() 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 { return {
{ {
'v', '<leader>xr',
'<leader>r',
slimux.send_highlighted_text, slimux.send_highlighted_text,
mode = 'v',
desc = 'Send currently highlighted text to configured tmux pane', desc = 'Send currently highlighted text to configured tmux pane',
}, },
{ {
'n',
'<leader>r', '<leader>r',
slimux.send_paragraph_text, slimux.send_paragraph_text,
mode = 'n',
desc = 'Send paragraph under cursor to configured tmux pane', desc = 'Send paragraph under cursor to configured tmux pane',
} },
} }
end, end,
}, },