diff --git a/powerline/config.json b/powerline/config.json new file mode 100644 index 00000000..a570fb6a --- /dev/null +++ b/powerline/config.json @@ -0,0 +1,20 @@ +{ + "common": { + "dividers": { + "left": { + "hard": "⮀", + "soft": "⮁" + }, + "right": { + "hard": "⮂", + "soft": "⮃" + } + } + }, + "ext": { + "vim": { + "colorscheme": "default", + "theme": "default" + } + } +} diff --git a/powerline/core.py b/powerline/core.py index db39bdb5..45283c94 100644 --- a/powerline/core.py +++ b/powerline/core.py @@ -22,15 +22,17 @@ class Powerline(object): sys.path[:0] = self.search_paths - # Load main config file, limited to the current extension - self.config = self._load_json_config('config')[ext] + # Load main config file + config = self._load_json_config('config') + self.config = config['common'] + self.config_ext = config['ext'][ext] # Load and initialize colorscheme - colorscheme_config = self._load_json_config(os.path.join('colorschemes', self.config['colorscheme'])) + colorscheme_config = self._load_json_config(os.path.join('colorschemes', self.config_ext['colorscheme'])) self.colorscheme = Colorscheme(colorscheme_config) # Load and initialize extension theme - theme_config = self._load_json_config(os.path.join('themes', ext, self.config['theme'])) + theme_config = self._load_json_config(os.path.join('themes', ext, self.config_ext['theme'])) self.theme = Theme(ext, theme_config) # Load and initialize extension renderer diff --git a/powerline/renderer.py b/powerline/renderer.py index ec06a6a0..907b6e6f 100644 --- a/powerline/renderer.py +++ b/powerline/renderer.py @@ -8,17 +8,6 @@ class Renderer(object): ATTR_ITALIC = 2 ATTR_UNDERLINE = 4 - dividers = { - 'l': { - 'hard': u'⮀', - 'soft': u'⮁', - }, - 'r': { - 'hard': u'⮂', - 'soft': u'⮃', - }, - } - def __init__(self, colorscheme, theme): pass