Update & reformat module readmes for v2.0.9
+ completion/ivy + completion/company + feature/evil + feature/eval + feature/snippets + feature/workspaces + tools/neotree
This commit is contained in:
parent
eef6ed3d11
commit
e87b788078
7 changed files with 138 additions and 81 deletions
|
@ -1,43 +1,52 @@
|
|||
#+TITLE: :feature eval
|
||||
|
||||
This modules adds support for evaluating code from inside Emacs. This includes REPLs and direct access to the interpreters and compilers of many languages.
|
||||
This modules adds support for evaluating code from inside Emacs, including
|
||||
REPLs.
|
||||
|
||||
* Table of Contents :TOC:
|
||||
- [[#install][Install]]
|
||||
- [[#usage][Usage]]
|
||||
- [[#configuration][Configuration]]
|
||||
- [[#repls][REPLs]]
|
||||
- [[#code-evaluation][Code Evaluation]]
|
||||
- [[#code-evaluation][*Code Evaluation*]]
|
||||
- [[#configuration][Configuration]]
|
||||
- [[#repls-1][REPLs]]
|
||||
- [[#code-evaluation-1][Code Evaluation]]
|
||||
|
||||
* Install
|
||||
This module has no external dependencies. However, specific languages may require additional setup.
|
||||
This module has no external dependencies. However, specific languages may
|
||||
require additional setup.
|
||||
|
||||
Check the README.org in that language's module for details.
|
||||
|
||||
* Usage
|
||||
+ *REPLs*
|
||||
Invoked via:
|
||||
+ ~:repl~ (evil ex-command)
|
||||
+ =<leader> o r= in normal mode (or visual mode, which sends the selection to the open REPL)
|
||||
+ ~M-x +eval/open-repl~
|
||||
+ ~M-x +eval/send-region-to-repl~ while a selection (and REPL) is active
|
||||
** REPLs
|
||||
Invoked via:
|
||||
+ ~:repl~ (evil ex-command)
|
||||
+ =<leader> o r= in normal mode (or visual mode, which sends the selection to
|
||||
the open REPL)
|
||||
+ ~M-x +eval/open-repl~
|
||||
+ ~M-x +eval/send-region-to-repl~ while a selection (and REPL) is active
|
||||
|
||||
+ *Code Evaluation*
|
||||
Quickrun can be invoked via:
|
||||
+ ~M-x +eval/buffer~ (or ~gR~, or ~M-r~)
|
||||
+ ~M-x +eval/region~
|
||||
+ ~M-x +eval/region-and-replace~
|
||||
+ Evil users can use the ~gr~ operator to select and run a region.
|
||||
** *Code Evaluation*
|
||||
Quickrun can be invoked via:
|
||||
+ ~M-x +eval/buffer~ (or ~gR~, or ~M-r~)
|
||||
+ ~M-x +eval/region~
|
||||
+ ~M-x +eval/region-and-replace~
|
||||
+ Evil users can use the ~gr~ operator to select and run a region.
|
||||
|
||||
* Configuration
|
||||
** REPLs
|
||||
REPLs are defined for most of the languages Doom supports (check its README.org to see if it does).
|
||||
REPLs are defined for most of the languages Doom supports (check its README.org
|
||||
to see if it does).
|
||||
|
||||
Otherwise, you can define your own for a specified major-mode with the =:repl= setting.
|
||||
Otherwise, you can define your own for a specified major-mode with the =:repl=
|
||||
setting.
|
||||
|
||||
~(set! :repl MAJOR-MODE FUNCTION)~
|
||||
|
||||
FUNCTION must return the repl buffer. Any window changes are ignored, then handed off to shackle (assuming shackle-mode is on) to display in a popup window.
|
||||
FUNCTION must return the repl buffer. Any window changes are ignored, then
|
||||
handed off to shackle (assuming shackle-mode is on) to display in a popup
|
||||
window.
|
||||
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(defun +emacs-lisp/repl ()
|
||||
|
@ -53,9 +62,14 @@ FUNCTION must return the repl buffer. Any window changes are ignored, then hande
|
|||
#+END_SRC
|
||||
|
||||
** Code Evaluation
|
||||
Run regions or entire buffers with [[https://github.com/syohex/emacs-quickrun][Quickrun]]. Output will be sent to a popup window.
|
||||
Run regions or entire buffers with [[https://github.com/syohex/emacs-quickrun][Quickrun]]. Output is show in a popup window.
|
||||
|
||||
Quickrun includes support for many languages, but occasionally, you'll find a language without support, such as [[https://crystal-lang.org/][Crystal]]. A "runner" can be defined like so:
|
||||
Quickrun includes support for many languages, usually by sending text directly
|
||||
to interpreters or compilers. However, occasionally, you'll find a language
|
||||
without support (like [[https://crystal-lang.org/][Crystal]]), or a language with better Emacs integration
|
||||
(like elisp).
|
||||
|
||||
Here's how you define a "runner":
|
||||
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(set! :eval 'crystal-mode
|
||||
|
|
|
@ -11,12 +11,14 @@ This holy module brings the vim experience to Emacs.
|
|||
- [[#differences-from-vim][Differences from vim]]
|
||||
|
||||
* Removing evil-mode
|
||||
To get back a more vanilla Emacs experience, remove =:feature evil= from init.el. Evil-specific configuration and keybindings (defined with ~map!~) will be ignored without evil present (and removed when byte-compiling).
|
||||
See the [[https://github.com/hlissner/doom-emacs/wiki/FAQ#remove-vimevil-for-a-more-vanilla-emacs-experience][corresponding question in the FAQ]].
|
||||
|
||||
* Features
|
||||
+ A better ~:g[lobal]~ command with incremental highlighting.
|
||||
+ Adds the ~:al[ign]~ ex command: offers an ex interface to ~align-regexp~ with incremental highlighting.
|
||||
+ Support for more of vim's filename modifiers in ex commands (like ~:p~, ~:p:h~ or ~:t~) than vanilla evil-mode offers.
|
||||
+ Adds the ~:al[ign]~ ex command: offers an ex interface to ~align-regexp~ with
|
||||
incremental highlighting.
|
||||
+ Support for more of vim's filename modifiers in ex commands (like ~:p~, ~:p:h~
|
||||
or ~:t~) than vanilla evil-mode offers.
|
||||
+ A list of new text objects:
|
||||
+ Blocks: ~B~ (from ~evil-textobj-anyblock~)
|
||||
+ Args: ~a~ (from ~evil-args~)
|
||||
|
@ -31,20 +33,29 @@ To get back a more vanilla Emacs experience, remove =:feature evil= from init.el
|
|||
+ =NERDTree= equivalent is available in =:tools neotree=
|
||||
|
||||
** Multiple-cursors
|
||||
Two multiple-cursor implementations exist in this module: ~evil-mc~ and ~evil-multiedit~. Together, these provide the functionality of ~vim-multiple-cursors~.
|
||||
Two multiple-cursor implementations exist in this module: ~evil-mc~ and
|
||||
~evil-multiedit~. Together, these provide the functionality of
|
||||
~vim-multiple-cursors~.
|
||||
|
||||
The former lets you place "clone" cursors. The latter lets you interactively edit many regions from one place (like an interactive version of ~:%s~).
|
||||
The former lets you place "clone" cursors. The latter lets you interactively
|
||||
edit many regions at once (like an interactive version of ~:%s~).
|
||||
|
||||
** A hybrid code-folding system
|
||||
This module combines ~evil-vimish-fold~ and ~hideshow~. The former allows arbitrary folds and the latter allows folds on markers and indentation. Together, they create a more consistent (and feature-complete) code-folding system.
|
||||
This module combines ~evil-vimish-fold~ and ~hideshow~. The former allows
|
||||
arbitrary folds and the latter allows folds on markers and indentation.
|
||||
Together, they create a more consistent (and feature-complete) code-folding
|
||||
system.
|
||||
|
||||
Most vim folding keys should work, e.g. =zr=, =zm=, =za=, =zo=, etc.
|
||||
|
||||
** Hacks
|
||||
+ Automatically moves to new window when splitting
|
||||
+ If in visual mode, =*= and =#= will search for the current selection instead of the word-at-point.
|
||||
+ From visual mode, =*= and =#= will search for the current selection instead of
|
||||
the word-at-point.
|
||||
|
||||
** Differences from vim
|
||||
+ Column-wise ranges in ex commands are enabled by default. i.e. the range in =:'<,'>s/a/b= will only affects the visual selection, not full lines (see ~evil-ex-visual-char-range~).
|
||||
+ Column-wise ranges in ex commands are enabled by default. i.e. the range in
|
||||
=:'<,'>s/a/b= will only affects the visual selection, not full lines (see
|
||||
~evil-ex-visual-char-range~).
|
||||
+ =:g= will incrementally highlight buffer matches.
|
||||
|
||||
|
|
|
@ -8,20 +8,5 @@ This module adds snippets to Emacs, powered by yasnippet.
|
|||
* Install
|
||||
There are no extra dependencies for this module.
|
||||
|
||||
By default, this module uses the snippet library included with yasnippet.
|
||||
|
||||
For the best experience, I'd suggest installing mine from https://github.com/hlissner/emacs-snippets -- they have been tailored specifically for Doom.
|
||||
|
||||
1. Clone the repo to your private module:
|
||||
#+BEGIN_SRC bash
|
||||
git clone https://github.com/hlissner/emacs-snippets ~/.emacs.d/modules/private/$(whoami)/snippets
|
||||
#+END_SRC
|
||||
2. Tell yasnippet where to look for them:
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
;; modules/private/{USERNAME}/config.el
|
||||
(after! yasnippet
|
||||
(setq yas-snippet-dirs
|
||||
(append (list (expand-file-name "snippets/" (file-name-directory load-file-name)))
|
||||
(delq 'yas-installed-snippets-dir yas-snippet-dirs))))
|
||||
#+END_SRC
|
||||
|
||||
By default, =private/default= installs a snippet library tailored exclusively
|
||||
for Doom Emacs.
|
||||
|
|
|
@ -1,9 +1,15 @@
|
|||
#+TITLE: :feature workspaces
|
||||
|
||||
This module adds support for workspaces, powered by persp_mode, as well as a unified API for manipulating them.
|
||||
This module adds support for workspaces, powered by persp_mode, as well as a API
|
||||
for manipulating them.
|
||||
|
||||
#+begin_quote
|
||||
There are many ways to use workspaces. Some use them to group buffers/windows by project or categories (views, models, logic, etc). I use them differently: on a per-task basis, which may traverse multiple projects or aspects, but are tied to an objective. For example: implement a specific feature or fix a certain bug; sometimes unrelated to the project at hand.
|
||||
There are many ways to use workspaces. I spawn a workspace per task. Say I'm
|
||||
working in the main workspace, when I realize there is a bug in another part of
|
||||
my project. I open a new workspace and deal with it in there. In the meantime, I
|
||||
need to check my email, so mu4e gets its own workspace.
|
||||
|
||||
Once I've completed the task, I close the workspace and return to main.
|
||||
#+end_quote
|
||||
|
||||
* Table of Contents :TOC:
|
||||
|
@ -22,25 +28,33 @@ This module has no additional dependencies.
|
|||
|
||||
* Features
|
||||
** Isolated buffer-list
|
||||
When persp-mode is active, ~doom-buffer-list~ becomes workspace-restricted. You can overcome this by using ~buffer-list~.
|
||||
When persp-mode is active, ~doom-buffer-list~ becomes workspace-restricted. You
|
||||
can overcome this by using ~buffer-list~.
|
||||
|
||||
** Automatic workspaces
|
||||
A workspace is automatically created (and switched to) when you:
|
||||
|
||||
+ Create a new frame (with =make-frame=; bound to =M-N= by default)
|
||||
+ Switch to a project using ~projectile-switch-project~ (or its ivy/helm equivalents)
|
||||
+ Create a new frame (with =make-frame=; bound to =M-N= by default).
|
||||
+ Switch to a project using ~projectile-switch-project~.
|
||||
|
||||
** Session persistence
|
||||
By default, your session is autosaved when you quit Emacs (or disable ~persp-mode~). You can load a previous session with ~M-x +workspace/load-session~ or ~:sl[oad]~ (ex command).
|
||||
By default, your session is autosaved when you quit Emacs (or disable
|
||||
~persp-mode~). You can load a previous session with ~M-x
|
||||
+workspace/load-session~ or ~:sl[oad]~ (ex command).
|
||||
|
||||
You can supply either a name to load a specific session to replace your current one.
|
||||
You can supply either a name to load a specific session to replace your current
|
||||
one.
|
||||
|
||||
** Workspace persistence
|
||||
If you'd like to save a specific workspace, use ~M-x +workspace/save~, which can be loaded into the current session (as another workspace) with ~M-x +workspace/load~.
|
||||
If you'd like to save a specific workspace, use ~M-x +workspace/save~, which can
|
||||
be loaded into the current session (as another workspace) with ~M-x
|
||||
+workspace/load~.
|
||||
|
||||
* Appendix
|
||||
** Commands & Keybindings
|
||||
Here is a list of available commands, their default keybindings (defined in private/hlissner/+bindings.el), and corresponding ex commands (if any -- defined in private/hlissner/+commands.el).
|
||||
Here is a list of available commands, their default keybindings (defined in
|
||||
[[../../private/default/+bindings.el][private/default/+bindings.el]]), and corresponding ex commands (if any -- defined
|
||||
in [[../../private/default/+evil-commands.el][private/default/+evil-commands.el]]).
|
||||
|
||||
| command | key / ex command | description |
|
||||
|---------------------------+----------------------------+------------------------------------------------------------|
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue