Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!cpqhou!jww From: jww@cpqhou.uucp (Jeff Wolford) Newsgroups: comp.editors Subject: Vi: Macro Challange... tags..^].. one better Message-ID: <1991Jan26.213324.29463@cpqhou.uucp> Date: 26 Jan 91 21:33:24 GMT Organization: Compaq Computer Corporation Lines: 51 Here is the simple challange: First I want to be able to create a key just like ^] only that it uses the W definition of a word instead of w... Q: ie how do you yank a word (yW) and have it spit back out after a ":ta " is typed... given that I want to be able to map it to a key... NOW for the REAL challange: Given this I might be able to get the following (which is really what I want...) to work.. 1 - I have a tag file that has several entries that are the same but point to different files and different locations, what I would like to do is have it so that when I type ^] on a variable in a file, it looks in the tag file and then goes to the file where that variable is changed, (ok, so far the standard ^] works just fine). But, since a variable can be changed in more than one routine, I have the variable name listed several times in the tag file (yes all sorted, and I have the script to generate it).... But when I type ^] again I want vi to "tag" to the second entry in the file and then the third ..fourth..etc and finally back to the first Yes I have the ability to add a _1 ... _9 to the tag entry name to make each tag unique, but would prefer that it be a postpend so that all the entries are together after they are sorted... My Thoughts: I figure that if I can get a macro that takes the current word (with W definition), yank it and put it after a :ta pW, I can force a _1 after the yanked word... and then change the variable that has the _1 to a _2...etc and would be ready for the next invocation and if I don't find the tag, set it back to _1... Jeff Wolford uunet!cpqhou!jww Compaq Computer Corp (713) 374-9465 #include -- Jeff Wolford uunet!cpqhou!jww Compaq Computer Corp (713) 374-9465