Coder Social home page Coder Social logo

andviro / efficient-python-folding Goto Github PK

View Code? Open in Web Editor NEW

This project forked from vim-scripts/efficient-python-folding

0.0 1.0 1.0 103 KB

Fold python code nicely and toggle with one keystroke

Home Page: http://www.vim.org/scripts/script.php?script_id=1494

Vim Script 100.00%

efficient-python-folding's Introduction

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

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.

Inspired by vimscript #515, actually the way the number of lines are displayed
is stolen from there :). A related script is vimscript #781 and a tip on
toggling a fold is vimtip #108.

efficient-python-folding's People

Contributors

andviro avatar

Watchers

 avatar

Forkers

bells

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.