<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Jun 21, 2011, at 8:22 , Alan Schmitt wrote:</div><blockquote type="cite"><div><font class="Apple-style-span" color="#000000"><br></font>As a related question, is it possible to change the cursor depending on the mode?</div></blockquote><br></div><div>This doesn't seem THAT related question and probably deserves it's own thread :) &nbsp;But yes, it is possible to change cursor according to mode by exploiting the various hooks provided. &nbsp;I tend to think this should be built into viper mode, but it's not.</div><div><br></div><div>---</div><div><br></div><div><div>(add-hook 'viper-insert-state-hook 'viper-set-cursor t)</div><div>(add-hook 'viper-emacs-state-hook 'viper-set-cursor t)</div><div>(add-hook 'viper-vi-state-hook 'viper-set-cursor t)</div><div><br></div><div>(defun viper-set-cursor ()</div><div>&nbsp; "Set the cursor for a given state"</div><div>&nbsp; (cond</div><div>&nbsp; &nbsp;((eq viper-current-state 'emacs-state) (setq cursor-type 'bar))</div><div>&nbsp; &nbsp;((eq viper-current-state 'vi-state) (setq cursor-type 'hollow))</div><div>&nbsp; &nbsp;((eq viper-current-state 'viper-mark-state) (setq cursor-type 'bar))</div><div>&nbsp; &nbsp;((eq viper-current-state 'visual-state) (setq cursor-type 'hbar))))</div><div><br></div><div>(defun viper-restore-cursor-type ()</div><div>&nbsp; (viper-set-cursor))</div><div><br></div></div><div>---</div><div><br></div><div>Tim</div></body></html>