Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/agzam/exwm-edit

Edit mode for EXWM
https://github.com/agzam/exwm-edit

emacs exwm linux melpa window-manager

Last synced: 3 months ago
JSON representation

Edit mode for EXWM

Awesome Lists containing this project

README

        

* Description
Edit mode for [[https://github.com/ch11ng/exwm][EXWM]]

Similar to [[https://github.com/alpha22jp/atomic-chrome][atomic-chrome]]

except this package is made to work with EXWM
and it works with any editable element of any app

The idea is very simple - when you invoke the edit,
it simulates =C-a= + =C-c= (select all & copy), or simply =C-c= if you already have something pre-selected.
Then it opens a buffer and yanks (pastes) the content so you can edit it,
after you done - it grabs (now edited text) and pastes back to where it's started

[[file:howitworks.gif]]

Now that opens interesting possibilities, for example:
- when typing in ChromeDevTools console, you can initiate exwm-edit, then change major mode to whatever your favorite javascript mode is, have all the JS syntax highlighting, flycheck, etc;
- you can edit GitHub issues and wiki pages using markdown-mode and use your syntax checker and thesaurus;
- quickly modify url in browser address bar using multiple-cursors and regexp-replace things;
- edit and modify code snippets with ease in Slack;
- etc. and etc.

* Customization

In your ~init.el~ file, put the following ~use-package~ declaration before
the call to ~exwm-enable~, since adjustments to ~exwm-input-global-keys~
only take effect before EXWM is enabled.

#+begin_src emacs-lisp
(use-package exwm-edit
:config
;; Edit text in an *exwm-edit* buffer
(add-to-list 'exwm-input-global-keys '([?\C-c ?\'] . exwm-edit--compose))
(add-to-list 'exwm-input-global-keys '([?\C-c ?\'] . exwm-edit--compose))

;; You can use hooks to, e.g., set desired mode:
(defun ag-exwm/on-exwm-edit-compose ()
(spacemacs/toggle-visual-line-navigation-on)
(funcall 'markdown-mode))

(add-hook 'exwm-edit-compose-hook 'ag-exwm/on-exwm-edit-compose))
#+end_src

* Keybindings

In the ~*exwm-edit*~ buffer, you can use ~C-c '~, ~C-c C-'~, ~C-c C-c~, or
whatever key you have bound to ~save-buffer~ to insert the buffer
contents into the X program. To discard the contents of the
~*exwm-edit*~ buffer and go back to the X program, press ~C-c C-k~.

* Changelog

** v0.0.4-pre

Nothing new yet...

** v0.0.3

- Autoload ~exwm-edit--compose~ and ~exwm-edit--compose-minibuffer~
- Just loading ~exwm-edit~ no longer binds any keys
- Window display now uses standard ~display-buffer~ actions.
Customize ~exwm-edit-display-buffer-action~ instead of
~exwm-edit-split~.
- Require Emacs 27.1 or later
- Bug fixes