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


Description
- package : tis-vim
- version : 1.2-3
- 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 : 2.0
- 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 : 2021-12-03T15:06:32.763437
- Homepage : https://www.vim.org/
Setup.py
# -*- coding: utf-8 -*-
from setuphelpers import *
"""
Usable WAPT package functions: install(), uninstall(), session_setup(), audit(), update_package()
"""
# Declaring global variables - Warnings: 1) WAPT context is only available in package functions; 2) Global variables are not persistent between calls
package_name = 'vim'
conf_file_content = r"""syntax on
let g:skip_defaults_vim = 1
"""
def install():
# Installing the package
if type_debian():
conf_file = makepath('/etc/vim/vimrc')
print("Installing package: %s" % package_name)
install_apt(package_name)
if type_redhat():
conf_file = makepath('/etc/vimrc')
print("Installing package: %s" % package_name)
install_yum(package_name)
# Editing default options 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 'let g:skip_defaults_vim = 1' in data.read():
data.write('\nlet g:skip_defaults_vim = 1')
def uninstall():
# Uninstalling the package
if type_debian():
print("Uninstalling package: %s" % package_name)
uninstall_apt(package_name)
if type_redhat():
print("Uninstalling package: %s" % package_name)
uninstall_yum(package_name)
def update_package():
pass
def uninstall_apt(package, autoremove=True):
"""
Remove package with APT
"""
if autoremove:
return run('LANG=C DEBIAN_FRONTEND=noninteractive apt-get remove --autoremove -y %s' % package)
else:
return run('LANG=C DEBIAN_FRONTEND=noninteractive apt-get remove -y %s' % package)