Thx for the example, but it does't work as expected, just consider multiple buffers, vi state hook is also executed when i switch for example from emacs state to vi state,.. All this leads to negative values of vimtest-var.<div>
<br></div><div>I thought of using vimpulse-visual-local-vars because, when looking at its definition I looks like exactly what I want:</div><div><br></div><div> (viper-deflocalvar vimpulse-visual-local-vars</div><div> '(cua-mode</div>
<div> mark-active</div><div> transient-mark-mode</div><div> zmacs-regions)</div><div> "System variables that are reset for each Visual session.")</div><div><br></div><div>Or am I wrong ?</div><div><br>
</div><div>Regards</div><div>Thomas</div><div><br></div><div><br><br><div class="gmail_quote">On Fri, Jun 17, 2011 at 7:35 PM, Tim Harper <span dir="ltr"><<a href="mailto:timcharper@gmail.com">timcharper@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hi Thomas,<br>
<br>
One approach is to use the provided hooks to toggle it on and off when visual mode is entered / left. viper vi-mode is entered again when vimpulse visual mode is left.<br>
<br>
(setq vimtest-var 0)<br>
(defun vimtest ()<br>
(interactive)<br>
(setq vimtest-var (+ 1 vimtest-var)))<br>
<br>
(defun vimtest-deactivate ()<br>
(interactive)<br>
(setq vimtest-var (- vimtest-var 1)))<br>
<br>
(add-hook 'vimpulse-visual-state-hook 'vimtest)<br>
(add-hook 'viper-vi-state-hook 'vimtest-deactivate)<br>
<br>
Tim<br>
<div><div></div><div class="h5"><br>
On Jun 17, 2011, at 11:08 , Thomas Hisch wrote:<br>
<br>
> Hey<br>
><br>
> I want to disable global-hl-line-mode in visual mode, but adding global-hl-mode to vimpulse-visual-local-vars didn't help.<br>
><br>
> Any ideas?<br>
><br>
> (latest git version of vimpulse)<br>
><br>
> Regards<br>
> Tom<br>
</div></div>> _______________________________________________<br>
> implementations-list mailing list<br>
> <a href="mailto:implementations-list@lists.ourproject.org">implementations-list@lists.ourproject.org</a><br>
> <a href="https://lists.ourproject.org/cgi-bin/mailman/listinfo/implementations-list" target="_blank">https://lists.ourproject.org/cgi-bin/mailman/listinfo/implementations-list</a><br>
<br>
<br>
_______________________________________________<br>
implementations-list mailing list<br>
<a href="mailto:implementations-list@lists.ourproject.org">implementations-list@lists.ourproject.org</a><br>
<a href="https://lists.ourproject.org/cgi-bin/mailman/listinfo/implementations-list" target="_blank">https://lists.ourproject.org/cgi-bin/mailman/listinfo/implementations-list</a><br>
</blockquote></div><br></div>