Closed jakobkhansen closed 3 years ago
I am not sure I understand your questions entirely. When this plugin opens a terminal, you should be able to switch to it by using window commands. For example, CTRL-W j
should allow you to switch from the current buffer to the terminal, assuming that the terminal is below your current buffer. Then if the cursor is in the terminal buffer, you can go into insert mode by pressing i
or a
and go back to normal mode by pressing CTRL-\ CTRL-n
. Is this what you are asking?
No, this is not what I meant. I want my cursor to automatically go to the terminal buffer window whenever I do a terminator command which opens the terminal. This is how :sp term://bash
works for me by default, automatically moving to that window whenever I open it.
Oh, I see. I suppose I could create an option (something like let g:terminator_focus_terminal_always = 1
) to always focus on the terminal whenever text is sent to it.
I thought of an easier solution. I have updated the file plugin/terminator.vim
so that every mapping that is provided by the plugin has a corresponding vim command. This allows you to make whatever mappings you like. To get your desired functionality, you could use something like this:
nnoremap <silent> <leader>rt :TerminatorRunFileInTerminal<CR>:wincmd p<CR>i<CR>
The wincmd p
will put the cursor back on the previous window (which is the terminal). The i
will put you in insert mode which is necessary in neovim but not necessary in normal vim.
Thanks!
I often want to scroll in the terminal or run another command in the terminal after I open it with this, is it possible to make the terminal the active buffer whenever I run a terminator command which opens a terminal?