跳转后在vim中自动'zz' [英] Auto 'zz' in vim after a jump

查看:124
本文介绍了跳转后在vim中自动'zz'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我跳到世界上任何地方,无论是在当前文件还是不同的文件中,都可以使vim自动运行 zz (重新中心在当前行)?

After I make a jump to anywhere in the world, whether in the current file or a different file, is it possible to make vim automatically run zz (re-center on current line)?

我想要搜索后, ctrl-o ctrl-i ...以及除 hjkl 之外的任何动作。

I want this after things like search, ctrl-o and ctrl-i ... and pretty much any movement other than hjkl.

感谢。

推荐答案

Voila:

" Center screen on next/previous selection.
nnoremap n nzz
nnoremap N Nzz
" Last and next jump should center too.
nnoremap <C-o> <C-o>zz
nnoremap <C-i> <C-i>zz

这篇关于跳转后在vim中自动'zz'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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