okay, i used Vim for years, and I really really love her. i'm a script-
writer,
so i want to create everything with vim-script, it's wonderful, i
know, but
need improved. i think add these feature are very simple(i will give
the
reason), and these can make a revolution to script-writer!! it's
worth to read it, i swear. just take you several minutes.
1. interaction with other application
yes, the first big problem!! Vim has Unix-traditional isn't it? so
it
should have the philosophy Unix have: just mix tools for you, not
a
stiffness program. now Vim CAN interaction with other program,
yes,
through perl, python, ruby, tcl, netbeans, etc. i know. but i
haven't
study either of above, let's face the readlity: why not afford a
interface
in the Vim-script? it not hard, because we always have cscope-
connect()
function. just add some bulit-in function below:
executable({expr})
yes! we just have this function yet!!
isconnect({expr})
return whether a program has connected to program. it can
replace
cscope_connect. if expr is a number, it's the pid of
program, and
if it's a string, it's the name of program.
connect({expr})
connect Vim and a program, that is, Vim run it, and if it
wait for
input, let it wait, untill kill it or give it input it
want. this
function return the pid of program returned. expr use for
string,
it's the name of program to run, program must be in $PATH.
kill({expr}[,{sid}])
to kill a connected program has pid or name of {expr}
(just like
the {expr} parameter of isconnect() ), and if has
{sid},
just send a signal {sid} to program.
sendto({expr}, {data}[,{varname}])
the most important function!! send data to the connected
to the
program of {expr} (just like the {epxr} parameter of
isconnect()).
treat data as string, and if expr is a list, treat this
list a
multi-line text(just like setline() ).
if didn't get varname, this is a synchronization
operation,
function will wait till the connect-program sendback the
response,
and the return value is the response, string. but if set
the
varname, the operation is async, the result will save in a
variable named varname, if responsed.
if has any error, put error-code to v:connect_error (just
like
v:shell_error), and return empty (if it's a async, set
variable
named varname to empty, too)
just five function (one of it has implement yet), Vim-script can
interaction
with other program. it's easy, isn't it?
2. more powerful autocmds
Timer Support:
first we can add timer support. just two command, settimer and
killtimer. it can raise Timer autocmd, e.g. :settimer 1s, 1
will set
a timer, that raise Timer autocmd per 1 second, and the Timer
id is 1,
and :killtimer 1 will kill the timer. may be a function named
hastimer({expr}), expr use to id, and return whether the timer
exists.
timer will be very useful, it can detect whether the operation
takes a
long time, and can used in game, it's a paltform-specified, so
add it
as a timer will be good, and if it slow, just can add a option
'enabletimer' 'ent' to disable/enable it.
buffer-modified detect:
maybe can add a autocmd BufModfied, <aopera> is the operation,
'a'
add, 'd' delete, 'm', modified, etc, and <amatch> is the text
of
modified (or other ways, all in all, just afford a way to
detect
wthether the buffer changed), it useful to make on-the-fly
plugin, and
if choose a right way to implement, it may be very simple. and
maybe
another autocmd BufModfiedI, raised in modified operation in
insert
mode. it's very simple, but it's powerful.
thanks for reading, I'm a programer, I think to add these feature
isn't very
hard, but they are useful, isn't it? I'm in my third year of collenge,
i study
compuer science. so if nobody want to implement it, i want to try,
just hope
anyone can support me!
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---