0

The screens plugin turns vim into a kind of dreampie, only its a whole lot better because you have more control over what gets send even when you have multiple buffers and specific text within those buffers.

To follow my environment setup, merely install screens with vim, and then at the command line, do screen, reach the shell, then type vim in. Edit a shell script of some kind with it, then do :ScreenShell *shell type here, eg python/bash/irb* which spawns a shell below. You can use :ScreenShellSend to send the visually selected text to the shell or all of the file if none is selected.

My problem is, say I want to restart the shell that I'm running using this plugin and sending it some text. I need to do :ScreenShellFocus, call exit, and then start it up again. But then I need to be able to return to the same vim session that is directly above the shell that I'm affecting. I realize that I can use screen to just reach the vim session, but the only way I can do that now is to select it with ^a 1, which really only replaces the lower portion, the one that supposed to be the shell, with the vim buffer being edited. This is stupid because now you have vim buffer on top of vim buffer.

So my question is, how do I return the cursor to the vim session above after doing :ScreenShellFocus?

(yes I know my example of killing and restarting a shell may be circumvented by other logic, but I'm not that acquainted with the GNU screen util, and I think there's a way to do it like this, which I think preserves the workflow of the programmer)

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
Adam Miller
  • 1,756
  • 1
  • 25
  • 44

1 Answers1

0
<C-a><Tab>

is the mapping used in screen to cycle through "regions". Since you have only two, it moves the focus to the other region.

Since you are effectively using screen, you should learn how to use it to make this plugin really useful.

$ man screen
romainl
  • 186,200
  • 21
  • 280
  • 313