I have a problem that I hope someone may have a nice solution to.

I've been developing a bash function called tvim, which combines vim and
tmux in a way that suits my workflow nicely. There is a single vim pane
that gets created (and re-created) on demand.

    +---------------+----------------+
    |               |                |
    |               |                |
    |               |                |
    |               |                |
    | bash          | vim            |
    +---------------+----------------+

When I run 'tvim file.c' in bash, this basically runs:

   tmux send-keys -t $TVIM_PANE_ID ':e file.c' enter

TVIM_PANE_ID is an environment variable that gets created/updated when
ever the vim pane is created/recreated.

    +---------------+----------------+
    |               |                |
    | bash-B        |                |
    +---------------+                |
    |               |                |
    | bash-A        | vim            |
    +---------------+----------------+

Now the problem occurs if I split the bash window further. I need
some way for bash-B to also know about $TVIM_PANE_ID.

Ideally, I'd like to be able to query the value of TVIM_PANE_ID from
any pane in that particular window.

Note that there may be a tvim pane in multiple windows, so this needs
to be local to the window, not a global setting.

Is there some way to do this using tmux functionality?

I can think of various ways involving temporary files or sqlite
databases, but these are all a bit clunky and cumbersome.

So far this whole tvim system is just bash functions, with no
external dependencies. I'd really like to keep it that way if possible.

Any ideas would be greatly appreciated.

Cheers,
Steve


ps. the code is here if anyone's interested
     https://github.com/sdt/tmux-vim

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users

Reply via email to