merci à Roman pour cette contribution — Fred Radeff 2008/04/14 14:07
j'utilise stata-se en mode console (pas xstata-se) et je me suis crée un script ( ev. à améliorer) qui me permet d'utiliser vim au lieu de l'éditeur standard de xstata (pas de highlight syntax) pour envoyer des lignes de commandes directement à stata-se. Finalement, c'est rien d'autre que d'envoyer des commandes d'une console à autre. vous remarques sont bienvenues: ouetech[at]lohnstudie[dot]ch ******************* Put in your .vimrc: " your MAP list map <F8> : w! $HOME/tmp.do<CR>:!$HOME/bin/do.sh<CR>:<CR> " this key-map will write stata-syntax or a part of it if selected in visual mode from the active buffer to the file named tmp.do and execute it through do.sh in the stata-konsole launched before with shell-script st10.sh below st10.sh launches stata-se and writes its konsole identifiers to the file do.sh which will be executed by the vim key-map F8 above: ****st10.sh********************************************************* #!/bin/bash # see this tutorial to understand dcop # When there is more than one application/object, which one should you use? Got a reference? # http://docs.kde.org/stable/en/kdebase-runtime/userguide/kde-diy.html # open new konsole and get konsole identifier konsole=$(dcopstart konsole-script) # get session identifier session=`dcop $konsole konsole currentSession` # rename session to STATA dcop $konsole $session renameSession STATA10 # define color shema (save your own or look for in list : konsole --schemas) dcop $konsole $session setSchema WhiteOnBlack.schema # write down shell script do.sh which afterwards will be executed by Vim in order to send selected syntax via tmp.do to stata-konsole (see below) echo "dcop $konsole $session sendSession 'do ~/tmp.do'">$HOME/bin/do.sh # allow execution chmod u+x $HOME/bin/do.sh # finally start stata in the identified terminal dcop $konsole $session sendSession 'stata-se -q' # for other editors or OS see: # http://fmwww.bc.edu/repec/bocode/t/textEditors.html#integrate # http://huebler.blogspot.com/2005/03/integrating-stata-and-external-text.html ****st10.sh*********************************************************