本文整理汇总了Python中neovim.plugin方法的典型用法代码示例。如果您正苦于以下问题:Python neovim.plugin方法的具体用法?Python neovim.plugin怎么用?Python neovim.plugin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类neovim
的用法示例。
在下文中一共展示了neovim.plugin方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: import neovim [as 别名]
# 或者: from neovim import plugin [as 别名]
def __init__(self, vim):
self._vim = vim
self._tandem = plugin.TandemPlugin(
vim=vim,
message_handler=self._handle_message,
)
self._text_applied = Event()
self._message = None
示例2: session
# 需要导入模块: import neovim [as 别名]
# 或者: from neovim import plugin [as 别名]
def session(self, args):
if not plugin.is_active:
self._vim.async_call(
lambda: self._vim.command('echom "No instance running."'),
)
return
self._vim.async_call(
lambda: self._vim.command('echom "Session ID: {}"'
.format(self._session_id)),
)
示例3: on_text_changed
# 需要导入模块: import neovim [as 别名]
# 或者: from neovim import plugin [as 别名]
def on_text_changed(self):
if not plugin.is_active:
return
self._tandem.check_buffer()
示例4: on_text_changed_i
# 需要导入模块: import neovim [as 别名]
# 或者: from neovim import plugin [as 别名]
def on_text_changed_i(self):
if not plugin.is_active:
return
self._tandem.check_buffer()
示例5: pudb_status
# 需要导入模块: import neovim [as 别名]
# 或者: from neovim import plugin [as 别名]
def pudb_status(self):
"""pudb_status
print the status of this plugin to :messages in neovim"""
__logger__.info('{}\n'.format(
pprint.pformat(self._bps_placed)))
__logger__.info('{}\n'.format(pprint.pformat(
[type(self), self._hlgroup, self.nvim])))
示例6: ensime_init_path
# 需要导入模块: import neovim [as 别名]
# 或者: from neovim import plugin [as 别名]
def ensime_init_path():
path = os.path.abspath(inspect.getfile(inspect.currentframe()))
expected_nvim_path_end = os.path.join('rplugin', 'python3', 'ensime.py')
expected_vim_path_end = os.path.join('autoload', 'ensime.vim.py')
if path.endswith(expected_nvim_path_end): # nvim rplugin
sys.path.append(os.path.join(
os.path.dirname(os.path.dirname(os.path.dirname(path)))))
elif path.endswith(expected_vim_path_end): # vim plugin
sys.path.append(os.path.join(
os.path.dirname(os.path.dirname(path))))
示例7: handle_lock
# 需要导入模块: import neovim [as 别名]
# 或者: from neovim import plugin [as 别名]
def handle_lock(plugin):
try:
yield
except NoDiscordClientError:
plugin.locked = True
plugin.log_warning("local discord client not found")
except ReconnectError:
plugin.locked = True
plugin.log_error("ran out of reconnect attempts")