Emacs在指定方向移动分割窗口? [英] Emacs move around split windows in a specified direction?

查看:84
本文介绍了Emacs在指定方向移动分割窗口?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在终端Emacs(没有鼠标)中,我使用拆分窗口同时处理多个缓冲区。我发现在分割窗口之间的移动比我在Vim中做的更加痛苦。阅读文档看起来像我正在做的正确( C-x o ),但只是围绕窗口顺时针旋转。如果我移动到相邻的窗口进行快速编辑,我需要在我回到我的位置之前点击 C-x o 几次。有时我不小心按下太多次,不得不重新循环回到窗口。



远离安装还有另一个外部包,有没有什么办法可以直接转到一个窗口(通过一个数字),或至少在相反的方向周围的窗口周围?



在Emacs中,Vim Cw Cw 类似于 Cx o ,但是也可以在指定的方向移动 Cw ARROW 。 :)

解决方案

将此添加到您的init文件中:

 (windmove-default-keybindings)

然后你可以使用 SHIFT + 箭头 移动到指定方向的下一个相邻窗口。



如果您喜欢,可以指定一个不同的修饰符通过传递一个参数(默认为'shift )。



或者只是将你喜欢的任何东西绑定到这些函数中:




  • windmove-up

  • code> windmove-down

  • windmove-left

  • windmove-right



您还可以添加 FrameMove 到混合,使这个工作透明地跨多个框架。



对于编号的窗口导航,有切换窗口。 el


In Terminal Emacs (no mouse), I'm using split windows to work with multiple buffers at the same time. I'm finding moving between the split windows much more painful than how I do it in Vim. Reading the documentation it looks like I'm doing it correctly (C-x o), but that just cycles around the windows in a clockwise direction. If I move to an adjacent window to make a quick edit, I need to hit C-x o a few times before I'm back where I was. Sometimes I accidentally press it too many times in a hurry and have to cycle all the way back through the windows again.

Far from install yet-another-external-package, is there any way I can just either move directly to a window (by, say, a number), or at least cycle around the windows in the opposite direction?

In Vim C-w C-w is like C-x o in Emacs, but there's also C-w ARROW to move in a specified direction... something like that? :)

解决方案

Add this to your init file:

(windmove-default-keybindings)

Then you can use SHIFT+arrow to move to the next adjacent window in the specified direction.

You can specify a different modifier if you prefer, by passing an argument (defaults to 'shift).

Or just bind whatever you like to these functions:

  • windmove-up
  • windmove-down
  • windmove-left
  • windmove-right

You can also add FrameMove to the mix, to make this work transparently across multiple frames.

For numbered window navigation, there's switch-window.el.

这篇关于Emacs在指定方向移动分割窗口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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