Example #1
0
def vimdir():
    """Return the vim runtime files directory."""
    if 'vimdir' in os.environ:
        dir = os.environ['vimdir']
    else:
        path = vim.exec_vimcmd(['echon $VIM'])
        path = path.strip(' \t\r\n')
        if not os.path.isdir(path):
            nodir = ('Invalid data files path. $VIM="%s" is returned'
                ' by Vim, but this is not an existing directory.' % path)
            raise DistutilsExecError, nodir
        dir = pathjoin(path, 'vimfiles')
    return dir
Example #2
0
def vim_features():
    """Abort if missing required Vim feature."""
    output = vim.exec_vimcmd(['version'])

    print >> sys.stderr, 'checking netbeans support in vim:',
    try:
        output.index('+netbeans_intg')
    except ValueError:
        raise DistutilsExecError, 'netbeans support in vim is required'
    print >> sys.stderr, 'yes'

    print >> sys.stderr, 'checking auto commands support in vim:',
    try:
        output.index('+autocmd')
    except ValueError:
        raise DistutilsExecError, 'auto commands support in vim is required'
    print >> sys.stderr, 'yes'
Example #3
0
def build_vimhelp():
    """Add pyclewn help to Vim help."""
    helpdir = pathjoin(vimdir(), 'doc')
    print >> sys.stderr, 'running Vim help tags file generation in %s' % helpdir
    vim.exec_vimcmd(['helptags ' + helpdir, 'echo v:version'])