Feature request: put the mode indicator more on the left
Tim Harper
timcharper at gmail.com
Tue Jun 21 18:15:51 CEST 2011
On Jun 21, 2011, at 8:22 , Alan Schmitt wrote:
>
> As a related question, is it possible to change the cursor depending on the mode?
This doesn't seem THAT related question and probably deserves it's own thread :) But yes, it is possible to change cursor according to mode by exploiting the various hooks provided. I tend to think this should be built into viper mode, but it's not.
---
(add-hook 'viper-insert-state-hook 'viper-set-cursor t)
(add-hook 'viper-emacs-state-hook 'viper-set-cursor t)
(add-hook 'viper-vi-state-hook 'viper-set-cursor t)
(defun viper-set-cursor ()
"Set the cursor for a given state"
(cond
((eq viper-current-state 'emacs-state) (setq cursor-type 'bar))
((eq viper-current-state 'vi-state) (setq cursor-type 'hollow))
((eq viper-current-state 'viper-mark-state) (setq cursor-type 'bar))
((eq viper-current-state 'visual-state) (setq cursor-type 'hbar))))
(defun viper-restore-cursor-type ()
(viper-set-cursor))
---
Tim
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://lists.ourproject.org/pipermail/implementations-list/attachments/20110621/bfa8e35e/attachment.htm
More information about the implementations-list
mailing list