akinsho / toggleterm.nvim

A neovim lua plugin to help easily manage multiple terminal windows
GNU General Public License v3.0
4.4k stars 174 forks source link

[ Question ] New to Neovim and have few questions about this Plugin #134

Closed lpossamai closed 2 years ago

lpossamai commented 2 years ago

Hi. Sorry to be creating an issue, but I am new to Neovim (trying to migrate from VSCode) and have a few questions about this plugin... Hopefully, you can help me out? Couldn't find these answers in the documentation.

  1. Once I open a new terminal :ToggleTerm direction=horizontal, for example, how can I move back to the other tab? It appears I'm "stuck" in the terminal I just opened and have to close it in order for me to go back to where I was. The same question applies to the float and vertical.
  2. How can I scroll up/down once I open a new terminal? If I use the Scroll mouse button, it scrolls up/down the entire window, not just the terminal itself.
  3. Can I change the size of the terminal window? If so, how? I know I can specify size=X, but what if I wanna change the size of the window after a terminal has already been opened with :ToggleTerm direction=horizontal, for example?

Thanks in advance!

palandovalex commented 2 years ago

1 for horizont or vertical - just use vim keys to switch windows - Ctr + w + [ h j k l ] for float - you always can use this keys, but it will close terninal 2 if you use horisontal terminal in bottom, you can switsh windon to down - it will activate vim normal mode. 3 you can use custom keymapp for it:

nnoremap :vertical resize -5 nnoremap :resize +5 nnoremap :resize -5 nnoremap :vertical resize +5

lpossamai commented 2 years ago

1 for horizont or vertical - just use vim keys to switch windows - Ctr + w + [ h j k l ] for float - you always can use this keys, but it will close terninal 2 if you use horisontal terminal in bottom, you can switsh windon to down - it will activate vim normal mode. 3 you can use custom keymapp for it:

nnoremap :vertical resize -5 nnoremap :resize +5 nnoremap :resize -5 nnoremap :vertical resize +5

Thanks for your reply.

for horizont or vertical - just use vim keys to switch windows - Ctr + w + [ h j k l ]

That doesn't work for me. CTRL + W + [ h j k l ] does nothing (I'm using Neovim).

if you use horisontal terminal in bottom, you can switsh windon to down - it will activate vim normal mode.

Sorry, what do you mean?

you can use custom keymapp for it:

Thanks! That worked!

" https://github.com/akinsho/toggleterm.nvim/issues/134#issuecomment-1003152135
map ru :resize +5<CR>
map rd :resize -5<CR>
map rvu :vertical resize +5<CR>
map rud :vertical resize -5<CR>
zeertzjq commented 2 years ago

You can read :h terminal-input and see if that helps.

lpossamai commented 2 years ago

Thanks for your help, guys! Closing this.