在 :windo 之后,如何让光标回到原来的位置? [英] After a :windo, how do I get the cursor back where it was?

查看:26
本文介绍了在 :windo 之后,如何让光标回到原来的位置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

似乎 :windo 将我的光标留在底部窗口中.

Seems that :windo leaves my cursor in the bottom window.

如何让它返回到我在运行 :windo 之前所在的窗口和光标位置?

How can I get it to return to the window and cursor-position I was at before I ran :windo?

我认为 mZ,然后 `Z 会工作.但它只是将该文件带入底部窗口,而不是将我移回原来的位置.

I thought mZ, then `Z would work. But it just brings that file into the bottom window, instead of moving me back to where I was.

在 Win XP 上运行 7.3.462.

Running 7.3.462 on Win XP.

谢谢

推荐答案

sehe 的好建议让我做了两个 mksession,然后对它们进行了比较.

sehe's great suggestion led me to doing two mksessions, and diffing them.

如果我在 :windo

let saved_winnr = winnr()

这之后:

exec saved_winnr . 'wincmd w'

它给了我我需要的东西.

It gets me what I need.

这篇关于在 :windo 之后,如何让光标回到原来的位置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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