diff --git a/modules/vim/module.py b/modules/vim/module.py index 370d01d..a28a8c8 100644 --- a/modules/vim/module.py +++ b/modules/vim/module.py @@ -21,7 +21,6 @@ class VimModule(AbstractModule): self.json_config = json.load(plugins) def create_folder_structure(self): - # Create necessary folder structure for vim os.makedirs(str(get_vim_root().joinpath("autoload")), exist_ok=True) os.makedirs(str(get_vim_root().joinpath("plugged")), exist_ok=True) @@ -40,19 +39,14 @@ class VimModule(AbstractModule): def create_plugin_section(self): vimrc_content = [] - mapped_list = [] plugins = self.json_config['plugins'] - for choice in plugins.keys(): - mapped_list.append({ - "name": choice - }) print("Available Plugins:") plugin_selection = [ { 'type': 'checkbox', 'message': 'Select plugins', 'name': 'modules', - 'choices': mapped_list + 'choices': list(map(lambda x: {"name": x}, plugins.keys())) } ] selected_plugins = prompt(plugin_selection)['modules'] @@ -73,14 +67,12 @@ class VimModule(AbstractModule): return vimrc_content def create_setting_section(self): - vimrc_content = [] - settings = self.json_config['settings'] - default_settings = list(settings.values()) + default_settings = list(self.json_config['settings'].values()) + print("\n\033[4mDefault settings:\033[0m") [print(i) for i in default_settings] - for setting in default_settings: - vimrc_content.append(setting + "\n") + vimrc_content = list(map(lambda x: x + "\n", default_settings)) return vimrc_content def get_vimfile_working_copy(self):