GithubHelp home page GithubHelp logo

et2010 / aggressive-fill-paragraph-mode Goto Github PK

View Code? Open in Web Editor NEW

This project forked from davidshepherd7/aggressive-fill-paragraph-mode

1.0 2.0 0.0 58 KB

An emacs minor-mode for keeping paragraphs filled (in both comments and prose)

License: GNU General Public License v3.0

Emacs Lisp 53.32% Makefile 2.23% Gherkin 44.45%

aggressive-fill-paragraph-mode's Introduction

Aggressive fill paragraph

travis melpa

An emacs minor-mode for keeping paragraphs filled in both comments and prose.

Each time a space is inserted the current paragraph is refilled.

C-q space or just-one-space (usually bound to M-space) can be used to insert a space without filling the paragraph.

Inserting spaces after whitespace characters will not fill the paragraph (so that it is possible to insert double spaces etc).

Some special behaviour is implemented in a few major modes where the default fill-paragraph behaviour would not work well, for example when code would be filled as well as comments.

Setup

Make sure that the file aggressive-fill-paragraph.el is loaded, then call

(afp-setup-recommended-hooks)

to enable the minor mode in all places where it might be useful. Alternatively use

(add-hook '[major-mode-hook] #'aggressive-fill-paragraph-mode)

to enable aggressive-fill-paragraph-mode only in specified major modes.

You can customise which keys trigger a fill with the afp-fill-keys variable, by default both and . are used.

Compatibility with new major modes

There seems to be little consensus between different major modes on what exactly fill-paragraph should fill. For example some programming modes stick to filling comments, while others attempt to fill other things such as code and strings.

Typically automatic filling of code paragraphs is not very helpful, so we want to disable it. For simple cases where the standard emacs comment filling behaviour (as implemented in fill-comment-paragraph) suffices this can be done by simply adding the major mode to afp-fill-comments-only-mode-list, e.g.

(add-to-list 'afp-fill-comments-only-mode-list 'python-mode)

Please submit a bug report or pull request if you find a mode that should be in this list by default.

More complex cases will probably require modifications to aggressive-fill-paragraph.el.

aggressive-fill-paragraph-mode's People

Contributors

cestdiego avatar davidshepherd7 avatar et2010 avatar syohex avatar

Stargazers

 avatar

Watchers

 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.