writing one text the same way vim's help

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

writing one text the same way vim's help

Mathieu
Hi everybody,

I posted questions before, but i was not clear in my mind about what i
wanted to do exactly and what was possible with vim.
I read more in vim's help, and i understand better now.
I can see in my directory /usr/share/vim/vim80/doc
how vim's help files are made.

And now i think tags are the best tools to do what i want (one long
text with hypertext links, but only textfile, not html).

As far as i understand, one script using ctag searched in all vim help
files, and where it found    |plouf|, one link was created in tags file
to search /*plouf*.

1) |plouf| is colored is blue, and *plouf* is colored in red when open
with vi. It is function of hightlight, right? How can i use the same
highlight for my own-text file?

2) Where is the script to build tags file for vim's help? I would like
to use it for my own.

Best regards,
Mathieu Roux

--
--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/6fc551d05c80107f7d1f6cddcfc10712df3b5e9e.camel%40gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: writing one text the same way vim's help

Erik Christiansen
On 10.05.19 19:29, Mathieu Roux wrote:
> 1) |plouf| is colored is blue, and *plouf* is colored in red when open
> with vi. It is function of hightlight, right? How can i use the same
> highlight for my own-text file?

Not being a user of highlighting, I can only point to ":h highlight".
Mastering syntax highlighting to the point of customising it will
probably require some reading, possibly even of some google hits.

> 2) Where is the script to build tags file for vim's help? I would like
> to use it for my own.

Built into Vim, by the look of it. See ":h helptags"
Where that puts the tagfile is not explicated, so we're not sure whether
it's suited to generating tags for other files.

Attempting to repurpose Vim's helptag generator is not as flexible as a
custom script, which may begin as a simple one-liner, yet be extended as
needed.

Erik

--
--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/20190511043410.GA3585%40ratatosk.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: writing one text the same way vim's help

Erik Christiansen
On 11.05.19 14:34, Erik Christiansen wrote:
> On 10.05.19 19:29, Mathieu Roux wrote:
> > 1) |plouf| is colored is blue, and *plouf* is colored in red when open
> > with vi. It is function of hightlight, right? How can i use the same
> > highlight for my own-text file?
>
> Not being a user of highlighting, I can only point to ":h highlight".
> Mastering syntax highlighting to the point of customising it will
> probably require some reading, possibly even of some google hits.

A useful starting point might be:  :h tag-highlight
It provides some mappings for generating and highlighting tags. Some of
that may suit your use case.

Erik

--
--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/20190511102800.GB3585%40ratatosk.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: writing one text the same way vim's help

Mathieu
On sam., 2019-05-11 at 20:28 +1000, Erik Christiansen wrote:

> On 11.05.19 14:34, Erik Christiansen wrote:
> > On 10.05.19 19:29, Mathieu Roux wrote:
> > > 1) |plouf| is colored is blue, and *plouf* is colored in red when
> > > open
> > > with vi. It is function of hightlight, right? How can i use the
> > > same
> > > highlight for my own-text file?
> >
> > Not being a user of highlighting, I can only point to ":h
> > highlight".
> > Mastering syntax highlighting to the point of customising it will
> > probably require some reading, possibly even of some google hits.
>
> A useful starting point might be:  :h tag-highlight
> It provides some mappings for generating and highlighting tags. Some
> of
> that may suit your use case.
>
> Erik
>
> --


Thanks for you help. So i have read several articles of vi's help.

I have understood that when my file is call foo.txt, :helptags .
creates my tags file, and that is what i want.

:h tag-highlight
is apparently the section to set the highlight, but i don't understand
everything.

I can read:


"If you want to highlight all the tags in your file, you can use the
following
mappings.

        <F11>   -- Generate tags.vim file, and highlight tags.
        <F12>   -- Just highlight tags based on existing tags.vim file.

  :map <F11>  :sp tags<CR>:%s/^\([^     :]*:\)\=\([^    ]*\).*/syntax
keyword Tag \2/<CR>:wq! tags.vim<CR>/^<CR><F12>
  :map <F12>  :so tags.vim<CR>"





1) How can i know free shortcuts on my machine? it seams that F11 is
used for a wider window.

2) For exemple, is it possible to use Ctrl+F11? should i write <C-
F11>... does not work...

3) I have one tags.vim file her:
/usr/share/vim/vim80/syntax/tags.vim
What is the utility of this file? Does it allow to define coloration?

4) How to use it?
I copied tags.vim file in my current directory, and i copied a "true"
helpfile from directory
/usr/share/vim/vim80/doc
I tried so execute the command for F11, but it does not work...

5) After that, if i modify my .txt file, i will have to launch again :h
tag-highlight, if i change my file. But of course, i want to define
hightlighting one time forever. Is it possible?







Best regards,
Mathieu Roux

--
--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/233c91ff94c15293567d2a477ced0a56a0959d90.camel%40gmail.com.
For more options, visit https://groups.google.com/d/optout.