Feature request: put the mode indicator more on the left

Vegard Øye vegard_oye at hotmail.com
Wed Jun 22 21:56:50 CEST 2011


On 2011-06-21 16:22 +0200, Alan Schmitt wrote:

> I see that the mode indicator (<V>, <I>, etc) is the last thing on
> the right of the status bar. Unfortunately, when many minor modes
> are loaded (typically when doing some latex), the information is not
> visible. Is there a way to put the mode indicator more on the left?

Viper (and Evil) puts the indicator in the variable
`global-mode-string', which is included in `mode-line-format'.
By default, `global-mode-string' occurs at the end of the mode line.
Thus, one way to move the indicator is to reorder `mode-line-format':

    (setq-default mode-line-format
                  '("%e"
                    "-"
                    mode-line-mule-info
                    mode-line-client
                    mode-line-modified
                    mode-line-remote
                    mode-line-frame-identification
                    mode-line-buffer-identification
                    "   "
                    mode-line-position
                    (vc-mode ("" vc-mode " "))
                    global-mode-string
                    mode-line-modes
                    (which-func-mode ("" which-func-format "--"))
                    "-%-"))

These changes may be shadowed by a buffer-local value, however.
That is why `global-mode-string' is used instead of inserting the
indicator directly: since `global-mode-string' is a standard variable,
even custom values of `mode-line-format' are likely to contain it.

Still, I see your point. I'm unsure of what would be the most robust
way of implementing it, though.

> As a related question, is it possible to change the cursor depending
> on the mode?

If you just want to customize the /color/ of Viper's cursors, you can
set the variables `viper-vi-state-cursor-color' (for vi state),
`viper-insert-state-cursor-color' (for Insert state), etc.
If you want to change the cursor's /type/, you'll have to use the
state hooks like Tim explained.

In Evil, you can change both the type and color with a single variable.

-- 
Vegard



More information about the implementations-list mailing list