I spend some time this weekend looking into the completion features of VIM. Using the omnicomplete feature that VIM 7 offers and well produced ctags you should be able to get intellisense-like completion. However the ctags for JavaScript is made for plain JavaScript and not for the kind of JS we tend to write. I.E. it doesn't parse something like:
var Cat = new Class({
foo: function() { alert("meow!"); }
});
So I started investigating into producing a better ctags to be used by vim. Figures the basic ctags format is pretty simple. It consists of rows with tags, filenames and regexpressions to find them. However the cool features you get with the optional tags specified in exuberant ctags.
George V. Reilly has some sort of solution to the problem by using regular expressions. However that only produces the regular tags without any special class structures, etc. And class structures I pretty much believe can't be done with simple regular expressions. However this might prove useful as a start:
--regex-JavaScript=/([A-Za-z0-9._$]+)[ \t]*[:=][ \t]*\{/\1/o,object/
--regex-JavaScript=/([A-Za-z0-9._$'"()]+)[ \t]*[:][ \t]*function[ \t]*\([^)]*\)/\1/f,function/
--regex-JavaScript=/([A-Za-z0-9._$]+)[ \t]*[:=][ \t]*\[/\1/a,array/
--regex-JavaScript=/([^= ]+)[ \t]*=[ \t]*'[^']*'/\1/s,string/
--regex-JavaScript=/([^= ]+)[ \t]*=[ \t]*"[^"]*"/\1/s,string/
Once I have time, I think I will start extending the C-based JavaScript ctags parser to understand our internal JavaScript syntax. This way we at some point should be able to produce kick-ass ctags files that will make VIM a competition for aptana and other JavaScript editors.
Did you ever do anything for this? I want to have ctags support for vim using the prototype js lib but have not seen anything around.
Posted by: Kiran Prasad | 06/07/2010 at 08:05 AM
Yeah, even as my own grandpa ( who was a tough fella - the man was a freewheeling driver, a war veteran that further along delved deep into all the Castaneda Toltec miracle stuff ), probably would have expressed: "I don't need to believe the details, or even understand anything at all with regard to this issue, in order to have an opinion". Allow me to express the very same thing having gone through your pieceג€¦ I'm not 1 / 2 as tough as my grandfather (and still I used to be his favourite grand daughter) plus having worked for 4 uninspiring years at Hitachi (nerd that I am) Making drivers and driver updates for "the man", left me with a positive fascination with "guru" types who are keen about their fields of interest. Thanks a ton for the decent read. Will certainly make an attempt to read more about "the facts" well before I'm able to present an opinion.
Posted by: Matshita | 03/30/2011 at 06:51 PM
an additional info for using javascript, especially for newbies like me
Posted by: misty | 08/17/2011 at 10:30 AM
AeEstj [url=http://redlandsliving.com/]penny auctions[/url] taotyQe
sAcjqk penny auctions clcdcjZ
cveqhj [url=http://paulchristenbury.com/]make money online[/url] XqiiAcd
RZupEj make money online sjEccRc
Posted by: obeboobby | 01/12/2012 at 10:01 AM