Re: [Ctags] File tags and vim: jump to last position.
Brought to you by:
dhiebert
|
From: J.D. L. <ct...@la...> - 2011-10-31 19:48:20
|
If the original post was a request for an option to customize the ex_cmd for file entries, the first bug listed at http://ctags.sourceforge.net/ctags.html#BUGS [5] is relevant: "CTAGS has more options than LS(1)." Adding another seems a step in the wrong direction. For those wants to customize the ex_cmd to a specific vim command "singlequote doublequote" instead of the positioning command "1", confirm that vim is the only consumer of your tag file (not the case in all shops, like mine), then try either of these barely-tested commands: perl -p -i -e 's@^(([^t]+t){2})1;@$1x27";@' tags or perl -F't' -i -ape '$F[2]=s@1;@x27";@' tags On Tue, 25 Oct 2011 16:06:23 -0700, Kaz Kylheku wrote: > On Tue, 25 Oct 2011 22:45:11 +0000, Gary Holloway > wrote: > >> "parser.c" is a tag to the source file itself, hence the tag's "location" is line 1, so it's going to line 1, which is exactly where it should go. > > Yes; this is the behavior I would like to customize. I'm accustomed > to the cursor being where I last edited when I open a file. > > Line 1 is exactly where the cursor should go if your user name > is a member of the set that includes "Gary Holloway"; it > would be a shame if that behavior went away. > > Others might prefer the behavior of "vi -t parser.c" to be > more or less exactly that of "vi path/to/parser.c". > >> The quote in the tag file introduces a comment. > > I see. The man page gives this general format: > > tag_namefile_nameex_cmd;"extension_fields > > Somehow, using the command '" for ex_cmd works. The > end result is that the cursor jumps to the correct line. > Perhaps this is by some kind of fluke. Links: ------ [1] mailto:Gar...@ca... [2] http://p.sf.net/sfu/cisco-dev2dev [3] mailto:Cta...@li... [4] https://lists.sourceforge.net/lists/listinfo/ctags-users [5] http://ctags.sourceforge.net/ctags.html#BUGS |