tis-vim
1.0-1
Vim is a clone, with additions, of Bill Joy's vi text editor program for Unix.
352 downloads

Description
- package : tis-vim
- version : 1.0-1
- architecture : all
- categories : System and network
- maintainer : WAPT Team,Jimmy PELÉ
- description : Vim is a clone, with additions, of Bill Joy's vi text editor program for Unix.
- locale :
- target_os : linux
- min_wapt_version : 1.8
- sources : https://github.com/vim/vim
- installed_size :
- impacted_process : vi,vim
- description_fr :
- description_pl :
- description_de :
- description_es :
- description_pt :
- description_it :
- description_nl :
- description_ru :
- editor :
- licence : Free software
- signature_date : 2020-09-11T16:38:30.265282
- Homepage : https://www.vim.org/
Setup.py
# -*- coding: utf-8 -*-
from setuphelpers import *
import platform
uninstallkey = []
# Declaring specific app values (TO CHANGE)
package_name = 'vim'
conf_file_content = """syntax on
set number
let g:skip_defaults_vim = 1
"""
def install():
# Installing the package
if platform.linux_distribution()[0].lower() in ['debian','ubuntu']:
conf_file = makepath('/','etc','vim','vimrc')
print('Installing deb package')
install_apt(package_name)
if platform.linux_distribution()[0].lower() in ['centos linux','centos','suse','fedora','redhat']:
conf_file = makepath('/','etc','vimrc')
print('Installing yum package')
install_yum(package_name)
# Editing default option of VIM
if not isfile(conf_file):
file_open = open(conf_file,'w')
file_open.write(conf_file_content)
file_open.close()
else:
with open(conf_file,'a+') as data:
if not 'syntax on' in data.read():
data.write('\nsyntax on')
with open(conf_file,'a+') as data:
if not 'set number' in data.read():
data.write('\nset number')
with open(conf_file,'a+') as data:
if not 'let g:skip_defaults_vim = 1' in data.read():
data.write('\nlet g:skip_defaults_vim = 1')
def uninstall():
# Uninstalling the package
if platform.linux_distribution()[0].lower() in ['debian','ubuntu']:
print('Uninstalling deb package')
uninstall_apt(package_name)
if platform.linux_distribution()[0].lower() in ['centos linux','centos','suse','fedora','redhat']:
print('Uninstalling yum package')
uninstall_yum(package_name)
def update_package():
pass
# put here what to do to update package content with newer installers.
# launched with command wapt-get update-package-sources <path-to-wapt-directory>
# implicit context variables are WAPT, basedir, control, user, params, run
# if attributes in control are changed, they should be explicitly saved to package file with control.save_control_to_wapt()