python_editing


Ⅰ. 插件描述

Folding expression for python http://www.vim.org/scripts/script.php?script_id=1494

Ⅱ. 基本信息

创建日期:  2014-12-12
使用用户:  4
Github星:  1
插件作者:  Bertrand Pechenot

Ⅲ. 安装方法

使用Vundle管理器安装

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

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

使用NeoBundle管理器安装

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

使用VimPlug管理器安装

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

使用Pathogen管理器安装

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

Ⅳ. 文档说明

This is a mirror of python http://www.vim.org/scripts/script.php?script_id=1494

  • Description :

Folding goes like this:

  1. Only top level class or function definitions are folded (no nesting)
  2. Folding is done one line after the class or function definition, so
    for example the line 'class foo( bar )' is right above the fold
  3. Fold text is the first line of the corresponding docstring (if any)
    together with the number of folded lines
  4. Toggle all folds on/off with the key F
  5. Toggle the fold under the cursor on/off with the key f
  6. In some rare cases folding can break down which can be fixed by :call ReFold()
    The reason for this break down is not known sometimes it happens when jumping
    between different files using tags.

In addition the script binds the key <Shift-e> (hint: _e_xecute) to saving the file and executing it in the interpreter assuming that /usr/bin/env exists otherwise you need to change this key mapping slightly. The keys 'gd' (hint: _g_o _d_efinition) are also bound to look for the definition of a function under the cursor similarly to the same key binding for C.

  • Install details :

Drop the file in your .vim/ftplugin/ directory (in case you already have a file there called python_editing.vim, don't forget to change the name).

添加新评论