I am new user to Vim and I want to use vim's embedded terminal (called by :term
). Unfortunately, I cannot use this terminal as I want to. The Shift
+ PageUp
/ Shift
+ PageDown
duo (to move up and down through logs) does not work. I tried to solve the issue, with found mapping tnoremap <CTRL-V><CTRL-PAGEUP> : tabp<CR>
, but this one does not work.
The best way that I've found to do this is to start a tmux session within the Vim terminal, then scroll in tmux copy mode. I can't necessarily give any key-bindings for this because it really depends on your tmux setup. You can make tmux use the Vim-like <C-u>
and <C-d>
(up and down half a page) by adding the following to your .tmux.conf
:
set -gw mode-keys vi
For that matter, why not use vi mode in bash?
set -o vi
To actually scroll in tmux then, you need to use your tmux prefix key (defaults to <C-b>
) followed by [
to put it in "copy mode".
Here is an example of my Vim/Tmux terminal. Note that at the end I turn off the status bar by typing <C-b>
(the default tmux prefix hotkey) followed by :
(put tmux in command mode). Finally enter the command set -g status off
.
However, I normally only do this if I am using GVim or MacVim, but for the most part I run Vim inside of a tmux session in a terminal which lets me get all of this for free.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With