Merge json files, inline settings list generation
This commit is contained in:
parent
9fe48808e7
commit
9ef6efcbc3
@ -9,19 +9,12 @@ import json
|
||||
class VimModule(AbstractModule):
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
self.plugins = {}
|
||||
with open("modules/vim/vim_plugins.json") as plugins:
|
||||
self.plugins = json.load(plugins)['plugins']
|
||||
self.json_config = {}
|
||||
with open("modules/vim/vimrc_conf.json") as plugins:
|
||||
self.json_config = json.load(plugins)
|
||||
|
||||
self.settings = {}
|
||||
with open("modules/vim/vim_settings.json") as settings:
|
||||
self.settings = json.load(settings)['settings']
|
||||
|
||||
def add_settings(self):
|
||||
list_settings = []
|
||||
for setting in self.settings.values():
|
||||
list_settings.append(setting)
|
||||
return list_settings
|
||||
self.plugins = self.json_config['plugins']
|
||||
self.settings = self.json_config['settings']
|
||||
|
||||
def do_plugin_selection(self):
|
||||
mapped_list = []
|
||||
@ -44,7 +37,7 @@ class VimModule(AbstractModule):
|
||||
def run(self):
|
||||
|
||||
selected_plugins = self.do_plugin_selection()
|
||||
default_settings = self.add_settings()
|
||||
default_settings = list(self.settings.values())
|
||||
# print out selected plugins
|
||||
print("\033[4mYour selection:\033[0m")
|
||||
[print(x) for x in selected_plugins]
|
||||
|
@ -1,11 +0,0 @@
|
||||
{
|
||||
"settings": {
|
||||
"tabstop": "set tabstop=2",
|
||||
"shiftwidth": "set shiftwidth=2",
|
||||
"expand": "set noexpandtab",
|
||||
"highlighting": "syntax on",
|
||||
"linenumbers": "set number",
|
||||
"status": "set laststatus=2",
|
||||
"noshowmode": "set noshowmode"
|
||||
}
|
||||
}
|
@ -6,5 +6,14 @@
|
||||
"Meta5 Theme": "Plug 'https://github.com/christophermca/meta5.git'",
|
||||
"Nerdtree": "Plug 'https://github.com/scrooloose/nerdtree'",
|
||||
"Lightline": "Plug 'https://github.com/itchyny/lightline.vim'"
|
||||
},
|
||||
"settings": {
|
||||
"tabstop": "set tabstop=2",
|
||||
"shiftwidth": "set shiftwidth=2",
|
||||
"expand": "set noexpandtab",
|
||||
"highlighting": "syntax on",
|
||||
"linenumbers": "set number",
|
||||
"status": "set laststatus=2",
|
||||
"noshowmode": "set noshowmode"
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user