powerline / powerline

Powerline is a statusline plugin for vim, and provides statuslines and prompts for several other applications, including zsh, bash, tmux, IPython, Awesome and Qtile.
https://powerline.readthedocs.org/en/latest/
Other
14.38k stars 997 forks source link

Mode segment doesn't respect exclude_modes / include_modes #584

Closed toupeira closed 10 years ago

toupeira commented 11 years ago

I was trying to show the mode indicator for non-current buffers as well, but no matter which exclude_modes / include_modes setting I tried it still wasn't shown.

Looking at the code in segments/vim.py, mode() always returns None when mode is nc. Is there a reason for this?

ZyX-I commented 11 years ago

What do you expect to be there in other windows? Mode information in vim exists only for current window. We are not showing anything because there is nothing to show.

04.07.13, 18:54, "Markus Koller" notifications@github.com":

I was trying to show the mode indicator for non-current buffers as well, but no matter which exclude_modes / include_modes setting I tried it still wasn't shown. Looking at the code in segments/vim.py, mode() always returns None when mode is nc. Is there a reason for this? — Reply to this email directly or view it on GitHub.

toupeira commented 11 years ago

Hmm... that's actually a good point :-) I had the old vim-powerline set up like this (with the mode indicator on inactive windows showing "normal" on a dark-gray background) because I preferred the look, and wanted to minimise UI changes when switching windows.

But since the indicator is already hidden for non-active windows by the default theme, is there any reason why the hard-coded check in the segment method is even necessary?

At the very least you could remove nc from vim_modes so nobody else will assume it's supported ;-) On Jul 4, 2013 6:45 PM, "ZyX-I" notifications@github.com wrote:

What do you expect to be there in other windows? Mode information in vim exists only for current window. We are not showing anything because there is nothing to show.

04.07.13, 18:54, "Markus Koller" notifications@github.com":

I was trying to show the mode indicator for non-current buffers as well, but no matter which exclude_modes / include_modes setting I tried it still wasn't shown. Looking at the code in segments/vim.py, mode() always returns None when mode is nc. Is there a reason for this? — Reply to this email directly or view it on GitHub.

— Reply to this email directly or view it on GitHubhttps://github.com/Lokaltog/powerline/issues/584#issuecomment-20485849 .

toupeira commented 11 years ago

I just realized nc isn't actually present in vim_modes, sorry about that ;-) Anyway, I remembered what exactly bugged me about this: I don't want the filename to move when switching windows, since it's the main thing I use to find a window to switch to, and it's irritating when it's always flipping from left to right. So I changed my old config to always show the segments on the left side.

If I remove the check in mode() and add nc to the mode list it seems to work fine, the only thing missing is to add a custom background color for this mode. Could you point me in the right direction where to do this? I'll be happy to provide a pull request if you're okay with it and don't see any other issues.

ZyX-I commented 10 years ago

Colors are defined in config_files/colorschemes/vim/*.json. You need to add mode_translations/nc/groups/mode to modify colors.

toupeira commented 10 years ago

Oh hey, sorry I switched to vim-airline in the meantime, so I'll close this issue now.