forked from amsword/setup
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgenerate_vimrc.py
28 lines (23 loc) · 914 Bytes
/
generate_vimrc.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
if __name__ == '__main__':
vimrc_plugin = '.vimrc_plugin_template'
vimrc_customize = '.vimrc_customize_template'
with open(vimrc_plugin, 'r') as fp:
plugins = fp.read()
runtime_path = '/etc/vim/bundle/Vundle.vim'
global_plugins = plugins.format(runtime_path, "'" + runtime_path + "'")
runtime_path = '~/.vim/bundle/Vundle.vim'
local_plugins = plugins.format(runtime_path, '')
with open(vimrc_customize, 'r') as fp:
customize = fp.read()
output = '.vimrc_plugin_global'
with open(output, 'w') as fp:
fp.write(global_plugins)
output = '.vimrc_plugin'
with open(output, 'w') as fp:
fp.write(local_plugins)
output = '.vimrc_global'
with open(output, 'w') as fp:
fp.write(global_plugins + '\n' + customize)
output = '.vimrc'
with open(output, 'w') as fp:
fp.write(local_plugins + '\n' + customize)