简体   繁体   English

emacs nw 模式,调整大小拆分 window

[英]emacs nw mode, resize split window

I'm interested how can I resize split windows in emacs when I'm in console mode?我很感兴趣,当我处于控制台模式时,如何在 emacs 中调整拆分 windows 的大小?

I opened my file with:我打开我的文件:

emacs myfilename.txt -nw

now when I split my window with:现在,当我将 window 拆分为:

C-x 2 

or或者

C-x 3

how can I resize new windows?如何调整新 windows 的大小?

Try Mx enlarge-window and Mx shrink-window .试试Mx 放大窗口Mx 缩小窗口

You can specify the number of lines by which to enlarge or shrink with the prefix argument, eg to enlarge a window by six lines, type:您可以使用前缀参数指定放大或缩小的行数,例如将 window 放大六行,输入:

Cu 6 Mx enlarge-window Cu 6 Mx 放大窗口

By default enlarge-window is bound to Cx ^ .默认情况下enlarge-window绑定到Cx ^ shrink-window is not bound to any shortcut by default, but you can use a negative prefix argument with Cx ^ to get shrinkage.默认情况下, shrink-window不绑定到任何快捷方式,但您可以使用带有Cx ^的负前缀参数来获得收缩。

So you could get the same effect as above by typing:因此,您可以通过键入以下内容获得与上述相同的效果:

Cu 6 Cx ^ (enlarge) Cu 6 Cx ^ (放大)

Cu - 6 Cx ^ (shrink) Cu - 6 Cx ^ (收缩)


A special case is the horizontal split where you have additional keyboard shortcuts available for embiggening or shrinking the windows:一个特殊情况是水平拆分,您可以使用额外的键盘快捷键来扩大或缩小 windows:

Cx } is bound to enlarge-window-horizontally Cx }必然会enlarge-window-horizontally

Cx { is bound to shrink-window-horizontally Cx {必然会shrink-window-horizontally

Again, you can use prefix arguments to specify the amount (ie, number of columns) you want to enlarge/shrink the windows with Cu同样,您可以使用前缀 arguments 来指定要放大/缩小 windows 与Cu的数量(即列数)

If you split window vertically with Cx 2 , use Cx ^ and Mx shrink-window .如果您使用Cx 2垂直拆分 window ,请使用Cx ^Mx shrink-window If you split horizontally with Cx 3 , use Cx { and Cx } to enlarge and shrink.如果您使用Cx 3水平分割,请使用Cx {Cx }放大和缩小。

In addition to shrink-window and enlarge-window, you can also use enlarge-window-horizontally and shrink-window-horizontally.除了收缩窗口和放大窗口,您还可以使用水平放大窗口和水平收缩窗口。

Personally I bind these like this:我个人像这样绑定这些:

(global-set-key (kbd "A-<down>") 'enlarge-window)
(global-set-key (kbd "A-<up>") 'shrink-window)
(global-set-key (kbd "A-<left>") 'enlarge-window-horizontally)
(global-set-key (kbd "A-<right>") 'shrink-window-horizontally)

Then it's very easy to resize -nw window splits using alt-arrow keys.然后很容易使用 alt 箭头键调整 -nw window 拆分的大小。 Also you can just hold the keys down to repeat the command, I find this easier than having to think about how many repeats I want (ie using Cu 10 etc).你也可以按住键来重复命令,我发现这比考虑我想要多少重复(即使用 Cu 10 等)更容易。

(more info http://www.emacswiki.org/emacs/WindowResize ) (更多信息http://www.emacswiki.org/emacs/WindowResize

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM