this post was submitted on 21 Jun 2023
19 points (100.0% liked)

Neovim

2155 readers
1 users here now

founded 1 year ago
MODERATORS
 

๐Ÿ˜ป

top 6 comments
sorted by: hot top controversial new old
[โ€“] [email protected] 3 points 1 year ago

Another option to consider is tmux with neovim.

[โ€“] [email protected] 1 points 1 year ago (2 children)

Still getting used to this. I'm having a hard time opening side-by-side terminals.

I think my next step is to reduce my config down to just this and make sure nothing is interfering. But if anybody already figured this out, I'm all ears.

[โ€“] [email protected] 2 points 1 year ago* (last edited 1 year ago) (1 children)

Iโ€™m having a hard time opening side-by-side terminals

Side-by-side how? the way I imagine this is starting with a single window with a regular buffer, then opening two toggleterm terminals in splits to end up like this:

If that's what you mean, all you need is to pass unique terminal ids as you call ToggleTerm.

  • :ToggleTerm 1<CR>
  • :ToggleTerm 2<CR>

You could then map that to whatever keys you want, like <c-1> and <c-2>:

vim.keymap.set('n', '<c-1>', ':ToggleTerm 1<CR>')
vim.keymap.set('n', '<c-2>', ':ToggleTerm 2<CR>')

I have a similar setup: https://github.com/davidmh/dot-files/blob/3b0e79919f231db1f3628f6fde06e9f78f347b87/nvim/fnl/own/plugin/toggle-term.fnl

  • ctrl + 1-5 for dedicated split terms
  • alt + 1-5 for dedicated tab terms
  • ctrl + t as a wildcard split term, that's my go to
  • alt + t to attach or start a tmux session in a tab
[โ€“] [email protected] 2 points 1 year ago

๐Ÿคฆโ€โ™‚๏ธ

Thank you

[โ€“] [email protected] 2 points 1 year ago* (last edited 1 year ago) (1 children)

I think you can learn a thing or two from this guy's config, his keybinding config is clean and I stole it :D toggle layzygit and vifm from toggleterm is nice if you use them. Btw: it only configs float terminal, side by side terminals I just use tmux instead

[โ€“] [email protected] 1 points 1 year ago
load more comments
view more: next โ€บ