You are not logged in.
Pages: 1
Topic closed
Hello,
I have recently come across a very cool Firefox extension, called Mozex, which allows you to use external programs to do a number of actions, including editing text areas. So I was planning to use Vim to edit all the text areas (I think it's very cool). Now, my current Window Manager is Ratpoison, and I would like to open up Vim in an existing urxvt terminal (so, I don't have to bother specifying all the settings I have indicated in .ratpoisonrc again, and have two terminals open). I also use GNU Screen, so I would like Vim to be opened in a new Screen session. In short I need to open Vim in a new Screen session in an existing urxvt terminal.
I am currently using Gvim to write this, but I would much prefer to use a terminal instead, do you think that would be possible?
Thanks for your time
Last edited by finferflu (2007-10-25 14:58:01)
Have you Syued today?
Free music for free people! | Earthlings
"Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away." -- A. de Saint-Exupery
Offline
Hi,
I don't now how to start a new screen session in an existing terminal other as from the same terminal itself - but if you have an already running named screen session:
% screen -S mysession
you can open a vim instance in this particular screen session from any other script/terminal/you name it by using:
% screen -S mysession -X exec vim
Maybe this in combination with the "It's All Text" [1] firefox extension could give you what you want.
[1]https://addons.mozilla.org/de/firefox/addon/4125
Last edited by chimeric (2007-10-25 13:12:50)
Offline
hi,
try something like:
"urxvt -c screen -dRR -S vim /usr/bin/vim"
for more details -> man screen.
vlad
ps: i don't thnk there is a way to open in an existing urxvt terminal. if yes i would also be interested.
Last edited by DonVla (2007-10-25 13:16:15)
Offline
@ chimeric
That command seems to work only from within a Screen session, but I need to run a command externally, namely from Mozex.
The Mozex extension does exatly what It's All Text does, and even more.
@ DonVla
Your command detaches the current Screen session and reattaches it to a new terminal, I think it's too messy. Also I have specified all my options for urxvt in .ratpoisonrc and I don't want to type them in every time. If I'll need to open a new window it's more convenient for me to keep using Gvim.
Thank you both for your help so far
Last edited by finferflu (2007-10-25 13:43:12)
Have you Syued today?
Free music for free people! | Earthlings
"Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away." -- A. de Saint-Exupery
Offline
@ chimeric
That command seems to work only from within a Screen session, but I need to run a command externally, namely from Mozex.
The Mozex extension does exatly what It's All Text does, and even more.
Hmmm, strange ... I tested it here on a headless server as follows and it's working for me:
# start a new screen session in terminal
Screen -S mysession
# detach session
# run that anywhere else
screen -S mysession -X exec vim
# attach screen session and vim is waiting for me
I'll give it another try when I am at home later today...
Offline
urxvt -c screen -x -S vim /usr/bin/vim
That will open the other screen session in a new urxvt... I don't quite understand yet why you want it in your old screen session, though. I figure you'd just want urxvt -c vim. When you're done you can :wq and move on. You really want to edit the file, quit vim, detach the screen session, exit urxvt every time you edit a text box online?
You have a different workflow than I do.
Offline
@ chimeric
I think you're right. I don't know what I did before, but it was not working. So I gave it another go this time, and it's actually working quite well. It's exactly what I needed, invaluable help, since I couldn't find this by googling extensively. Thanks a lot!
@ codemac
What I need is only one terminal open. I keep a terminal running Screen always open, and I don't want to have too many windows opening, especially while using Ratpoison. So, the only way of having multiple "tabs" in an urxvt terminal is by using Screen.
By the way, is there any way I can set the default session name in .screenrc?
Last edited by finferflu (2007-10-25 14:52:25)
Have you Syued today?
Free music for free people! | Earthlings
"Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away." -- A. de Saint-Exupery
Offline
@ chimeric
I think you're right. I don't know what I did before, but it was not working. So I gave it another go this time, and it's actually working quite well. It's exactly what I needed, invaluable help, since I couldn't find this by googling extensively. Thanks a lot!
np - I am glad I could help .
By the way, is there any way I can set the default session name in .screenrc?
Not that I know of - however - I think that would get in your way solving your idea anyway - well - unless you intend to only have one screen session ever - because screen allows you to start more session with the same session name.
screen -list
There are screens on:
25998.chi (Detached)
26652.chi (Detached)
26659.chi (Detached)
The aforementioned command to execute vim inside one of these session would then require to use the full session identifier ie:
screen -S 25998.chi -X exec vim
Anyway - a simple way to set a default session name would be to set an alias in the .rc file of your preferred shell:
alias newscreen="screen -S defaultsession"
Offline
Yes, I thought about the alias, but I was wondering what would have happened if I opened a new screen session, using the alias, but you have answered my question. Anyway, I was thinking that I usually open a new screen session only by mistake. One should be enough. Thanks for your help
Have you Syued today?
Free music for free people! | Earthlings
"Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away." -- A. de Saint-Exupery
Offline
If you want your screen session to open vim in a new screen window (in an already-running screen session) editing a specific file you can do the following:
screen -S mysession -X screen vim ~/.vimrc
where "mysession" is the name of your vim session (which you can specify by starting screen with "screen -S mysession", and "~/.vimrc" is the location of the file that you want to edit.
This means that if you're running a program like "top" for instance, it won't try to load vim on top of top (like my mac just tried to do using the -X exec method and went all crazy).
Now It's time for me to see if I can get pentadactyl (vimperator branch (firefox plugin)) to do exactly this for it's external editor feature.
Last edited by matt.woelk (2011-02-12 03:01:17)
Offline
If you want your screen session to open vim in a new screen window (in an already-running screen session) editing a specific file you can do the following:
screen -S mysession -X screen vim ~/.vimrc
where "mysession" is the name of your vim session (which you can specify by starting screen with "screen -S mysession", and "~/.vimrc" is the location of the file that you want to edit.
This means that if you're running a program like "top" for instance, it won't try to load vim on top of top (like my mac just tried to do using the -X exec method and went all crazy).
Now It's time for me to see if I can get pentadactyl (vimperator branch (firefox plugin)) to do exactly this for it's external editor feature.
Yes, let's all find 3+ year old threads and bump them by providing EXACTLY the same information which has already been provided initially....
Closing. Don't do that again.
Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.
Offline
Pages: 1
Topic closed