diff --git a/modules/vim/module.py b/modules/vim/module.py index 688ddb4..ada45e3 100644 --- a/modules/vim/module.py +++ b/modules/vim/module.py @@ -1,4 +1,5 @@ from IModule import IModule +import os.path class VimModule(IModule): @@ -23,16 +24,27 @@ class VimModule(IModule): print("") - def select_plugins(): - user_input = [int(userInput) for userInput in input("Enter multiple value: ").split()] - clean_plugin_list = set(user_input) + # Select Plugins + user_input = [int(userInput) for userInput in input("Select modules: ").split()] + clean_plugin_list = set(user_input) - # print out selected plugins - for element in clean_plugin_list: - selection = element - 1 - try: - print(plugins[selection][0]) - except Exception: - print("Fail") + # print out selected plugins + for element in clean_plugin_list: + selection = element - 1 + try: + print(plugins[selection][0]) + except Exception: + print("Fail") - select_plugins() + # Create vimrc file + vimrc_exists = os.path.isfile("testfile") + + if vimrc_exists: + vimrc_file = open("testfile", "a+") + vimrc_file.write("\n" + plugins[selection][1]) + vimrc_file.close() + + else: + vimrc_file = open("testfile", "w+") + vimrc_file.write(plugins[selection][1]) + vimrc_file.close()