Use buf_nc and tab_nc modes in listers

This commit is contained in:
ZyX 2014-08-16 13:51:26 +04:00
parent ac7a9596ab
commit 096c4801b0
6 changed files with 84 additions and 6 deletions

View File

@ -51,6 +51,44 @@
"dark_green_gray": "gray5"
}
},
"tab_nc": {
"colors": {
"brightyellow": "darkorange",
"brightestred": "darkred",
"gray0": "gray0",
"gray1": "gray0",
"gray2": "gray0",
"gray3": "gray1",
"gray4": "gray1",
"gray5": "gray1",
"gray6": "gray1",
"gray7": "gray4",
"gray8": "gray4",
"gray9": "gray4",
"gray10": "gray5",
"white": "gray6",
"dark_green_gray": "gray5"
}
},
"buf_nc": {
"colors": {
"brightyellow": "darkorange",
"brightestred": "darkred",
"gray0": "gray0",
"gray1": "gray0",
"gray2": "gray0",
"gray3": "gray1",
"gray4": "gray1",
"gray5": "gray1",
"gray6": "gray1",
"gray7": "gray4",
"gray8": "gray4",
"gray9": "gray4",
"gray10": "gray5",
"white": "gray6",
"dark_green_gray": "gray5"
}
},
"i": {
"colors": {
"gray0": "darkestblue",

View File

@ -43,6 +43,26 @@
"oldlace": "gray61"
}
},
"tab_nc": {
"colors": {
"darkgreencopper": "royalblue5",
"lightskyblue4": "royalblue5",
"azure4": "darkgreencopper",
"gray61": "lightskyblue4",
"lightyellow": "azure4",
"oldlace": "gray61"
}
},
"buf_nc": {
"colors": {
"darkgreencopper": "royalblue5",
"lightskyblue4": "royalblue5",
"azure4": "darkgreencopper",
"gray61": "lightskyblue4",
"lightyellow": "azure4",
"oldlace": "gray61"
}
},
"i": {
"groups": {
"background": { "fg": "oldlace", "bg": "darkgreencopper", "attr": [] },

View File

@ -43,6 +43,26 @@
"gray13": "gray61"
}
},
"tab_nc": {
"colors": {
"lightyellow": "darkgreencopper",
"azure4": "darkgreencopper",
"lightskyblue4": "lightyellow",
"gray61": "azure4",
"royalblue5": "lightskyblue4",
"gray13": "gray61"
}
},
"buf_nc": {
"colors": {
"lightyellow": "darkgreencopper",
"azure4": "darkgreencopper",
"lightskyblue4": "lightyellow",
"gray61": "azure4",
"royalblue5": "lightskyblue4",
"gray13": "gray61"
}
},
"i": {
"groups": {
"background": { "fg": "gray13", "bg": "lightyellow", "attr": [] },

View File

@ -11,7 +11,7 @@
"name": "tabnr",
"after": " ",
"draw_soft_divider": false,
"exclude_modes": ["tab", "buf"],
"exclude_modes": ["tab", "buf", "buf_nc"],
"priority": 5
},
{

View File

@ -733,7 +733,7 @@ top_colorscheme_spec = (Spec(
mode_translations_value_spec(),
).optional().context_message('Error while loading mode translations (key {key})').optional(),
).context_message('Error while loading top-level coloscheme'))
vim_mode_spec = Spec().oneof(set(list(vim_modes) + ['nc'])).copy
vim_mode_spec = Spec().oneof(set(list(vim_modes) + ['nc', 'tab_nc', 'buf_nc'])).copy
vim_colorscheme_spec = (Spec(
name=name_spec(),
groups=groups_spec(),

View File

@ -36,7 +36,7 @@ def tablister(pl, segment_info, **kwargs):
``winnr``, ``window_id``, ``buffer`` and ``bufnr`` keys set to tab-local
ones and additional ``tabpage`` and ``tabnr`` keys.
Sets segment ``mode`` to either ``tab`` (for current tab page) or ``nc``
Sets segment ``mode`` to either ``tab`` (for current tab page) or ``tab_nc``
(for all other tab pages).
Works best with vim-7.4 or later: earlier versions miss tabpage object and
@ -53,7 +53,7 @@ def tablister(pl, segment_info, **kwargs):
(lambda tabpage, mode: (
tabpage_updated_segment_info(segment_info, tabpage, mode),
add_multiplier(tabpage, {'mode': mode})
))(tabpage, 'tab' if tabpage == cur_tabpage else 'nc')
))(tabpage, 'tab' if tabpage == cur_tabpage else 'tab_nc')
for tabpage in list_tabpages()
)
@ -79,7 +79,7 @@ def bufferlister(pl, segment_info, show_unlisted=False, **kwargs):
and ``bufnr`` keys set to buffer-specific ones, ``window``, ``winnr`` and
``window_id`` keys set to None.
Sets segment ``mode`` to either ``buf`` (for current buffer) or ``nc``
Sets segment ``mode`` to either ``buf`` (for current buffer) or ``buf_nc``
(for all other buffers).
:param bool show_unlisted:
@ -102,7 +102,7 @@ def bufferlister(pl, segment_info, show_unlisted=False, **kwargs):
buffer_updated_segment_info(
segment_info,
buffer,
('buf' if buffer is cur_buffer else 'nc')
('buf' if buffer is cur_buffer else 'buf_nc')
)
for buffer in vim.buffers
) if (