无法在屏幕中有效使用分割

发布于 2024-07-18 08:53:19 字数 425 浏览 3 评论 0 原文

我在 Emacs 中通过 Cs 搜索了 Screen 的信息手册,但没有成功。 我无法一次搜索所有节点。

我可以在屏幕中创建分割

C-a S 

,在它们之间移动

C-a TAB 

并关闭它们

C-a X

但是,我无法在它们上启动任何内容。 我现在有两个相同的窗口,分为两个部分。

我想在其他 split 中启动一个新会话,类似于 Vim 中的

:args newFile

How can you start a new session in the secondary split?

I searched unsuccessfully Screen's info manual in Emacs by C-s. I was not able to search all nodes at once.

I can create a split by

C-a S 

in Screen, move between them by

C-a TAB 

and close them by

C-a X

However, I cannot launch anything on them. I have now two same windows in two splits.

I want to start a new session in other split, similarly as in Vim by

:args newFile

How can you start a new session in the second split?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

好听的两个字的网名 2024-07-25 08:53:19

Ca c 将在当前分割中创建一个新的屏幕窗口。

您还可以在屏幕中执行命令,方法是键入 Ca :,然后键入命令,然后按 Enter 键。 然后你可以做与你所描述的类似的事情:

:screen vi look-a-new-screen-window-started-with-vi.txt

另外,由于你可能习惯了 Vim 的窗口移动键,请尝试将 Ca j 绑定到移动到下一个拆分和 Ca k 向上移动到上一个分割,就像 Vim 的 Cw jCw k 一样。 在您的 .screenrc 中:

bind j focus down
bind k focus up

当我共享屏幕内容时,这里有一个方便的位可以添加到您的 screenrc 中,以便在底部为您提供一个漂亮的状态栏,显示所有屏幕窗口,并突出显示当前窗口:

hardstatus alwayslastline "%{k}%-w%{.kY}%n %t%{-}%+w %= %H: %l %d/%m %c"

使用Ca A重命名窗口。

C-a c will create a new screen window in the current split.

You can also execute commands in screen by typing C-a : and then the command, then Enter. Then you could do something similar to what you're describing:

:screen vi look-a-new-screen-window-started-with-vi.txt

Also, since you might be used to Vim's window-movement keys, try binding the C-a j to moving to the next split down and C-a k to move to the previous split upward, just like Vim's C-w j and C-w k. In your .screenrc:

bind j focus down
bind k focus up

While I'm sharing screen stuff, here's a handy bit to add to your screenrc to give you a nice status bar at the bottom showing all of your screen windows with the current one highlighted:

hardstatus alwayslastline "%{k}%-w%{.kY}%n %t%{-}%+w %= %H: %l %d/%m %c"

Rename a window with C-a A.

无法回应 2024-07-25 08:53:19

Ca c 创建一个新窗口(并立即切换到该窗口)
Ca w 列出窗口
Ca 和用于切换窗口的窗口号。

您可以使用 screenrc 文件更改默认键绑定,但我不认为您可以将多个命令绑定到单个按键。

但是,如果您正在使用一组通用的屏幕,则默认情况下您可以让屏幕以已打开的屏幕(并运行您想要的任何程序)启动。 查看 dotfiles 上的 screenrc,了解一些很棒的提示。

一个简单的 ~/.screenrc 用于让屏幕自动打开几个会话(拆分如下)

screen -t vim vim
split
focus down
startup_message off
screen -t home

这将打开两个拆分的屏幕会话,第一个名为 vim (运行 vim),第二个名为 home,只是等待使用正常的 shell 提示符。

您可以通过 screen -c nameOfYourScreenRC 使用不同的 screenrc 文件,因此,如果您想要使用不同的 screenrc 文件来设置 vim 会话和 gdb 会话,您只需执行 screen -c gdbscreenrc 如果您设置了适当的文件。

C-a c to create a new window (and immediately switch to that window)
C-a w to list windows
C-a and a window number to switch windows.

You can change default keybindings using a screenrc file, but I don't think you can bind multiple commands to a single keypress.

However, if there's a common set of screens that you're using you can get screen to start with these already open (and running whichever programs you want) by default. Check out the screenrc's on dotfiles for some great tips.

A simple ~/.screenrc for getting screen to automatically open a couple of sessions (with a split is as follows)

screen -t vim vim
split
focus down
startup_message off
screen -t home

Which will open two screen sessions with a split, the first named vim (running vim) and the second named home, just waiting with the normal shell prompt.

You can use different screenrc files with screen -c nameOfYourScreenRC, so if you wanted a different screenrc file to set up a vim session and a gdb session you could just do screen -c gdbscreenrc if you'd set up the appropriate file.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文