Trigger global forechange event on region change.
[screen-lua.git] / incoming / howto / emulate_vims_help.txt
blobb7e3c3f4dcbb0640eeb481531e045cfc24dee123
1    Date: Mon, 7 Apr 2003 02:01:59 +0000 (UTC)
2    From: Miciah Dashiel Butler Masters <gcgs-gnu-screen@m.gmane.org>
3 Subject: Re: HOWTO: emulate vim's :help in a screen window
5 In article <20030406193514.4b43c6ba.mramos@adinet.com.uy>, Marcelo Ramos wrote:
6 > Something interesting and useful developed with Miciah's help a few minutes
7 > ago in the #screen channel (irc.debian.org):
8
9 > 1) Create a shell script "showman": 
10
11 >       echo -n "What manpage?"; read X; man $X; screen -X eval 'focus bottom' remove 
12
13 > 2) Put the following in your.screenrc: 
14
15 >       bindkey "^B" eval split "focus bottom" "screen /path/to/showman" 
16
17 > 3) Now press ^B and enjoy :-)
18
19 > (^B or the key you prefer)
21 You inspired to write a couple of scripts to generalise this process:
23 screen-run-program-in-region:
24     #!/bin/sh
25     
26     eval "$*"
27     echo -n Press any key to close this region...
28     read throwaway_variable
29     screen -X eval 'focus bottom' remove
31 screen-open-region-with-program:
32     #!/bin/sh
33     
34     screen -X eval \
35         "focus bottom" \
36         split \
37         "focus bottom" \
38         "screen screen-run-program-in-region $*"
40 Note that enabling zombie-mode will interfere with this script's
41 operation -- to kill the zombie window, screen-run-program-in-region
42 would need to also send Screen the 'kill' command. Unfortunately, if you
43 _disable_ zombie-mode then the 'kill' command would probably kill a
44 program that you _don't_ want killed.  This is why we need a per-window
45 zombie-setting (*nudge* *nudge*). A way to silence the kill command
46 would also be nice.
48 BTW, I know that 'echo -n' is not portable. Please forgive me. You can
49 feel free to remove the '-n'.
51  -- Miciah <miciah@myrealbox.com>