Frage

I like the Highlight multiple words plugin in my GVim but when i quit and re-open this editor all highlights disappears.

plugin description is here

:Hsave and :Hrestore do the job but the global variable contain the word highlighted ans disparead when i close GVim.

I've used :let g: to check :set viminfo^=! is inside viminfo I've seen mksession and source in your answers

So, what's not right ?

Thanks.

War es hilfreich?

Lösung

For troubleshooting, try to manually define a persistent variable, e.g.:

:let g:TEST_VAR = 'abc'

With :set viminfo+=!, the value should persist after a Vim restart:

:echo g:TEST_VAR
abc

If this works, the plugin's persistence should, too. If not, check the contents of the viminfo file and any modifications of 'viminfo'.


Note that my Mark plugin is an alternative, and also has marks persistence. It relies on the same persistent variable mechanism.

Andere Tipps

Thx to have decrypted my english :)

I'v trying this :

:echo has('viminfo')
show    1

:set viminfo?
show    viminfo='100,<50,s10,h

:set history?
show    history=20

My work is :

\m

(many times...)

On the word "Fabrice" i press 1 on keypad, it become red for foreground.

:Hsave CHIN
:Hclear
:Hrestore CHIN

(it's right)

:let g:

This is store :

HI_SAVE_CHIN           hl1^I\<Fabrice\>^I-1^I101    

and:

:let g:TEST_VAR = 'HI_SAVE_'

(or HI_SAVE_CHIN ?)

:set viminfo+=!
:echo g:TEST_VAR

It shows :

HI_SAVE_

In .viminfo :

Variables globales:

!HI_SAVE_CHIN   STR hl1 \<Fabrice\> -1  101
!TEST_VAR   STR HI_SAVE_

I'have doubt about HI_SAVE_ or HI_SAVE_CHIN. These lines stays in .vimfo when GVim is open but i can't :Hrestore CHIN (Chin or chin), let g: nothing.

And it be deleted when i quit.

I's hard job ! i will try your plugin, maybe it's more easy for me !

I may not have respect the rules of this site but I have found the solution to my problem so I am writing this to all. It may be an incompatibility with unnecessary files (I do not believe it) can be settings, nocompatility mainly but I have disabled all in vimrc and I put :set viminfo+=! because he did not want to get into viminfo. Thanks for your elegant plugin Ingo and your help.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top