Suppose I have a agenda file, in which I note things to do, e.g. :
2012.10.13 write to Inc
2012.10.14 write to Gmbh
etc...
I want to complement this file with incremented information about these
companies (quotes, articles, etc…).
So, I create a tag file : .vim/doc/vimlog.txt, in which I have both *Inc*
and *Gmbh*.
(NB :I have verified that I have, too, .vim/doc/tags)
Two tags are easy to remember, but a hundred ?
It would be handy to see immediately through highlighting (in magenta, to
take an example) - while writing the name of one of those companies - if I
already have information about it in my custom tag file, which would be then
a Ctrl-] away.
I would rather not use plugins, and anyway, ctags is most certainly overkill
for me, because I only write plain text (on Terminal Vim in my MBpro ... and
on an Android smartphone with VimTouch).
Your second suggestion brings other - naïve - questions :
- Where is the vimlog.txt file ? Must I create it ?
- Is it impossible to parse the .vim/doc/tags file for *keywords* through a
function ?
On Monday, October 15, 2012 12:03:30 PM UTC-5, tjg wrote:
> I would rather not use plugins, and anyway, ctags is most certainly overkill
> for me, because I only write plain text (on Terminal Vim in my MBpro ... and
> on an Android smartphone with VimTouch).
You're going to need a plugin of some sort here, even if you must write it yourself. Vim doesn't do syntax highlighting of any kind without one, and certainly not syntax highlighting of a configurable dictionary of words. The plugin could be a very lightweight syntax file only if you want, but you'll need one.
> Your second suggestion brings other - naïve - questions :
> - Where is the vimlog.txt file ? Must I create it ?
You created it already. You told us in your original post:
> So, I create a tag file : .vim/doc/vimlog.txt, in which I have both *Inc* > and *Gmbh*. > (NB :I have verified that I have, too, .vim/doc/tags)
> - Is it impossible to parse the .vim/doc/tags file for *keywords* through a
> function ?
You can get all tags Vim knows about which match a regular expression using the taglist() function. Or you can use readfile() to read in the contents of a file and parse it line by line in whatever way you wish.
You could also make a static syntax file with your desired keywords.
Or, if your keywords are set off from normal text in some way, with special tokens or something, make a syntax file to highlight them based on the special tokens.
First of all, sorry for my blunder about vimlog.txt. As you may have guessed,
this was an invented name , and I still had in mind the real name of my file
(vimnotes.txt)
I shall follow your different suggestions (I learn Vim the slow way...)