GithubHelp home page GithubHelp logo

mitchty / hideshow-org Goto Github PK

View Code? Open in Web Editor NEW

This project forked from shanecelis/hideshow-org

0.0 3.0 0.0 60 KB

Provides org-mode like hide and show for hideshow.el

License: GNU General Public License v2.0

hideshow-org's Introduction

hideshow-org.el

hideshow-org.el provides an org-mode like interface to the hideshow.el file.

org-mode provides an elegant means of interacting with outlines that one can toggle with the TAB key and Shift TAB. hideshow-org.el is my attempt to bring the org-mode like hiding and showing to code.

Download

$ git clone git://github.com/secelis/hideshow-org.git

Installation

(add-to-list 'load-path "/path/to/hideshow-org-directory")
(require 'hideshow-org)

Keymaps

I set this as my global key.

(global-set-key "\C-ch" 'hs-org/minor-mode)

Here are the keys in the minor mode.

TAB       -- execute normal TAB command, if point doesn't move, try to
             toggle the visibility of the block.
<S-tab>   -- execute normal <S-tab command, if point doesn't move, try to
             toggle the visibility of all the blocks.

Notes

The hardest part was trying to figure out when TAB should behave normally: for code that usually means some variant of *-ident-line (and is incidentally one of the reason I love emacs); for outlines in org-mode that means toggling the visibility. So the solution I came up with is this. If TAB doesn't change the point, then we try to hide or show the block. And we do a similar thing for Shift TAB. Hopefully, this will be sufficient such that hs-org/minor-mode does not get in the way of anyone's normal programming habits.

Many thanks to the developers of hideshow.el. Thanks to yasnippets.el for showing me how one could piggyback on an already bound key.

hideshow-org's People

Contributors

tarsius avatar mattfidler avatar

Watchers

Mitch Tishmack avatar James Cloos avatar  avatar

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.