Skip to content

andreas-roehler/operator-mode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

operator mode

CircleCI operator-mode

Auto-add spaces around operators if appropriate.

For example typing

a=10*5+2

according to language might result in

a = 10 * 5 + 2

Should work out of the box for most languages. Currently the following languages are explicitly configured:

Agda
Clojure
Coq
Emacs Lisp
Haskell
Idris
Java
Python
Scala
Shell
Sql
Text

Please file bug-report, should your language is missing.

Setup

Put something like this in your init-file:

(add-to-list 'load-path "/MY-PATH-TO-OPERATOR") (require 'operator)

Then just M-x operator-mode RET. To switch it off just call this again - resp. with negative argument.

Or add the relevant mode hook.

For example for python-mode write: (add-hook 'python-mode-hook #'operator-mode)

History

This is inspired by [electric-operator] https://github.com/davidshepherd7/electric-operator.git

Whilst electric-operator is based on a heavily refactored version of simple-spacing by William Xu with contributions from Nikolaj Schumacher. Electric-spacing is itself based on smart-operator, also by William Xu.

About

Add spaces around operators if appropriate.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages