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):
|
class VimModule(AbstractModule):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
self.plugins = {}
|
self.json_config = {}
|
||||||
with open("modules/vim/vim_plugins.json") as plugins:
|
with open("modules/vim/vimrc_conf.json") as plugins:
|
||||||
self.plugins = json.load(plugins)['plugins']
|
self.json_config = json.load(plugins)
|
||||||
|
|
||||||
self.settings = {}
|
self.plugins = self.json_config['plugins']
|
||||||
with open("modules/vim/vim_settings.json") as settings:
|
self.settings = self.json_config['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
|
|
||||||
|
|
||||||
def do_plugin_selection(self):
|
def do_plugin_selection(self):
|
||||||
mapped_list = []
|
mapped_list = []
|
||||||
@ -44,7 +37,7 @@ class VimModule(AbstractModule):
|
|||||||
def run(self):
|
def run(self):
|
||||||
|
|
||||||
selected_plugins = self.do_plugin_selection()
|
selected_plugins = self.do_plugin_selection()
|
||||||
default_settings = self.add_settings()
|
default_settings = list(self.settings.values())
|
||||||
# print out selected plugins
|
# print out selected plugins
|
||||||
print("\033[4mYour selection:\033[0m")
|
print("\033[4mYour selection:\033[0m")
|
||||||
[print(x) for x in selected_plugins]
|
[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'",
|
"Meta5 Theme": "Plug 'https://github.com/christophermca/meta5.git'",
|
||||||
"Nerdtree": "Plug 'https://github.com/scrooloose/nerdtree'",
|
"Nerdtree": "Plug 'https://github.com/scrooloose/nerdtree'",
|
||||||
"Lightline": "Plug 'https://github.com/itchyny/lightline.vim'"
|
"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