setbreakpoints_python


Ⅰ. 插件描述

Ⅱ. 基本信息

创建日期:  2017-10-11
使用用户:  3
Github星:  4
插件作者:  Yiteng Zhang.

Ⅲ. 安装方法

使用Vundle管理器安装

在你的.vimrc下添加:
Plugin 'sillybun/setbreakpoints-python'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall

对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。

使用NeoBundle管理器安装

在你的.vimrc下添加:
NeoBundle 'sillybun/setbreakpoints-python'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall

使用VimPlug管理器安装

在你的.vimrc下添加:
Plug 'sillybun/setbreakpoints-python'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall

使用Pathogen管理器安装

在终端中运行以下命令:
cd ~/.vim/bundle
git clone https://github.com/sillybun/setbreakpoints_python

Ⅳ. 文档说明

# setbreakpoints_python

Introduction

This is a plungin aimed to facilitate inserting and removing breakpoints in python script. It enables user to add/remove set_trace() to the code swiftly, and therefore be ready for pbd – The Python Debugger. Python3 support compilation in Vim is required.

Installation

Use your plugin manager of choice.

  • Pathogen

    • git clone https://github.com/sillybun/setbreakpoints_python ~/.vim/bundle/setbreakpoints_python
  • Vundle

    • Add Bundle 'https://github.com/sillybun/setbreakpoints_python' to .vimrc
    • Run :BundleInstall
  • NeoBundle

    • Add NeoBundle 'https://github.com/sillybun/setbreakpoints_python' to .vimrc
    • Run :NeoBundleInstall
  • vim-plug

    • Add Plug 'https://github.com/sillybun/setbreakpoints_python' to .vimrc
    • Run :PlugInstall

Usage

Add this into your .vimrc:

autocmd FileType python nnoremap <F12> :call ToggleBreakPoint()<Cr>

When you want to insert or remove a breakpoint at a certain sentence, just click F12.

Troubleshooting

  1. If E319: Sorry, the command is not available in this version: python3 import sys raised:

Please check if your vim support +python3, by :version(within vim) or vim --version | grep python3 (Terminal). If +python3 is supported, please refer to (2), otherwise see Building Vim from source.

  1. +python3 is shown in version, but :echo has('python3') gives 0:

This means vim cannot configure python3 library successifully, you may manually compile vim with --with-python3-config-dir=$PYTHON3PATH where $PYTHON3PATH is the path of your python3.
For conda users, pre-compiled macvim is recommended since it may turns complicated with the dylib.

添加新评论