How do I scroll through a terminal using Vim 8.1's new terminal/termpack support?

后端 未结 3 1798
栀梦
栀梦 2021-01-31 01:46

I love the new terminal support that Vim 8.1 offers and I like that up/down are mapped to the terminal, so that you can select prior commands. How can I scroll up and down the t

3条回答
  •  日久生厌
    2021-01-31 02:25

    If you are using neovim, press Ctrl + \ followed by Ctrl + n to enter normal mode in a terminal.

    The help (:help terminal-input) says the following:

    In this mode all keys except are sent to the underlying program. Use to return to normal-mode. CTRL-\_CTRL-N

    Also, if you do this often, I recommend mapping it to something more convenient, like a double tap of Escape:

    tnoremap  
    

    (That way you can still use programs in the command line, that require escape to retain it's original functionality, since if you don't press anything else, it will just send a regular escape event after your defined timeout length.)

提交回复
热议问题