Friday, October 24, 2014

Re: shortcuts for long filenames

On Thursday, October 23, 2014 1:02:03 PM UTC-5, B. Elijah Griffin wrote:
> DwigtArmyOfChampions wrote:
> > Oftentimes I'm opening really long filenames in command mode, for example:
> >
> > :e /var/www/html/sites/all/modules/jqueryui_theme/jqueryui_theme.module
> >
> > Is there a way to create aliases for this file? Or if not the whole
> > file, how about part of the path, like everything up to and including
> > "modules"? That's a lot of typing!
>
> Have you considered tags? Often people don't create tags files by hand,
> but use a tool such as ctags, but you can hand create them or write your
> own tag file creation tool. The general original format is
>
> <tagname> <tab> <filename> <tab> <movement> <newline>
>
> Where the movement is an ex-mode movement such as a line number or
> /search/. In true vi you can put an ex-mode command, including edits,
> in the movement, vim is more restrictive.
>
> Say you create a tag file with this tag:
>
> jquitheme /var/www/html/sites/all/modules/jqueryui_theme/jqueryui_theme.module 1
>
> Then you can use ":tag jquitheme" to go to the top line of it. You can
> also use "vi -t jquitheme" to start the editor there.
>
> If you don't think you have used tags before, you are probably wrong.
> The vim help system is just a special form of them.
>


There is no need to manually create entries for files in tags! ctags will include file names automatically, if you use "--extra=+f". See http://ctags.sourceforge.net/ctags.html

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment