本文整理匯總了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")