diff --git a/powerline/config_files/config.json b/powerline/config_files/config.json index cf9cf771..a70922ff 100644 --- a/powerline/config_files/config.json +++ b/powerline/config_files/config.json @@ -36,7 +36,8 @@ "theme": "default", "local_themes": { "cmdwin": "cmdwin", - "help": "help" + "help": "help", + "quickfix": "quickfix" } }, "wm": { diff --git a/powerline/config_files/themes/vim/quickfix.json b/powerline/config_files/themes/vim/quickfix.json new file mode 100644 index 00000000..00f8a9fd --- /dev/null +++ b/powerline/config_files/themes/vim/quickfix.json @@ -0,0 +1,36 @@ +{ + "segment_data": { + "file_name": { + "contents": "Location List" + } + }, + "segments": { + "left": [ + { + "type": "string", + "name": "file_name", + "draw_soft_divider": false + }, + { + "type": "string", + "highlight_group": ["background"], + "draw_soft_divider": false, + "draw_hard_divider": false, + "width": "auto" + } + ], + "right": [ + { + "type": "string", + "name": "line_current_symbol", + "highlight_group": ["line_current_symbol", "line_current"] + }, + { + "name": "line_current", + "draw_soft_divider": false, + "width": 3, + "align": "r" + } + ] + } +} diff --git a/powerline/matchers/vim.py b/powerline/matchers/vim.py index e46b5ef2..9d8eec37 100644 --- a/powerline/matchers/vim.py +++ b/powerline/matchers/vim.py @@ -13,3 +13,7 @@ def help(matcher_info): def cmdwin(matcher_info): name = matcher_info['buffer'].name return name and os.path.basename(name) == '[Command Line]' + + +def quickfix(matcher_info): + return str(getbufvar(matcher_info['bufnr'], '&buftype')) == 'quickfix' diff --git a/tests/test_configuration.py b/tests/test_configuration.py index 81c9b624..668c57b6 100644 --- a/tests/test_configuration.py +++ b/tests/test_configuration.py @@ -19,7 +19,7 @@ class TestConfig(TestCase): def test_vim(self): from powerline.vim import VimPowerline cfg_path = os.path.join(os.path.dirname(os.path.dirname(__file__)), 'powerline', 'config_files') - buffers = ((('bufoptions',), {'buftype': 'help'}), (('buffer', '[Command Line]'), {})) + buffers = ((('bufoptions',), {'buftype': 'help'}), (('buffer', '[Command Line]'), {}), (('bufoptions',), {'buftype': 'quickfix'})) with open(os.path.join(cfg_path, 'config.json'), 'r') as f: self.assertEqual(len(buffers), len(json.load(f)['ext']['vim']['local_themes'])) outputs = {}