summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSomelauw <Somelauw>2017-07-18 15:33:01 +0200
committerSomelauw <Somelauw>2017-07-18 15:33:01 +0200
commita647aae9655058a9381fd512ff3c2ff940481267 (patch)
tree1db97174d0351aa5a76d2d28a3120bdd26887e91
parent25a6d5b05a5c19a105c59215f16888c89c245712 (diff)
Move org-beginning-of-line from ^ to 0.
-rw-r--r--doc/changelog.org31
-rw-r--r--doc/keythemes.org6
-rw-r--r--evil-org.el41
3 files changed, 40 insertions, 38 deletions
diff --git a/doc/changelog.org b/doc/changelog.org
index 00bef37..6ad4c75 100644
--- a/doc/changelog.org
+++ b/doc/changelog.org
@@ -1,6 +1,7 @@
* Version 0.8
- - Make evil-org-a-greater-org-object (ar), evil-org-inner/a-subtree (iR, aR) text objects linewise. The other text objects remain characterwise.
- - Improvements to o/O
+ - Make evil-org-a-greater-org-object (=ar=), evil-org-inner/a-subtree (=iR=, =aR=) text objects linewise. The other text objects remain characterwise.
+ - Improvements to =o/O=
+ - Bind =org-beginning-to-line= to =0=. Leave =^= mapped to =evil-first-non-blank=.
* Version 0.7
- A hook is no longer created automatically. The following line of code is from now on required in a user config:
#+BEGIN_SRC emacs-lisp
@@ -8,21 +9,21 @@
#+END_SRC
- Leader key bindings are removed. See [[file:example_config.el][example config]] for an example how you can set them up yourself.
- Redone text objects
- - Sentence (is/as) and paragraph (ip/ap) text objects no longer get special treatment in tables. Use ie/ae for cells and ir/ar for tables instead.
- - Move element text object bindings from ie/ae to iE/aE
- - New text object ie/ae that works on elements and a few smaller objects.
- - Move subtree text object bindings from ir/ar to iR/aR
- - New text object ir/ar that works on recursive objects. Repeatable in visual mode.
- - Make o/O customizable by =evil-org-special-o/O=.
+ - Sentence (=is/as=) and paragraph (=ip/ap=) text objects no longer get special treatment in tables. Use =ie/ae= for cells and =ir/ar= for tables instead.
+ - Move element text object bindings from =ie/ae= to =iE/aE=
+ - New text object =ie/ae= that works on elements and a few smaller objects.
+ - Move subtree text object bindings from =ir/ar= to =iR/aR=.
+ - New text object =ir/ar= that works on recursive objects. Repeatable in visual mode.
+ - Make =o/O= customizable by =evil-org-special-o/O=.
* Between versions 0.1.2 and 0.6.3
- less controversial default keybindings (see issue [[https://github.com/edwtjo/evil-org-mode/issues/13][#13]])
- t, T, O and leader bindings are no longer bound by default, but can be enabled using key themes.
+ =t=, =T=, =O= and leader bindings are no longer bound by default, but can be enabled using key themes.
- leader keys are deprecated and evil-leader is no longer required
- customizable movement keys (as a courtesy to dvorak users)
- - new operators (>, <) for promotion, demotion. Can also be used for plain indentation when in a code block.
- That means < and > are no longer bound to org-meta-left/right.
+ - new operators (=>=, =<=) for promotion, demotion. Can also be used for plain indentation when in a code block.
+ That means =<= and =>= are no longer bound to =org-meta-left/right=.
- new text objects
- - ae, ar to match element, subheading
- - ap, as to match whole table, table cell in table context
- - optional insert mode bindings C-d and C-t
- - table support for keys: x, X, (, ), { and }.
+ - =ae=, =ar= to match element, subheading
+ - =ap=, =as= to match whole table, table cell in table context
+ - optional insert mode bindings =C-d= and =C-t=
+ - table support for keys: =x=, =X=, =(=, =)=, ={= and =}=.
diff --git a/doc/keythemes.org b/doc/keythemes.org
index 7308688..3b0b727 100644
--- a/doc/keythemes.org
+++ b/doc/keythemes.org
@@ -16,8 +16,8 @@
|-------+-------------------------------+-----------------------------------------|
| =x= | evil-org-delete-char | like x but keep tables and tags aligned |
| =X= | evil-org-delete-previous-char | like X but keep tables and tags aligned |
- | =$= | org-end-of-line | like $ but stop before fold marker* |
- | =^= | org-beginning-of-line | like 0 but can be special* |
+ | =0= | org-beginning-of-line | like 0 but can be special* |
+ | =$= | org-end-of-line | like $ but can be special* |
| =TAB= | org-cycle | change folding level of current heading |
| =o= | evil-org-open-below | like o but continue tables and items* |
| =O= | evil-org-open-above | like O but continue tables and items* |
@@ -27,7 +27,7 @@
| =}= | org-forward-paragraph | end of table |
|-------+-------------------------------+-----------------------------------------|
- * Set =org-special-ctrl-a/e= to =t= to make =org-beginning-of-line= and =org-end-of-line= ignore leading stars and ending tags on headings.
+ * Set =org-special-ctrl-a/e= to =t= to make =org-beginning-of-line= and =org-end-of-line= ignore leading stars or tags on headings. Repeat to toggle. By default it's set to ~nil~.
* The cases in which =o= and =O= should behave special can be controlled using =evil-org-special-o/O=. By default it's set to ~'(table-row item)~.
*** Operators
diff --git a/evil-org.el b/evil-org.el
index b2d8e52..381edb1 100644
--- a/evil-org.el
+++ b/evil-org.el
@@ -503,37 +503,38 @@ Includes tables, list items and subtrees."
;;; Keythemes
(defun evil-org--populate-base-bindings ()
"Bindings that are always available."
- (dolist (state '(normal visual operator motion))
- (evil-define-key state evil-org-mode-map
- (kbd "$") 'org-end-of-line
- (kbd "^") 'org-beginning-of-line
- (kbd "x") 'evil-org-delete-char
- (kbd "X") 'evil-org-delete-backward-char
- (kbd ")") 'evil-org-forward-sentence
- (kbd "(") 'evil-org-backward-sentence
- (kbd "}") 'org-forward-paragraph
- (kbd "{") 'org-backward-paragraph
- (kbd "<C-return>") (lambda ()
+ ;; (let-alist evil-org-movement-bindings)
+ (let ((motion-map (evil-get-auxiliary-keymap evil-org-mode-map 'motion t)))
+ (evil-redirect-digit-argument motion-map "0" 'org-beginning-of-line))
+ (evil-define-key 'motion evil-org-mode-map
+ (kbd "$") 'org-end-of-line
+ (kbd "x") 'evil-org-delete-char
+ (kbd "X") 'evil-org-delete-backward-char
+ (kbd ")") 'evil-org-forward-sentence
+ (kbd "(") 'evil-org-backward-sentence
+ (kbd "}") 'org-forward-paragraph
+ (kbd "{") 'org-backward-paragraph
+ (kbd "<C-return>") (lambda ()
+ (interactive)
+ (evil-org-eol-call
+ #'org-insert-heading-respect-content))
+ (kbd "<C-S-return>") (lambda ()
(interactive)
(evil-org-eol-call
- #'org-insert-heading-respect-content))
- (kbd "<C-S-return>") (lambda ()
- (interactive)
- (evil-org-eol-call
- #'org-insert-todo-heading-respect-content))))
(dolist (state '(normal visual))
(evil-define-key state evil-org-mode-map
(kbd "<") 'evil-org-promote-or-dedent
(kbd ">") 'evil-org-demote-or-indent
(kbd "<tab>") 'org-cycle
(kbd "<S-tab>") 'org-shifttab))
+ #'org-insert-todo-heading-respect-content)))
(evil-define-key 'normal evil-org-mode-map
(kbd "o") 'evil-org-open-below
(kbd "O") 'evil-org-open-above))
(defun evil-org--populate-textobjects-bindings ()
"Text objects."
- (dolist (state '(visual operator))
+ (let ((state '(visual operator)))
(evil-define-key state evil-org-mode-map "ae" 'evil-org-an-object)
(evil-define-key state evil-org-mode-map "ie" 'evil-org-inner-object)
(evil-define-key state evil-org-mode-map "aE" 'evil-org-an-element)
@@ -577,9 +578,9 @@ Includes tables, list items and subtrees."
(defun evil-org--populate-additional-bindings ()
"Bindings with meta and control."
(let-alist evil-org-movement-bindings
- (dolist (state (if evil-org-use-additional-insert
- '('normal visual insert)
- '(normal visual)))
+ (let ((state (if evil-org-use-additional-insert
+ '('normal visual insert)
+ '(normal visual))))
(evil-define-key state evil-org-mode-map
(kbd (concat "M-" .left)) 'org-metaleft
(kbd (concat "M-" .right)) 'org-metaright