spacemacs/layers/+tools/chrome
syl20bnr ebe4c60264 Revert "Defer packages by default using use-package-always-defer"
This reverts commit 29c78ce841 and all other fixes
that have been made afterwards.

The motivation is that use-package is seen by many as a replacement for
`require`. Is use-package always defer the loading of packages then is breaks
this use case, this does not respect POLA so even if it was making Spacemacs
loading faster (up to 3s faster on some startup on my machine) we just cannot
use it, it would be irresponsible. Spacemacs should be easy to use, loading
performance will come with time but it is not a priority.
2018-03-03 23:40:10 -05:00
..
img
config.el
funcs.el Happy New Year 2018! 2018-01-04 02:00:25 -05:00
keybindings.el
packages.el Revert "Defer packages by default using use-package-always-defer" 2018-03-03 23:40:10 -05:00
README.org Fixed feature header 2017-08-29 20:00:44 +03:00

Chrome layer

/TakeV/spacemacs/media/commit/ebe4c602647801d59013915c8c97d44570556f3e/layers/+tools/chrome/img/chrome.png

Description

This layer provides some integration with the Google Chrome browser.

Features:

  • Edit text boxes with Emacs using edit-server
  • Write markdown in Emacs and realtime show in chrome using flymd
  • gmail message mode uses standard markdown keybindings

Install

Layer

To use this configuration layer, add it to your ~/.spacemacs. You will need to add chrome to the existing dotspacemacs-configuration-layers list in this file.

Chrome extension

edit-server is a server that responds to edit requests sent Chrome via the Google Chrome extension Edit with Emacs. You have to install this extension.

More information can be found on Emacs Wiki.

The edit server is configured to start automatically when Spacemacs starts.

Configuration

Use edit-server-url-major-mode-alist to choose a major mode initialization function based on edit-server-url, or fall back to edit-server-default-major-mode that has a current value of markdown-mode.

  (defun dotspacemacs/user-config ()
  ;; Open github text areas as org buffers
  ;; currently they are opened as markdown
    (setq edit-server-url-major-mode-alist
        '(("github\\.com" . org-mode))))

To change frame defaults (width, height, etc. use edit-server-new-frame-alist)

  (add-to-list 'edit-server-new-frame-alist '(width  . 140))
  (add-to-list 'edit-server-new-frame-alist '(height . 60))

If you want Emacs to switch focus to Chrome after done editing, you can utilize edit-server-done-hook.

Emacs cannot control focus of windows for external apps, so you need to use some sort of command line window manager like wmctrl.

The following example works on OS X:

  (add-hook 'edit-server-done-hook (lambda () (shell-command "open -a \"Google Chrome\"")))

Key bindings

Key Binding Description
SPC a F flymd-flyit

Note: You need to kill all google chrome process before using flymd-flyit.