當前位置: 首頁>>代碼示例>>Python>>正文


Python neovim.command方法代碼示例

本文整理匯總了Python中neovim.command方法的典型用法代碼示例。如果您正苦於以下問題:Python neovim.command方法的具體用法?Python neovim.command怎麽用?Python neovim.command使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在neovim的用法示例。


在下文中一共展示了neovim.command方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: place_sign

# 需要導入模塊: import neovim [as 別名]
# 或者: from neovim import command [as 別名]
def place_sign(self, buffname, lineno):
        """place_sign
        Places a new sign on the buffer and registers it as a breakpoint with
        pudb
        :param buffname:
        :param lineno:
        """
        # do nothing without a line number
        if not lineno:
            return None
        # don't place it if it has already been placed
        if self.has_breakpoint(buffname, lineno):
            return self.pudbbp(buffname, lineno)
        signcmd = "sign place {} line={} name={} file={}".format(
            signid(buffname, lineno),
            lineno,
            self.sgnname(),
            buffname)
        __logger__.debug(signcmd)
        self.nvim.command(signcmd)
        if buffname in self._bps_placed:
            self._bps_placed[buffname].append(signid(buffname, lineno))
        else:
            self._bps_placed[buffname] = [signid(buffname, lineno)]
        return self.pudbbp(buffname, lineno) 
開發者ID:SkyLeach,項目名稱:pudb.vim,代碼行數:27,代碼來源:vim_pudb.py

示例2: remove_sign

# 需要導入模塊: import neovim [as 別名]
# 或者: from neovim import command [as 別名]
def remove_sign(self, buffname, lineno):
        """remove_sign
        removes the sign from the buffer and the breakpoint from pudb
        :param buffname:
        :param bpt:
        """
        if not self.has_breakpoint(buffname, lineno):
            return
        __logger__.info(
            'removing sign %d at line: %d',
            signid(buffname, lineno),
            lineno)
        vimmsg = 'sign unplace {} file={}'.format(
            signid(buffname, lineno),
            buffname)
        __logger__.debug(vimmsg)
        self.nvim.command(vimmsg)
        self._bps_placed[buffname].pop(
            self._bps_placed[buffname].index(
                signid(buffname, lineno))) 
開發者ID:SkyLeach,項目名稱:pudb.vim,代碼行數:22,代碼來源:vim_pudb.py

示例3: AerojumpUp

# 需要導入模塊: import neovim [as 別名]
# 或者: from neovim import command [as 別名]
def AerojumpUp(self, args, range):
        """ Go up one line of matches

        Parameters:
            n/a

        Returns:
            n/a
        """
        self.aj.cursor_line_up()
        # TODO: [Performance] Incremental update of highlights?
        self.__update_highlights(self.aj.get_highlights())
        self.main_win.cursor = self.aj.get_cursor()

        self.nvim.command('startinsert')
        self.nvim.command('normal! $') 
開發者ID:ripxorip,項目名稱:aerojump.nvim,代碼行數:18,代碼來源:__init__.py

示例4: AerojumpDown

# 需要導入模塊: import neovim [as 別名]
# 或者: from neovim import command [as 別名]
def AerojumpDown(self, args, range):
        """ Go down one line of matches

        Parameters:
            n/a

        Returns:
            n/a
        """
        self.aj.cursor_line_down()
        # TODO: [Performance] Incremental update of highlights?
        self.__update_highlights(self.aj.get_highlights())
        self.main_win.cursor = self.aj.get_cursor()

        self.nvim.command('startinsert')
        self.nvim.command('normal! $') 
開發者ID:ripxorip,項目名稱:aerojump.nvim,代碼行數:18,代碼來源:__init__.py

示例5: AerojumpSelNext

# 需要導入模塊: import neovim [as 別名]
# 或者: from neovim import command [as 別名]
def AerojumpSelNext(self, args, range):
        """ Select the next match

        Parameters:
            n/a

        Returns:
            n/a
        """
        self.aj.cursor_match_next()
        # TODO: [Performance] Incremental update of highlights?
        self.__update_highlights(self.aj.get_highlights())
        self.main_win.cursor = self.aj.get_cursor()

        self.nvim.command('startinsert')
        self.nvim.command('normal! $') 
開發者ID:ripxorip,項目名稱:aerojump.nvim,代碼行數:18,代碼來源:__init__.py

示例6: AerojumpSelPrev

# 需要導入模塊: import neovim [as 別名]
# 或者: from neovim import command [as 別名]
def AerojumpSelPrev(self, args, range):
        """ Select the previous match

        Parameters:
            n/a

        Returns:
            n/a
        """
        self.aj.cursor_match_prev()
        # TODO: [Performance] Incremental update of highlights?
        self.__update_highlights(self.aj.get_highlights())
        self.main_win.cursor = self.aj.get_cursor()

        self.nvim.command('startinsert')
        self.nvim.command('normal! $') 
開發者ID:ripxorip,項目名稱:aerojump.nvim,代碼行數:18,代碼來源:__init__.py

示例7: AerojumpExit

# 需要導入模塊: import neovim [as 別名]
# 或者: from neovim import command [as 別名]
def AerojumpExit(self, args, range):
        """ Exit aerojump without moving the selection

        Parameters:
            n/a

        Returns:
            n/a
        """
        self.nvim.command('stopinsert')
        self.nvim.current.buffer = self.og_buf
        self.nvim.command('bwipeout %s' % self.aerojump_buf_num)
        self.nvim.command('bwipeout %s' % self.filt_buf_num)
        if self.uses_tabs:
            self.nvim.command('tabclose')
        # Restore original position
        self.nvim.current.window.cursor = self.top_pos
        self.nvim.command('normal! zt')
        self.nvim.current.window.cursor = self.og_pos 
開發者ID:ripxorip,項目名稱:aerojump.nvim,代碼行數:21,代碼來源:__init__.py

示例8: session

# 需要導入模塊: import neovim [as 別名]
# 或者: from neovim import command [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)),
        ) 
開發者ID:typeintandem,項目名稱:tandem,代碼行數:12,代碼來源:tandem_neovim.py

示例9: _handle_message

# 需要導入模塊: import neovim [as 別名]
# 或者: from neovim import command [as 別名]
def _handle_message(self, message):
        if isinstance(message, m.WriteRequest):
            self._message = message
            self._text_applied.clear()
            self._vim.async_call(
                lambda: self._vim.funcs.TandemHandleWriteRequest(async=True),
            )
            self._text_applied.wait()
        elif isinstance(message, m.SessionInfo):
            self._session_id = message.session_id
            self._vim.async_call(
                lambda: self._vim.command('echom "Session ID: {}"'
                                          .format(message.session_id)),
            ) 
開發者ID:typeintandem,項目名稱:tandem,代碼行數:16,代碼來源:tandem_neovim.py

示例10: open_temp_matlab_script

# 需要導入模塊: import neovim [as 別名]
# 或者: from neovim import command [as 別名]
def open_temp_matlab_script(self, args):
        dirname = os.path.join(os.path.expanduser('~'), '.vim-matlab/scratch/')
        if not os.path.exists(dirname):
            try:
                os.makedirs(dirname)
            except OSError as ex:
                # In case of a race condition
                if ex.errno != errno.EEXIST:
                    raise
        timestamp = datetime.datetime.now().strftime("%Y_%m_%d_%H_%M_%S")
        if len(args) > 0:
            filename = "{}_{}.m".format(timestamp, args[0])
        else:
            filename = "{}.m".format(timestamp)
        self.vim.command('edit {}'.format(os.path.join(dirname, filename))) 
開發者ID:daeyun,項目名稱:vim-matlab,代碼行數:17,代碼來源:__init__.py

示例11: fix_name

# 需要導入模塊: import neovim [as 別名]
# 或者: from neovim import command [as 別名]
def fix_name(self, args):
        curr_file = vim_helper.get_current_file_path()
        modified = os.path.getmtime(curr_file)
        changed = os.path.getctime(curr_file)
        head_lines = self.vim.current.buffer[:100]
        head_string = '\n'.join(head_lines)

        def get_basename_ext(path):
            filename = os.path.basename(path)
            return os.path.splitext(filename)

        def rename_function(name):
            new_head = self.function_name_pattern.sub(
                r"\1{}\3".format(name), head_string).split('\n')
            for i, line in enumerate(new_head):
                if line != head_lines[i]:
                    self.vim.current.buffer[i] = line

        basename, ext = get_basename_ext(curr_file)

        if len(args) > 0:
            new_name, new_ext = get_basename_ext(args[0])
            new_ext = new_ext if len(new_ext) > 0 else ext
            rename_function(new_name)
            self.vim.command("Rename {}{}".format(new_name, new_ext))
            return

        if vim_helper.is_current_buffer_modified() or changed != modified:
            match = self.function_name_pattern.search(head_string)
            if match is None:
                return
            function_name = match.group(2)
            self.vim.command("Rename {}{}".format(function_name, ext))
        else:
            rename_function(basename) 
開發者ID:daeyun,項目名稱:vim-matlab,代碼行數:37,代碼來源:__init__.py

示例12: set_sgnname

# 需要導入模塊: import neovim [as 別名]
# 或者: from neovim import command [as 別名]
def set_sgnname(self, sgnname):
        self.nvim.command("let g:pudb_sign_name='{}'".format(sgnname))

    # @property 
開發者ID:SkyLeach,項目名稱:pudb.vim,代碼行數:6,代碼來源:vim_pudb.py

示例13: set_bpsymbol

# 需要導入模塊: import neovim [as 別名]
# 或者: from neovim import command [as 別名]
def set_bpsymbol(self, bpsymbol):
        self.nvim.command("let g:pudb_breakpoint_symbol='{}'".format(bpsymbol))

    # @property 
開發者ID:SkyLeach,項目名稱:pudb.vim,代碼行數:6,代碼來源:vim_pudb.py

示例14: set_lgroup

# 需要導入模塊: import neovim [as 別名]
# 或者: from neovim import command [as 別名]
def set_lgroup(self, hlgroup):
        self.nvim.command("let g:pudb_highlight_group='{}'".format(hlgroup))

    # @property 
開發者ID:SkyLeach,項目名稱:pudb.vim,代碼行數:6,代碼來源:vim_pudb.py

示例15: set_launcher

# 需要導入模塊: import neovim [as 別名]
# 或者: from neovim import command [as 別名]
def set_launcher(self, launcher):
        self.nvim.command("let g:pudb_python_launcher='{}'".format(launcher))

    # @property 
開發者ID:SkyLeach,項目名稱:pudb.vim,代碼行數:6,代碼來源:vim_pudb.py


注:本文中的neovim.command方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。