hkupty / nvimux

Neovim as a TMUX replacement
Apache License 2.0
444 stars 17 forks source link

Ability to send a text object to a quickterm #37

Open devth opened 5 years ago

devth commented 5 years ago

Would love to be able to send current line, text object or visual selection to a quickterm with a hotkey, similar to how neoterm does it.

pchampio commented 5 years ago
(Not using quickterm)

I use neoterm with nvimux. The config is a bit tricky, I had to set new_window = 'enew | Tnew'.

Here the full conf:

" abstraction on top of neovim terminal
Plug 'kassio/neoterm'

" send stuff to REPL using NeoTerm
nnoremap <silent> <c-s>l :TREPLSendLine<CR>
vnoremap <silent> <c-s>l :TREPLSendSelection<CR>

" simulate tmux shortcuts in neovim
Plug 'Vigemus/nvimux', {'do': 'cp -r ./lua $HOME/.config/nvim/'}

lua << EOF
local nvimux = require('nvimux')
-- Nvimux configuration
nvimux.config.set_all{
  prefix = '<C-Space>',
  new_window = 'enew | Tnew',
  open_term_by_default = true,
  new_window_buffer = 'single',
}
-- Nvimux custom bindings
nvimux.bindings.bind_all{
  {'i', ':NvimuxHorizontalSplit', {'n', 'v', 'i', 't'}},
  {'s', ':NvimuxVerticalSplit', {'n', 'v', 'i', 't'}},
}
-- Required so nvimux sets the mappings correctly
nvimux.bootstrap()
EOF

Hope it can help.