Git Product home page Git Product logo

emacs-moz-controller's Introduction

moz-controller: Control Firefox from Emacs

It’s annoying to switch between your text editor and your web browser constantly when you’re hacking and reading web pages at the time. moz-controller allows you to control Firefox to scroll, refresh, zoom in, zoom out, close tabs and switch tabs without leaving Emacs.

Video Demo

Functions and Keybindings

functionnamekeybinding
get current tab’s urlmoz-controller-get-current-urlC-c m l
refreshmoz-controller-page-refreshC-c m R
scroll downmoz-controller-page-downC-c m n
scroll upmoz-controller-page-upC-c m p
zoom inmoz-controller-zoom-inC-c m +
zoom outmoz-controller-zoom-outC-c m -
zoom resetmoz-controller-zoom-resetC-c m 0
switch to previous tabmoz-controller-tab-previousC-c m b
switch to next tabmoz-controller-tab-nextC-c m f
close current tabmoz-controller-tab-closeC-c m k
view page source codemoz-controller-view-page-sourceC-c m u

Installation

Firefox Plugin

Install MozRepl in Firefox.

Manual Installation

First install moz.el in Emacs (you can install it via Emacs package systems such as el-get).

Then install moz-controller:

git clone [email protected]:RenWenshan/emacs-moz-controller.git

and add the following code in your .emacs or init.el:

(add-to-list 'load-path "/path/to/emacs-moz-controller")
(require 'moz-controller)

Package Installation

moz-controller is available on melpa:

  • Make sure you have melpa in the package-archives list:
    (require 'package)
    (add-to-list 'package-archives
                 '("melpa" . "http://melpa.milkbox.net/packages/") t)
    (when (< emacs-major-version 24)
      ;; For important compatibility libraries like cl-lib
      (add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/")))
    (package-initialize)
        
  • Press M-x package-list-packages to get a list of Emacs extensions.
  • Find moz-controller and install it from there.

Usage

After installation, press M-x moz-controller-mode to turn on/off moz-controller-mode in the current buffer.

Press M-x moz-controller-global-mode to turn on/off moz-controller-global-mode in all buffers, including future buffers.

To turn on moz-controller-mode globally by default, you can add (moz-controller-global-mode t) to your .emacs or init.el.

Define New Commands

I have a macro defined in moz-controller: defun-moz-controller-command

You can use it to define new moz-controller commands, for example:

(defun-moz-controller-command moz-controller-zoom-in ()
  "Zoom in."
  (concat "gBrowser.selectedBrowser.markupDocumentViewer.fullZoom += "
          (number-to-string moz-controller-zoom-step) ";")
  )

Where moz-controller-zoom-in is the function name, “Zoom in.” is the docstring, (concat …) is the command (in string format) you want MozRepl to execute.

Thanks

License

See the LICENSE file.

Copyright

(C) 2014 任文山 (Ren Wenshan) All rights reserved. renws1990 at gmail.com

Contributors

emacs-moz-controller's People

Contributors

renwenshan avatar cute-jumper avatar purcell avatar

Watchers

James Cloos avatar 周子豪, Zhou Robot ZiHao 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.