GithubHelp home page GithubHelp logo

abred / clean-aindent-mode Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pmarinov/clean-aindent-mode

0.0 2.0 0.0 227 KB

Emacs extension for simple indent and unindent

License: Other

Emacs Lisp 100.00%

clean-aindent-mode's Introduction

README

clean-aindent-mode.el — Emacs extension for clean auto-indent and backspace unindent

Features

  • An auto-indent function (RET) that takes care to delete any unused white spaces

  • An unindent function (M-backspace) that aligns the cursor position to match indentation of best candidate from lines above

  • Simple auto-indent mode (activate via M-x customize) that disregards smart language based indentation and instead consistently aligns only based on indentation of the line above

For detailed documentation with screenshots please visit the emacswiki page.

Installation

  1. Download clean-aindent-mode.el

    $ wget https://github.com/pmarinov/clean-aindent-mode/archive/master.zip
    $ unzip master.zip
  2. Copy clean-aindent-mode.el to your ~/.emacs.d directory

    $ cp clean-aindent-master/clean-aindent-mode.el ~/.emacs.d
  3. Add this to your init.el

    (require 'clean-aindent-mode)
  4. For convenience, activate RET for auto indent operation (the default is C-j)

    (define-key global-map (kbd "RET") 'newline-and-indent))

Configuration

To activate the simple indent mode, do one of the two:

  1. In your init.el

    (set 'clean-aindent-is-simple-indent t)
  2. Via M-x customize

Search for auto indent, toggle to on. Then Apply and Save.

Installation and configuration via MELPA

An example configiration if the extension is installed via MELPA

(defun my-pkg-init()
  (electric-indent-mode -1)  ; no electric indent, auto-indent is sufficient
  (clean-aindent-mode t)
  (setq clean-aindent-is-simple-indent t)
  (define-key global-map (kbd "RET") 'newline-and-indent))
(add-hook 'after-init-hook 'my-pkg-init)

License

clean-aindent-mode was written by Peter Marinov

C0, public domain. See LICENSE.txt

Changelog

2015-06-18, v1.5.0, pmarinov

  • Fix for a compiler warning by justbur

  • Extra comments in README

2014-06-14, v1.4.0, pmarinov

  • Implement as an advice to 'newline-and-indent'

2014-06-12, v1.3.0, pmarinov

  • Changed: Change name space to be "clean-aindent--"

  • Changed: Implement a clean-aindent-mode as a way to turn on/off

  • Bugfix: Backspace unindent now handles TABs ('\t') correctly

2014-05-27, v1.2.0, pmarinov

  • Changed: Move all function under the same namespace (function prefix)

2014-03-07, v1.1.0, pmarinov

  • Added: Simple auto indent mode. Configurable via M-x customize.

2013-08-31, v1.0.0, pmarinov

  • First implementation

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.