Neovim终端支撑

发布于 2025-01-26 10:21:48 字数 703 浏览 0 评论 0 原文

这是我的config init.vim: https://github.com/ neuralnine/config-files/blob/master/init.vim

当我做:terminalsplit bash 时,我会在此过程中获得终端,这可以正常工作。

但是,当我做:terminalsplit bash 时, 看起来很空,却不正常,那为什么呢?

This is my config init.vim : https://github.com/NeuralNine/config-files/blob/master/init.vim

when i do :TerminalSplit bash i get the terminal in this process which works fine.

but when i do :TerminalSplit bash on this process terminal just looks empty and not working fine, why is that ?
but when i do :TerminalSplit bash on this process terminal just looks empty

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

漆黑的白昼 2025-02-02 10:21:48

问题

您需要在为此,看起来这个插件已经不再维护,因为上一个提交是4年前。

无论如何,替代修复

作为替代方法,您可以尝试使用内置:终端命令,该命令也可以为您打开终端。这是您可以使用的一些映射:

nnoremap <silent> <C-t> :vsplit <bar> :term<CR>

这将在右侧创建一个新窗口,并为您启动一个新的外壳。您还可以将以下片段添加到 init.vim

augroup TerminalSplitup
    autocmd!
    autocmd TermOpen * setlocal list
    autocmd TermOpen,TermEnter * startinsert
augroup END

如果您打开该终端窗口,它应该自动进入插入模式。

还有另一个提示:

tnoremap <silent> <Esc> <C-\><C-n>

如果您想能够滚动终端,请使用此映射。此映射将使您将插入模式留在终端中,以便能够使用正常的vim-keybindings滚动终端缓冲器。

The problem

You'd need to create an issue on vim-terminal for that but it looks like that this plugin isn't maintained anymore since the last commit is 4 years ago.

Alternative fix

Anyway as an alternativ you can try to use the builtin :terminal command which can open up a terminal for you as well. Here's a little mapping which you can use:

nnoremap <silent> <C-t> :vsplit <bar> :term<CR>

This will create a new window on the right and starts a new shell for you. You can also add the following snippet to your init.vim:

augroup TerminalSplitup
    autocmd!
    autocmd TermOpen * setlocal list
    autocmd TermOpen,TermEnter * startinsert
augroup END

which should bring you automatically into insert mode if you open up that terminal-window.

Also another hint:

tnoremap <silent> <Esc> <C-\><C-n>

use this mapping if you want to be able to scroll through your terminal. This mapping will let you leave the insert mode in your terminal to be able to scroll through the terminal-buffer with the normal vim-keybindings.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文