Python neovim.plugin() Examples

The following are 7 code examples of neovim.plugin(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module neovim , or try the search function .
Example #1
Source File: tandem_neovim.py    From tandem with Apache License 2.0 5 votes vote down vote up
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 
Example #2
Source File: tandem_neovim.py    From tandem with Apache License 2.0 5 votes vote down vote up
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)),
        ) 
Example #3
Source File: tandem_neovim.py    From tandem with Apache License 2.0 5 votes vote down vote up
def on_text_changed(self):
        if not plugin.is_active:
            return
        self._tandem.check_buffer() 
Example #4
Source File: tandem_neovim.py    From tandem with Apache License 2.0 5 votes vote down vote up
def on_text_changed_i(self):
        if not plugin.is_active:
            return
        self._tandem.check_buffer() 
Example #5
Source File: vim_pudb.py    From pudb.vim with MIT License 5 votes vote down vote up
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]))) 
Example #6
Source File: ensime.py    From ensime-vim with MIT License 5 votes vote down vote up
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)))) 
Example #7
Source File: __init__.py    From discord.nvim with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
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")