feature/evil: update README & ex commands
- Fix :sl[oad] and :ss[ave] - Disable MIA :debug +debug/run - Remove unnecessary comments
This commit is contained in:
parent
08c30336d2
commit
13bac97c07
2 changed files with 96 additions and 58 deletions
|
@ -66,10 +66,6 @@ buffers."
|
||||||
;;
|
;;
|
||||||
;; Commands
|
;; Commands
|
||||||
|
|
||||||
;;; these are defined in feature/evil
|
|
||||||
;;(evil-ex-define-cmd "al[ign]" #'+evil:align)
|
|
||||||
;;(evil-ex-define-cmd "g[lobal]" #'+evil:global)
|
|
||||||
|
|
||||||
;;; Custom commands
|
;;; Custom commands
|
||||||
;; Editing
|
;; Editing
|
||||||
(evil-ex-define-cmd "@" #'+evil:macro-on-all-lines) ; TODO Test me
|
(evil-ex-define-cmd "@" #'+evil:macro-on-all-lines) ; TODO Test me
|
||||||
|
@ -151,7 +147,7 @@ buffers."
|
||||||
;;; Project tools
|
;;; Project tools
|
||||||
(evil-ex-define-cmd "compile" #'+evil:compile)
|
(evil-ex-define-cmd "compile" #'+evil:compile)
|
||||||
(evil-ex-define-cmd "mak[e]" #'+evil:make)
|
(evil-ex-define-cmd "mak[e]" #'+evil:make)
|
||||||
(evil-ex-define-cmd "debug" #'+debug/run)
|
;; (evil-ex-define-cmd "debug" #'+debug/run)
|
||||||
(evil-ex-define-cmd "er[rors]" #'flycheck-list-errors)
|
(evil-ex-define-cmd "er[rors]" #'flycheck-list-errors)
|
||||||
|
|
||||||
;;; File operations
|
;;; File operations
|
||||||
|
@ -161,8 +157,8 @@ buffers."
|
||||||
|
|
||||||
;;; Sessions/tabs
|
;;; Sessions/tabs
|
||||||
(evil-ex-define-cmd "sclear" #'+workspace/kill-session)
|
(evil-ex-define-cmd "sclear" #'+workspace/kill-session)
|
||||||
(evil-ex-define-cmd "sl[oad]" #'+workspace:load-session)
|
(evil-ex-define-cmd "sl[oad]" #'doom/quickload-session)
|
||||||
(evil-ex-define-cmd "ss[ave]" #'+workspace:save-session)
|
(evil-ex-define-cmd "ss[ave]" #'doom/quicksave-session)
|
||||||
(evil-ex-define-cmd "tabc[lose]" #'+workspace:delete)
|
(evil-ex-define-cmd "tabc[lose]" #'+workspace:delete)
|
||||||
(evil-ex-define-cmd "tabclear" #'doom/kill-all-buffers)
|
(evil-ex-define-cmd "tabclear" #'doom/kill-all-buffers)
|
||||||
(evil-ex-define-cmd "tabl[ast]" #'+workspace/switch-to-last)
|
(evil-ex-define-cmd "tabl[ast]" #'+workspace/switch-to-last)
|
||||||
|
|
|
@ -4,26 +4,25 @@
|
||||||
#+STARTUP: inlineimages
|
#+STARTUP: inlineimages
|
||||||
|
|
||||||
* Table of Contents :TOC_3:noexport:
|
* Table of Contents :TOC_3:noexport:
|
||||||
- [[Description][Description]]
|
- [[#description][Description]]
|
||||||
- [[Module Flags][Module Flags]]
|
- [[#module-flags][Module Flags]]
|
||||||
- [[Plugins][Plugins]]
|
- [[#plugins][Plugins]]
|
||||||
- [[Hacks][Hacks]]
|
- [[#hacks][Hacks]]
|
||||||
- [[Prerequisites][Prerequisites]]
|
- [[#prerequisites][Prerequisites]]
|
||||||
- [[Features][Features]]
|
- [[#features][Features]]
|
||||||
- [[Ported vim plugins][Ported vim plugins]]
|
- [[#ported-vim-plugins][Ported vim plugins]]
|
||||||
- [[Custom Text Objects][Custom Text Objects]]
|
- [[#custom-text-objects][Custom Text Objects]]
|
||||||
- [[Custom Ex Commands][Custom Ex Commands]]
|
- [[#custom-ex-commands][Custom Ex Commands]]
|
||||||
- [[A hybrid code-folding system][A hybrid code-folding system]]
|
- [[#configuration][Configuration]]
|
||||||
- [[Differences from vim][Differences from vim]]
|
- [[#removing-evil-mode][Removing evil-mode]]
|
||||||
- [[Configuration][Configuration]]
|
- [[#restoring-old-substitution-behavior-on-ss][Restoring old substitution behavior on s/S]]
|
||||||
- [[Removing evil-mode][Removing evil-mode]]
|
|
||||||
|
|
||||||
* Description
|
* Description
|
||||||
This holy module brings the vim experience to Emacs.
|
This holy module brings the vim experience to Emacs.
|
||||||
|
|
||||||
** Module Flags
|
** Module Flags
|
||||||
+ =+everywhere= Enables evilified keybinds everywhere possible, utilizing the
|
+ =+everywhere= Enables evilified keybinds everywhere possible. Uses the
|
||||||
~evil-collection~ plugin.
|
[[https://github.com/emacs-evil/evil-collection][evil-collection]] plugin as a foundation.
|
||||||
|
|
||||||
** Plugins
|
** Plugins
|
||||||
+ [[https://github.com/emacs-evil/evil][evil]]
|
+ [[https://github.com/emacs-evil/evil][evil]]
|
||||||
|
@ -48,10 +47,9 @@ This holy module brings the vim experience to Emacs.
|
||||||
+ When a window is split, the new window will be focused.
|
+ When a window is split, the new window will be focused.
|
||||||
+ The o/O keys will respect and continue commented lines (can be disabled by
|
+ The o/O keys will respect and continue commented lines (can be disabled by
|
||||||
setting ~+evil-want-o/O-to-continue-comments~ to ~nil~).
|
setting ~+evil-want-o/O-to-continue-comments~ to ~nil~).
|
||||||
+ From visual mode, =*= and =#= will search for the current selection instead of
|
+ In visual mode, =*= and =#= will search for the current selection instead of
|
||||||
the word-at-point.
|
the word-at-point.
|
||||||
+ The ~:g[lobal]~ ex command has been modified to highlight matches
|
+ The ~:g[lobal]~ ex command has been modified to highlight matches.
|
||||||
incrementally.
|
|
||||||
+ More of vim's filename modifiers are supported in ex commands (like ~:p~,
|
+ More of vim's filename modifiers are supported in ex commands (like ~:p~,
|
||||||
~:p:h~ or ~:t~) than vanilla evil-mode offers.
|
~:p:h~ or ~:t~) than vanilla evil-mode offers.
|
||||||
+ A custom filename modifier is available in Doom: ~:P~, which expands to the
|
+ A custom filename modifier is available in Doom: ~:P~, which expands to the
|
||||||
|
@ -64,45 +62,77 @@ This module has no external prerequisites.
|
||||||
** Ported vim plugins
|
** Ported vim plugins
|
||||||
The following vim plugins have been ported to evil:
|
The following vim plugins have been ported to evil:
|
||||||
|
|
||||||
| Vim Plugin | Emacs Plugin | Keybind(s) |
|
| Vim Plugin | Emacs Plugin | Keybind(s) |
|
||||||
|-----------------------+--------------------------------+---------------------|
|
|-----------------------+--------------------------------+--------------------------------------|
|
||||||
| vim-commentary | evil-commentary | omap =gc= |
|
| vim-commentary | evil-commentary | omap =gc= |
|
||||||
| vim-easymotion | evil-easymotion | omap =gs= |
|
| vim-easymotion | evil-easymotion | omap =gs= |
|
||||||
| vim-seek or vim-sneak | evil-snipe | mmap =s=/=S= |
|
| vim-seek or vim-sneak | evil-snipe | mmap =s=/=S=, omap =z=/=Z= & =x=/=x= |
|
||||||
| vim-surround | evil-embrace and evil-surround | vmap =S=, omap =ys= |
|
| vim-surround | evil-embrace and evil-surround | vmap =S=, omap =ys= |
|
||||||
|
|
||||||
In other modules:
|
In other modules:
|
||||||
+ The tools/neotree & tools/treemacs modules contain a =NERDTree= equivalent.
|
+ The tools/neotree & tools/treemacs modules provide a =NERDTree= equivalent.
|
||||||
+ The editor/multiple-cursors module contains:
|
+ The editor/multiple-cursors module contains functionality equal to the
|
||||||
+ ~vim-multiedit~ => evil-multiedit
|
following vim plugins:
|
||||||
+ ~vim-multiple-cursors~ => evil-mc
|
+ evil-multiedit => vim-multiedit
|
||||||
|
+ evil-mc => vim-multiple-cursors
|
||||||
|
|
||||||
** Custom Text Objects
|
** Custom Text Objects
|
||||||
+ A list of new text objects:
|
This module provides a couple extra text objects, along with the built-in ones.
|
||||||
+ Blocks: ~B~ (from ~evil-textobj-anyblock~)
|
For posterity, here are the built-in ones:
|
||||||
+ Args: ~a~ (from ~evil-args~)
|
|
||||||
+ Indentation: ~i~ / ~I~ / ~J~ (from ~evil-indent-plus~)
|
+ =w W= words
|
||||||
|
+ =s= sentences
|
||||||
|
+ =p= paragraphs
|
||||||
|
+ =b= parenthesized blocks
|
||||||
|
+ =b ( ) { } [ ] < >= braces, parentheses and brackets
|
||||||
|
+ =' " `= quotes
|
||||||
|
+ =t= tags
|
||||||
|
+ =o= symbols
|
||||||
|
|
||||||
|
And these are text objects added by this module:
|
||||||
|
|
||||||
|
+ =B= any block delimited by braces, parentheses or backets (provided by
|
||||||
|
~evil-textobj-anyblock~)
|
||||||
|
+ =a= C-style fucntion arguments (provided by ~evil-args~)
|
||||||
|
+ =i I J= By indentation (I includes on line above and J includes one line
|
||||||
|
below) (provided by ~evil-indent-plus~)
|
||||||
|
+ =x= XML attributes (provided by ~exato~)
|
||||||
|
|
||||||
** Custom Ex Commands
|
** Custom Ex Commands
|
||||||
| Ex Command | Description |
|
| Ex Command | Description |
|
||||||
|----------------------+----------------------------------------------------------------------------------|
|
|----------------------+--------------------------------------------------------------------------------------|
|
||||||
| ~:al[ign][!] REGEXP~ | Align text to the first match of REGEXP. If BANG, align all matches on each line |
|
| ~:@~ | Apply macro on selected lines |
|
||||||
| ~:mv[!] NEWPATH~ | Move the current file to NEWPATH |
|
| ~:ag[!] REGEXP~ | Perform a project search with ag |
|
||||||
| ~:cp[!] NEWPATH~ | Copy the current file to NEWPATH |
|
| ~:agcwd[!] REGEXP~ | Perform a project search with ag |
|
||||||
| ~:rm[!] [PATH]~ | Delete the current buffer's file and buffer |
|
| ~:al[ign] REGEXP~ | Align text that matches REGEXP |
|
||||||
|
| ~:al[ign][!] REGEXP~ | Align text to the first match of REGEXP. If BANG, align all matches on each line |
|
||||||
** A hybrid code-folding system
|
| ~:cp[!] NEWPATH~ | Copy the current file to NEWPATH |
|
||||||
This module combines ~vimish-fold~ and ~hideshow~. The former allows arbitrary
|
| ~:dash QUERY~ | Look up QUERY (or the symbol at point) in dash docsets |
|
||||||
folds and the latter allows folds on markers and indentation. Together, they
|
| ~:dehtml [INPUT]~ | HTML decode selected text / inserts result if INPUT is given |
|
||||||
create a more consistent (and feature-complete) code-folding system.
|
| ~:enhtml [INPUT]~ | HTML encode selected text / inserts result if INPUT is given |
|
||||||
|
| ~:grep[!]~ | Perform a project search with git-grep |
|
||||||
Most vim folding keys should work, e.g. =zr=, =zm=, =za=, =zo=, etc.
|
| ~:grepcwd[!]~ | Perform a project search with git-grep |
|
||||||
|
| ~:iedit REGEXP~ | Invoke iedit on all matches for REGEXP |
|
||||||
** Differences from vim
|
| ~:k[ill]all[!]~ | Kill all buffers (if BANG, affect buffer across workspaces) |
|
||||||
+ Column-wise ranges in ex commands are enabled by default. i.e. the range in
|
| ~:k[ill]b~ | Kill all buried buffers |
|
||||||
=:'<,'>s/a/b= will only affects the visual selection, not full lines (see
|
| ~:k[ill]m[!] REGEXP~ | Kill buffers whose name matches REGEXP (if BANG, affect buffers across workspaces) |
|
||||||
~evil-ex-visual-char-range~).
|
| ~:k[ill]o~ | Kill all other buffers besides the selected one |
|
||||||
+ =:g= will incrementally highlight buffer matches.
|
| ~:k[ill]~ | Kill the current buffer |
|
||||||
|
| ~:lo[okup] QUERY~ | Look up QUERY on an online search engine |
|
||||||
|
| ~:mc REGEXP~ | Invoke multiple cursors on all matches for REGEXP |
|
||||||
|
| ~:mv[!] NEWPATH~ | Move the current file to NEWPATH |
|
||||||
|
| ~:na[rrow]~ | Narrow the buffer to the selection |
|
||||||
|
| ~:pad~ | Open a scratch pad for running code quickly |
|
||||||
|
| ~:pt[!]~ | Perform a project search with pt |
|
||||||
|
| ~:ptcwd[!]~ | Perform a project search with pt |
|
||||||
|
| ~:ral[ign] REGEXP~ | Right-align text that matches REGEXP |
|
||||||
|
| ~:repl~ | Open a REPL and/or copy the current selection to it |
|
||||||
|
| ~:retab~ | Convert indentation to the default within the selection |
|
||||||
|
| ~:rev[erse]~ | Reverse the selected lines |
|
||||||
|
| ~:rg[!]~ | Perform a project search with ripgrep |
|
||||||
|
| ~:rgcwd[!]~ | Perform a project search with rigprep |
|
||||||
|
| ~:rm[!] [PATH]~ | Delete the current buffer's file and buffer |
|
||||||
|
| ~:tcd[!]~ | Send =cd X= to tmux. X = the project root if BANG, X = ~default-directory~ otherwise |
|
||||||
|
|
||||||
* Configuration
|
* Configuration
|
||||||
** Removing evil-mode
|
** Removing evil-mode
|
||||||
|
@ -125,3 +155,15 @@ ignored without evil present (and stripped out when byte-compiling).
|
||||||
|
|
||||||
Unfortunately, since Doom was designed by a vimmer, for vimmers, little
|
Unfortunately, since Doom was designed by a vimmer, for vimmers, little
|
||||||
consideration into a keybinding scheme for vanilla Emacs users.
|
consideration into a keybinding scheme for vanilla Emacs users.
|
||||||
|
|
||||||
|
** Restoring old substitution behavior on s/S
|
||||||
|
Doom replaces the =s= and =S= keys with the =evil-snipe= package (a port of
|
||||||
|
vim-seek/vim-sneak for 2-character versions of f/F/t/T).
|
||||||
|
|
||||||
|
To disable evil-snipe on s/S, you can either:
|
||||||
|
|
||||||
|
1. Disable ~evil-snipe-mode~ by adding ~(after! evil-snipe (evil-snipe-mode
|
||||||
|
-1))~ to =$DOOMDIR/config.el=,
|
||||||
|
2. Or disable =evil-snipe= completely with ~(package! evil-snipe :disable t)~
|
||||||
|
added to =$DOOMDIR/packages.el=, but this will also disable incremental
|
||||||
|
highlighting for the f/F/t/T motions keys.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue