当前位置: 首页>>代码示例>>Python>>正文


Python vim.vars方法代码示例

本文整理汇总了Python中vim.vars方法的典型用法代码示例。如果您正苦于以下问题:Python vim.vars方法的具体用法?Python vim.vars怎么用?Python vim.vars使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在vim的用法示例。


在下文中一共展示了vim.vars方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: highlight_line

# 需要导入模块: import vim [as 别名]
# 或者: from vim import vars [as 别名]
def highlight_line(group, buf_number, line_number):
    match_id = int(vim.buffers[buf_number].vars.get('_roast_match_id', 0))

    if match_id:
        win = None
        for win in vim.windows:
            if win.buffer.number == buf_number:
                break

        try:
            vim.eval(f'matchdelete({match_id})' if win is None else f'matchdelete({match_id}, {win.number})')
        except vim.error:
            # TODO: Only hide E803 error, which is thrown if this match_id has already been deleted.
            pass

    vim.buffers[buf_number].vars['_roast_match_id'] = vim.eval(
        fr"matchadd('{group}', '\V' . escape(getbufline({buf_number}, {line_number + 1})[0], '\') . '\$')"
    ) 
开发者ID:sharat87,项目名称:roast.vim,代码行数:20,代码来源:roast.py

示例2: __init__

# 需要导入模块: import vim [as 别名]
# 或者: from vim import vars [as 别名]
def __init__(self, vim):
        Ncm2Source.__init__(self, vim)

        env = vim.vars['ncm2_jedi#environment']
        if not env:
            osenv = os.environ
            if 'VIRTUAL_ENV' not in osenv and 'CONDA_PREFIX' in osenv:
                # if conda is active
                self._env = jedi.create_environment(osenv['CONDA_PREFIX'])
            else:
                # get_default_environment handles VIRTUAL_ENV
                self._env = jedi.get_default_environment()
        else:
            self._env = jedi.create_environment(env)

        rc_settings = vim.vars['ncm2_jedi#settings']
        for name in rc_settings:
            setattr(settings, name, rc_settings[name]) 
开发者ID:ncm2,项目名称:ncm2-jedi,代码行数:20,代码来源:ncm2_jedi.py

示例3: show_error

# 需要导入模块: import vim [as 别名]
# 或者: from vim import vars [as 别名]
def show_error(message: str):
    vim.vars['__roast_error_message'] = message
    vim.eval("timer_start(10, {_ -> execute(['echohl Error', 'redraw', 'echomsg g:__roast_error_message',"
             " 'echohl None', 'unlet g:__roast_error_message'], '')})") 
开发者ID:sharat87,项目名称:roast.vim,代码行数:6,代码来源:roast.py

示例4: next_render

# 需要导入模块: import vim [as 别名]
# 或者: from vim import vars [as 别名]
def next_render(delta=1):
    renderer = vim.current.buffer.vars['_roast_renderer']
    if not isinstance(renderer, str):
        renderer = renderer.decode()
    vim.command('buffer __roast_' + renderers[(renderers.index(renderer) + delta) % len(renderers)] + '__') 
开发者ID:sharat87,项目名称:roast.vim,代码行数:7,代码来源:roast.py

示例5: test_binary

# 需要导入模块: import vim [as 别名]
# 或者: from vim import vars [as 别名]
def test_binary():
    assert NoName().binary == 'ls'
    with mock.patch.dict(vim.vars, {'validator_no_name_binary': b'lls'}):
        assert NoName().binary == 'lls' 
开发者ID:maralla,项目名称:validator.vim,代码行数:6,代码来源:test_validator.py

示例6: test_args

# 需要导入模块: import vim [as 别名]
# 或者: from vim import vars [as 别名]
def test_args():
    assert NoName().cmd_args == '-a -b -c -d'
    with mock.patch.dict(vim.vars, {'validator_no_name_args': b'-l'}):
        assert NoName().cmd_args == '-l' 
开发者ID:maralla,项目名称:validator.vim,代码行数:6,代码来源:test_validator.py

示例7: test_load_checkers

# 需要导入模块: import vim [as 别名]
# 或者: from vim import vars [as 别名]
def test_load_checkers():
    import vim

    with mock.patch.dict(vim.vars, {
            'validator_filetype_map': {b'abcd': b'linter1'}}):
        assert isinstance(load_checkers(b'abcd')['checker1'], Linter1)
    assert isinstance(load_checkers(b'linter2')['checker2'], Linter2) 
开发者ID:maralla,项目名称:validator.vim,代码行数:9,代码来源:test_load.py

示例8: nvim_call_function

# 需要导入模块: import vim [as 别名]
# 或者: from vim import vars [as 别名]
def nvim_call_function(method, args):
    vim.vars['_neovim_rpc_tmp_args'] = args
    # vim.eval('getcurpos()') return an array of string, it should be an array
    # of int.  Use json_encode to workaround this
    return vim.bindeval('call("%s",g:_neovim_rpc_tmp_args)' % method) 
开发者ID:roxma,项目名称:vim-hug-neovim-rpc,代码行数:7,代码来源:neovim_rpc_methods.py

示例9: nvim_get_var

# 需要导入模块: import vim [as 别名]
# 或者: from vim import vars [as 别名]
def nvim_get_var(name):
    return vim.vars[name] 
开发者ID:roxma,项目名称:vim-hug-neovim-rpc,代码行数:4,代码来源:neovim_rpc_methods.py

示例10: nvim_set_var

# 需要导入模块: import vim [as 别名]
# 或者: from vim import vars [as 别名]
def nvim_set_var(name, val):
    vim.vars[name] = val
    return val 
开发者ID:roxma,项目名称:vim-hug-neovim-rpc,代码行数:5,代码来源:neovim_rpc_methods.py

示例11: nvim_buf_get_var

# 需要导入模块: import vim [as 别名]
# 或者: from vim import vars [as 别名]
def nvim_buf_get_var(buffer, name):
    return buffer.vars[name] 
开发者ID:roxma,项目名称:vim-hug-neovim-rpc,代码行数:4,代码来源:neovim_rpc_methods.py

示例12: nvim_buf_set_var

# 需要导入模块: import vim [as 别名]
# 或者: from vim import vars [as 别名]
def nvim_buf_set_var(buffer, name, val):
    buffer.vars[name] = val 
开发者ID:roxma,项目名称:vim-hug-neovim-rpc,代码行数:4,代码来源:neovim_rpc_methods.py

示例13: nvim_win_set_var

# 需要导入模块: import vim [as 别名]
# 或者: from vim import vars [as 别名]
def nvim_win_set_var(window, name, val):
    window.vars[name] = val 
开发者ID:roxma,项目名称:vim-hug-neovim-rpc,代码行数:4,代码来源:neovim_rpc_methods.py

示例14: nvim_set_client_info

# 需要导入模块: import vim [as 别名]
# 或者: from vim import vars [as 别名]
def nvim_set_client_info(*args):
    # https://github.com/roxma/vim-hug-neovim-rpc/issues/61
    vim.vars['_neovim_rpc_client_info'] = args 
开发者ID:roxma,项目名称:vim-hug-neovim-rpc,代码行数:5,代码来源:neovim_rpc_methods.py

示例15: nvim_get_client_info

# 需要导入模块: import vim [as 别名]
# 或者: from vim import vars [as 别名]
def nvim_get_client_info():
    if '_neovim_rpc_client_info' not in vim.vars:
        return []
    return vim.vars['_neovim_rpc_client_info'] 
开发者ID:roxma,项目名称:vim-hug-neovim-rpc,代码行数:6,代码来源:neovim_rpc_methods.py


注:本文中的vim.vars方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。