chore(nvim): improve slimux configuration and key mapping

This commit is contained in:
João Paulo Dubas 2024-09-16 17:20:20 -03:00
parent f98a4d5bcf
commit 5e39fc19a8
No known key found for this signature in database

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,
},