Edit method for creating the initial vimrc file to be less error prone

This commit is contained in:
Lucas Noki 2019-12-16 12:10:08 +01:00 committed by Marcel Schwarz
parent 4103c42724
commit 0c6744e378

View File

@ -52,10 +52,9 @@ class VimModule(IModule):
vimrc_out_file.write(line)
else:
vimrc_file = open("testfile", "w+")
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")
vimrc_file.close()