All Projects → Wilfred → Emacs Refactor

Wilfred / Emacs Refactor

Licence: gpl-3.0
language-specific refactoring in Emacs

Programming Languages

lisp
113 projects

Projects that are alternatives of or similar to Emacs Refactor

Radian
🍉 Dotfiles that marry elegance and practicality.
Stars: ✭ 274 (-12.46%)
Mutual labels:  emacs
Company Coq
A Coq IDE build on top of Proof General's Coq mode
Stars: ✭ 297 (-5.11%)
Mutual labels:  emacs
Markovkeyboard
keyboard layout that changes by markov frequency
Stars: ✭ 307 (-1.92%)
Mutual labels:  emacs
Zetteldeft
A Zettelkasten system! Or rather, some functions on top of the emacs deft package.
Stars: ✭ 284 (-9.27%)
Mutual labels:  emacs
Fountain Mode
Emacs major mode for screenwriting in Fountain plain-text markup
Stars: ✭ 288 (-7.99%)
Mutual labels:  emacs
Cider
The Clojure Interactive Development Environment that Rocks for Emacs
Stars: ✭ 3,229 (+931.63%)
Mutual labels:  emacs
Php Ide Serenata
Atom IDE package that integrates the Serenata server to provide PHP code assistance
Stars: ✭ 277 (-11.5%)
Mutual labels:  refactoring
Indent Guide
Show vertical lines to guide indentation
Stars: ✭ 307 (-1.92%)
Mutual labels:  emacs
Vue Mode
Emacs major mode for vue.js
Stars: ✭ 290 (-7.35%)
Mutual labels:  emacs
Emacs Emojify
Display emojis in Emacs
Stars: ✭ 303 (-3.19%)
Mutual labels:  emacs
Helm Projectile
Helm UI for Projectile
Stars: ✭ 285 (-8.95%)
Mutual labels:  emacs
Helm
Emacs incremental completion and selection narrowing framework
Stars: ✭ 3,109 (+893.29%)
Mutual labels:  emacs
Suggest.el
discover elisp functions that do what you want
Stars: ✭ 302 (-3.51%)
Mutual labels:  emacs
Spacehammer
Hammerspoon config inspired by Spacemacs
Stars: ✭ 280 (-10.54%)
Mutual labels:  emacs
.spacemacs.d
My spacemacs configuration.
Stars: ✭ 307 (-1.92%)
Mutual labels:  emacs
Dotfiles
●📄 Ryan McGeary's configuration shiznit that makes him productive
Stars: ✭ 278 (-11.18%)
Mutual labels:  emacs
Emax64
64-bit Emacs for Windows with ImageMagick 7
Stars: ✭ 301 (-3.83%)
Mutual labels:  emacs
Evil Mc
Multiple cursors implementation for evil-mode
Stars: ✭ 308 (-1.6%)
Mutual labels:  emacs
Swift Mode
Emacs support for Apple's Swift programming language.
Stars: ✭ 308 (-1.6%)
Mutual labels:  emacs
Themecreator
https://mswift42.github.io/themecreator/ create themes for intellij, textmate, atom, emacs, vim and gnome terminal.
Stars: ✭ 303 (-3.19%)
Mutual labels:  emacs

emacs-refactor

Coverage Status MELPA MELPA stable

Emacs Refactor (EMR) is a framework for providing language-specific refactoring in Emacs. It includes refactoring commands for a variety of languages, including elisp itself!

Summary

To use EMR when editing, simply move point to an expression and M-x emr-show-refactor-menu.

Example

EMR ships with many refactoring commands, and pull requests for extensions are welcome. See Extension for details on extending EMR to other language modes. It's easy (honest!).

Installation

Install emr from MELPA, then configure your init.el:

(define-key prog-mode-map (kbd "M-RET") 'emr-show-refactor-menu)

Language support

Most EMR commands are context-sensitive and are available through the refactor menu. Some actions affect the whole buffer and are available in the menu bar.

General

These commands are available for all programming languages.

The following context-sensitive refactoring commands are available:

  • comment region
  • uncomment region

C

The following context-sensitive refactoring commands are available:

  • tidy includes

The following buffer-wide actions are available:

  • insert include

Refactoring support for C is a work in progress. Contributions are welcome.

Lisps

These commands are available to all Lisp dialects, including Clojure, Elisp and Common Lisp.

The following context-sensitive refactoring commands are available:

  • comment form
  • uncomment block

Elisp

The following context-sensitive refactoring commands are available:

  • delete unused definition
  • delete unused let binding form
  • eval and replace
  • extract autoload
  • extract constant
  • extract function
  • extract to let
  • extract variable
  • implement function
  • inline function
  • inline let variable
  • inline variable
  • insert autoload directive
  • tidy autoloads

The following buffer-wide actions are available:

  • find unused definitions

JavaScript

JavaScript refactoring support requires js2 refactor.

The following refactoring commands are available:

  • extract function
  • extract method
  • extract variable
  • add parameter
  • local variable to instance variable
  • log region

Ruby

Ruby refactoring support requires ruby refactor.

The following refactoring commands are available:

  • extract function
  • extract variable
  • extract constant
  • add parameter
  • extract to let

Scheme

The following refactoring commands are available:

  • extract function
  • extract variable

Extension

Use the emr-declare-command function to declare a refactoring action. The action will automatically become available in the refactoring popup menu.

This function supports predicate expressions, allowing the options displayed to be context-sensitive.

As an example, here is the declaration for a refactoring command that ships with EMR:

(emr-declare-command 'emr-el-extract-constant
  :title "constant"
  :description "defconst"
  :modes 'emacs-lisp-mode
  :predicate (lambda ()
               (not (or (emr-el:looking-at-definition?)
                        (emr-el:looking-at-let-binding-symbol?)))))

This wires the emr-el-extract-constant function to be displayed in emacs-lisp-mode, provided point is not looking at an Elisp definition or let-binding form.

If your favourite language mode already offers refactoring commands, it is simple to wire them up with EMR using this interface.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].