Load vimrc into memory for safer editing
Allow plugins to be installed after initial run
This commit is contained in:
parent
963a164611
commit
39a3560bdf
@ -40,9 +40,14 @@ class VimModule(IModule):
|
||||
vimrc_exists = os.path.isfile("testfile")
|
||||
|
||||
if vimrc_exists:
|
||||
vimrc_file = open("testfile", "a+")
|
||||
vimrc_file.write("\n" + plugins[selection][1])
|
||||
vimrc_file.close()
|
||||
with open("testfile", "r") as vimrc_in_file:
|
||||
buf = vimrc_in_file.readlines()
|
||||
|
||||
with open("testfile", "w") as vimrc_out_file:
|
||||
for line in buf:
|
||||
if line == "call plug#begin('~/.vim/plugged')\n":
|
||||
line = line + plugins[selection][1] + "\n"
|
||||
vimrc_out_file.write(line)
|
||||
|
||||
else:
|
||||
vimrc_file = open("testfile", "w+")
|
||||
|
Loading…
Reference in New Issue
Block a user