-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsetup.py
More file actions
116 lines (89 loc) · 3.13 KB
/
setup.py
File metadata and controls
116 lines (89 loc) · 3.13 KB
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
'''
LeafVim installer by wooshdude
https://github.com/wooshdude/leafvim
This file does not contain any Vim or NeoVim configs.
'''
import os
import sys
from datetime import datetime
logo ='''
/////////////////////////////////////////////////////
/// __ _____ __ ///
/// | | ____ _____ _/ ____\__ _|__| _____ ///
/// | | / __ \\\__ \\\ __\\\ \/ / |/ \ ///
/// | |_| ___/ / __ \| | \ /| | Y Y \ ///
/// |____/\____ \____ |__| \_/ |__|_/|_|\_/ ///
/// Installer ///
/// ///
/////////////////////////////////////////////////////
'''
credits = '''
Credits
Project Owner:
wooshdude
Main Contributor:
wooshdude
'''
os.system('clear')
def main():
print(logo)
print()
print('''
Select option:
[1] Install
[2] Uninstall
[3] Credits
''')
choice = input(''':: ''')
print('')
if choice == str('1'):
os.system('clear')
print(logo)
print('''
Select version:
[1] Vim
[2] NeoVim
''')
ver = input(''':: ''')
if ver == '1':
# Check if .vimrc folder exists. If not, create it.
path = os.path.expanduser("~/.vimrc")
if not os.path.exists(path):
os.system('mkdir ~/.vimrc')
print("Created ~/.vimrc directory")
print(f'Copying config file...')
os.system('cp init.vim ~/.vimrc')
print('Copied to ~/.vimrc')
print('Installing VimPlug plugins manager')
os.system('bash vimplug.sh')
print('')
print('LeafVim has finished setup. Start nvim and use the command :PlugInstall to finish plugin installation.')
if ver == '2':
# Check if nvim folder exists. If not, create it.
path = os.path.expanduser("~/.config/nvim")
if not os.path.exists(path):
os.system('mkdir ~/.config/nvim')
print("Created ~/.config/nvim directory")
print(f'Copying config file...')
os.system('cp init.vim ~/.config/nvim/init.vim')
print('Copied to ~/.config/nvim/init.vim')
print('Installing VimPlug plugins manager')
os.system('bash neovimplug.sh')
print('')
print('LeafVim has finished setup. Start nvim and use the command :PlugInstall to finish plugin installation.')
elif choice == str('2'):
check = input('Are you sure you want to uninstall LeafVim? This will revert NeoVim to a default installation. (y/N) ')
if check == "y":
print('Removing LeafVim config')
os.system('rm ~/.config/nvim/init.vim')
print('Removing LeafVim plugins file')
os.system('rm ~/.config/nvim/leaf.plug')
print('')
print('Files removed from system.')
elif choice == str('3'):
print(credits)
input('Press ENTER to resume setup.')
os.system('clear')
main()
if __name__ =='__main__':
main()