2017-05-16 24 views
0

With :vsplit | te <command>我在neovim的終端模擬器中運行一個垂直分割命令。但我怎樣才能滾動它的輸出?當我按下某個鍵時,分割窗口再次關閉。如何在neovim中滾動終端模擬器?

爲了便於說明,我們讓命令:vsplit | te ls -lah /usr/lib/在分割窗口中產生一個長輸出。我怎樣才能在這個分割窗口中向上滾動,以便看到更多的輸出?當您使用set mouse=a時,我發現使用鼠標滾輪是可行的,但我不喜歡使用鼠標。

回答

1

按照Neovim documentation

終端模式有其自身的|:tnoremap |用於映射的名稱空間,這可以用來自動化任何終端交互。

因此,您可以映射任何您想要的密鑰或組合。

此外,您可以使用PgUpPgDown滾動終端窗口。在一個完整的鍵盤這些鍵應該是可用的,在筆記本電腦之一,它往往可以通過FN FN

更新:

關於終端模式的一些額外的配置選項。

if has("nvim") 
    " Make escape work in the Neovim terminal. 
    tnoremap <Esc> <C-\><C-n> 

    " Make navigation into and out of Neovim terminal splits nicer. 
    tnoremap <C-h> <C-\><C-N><C-w>h 
    tnoremap <C-j> <C-\><C-N><C-w>j 
    tnoremap <C-k> <C-\><C-N><C-w>k 
    tnoremap <C-l> <C-\><C-N><C-w>l 

    " I like relative numbering when in normal mode. 
    autocmd TermOpen * setlocal conceallevel=0 colorcolumn=0 relativenumber 

    " Prefer Neovim terminal insert mode to normal mode. 
    autocmd BufEnter term://* startinsert 
endif 
相關問題