You are not logged in.
Pages: 1
I use xmonad, urxvt, and vim for development, but there is no session saving such as in geany or kate. Is there any way I can open a project one file at a time, save a session, reboot, and then open the same session with a few commands and not one (file) by one? I'm perfectly fine with any level of hackishness .
urxvtc / wmii / zsh / configs / onebluecat.net
Arch will not hold your hand
Offline
In vim, run
:help mksession
archlinux - please read this and this — twice — then ask questions.
--
http://rsontech.net | http://github.com/rson
Offline
I use xmonad, urxvt, and vim for development, but there is no session saving such as in geany or kate. Is there any way I can open a project one file at a time, save a session, reboot, and then open the same session with a few commands and not one (file) by one? I'm perfectly fine with any level of hackishness
.
Do an initial
:mksession
and save the file (usually "Session.vim") at some suiting place.
To save later editing sessions I did set up a keybinding for this in my .vimrc:
" --- Define a session save shortcut ---
:map <C-F12> :wa<Bar>exe "mksession! " . v:this_session<CR>
Afterwards reopen the session with
vim -S <where-your-Session-file-was-saved>
Last edited by bernarcher (2009-09-10 07:17:41)
To know or not to know ...
... the questions remain forever.
Offline
Thanks for the quick replies, but mksession only handles one vim instance, I often have five or six open at a time
in multiple windows. I'm sorry If I didn't phrase the question correctly.
I coded a simple script to open/load vim sessions, but it would be nice if there is a better solution.
#!/bin/bash
SESSIONLIST=""
SESSIONLIST=$(cat /etc/vs.save)
if [ $1 == "add" ] && [ $2 ]
then
SESSIONLIST="$SESSIONLIST $2"
echo $SESSIONLIST > /etc/vs.save
urxvtc -e vim $2
elif [ $1 == "load" ]
then
for i in $SESSIONLIST
do
urxvtc -e vim $i
done
fi
Last edited by Lexion (2009-09-10 11:43:39)
urxvtc / wmii / zsh / configs / onebluecat.net
Arch will not hold your hand
Offline
If I understand properly, you do want to run some sort of "project" which consists of several vim instances each running in its own urxvt window. In that case I too have no better idea than your script.
But I vaguely remember there are some project/ide vim scripts out there. Did you search the Vim Scripts database for these?
Most a designed to run one single vim instance, however. But one or two of them were outside scripts which provided multiple vim instances.
Sorry to be of no better help. It is quite some time ago, I had a look at vim IDEs.
To know or not to know ...
... the questions remain forever.
Offline
@Lexion:
albeit i have no clue whatsoever about how to, I suppose you could write some script for vim to be aware of other vim instances and communicate with them.
good luck
cheers Barde
Offline
Pages: 1