I forgot to post how I use vim as an external editor for J session.

In edit > configure > startup > open, and add these lines

externedit_j_=: 3 : 0
spawn=. 2!:1
fn=. LF -.~ 2!:0 'mktemp'
smselact_jijs_''
pos=. {. smgetsel_jijs_''
(<fn) 1!:2~ 8&u: txt=. smread_jijs_''
ln=. 0 >. +/ LF = pos {. txt
NB. change this line for your own choice
NB.   spawn 'gvim -f -c":set filetype=j | syntax on" +', (":>:ln),' "', fn, '"'
  spawn 'xterm -e vim -c":set filetype=j | syntax on" +', (":>:ln),' "', fn, '"'
smwrite_jijs_ 1!:1 <fn
1!:55 ::0: <fn
smscroll_jijs_ ln
smsetselect_jijs_ (pos+0,0),1
smfocus_jijs_''
)

then edit > configure > fkeys > add,  
function key: f5
output: quiet
label: External Editor
Code: externaledit_j_ 1

Then you can open a ijs window, and press f5 to edit using an external
editor.

It also works for window but requires the task package to replace 2!:1,
and roll your own tempfile instead of mktemp

-- 
regards,
====================================================
GPG key 1024D/4434BAB3 2008-08-24
gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3
唐詩252 西鄙人  哥舒歌
    北斗七星高  哥舒夜帶刀  至今窺牧馬  不敢過臨洮
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to