chore(nvim): improve slimux configuration and key mapping
This commit is contained in:
parent
f98a4d5bcf
commit
5e39fc19a8
@ -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,
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user