vi 不识别滚动,而是滚动终端。

huangapple go评论49阅读模式
英文:

vi not recognizing scrolling, scrolls terminal instead

问题

I have an instance of vi on a remote server that is not behaving like it used to, and I'm not sure what made this happen.

On my local shell, (and the remote server before this started happening), if I scroll with my mouse/touchpad, it would navigate the cursor within vim. I have checked my .vimrc and there's nothing in it relating to the mouse, and I did not make any changes to it before this issue started.

The only thing I can think of is that a few weeks ago, I was trying to figure out how I could split two files in the same vi instance so I could yank from one file to another, and I tried some : commands that I didn't really understand (didn't get any productive results). And also, I ran tmux once, but I don't think there are any . files that are applying unwanted settings (not sure).

I can't find anything to check the vi settings being applied, but I know that my .vimrc is working, and it's not anything in there (if I comment everything out it still behaves this way).

I just want my vi to respond the same way.

Describing the problem more exactly:
If I scroll, the cursor doesn't move, instead it scrolls on the terminal window, and it shows the previous bash commands instead of scrolling the file being edited. If I navigate using vim keys, it still works.

英文:

I have an instance of vi on a remote server that is not behaving like it used to, and I'm not sure what made this happen.

On my local shell, (and the remote server before this started happening), if I scroll with my mouse/touchpad, it would navigate the cursor within vim. I have checked my .vimrc and there's nothing in it relating to the mouse, and I did not make any changes to it before this issue started.

The only thing I can think of is that a few weeks ago, I was trying to figure out how I could split two files in the same vi instance so I could yank from one file to another, and I tried some : commands that I didn't really understand (didn't get any productive results). And also, I ran tmux once, but I don't think there are any . files that are applying unwanted settings (not sure).

I can't find anything to check the vi settings being applied, but I know that my .vimrc is working, and it's not anything in there (if I comment everything out it still behaves this way).

I just want my vi to respond the same way.

Describing the problem more exactly:
If I scroll, the cursor doesn't move, instead it scrolls on the terminal window, and it shows the previous bash commands instead of scrolling the file being edited. If I navigate using vim keys, it still works.

答案1

得分: 0

我发现问题实际上与一个特定的终端实例有关。关闭它,打开一个新的,现在没有问题。如果有人知道这可能是为什么,我很想知道。

英文:

Randomly, I discovered that it actually had to do with the a specific terminal instance that was causing the issue. Closed it, opened a new one, no issue now. If anyone has any insight on why this could've been, I'd love to know.

答案2

得分: 0

.vimrc只适用于vim而不是vi,是吗?

滚动的问题可能也与您的终端模拟器有关。

我通常在VS Code中使用嵌入的终端,这并不理想(因为它不是为管理员而制作的...),但使用快捷键从一个窗口跳到另一个窗口,复制粘贴很方便...
我知道有些同事在Windows上使用mobaXterm或mremoteNG。

我知道我应该尝试一下Terminator,但它只适用于Linux,我不想为此运行本地虚拟机。

英文:

.vimrc applies to vim not vi, doesn't it ?

the problem of scrolling might come from your terminal emulator as well.

I usually use embedded terminal in VS code which is not ideal (since it's not made for administration ...) but it's practical with keybinds to jump from one window to another, copy paste ...
I know some colleagues who use, mobaXterm or mremoteNG on windows.

I know I should give a go to Terminator, but it's on linux only and I don't want to run a local vm just for that.

答案3

得分: 0

问题是vi编辑器尚未安装在计算机上。这通常发生在新安装的Ubuntu操作系统或其他虚拟机操作系统上。以下代码以非常简单的方式解决了这个问题。
这解决了这个问题:

sudo apt install vim
英文:

The problem is that the vi editor is not yet install on the PC.This usually happened for newly installed Ubuntu OS or other virtual box OS. The below code resolved the issue 100% for me in a very easy way.
This resolve the issue:

sudo apt install vim

Thanks

huangapple
  • 本文由 发表于 2023年2月10日 05:59:45
  • 转载请务必保留本文链接:https://go.coder-hub.com/75404868.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定