使用 viper 时,Vim 宏不起作用 Emacs 中的 vimpulse
任何其他使 emacs 尽可能像 vim 的调整也将受到赞赏。
附录:我不只使用 vim 的主要原因是我喜欢 emacs 如何让你在两个不同的框架中打开文件[添加:抱歉,这很令人困惑:我的意思是单独的窗口,其中 emacs称为“框架”]。 这就像进行垂直分割,但我不需要有一扇巨大的窗户。
Any other tweaks for making emacs as vim-like as possible would be appreciated as well.
Addendum: The main reason I don't just use vim is that I love how emacs lets you open a file in two different frames [ADDED: sorry, this was confusing: I mean separate windows, which emacs calls "frames"]. It's like making a vertical split but I don't have to have one enormous window.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(9)
我不知道如何让 Vim 宏工作,但是既然你要求调整 emacs 尽可能像 vim 一样,这里有一些我每天使用的 vimpulse 的补充:
当然,学习 Emacs 也非常重要,但是 Emacs依靠定制来使其行为完全符合您的要求。 默认的 Vim 键绑定非常舒适,使用 Viper 仅仅意味着 Viper 会为您进行一些 Emacs 定制。
至于使用 Vim 而不是 Emacs,我喜欢 Vim,但我喜欢 Lisp 系统 Emacs 的交互性。 没有什么比在编辑器中的任何位置键入一行代码并通过一次击键立即对其进行评估、通过一次击键从编辑器(包括实时文档)更改或检查编辑器的状态(包括实时文档)更好的了(
CMx
) 当它运行时。I don't know how to make Vim macros work, but since you asked for tweaks for making emacs as vim-like as possible, here's a few additions to vimpulse I use everyday:
Of course, learning Emacs is very important too, but Emacs relies on customization to make it behave exactly like you want it to. And the default Vim key bindings are so comfortable that using Viper simply means that Viper does some Emacs customization for you.
As for using Vim instead of Emacs, I love Vim, but I love the interactiveness of the Lisp system that is Emacs. Nothing feels like typing a line of code anywhere in your editor and instantly evaluating it with a single keystroke, changing or inspecting the state of your editor from your editor (including the live documentation) with a single keystroke (
C-M-x
) while it is running.我没有为您提供任何 viper 或 vimpulse 调整,但我建议您尝试跟随模式。
当然我也建议你也开始学习Emacs。 我的意思是,如果您已经了解了这么多,您不妨阅读一下本教程,也许还可以看看 emacswiki。
I don't have any viper or vimpulse tweaks for you, but I do recommend that you try follow-mode.
Of course I'd also recommend that you start learning Emacs too. I mean, if you're in this far you might as well go through the tutorial and maybe have a look at emacswiki.
我使用的VIM版本支持(Windows版本)支持使用“Ctrl+W s”将文件分成2个不同的框架...
The version of VIM I use support (Window version) support splitting a file into 2 different frames using "Ctrl+W s"...
Vim 可以轻松地让您在两个不同的框架中打开文件:
:split
水平分割:vsplit
垂直分割您可以根据需要多次分割屏幕相同文件、不同文件或两者。
CTRL-ww
切换帧。:resize +n
或:resize -n
调整当前帧的大小。Vim easily lets you open a file in two different frames:
:split
to split it horizontally:vsplit
to split it verticallyYou can split the screen as many times as you want between the same file, different files, or both.
CTRL-w-w
switches frames.:resize +n
or:resize -n
resizes the current frame.Emacs+vimpulse 很棒,但我认为它正确的工作流程是自由地结合使用 emacs 命令和 vim 快捷方式。
例如,emacs 的宏快捷键 F3 和 F4 比 vim 的 qq 和 @q 更容易。
另外,emacs 命令是通过 Alt+x 访问的,而不是 : 命令。 尽管 vimpulse 支持一些重要的 vim 命令,但它们的存在只是为了兼容性。
以下是我的 vimpulse 具体定制。
.emacs
如果您喜欢终端,可以使用 emacs -nw。 在这种情况下,这个剪贴板插件就很有用了。 http://www.lingotrek.com/2010 /12/integrating-emacs-with-x11-clipboard-in.html
.viper
几乎所有 vim 所做的事情都可以在 emacs+vimpulse 中轻松完成(如果不是相同的方式),但反之则绝对不行!
ps 上面的大部分建议都被最近的 vimpulse 默认支持。
Emacs+vimpulse is awesome, but I think its right workflow is to liberally use emacs commands in combination to vim shortcuts.
For example, emacs's macro shortcut F3 and F4 is easier than vim's qq and @q .
Also emacs commands are accessed through Alt+x, not : commands. Though vimpulse support a few important vim commands, they are there just for compatibility.
Followings are my vimpulse specific customizations.
.emacs
If you like terminal, you can use emacs -nw. In this case, this clipboard add-on is useful. http://www.lingotrek.com/2010/12/integrating-emacs-with-x11-clipboard-in.html
.viper
Almost everything vim does can be as easily done (if not the same way) in emacs+vimpulse but definitely not vice versa!
p.s. most of the suggestions above are supported by recent vimpulse BY DEFAULT.
你总是可以在 shell 缓冲区中启动 vim 并调整它的大小以使其填充整个框架?
You could always start vim in a shell buffer and resize it so it filled the whole frame?
如果您想要 VIM 功能,那么安装 VIM 更有意义!
If you want VIM functionality, it makes more sense to just install VIM!
我不确定我是否回答了你的问题,因为并不完全清楚你在问什么(为什么宏不起作用,或者哪些调整可用于在 emacs 中模拟 vim)
那么,这是你的问题吗?:
如果是,您可以尝试所述解决方案。
我从 emacs wiki 获得此信息,这是一个已知的错误。
I'm not sure if I answer your question, as it is not entirely clear what you are asking (why the macro's are not working, or which tweaks are available for emulating vim in emacs)
so, is this your problem?:
if it is, you can try the stated solution.
I got this information from the emacs wiki, and it's a known bug.
你可以在客户端服务器模式下运行VIM,然后你就可以有两个窗口连接到一个实例,从而消除了对 Emacs 的需要。
You could run VIM in client server mode, then you could have two windows connecting to one instance, hence removing the need for Emacs.