Giter VIP home page Giter VIP logo

atomic-chrome's Introduction

Atomic Chrome for Emacs MELPA MELPA Stable

This is the Emacs version of Atomic Chrome which is an extension for Google Chrome browser that allows you to edit text areas of the browser in Emacs. It's similar to Edit with Emacs, but has some advantages as below with the help of websocket.

  • The input on Emacs is reflected to the browser instantly and continuously.
  • You can use both the browser and Emacs at the same time. They are updated to the same content bi-directionally.

Since v2.0.0, Atomic Chrome for Emacs supports Ghost Text as browser extension, bringing compatibility with Firefox, too.

Screencast

Screencast

Requirements

  • Emacs: 24.3 or later
  • OS: Tested on Windows and Linux

Installation

For Chrome

Atomic Chrome for Emacs shares browser extension with the one for Atomic Chrome. Just install and setup it. Alternatively, you can use Ghost Text as browser extension.

For Firefox

Install the GhostText addon.

For Emacs

Atomic Chrome for Emacs can be installed via MELPA as below.

M-x package-install [RET] atomic-chrome [RET]

Then add the following lines to your .emacs.

(require 'atomic-chrome)
(atomic-chrome-start-server)

Usage

  1. Start Emacs.
  2. Focus the text area you want to edit on the browser.
  3. Press Atomic Chrome button on the tool bar.
  4. Contet of the text area is opened in a new buffer of Emacs.
  5. Edit content on Emacs buffer.
  6. C-c C-c to finish editing, or the buffer killed if the browser closes the connection.

Customization

Set major mode for editing buffer

The default major mode of editing buffer is text-mode. You can change the major mode manually. If you want to use a different major mode as the default, set atomic-chrome-default-major-mode like below.

(setq atomic-chrome-default-major-mode 'markdown-mode)

Additionally, you can use atomic-chrome-url-major-mode-alist to choose the major mode for a specific website based on the page URL (or, with GhostText, URL hostname) like below.

(setq atomic-chrome-url-major-mode-alist
      '(("github\\.com" . gfm-mode)
        ("redmine" . textile-mode)))

This is an association list of regexp and major mode function. If the page URL matches to on of the regexp, the corresponding major mode is selected.

Select editing buffer style

You can select the style of opening the editing buffer by atomic-chrome-buffer-open-style like below.

(setq atomic-chrome-buffer-open-style 'frame)

Available values are the followings.

  • full: Open in the selected window.
  • split: Open in the new window by splitting the selected window (default).
  • frame: Create a new frame and window in it.

frame is available only when you are using Emacs on some window system.

If you select frame, you can also set the width and height of the frame with atomic-chrome-buffer-frame-width and atomic-chrome-buffer-frame-height. Their default values are 80 and 25.

Select available browser extension

By default, Atomic Chrome for Emacs accepts the connection request from both Atomic Chrome and Ghost Text. If you never use one of them, you can disable it by setting atomic-chrome-extension-type-list like below.

(setq atomic-chrome-extension-type-list '(atomic-chrome))

Set Server Port for Ghost Text

By default, Atomic Chrome for Emacs uses the default port 4001 for Ghost Text. If you need to set this to another port, you can do it by setting atomic-chrome-server-ghost-text-port like below.

(setq atomic-chrome-server-ghost-text-port 4002)

You may also need to update Ghost Text's port setting in Chrome Extensions page.

History

version 2.0.0 (2016-11-08)

  • Add support for Ghost Text

version 1.0.1 (2016-11-06)

  • Fix updating text from Chrome doesn't work

version 1.0.0 (2016-11-05)

  • Add support for automatic window focus (#6)
  • Fix major mode issue (#1, #7)

version 0.1.0 (2016-10-23)

  • Initial version

atomic-chrome's People

Contributors

alpha22jp avatar defaultxr avatar dsdshcym avatar iquiw avatar justinjk007 avatar mavit avatar munen avatar tarsius avatar vmfhrmfoaj avatar xuchunyang 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.