From b15474edaf20bd0dc06ec8cde407267da55d71af Mon Sep 17 00:00:00 2001 From: Marcel Schwarz Date: Sat, 11 Jan 2020 05:12:05 +0100 Subject: [PATCH] Change curl request to format string Put plugin manager installation in plugin selection and only if plugins are selected --- modules/vim/module.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/vim/module.py b/modules/vim/module.py index a28a8c8..6b2f763 100644 --- a/modules/vim/module.py +++ b/modules/vim/module.py @@ -30,11 +30,10 @@ class VimModule(AbstractModule): if os.path.isfile(str(get_vim_root().joinpath("autoload", "plug.vim"))): print("Vimplug already installed!") else: - pluginmanager_url = self.json_config['pluginmanager_url'] - curl_request = "curl " + \ - pluginmanager_url + \ - " -o " + \ - str(get_vim_root().joinpath("autoload", "plug.vim")) + curl_request = "curl {} -o {}".format( + self.json_config['pluginmanager_url'], + str(get_vim_root().joinpath("autoload", "plug.vim")) + ) subprocess.call(curl_request, shell=True) def create_plugin_section(self): @@ -50,6 +49,8 @@ class VimModule(AbstractModule): } ] selected_plugins = prompt(plugin_selection)['modules'] + if len(selected_plugins) > 0: + self.get_vimplug_file() print("\033[4mYour selection:\033[0m") [print(x) for x in selected_plugins] @@ -101,7 +102,6 @@ class VimModule(AbstractModule): def run(self): self.create_folder_structure() - self.get_vimplug_file() plugin_section = self.create_plugin_section() settings_section = self.create_setting_section() self.write_vimfile(settings_section + plugin_section)