Any help greatly appreciated...Larry Gagnon
> I am a newbie to tcl/tk but love it so far. Am using Windows 95 with
> gVIM as my editor. So far I have been editing my code with gvim then
> pasting it into the wish shell. Is there any way I can call the
> interpreter from within vim and it would highlight the first or all
> errors???
I think something like this will do, just s/ruby/tcl:
function ExecRuby()
w! /tmp/ruby_input
!ruby /tmp/ruby_input > /tmp/ruby_output 2>&1
10 sp /tmp/ruby_output
set nonumber
wincmd w
endfunction
map <C-P> :call ExecRuby()<CR><CR><CR>
More preffered way (i think) is just to update tcl script (from within
Vim) and then [source] it from wish.
PS: AFAIK vim6.0 for win32 has dynamic tcl support.
You can extend vim using tcl!
--
"Linux poses a real challenge for those with a taste for late-night
hacking (and/or conversations with God)."
(By Matt Welsh)
proc evalBuffer {} {
set buf $::vim::current(buffer)
set win $::vim::current(window)
set script [$buf get top bottom]
set interp [interp create -safe]
interp share {} vimout $interp
interp share {} vimerr $interp
interp share {} stdout $interp
interp share {} stderr $interp
if {[catch {$interp eval [join $script \n]} error]} {
# something went wrong
puts vimerr $error
# Parse ::errorInfo here to determine line number
# hint [regexp] on each line will allow you to find the proc and
line
}
interp delete $interp
}
This works for simple scripts, and does everything in a safe
interpreter, to minimize the amount of damage your untested script could
do. The standard channels have to be shared with the child interpreter,
but stdin isn't supported by the embedded Tcl in Vim. For a full
functional Tcl interpreter, I would recommend using the approach
described by Max Ischenko.
I am a newbie also and I use textpad as my editor,
http://www.textpad.com/
under congigure->preferences->tools you can add all sorts of tools. then
from the tools menu select the one you want.
Very handy.
Larry K.