diff --git a/modules/vim/module.py b/modules/vim/module.py index db7d89b..e8b93dd 100644 --- a/modules/vim/module.py +++ b/modules/vim/module.py @@ -52,10 +52,9 @@ class VimModule(IModule): vimrc_out_file.write(line) else: - vimrc_file = open("testfile", "w+") - vimrc_file.write("\n" + "call plug#begin('~/.vim/plugged')\n") - for element in clean_plugin_list: - selection = element -1 - vimrc_file.write(plugins[selection][1] + "\n") - vimrc_file.write("call plug#end()\n") - vimrc_file.close() + with open("testfile", "w+") as vimrc_file: + vimrc_file.write("\n" + "call plug#begin('~/.vim/plugged')\n") + for element in clean_plugin_list: + selection = element -1 + vimrc_file.write(plugins[selection][1] + "\n") + vimrc_file.write("call plug#end()\n")