diff --git a/powerline/config_files/colorschemes/vim/default.json b/powerline/config_files/colorschemes/vim/default.json index f87b233e..5e602bcb 100644 --- a/powerline/config_files/colorschemes/vim/default.json +++ b/powerline/config_files/colorschemes/vim/default.json @@ -82,7 +82,8 @@ "line_percent_gradient6": { "fg": "gradient6", "bg": "gray4" }, "line_current": { "fg": "gray1", "bg": "gray10", "attr": ["bold"] }, "line_current_symbol": { "fg": "gray1", "bg": "gray10" }, - "col_current": { "fg": "gray6", "bg": "gray10" } + "col_current": { "fg": "gray6", "bg": "gray10" }, + "modified_buffers": { "fg": "brightyellow", "bg": "gray2" } }, "mode_translations": { "nc": { diff --git a/powerline/segments/vim.py b/powerline/segments/vim.py index ce11deb4..f23d87c0 100644 --- a/powerline/segments/vim.py +++ b/powerline/segments/vim.py @@ -167,6 +167,15 @@ def col_current(virtcol=True): return vim_funcs['virtcol' if virtcol else 'col']('.') +def modified_buffers(text=u'+'): + '''Return a comma-separated list of modified buffers.''' + buffer_len = int(vim.eval('bufnr("$")')) + buffer_mod = [str(bufnr) for bufnr in range(1, buffer_len + 1) if vim.eval('getbufvar({0}, "&mod")'.format(bufnr)) == '1'] + if buffer_mod: + return u'{0} {1}'.format(text, ','.join(buffer_mod)) + return None + + @memoize(2) def branch(): repo = guess(os.path.abspath(vim.current.buffer.name or os.getcwd()))