如何更快地纠正 Vim 拼写错误? [英] How do I correct Vim spelling mistakes quicker?

查看:27
本文介绍了如何更快地纠正 Vim 拼写错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我通常的 Vim 工作流程是:

My usual Vim work flow is:

  • 在插入模式下,拼写错误.

  • In insert mode, spell something wrong.

^X s 获取一些建议.

按 Esc 接受第一个.

Press Esc to accept the first one.

在此之后,我在行中间处于命令模式,而不是我之前所在的插入模式.我可以使用 A,但只有当我在行尾输入时才有效.有没有替代方法?最理想的是,我想要一个命令,可以在不移动光标的情况下将最后一个错误纠正为第一个建议.

After this, I'm in command mode in the middle of the line, instead of insert mode of where I was before. I could use A, but that only works if I was typing on the end of the line. Is there an alternative way? Optimally, I'd like a command that corrects the last mistake to the first suggestion without moving the cursor.

推荐答案

这很有效:

imap ^L <Esc>[s1z=`]a

[s 移至最后一个拼写错误
1z= 选择第一个建议
`] 移动到最后一个插入点
a 追加文本

[s moves to the last spelling mistake
1z= chooses the first suggestion
`] move to the last insert point
a append text

这篇关于如何更快地纠正 Vim 拼写错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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