Monday, May 13, 2019

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

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 vim_use+unsubscribe@googlegroups.com.
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.

No comments: