From d38df4805e2c4b2a7b8aeee6e53d557bef5d67e3 Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Sat, 22 Nov 2014 18:10:49 +0100 Subject: added a buffer session module (session.tes) This is a simple and straight-forward implementation of buffer sessions in SciTECO. A session is merely a SciTECO script that opens files when executed (and restores properties). The current session is identified by this script's filename in Q-Register "session.path": ~/.teco_session by default. Users may set "session.path" to manage different profiles. An abstraction of session "names" is not provided. Users are expected to hack these on their own. For the common task of having one session per profile, the "session.git" macro is provided. It set's up the current session relative to the current Git repository. This will create ".teco_session" files in the root of Git repositories, that may be added to a global ignore pattern (or they may even be versioned!) --- teco.ini | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) (limited to 'teco.ini') diff --git a/teco.ini b/teco.ini index 498bb67..759124e 100644 --- a/teco.ini +++ b/teco.ini @@ -4,13 +4,18 @@ EMQ[$SCITECOPATH]/color.tes :EMQ[$SCITECOPATH]/colors/terminal.tes -! Load lexer library ! +! Load lexer and buffer session libraries ! EMQ[$SCITECOPATH]/lexer.tes +EMQ[$SCITECOPATH]/session.tes -! Automatic lexing using ED hooks ! +! Uncomment to use a separate session per Git repository ! +! M[session.git] ! + +! Automatic lexing and session management using ED hooks ! @#ED{ Oadd,edit,close,quit !add! + ! Add code here to execute when a document is added ! M[lexer.auto] ! Set up margins ! 33ESTEXTWIDTH9U.w @@ -21,13 +26,16 @@ EMQ[$SCITECOPATH]/lexer.tes !edit! ! Add code here to execute when a document is edited ! + Oend !close! ! Add code here to execute when a document is closed ! + Oend !quit! ! Add code here to execute when SciTECO quits ! -} + M[session.save] +!end!} 0,32ED ! Keyboard macros ! @@ -35,8 +43,13 @@ EMQ[$SCITECOPATH]/fnkeys.tes ! Uncomment to enable default keyboard macros ! ! 0,64ED ! -! open all files specified on the commandline ! -[.f - <:L;R 0X.f EBQ.f EB L> -].f --EF +! open all files specified on the commandline + If no file is specified, load the last buffer session ! +Z"= + M[session.load] +| + [.f + <:L;R 0X.f EBQ.f EB L> + ].f + -EF +' -- cgit v1.2.3