Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
How to highlight words which correspond to tags in a custom tag file ?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  5 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
tjg  
View profile  
 More options Oct 14 2012, 1:30 pm
From: tjg <tguille...@gmail.com>
Date: Sun, 14 Oct 2012 10:29:54 -0700 (PDT)
Local: Sun, Oct 14 2012 1:29 pm
Subject: How to highlight words which correspond to tags in a custom tag file ?
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.

Is this achievable ?

--
View this message in context: http://vim.1045645.n5.nabble.com/How-to-highlight-words-which-corresp...
Sent from the Vim - General mailing list archive at Nabble.com.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ben Fritz  
View profile   Translate to Translated (View Original)
 More options Oct 15 2012, 11:59 am
From: Ben Fritz <fritzophre...@gmail.com>
Date: Mon, 15 Oct 2012 08:59:23 -0700 (PDT)
Local: Mon, Oct 15 2012 11:59 am
Subject: Re: How to highlight words which correspond to tags in a custom tag file ?

Maybe you can get it working with one of these:

http://www.vim.org/scripts/script.php?script_id=3114
http://www.vim.org/scripts/script.php?script_id=2646

They both use ctags though so I'm not certain it's workable.

You could also parse the vimlog.txt file in vimscript and make a :syn keyword or :syn match rule for each word found.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
tjg  
View profile  
 More options Oct 15 2012, 1:03 pm
From: tjg <tguille...@gmail.com>
Date: Mon, 15 Oct 2012 10:02:38 -0700 (PDT)
Local: Mon, Oct 15 2012 1:02 pm
Subject: Re: How to highlight words which correspond to tags in a custom tag file ?
Thank you for your answer.

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 ?

Thanks again

--
View this message in context: http://vim.1045645.n5.nabble.com/How-to-highlight-words-which-corresp...
Sent from the Vim - General mailing list archive at Nabble.com.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ben Fritz  
View profile   Translate to Translated (View Original)
 More options Oct 15 2012, 4:24 pm
From: Ben Fritz <fritzophre...@gmail.com>
Date: Mon, 15 Oct 2012 13:24:31 -0700 (PDT)
Local: Mon, Oct 15 2012 4:24 pm
Subject: Re: How to highlight words which correspond to tags in a custom tag file ?

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.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
tjg  
View profile  
 More options Oct 16 2012, 3:30 am
From: tjg <tguille...@gmail.com>
Date: Tue, 16 Oct 2012 00:29:51 -0700 (PDT)
Local: Tues, Oct 16 2012 3:29 am
Subject: Re: How to highlight words which correspond to tags in a custom tag file ?
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...)

Again, thank you very much.

--
View this message in context: http://vim.1045645.n5.nabble.com/How-to-highlight-words-which-corresp...
Sent from the Vim - General mailing list archive at Nabble.com.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »