An emacs package for easily, and visually, editing images via imgix. You can then easily use the generated imgix URL in your code or save the image.
- Emacs 24.4.1+
- imgix account (to use your own images)
imgix
is availabe on MELPA
Add a package archive to your ~/.emacs.d/init.el
or ~/.emacs
:
(require 'package)
(add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/") t)
then run M-x package-install <RET> imgix <RET>
There are two main ways to enter the *imgix*
buffer for editing images.
Use imgix-edit-url-at-url
to edit the imgix URL that is currently under the cursor. When you're done editing you can press d to replace the selected URL in that buffer with your edits.
Use imgix
to enter the the *imgix*
buffer directly.
To set up shortcut keys for these add the following to your .emacs
or use M+x to trigger them by name.
(global-set-key (kbd "C-c C-u") 'imgix-edit-url-at-point)
(global-set-key (kbd "C-c C-i") 'imgix)
When in the *imgix*
buffer the following default key bindings are available:
shortcut | about | function |
---|---|---|
u | Update imgix URL params (prompts for param and value) | imgix-update-url-param |
e | Edit full imgix URL | imgix-prompt-buffer-url |
b | Edit base imgix URL (keep applied params on new base) | imgix-prompt-buffer-url-base |
o | Open image in your default browser | imgix-open-in-browser |
s | Save image to disk | imgix-save-image |
d | Replace generated imgix URL in the buffer where imgix-edit-url-at-point was called. |
imgix-apply-inline-edit |
p | Select/Apply a preset to the current image. | imgix-prompt-preset-apply |
x | Save current imgix params as a new preset. | imgix-prompt-preset-save |
To override the default key bindings put the following your .emacs
with your new key bindings in the kbd
expression.
(setq imgix-mode-map
(let ((map (make-sparse-keymap)))
(define-key map (kbd "r") 'imgix-update-url-param) ;; to use "r" instead of "u" for updating param in *imgix*
map))