长线水平导航 [英] Horizontal navigation in long lines

查看:24
本文介绍了长线水平导航的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我该怎么做:

  1. 向右移动更快,类似于zw(类似于zl,但跳到单词上)
  2. 只移动光标所在的一行.文件的其余部分将保留在其位置
  1. shift faster to the right, something like zw (analogy to zl but jump on words)
  2. shift only the one long line where is the cursor. The rest of the file will remain in its position

我有 .vimrc 设置 set nowrap.那是因为代码看起来比包装的行更好.但是水平导航有问题.

I have .vimrc settings set nowrap. That's because the code looks nicer than wrapped lines. But there is a problem with horizontal navigation.

我注意到 zl(不要将 l (L) 与 1)混淆,它向右移动(zh 向左).

I noticed that zl (don't confuse l (L) with 1) shortcut which shifts to the right (zh to the left).

推荐答案

您是否尝试过 :帮助水平滚动?

Did you try :help scroll-horizontal?

您可以使用映射来滚动,例如向左或向右滚动 20 个字符:

You could use a mapping to scroll, for example, 20 characters to the left or to the right:

map <C-L> 20zl " Scroll 20 characters to the right
map <C-H> 20zh " Scroll 20 characters to the left

在不应用映射的情况下,您可以使用 zL 将视图向右移动一半屏幕宽度,并使用 zH 向左移动.

Without applying a mapping, you could use zL to move the view a half screenwidth to the right and zH to do it to the left.

关于您问题的第二部分:我认为这是不可能的.您可以猛拉整行,将其粘贴到第二个(临时)缓冲区中并在那里滚动.只要您只是在阅读这些行,这就会起作用.一旦你想改变什么,问题就会出现.但是比较麻烦...

Regarding the second part of your question: I don't think that this is possible. You could yank the whole line, paste it into a second (scratch) buffer and scroll there. This would work as long as you're just reading the lines. Problems will arise as soon as you want to change something. But it's quite cumbersome...

这篇关于长线水平导航的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆