gpt4 book ai didi

neovim - 如何在 neovim 中滚动终端模拟器?

转载 作者:行者123 更新时间:2023-12-01 22:57:34 54 4
gpt4 key购买 nike

:vsplit | te <command>我在垂直分割的 neovim 终端模拟器中运行一个命令。但是我怎样才能滚动它的输出呢?当我按下一个键时,拆分窗口再次关闭。

为了便于说明,我们使用命令 :vsplit | te ls -lah /usr/lib/在拆分窗口中产生长输出。我现在如何在这个拆分窗口中向上滚动以查看更多输出?我发现使用 set mouse=a 时可以使用鼠标滚轮,但我不喜欢使用鼠标。

最佳答案

根据Neovim documentation :

Terminal-mode has its own |:tnoremap| namespace for mappings, this can be used to automate any terminal interaction.

因此,您可以映射任何您想要的键或组合。

此外,您可以使用 PgUpPgDown 滚动终端窗口。在全键盘上这些键应该可用,在笔记本电脑上通常可以通过 fnfn.

更新:

关于终端模式的一些附加配置选项。

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

关于neovim - 如何在 neovim 中滚动终端模拟器?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44002912/

54 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com