[Emacs] Evil visual line movement in markdown and org

Markdown and org files can contain long files that span several visual
lines. Moving with `evil-next-line' and `evil-previous-line' is not
exactly comfortable when that’s the case. `evil-next-visual-line' and
`evil-previous-visual-line' come to the rescue!
This commit is contained in:
Lucien Cartier-Tilet 2022-06-21 16:36:31 +02:00
parent 4940ee4fd3
commit e6ffd2aba2
Signed by: phundrak
GPG Key ID: BD7789E705CB8DCA
1 changed files with 63 additions and 25 deletions

View File

@ -1085,6 +1085,39 @@ windows.
("r" enlarge-window-horizontally)) ("r" enlarge-window-horizontally))
#+end_src #+end_src
This one allows me to manipulate my Emacs frames background
transparency.
#+begin_src emacs-lisp
(defun my/increase-frame-alpha-background ()
"Increase current frames alpha background."
(interactive)
(set-frame-parameter nil
'alpha-background
(min 1.0
(+ (frame-parameter nil 'alpha-background) 0.1)))
(message "%s" (frame-parameter nil 'alpha-background)))
(defun my/decrease-frame-alpha-background ()
"Decrease current frames alpha background."
(interactive)
(set-frame-parameter nil
'alpha-background
(max 0.0
(- (frame-parameter nil 'alpha-background) 0.1)))
(message "%s" (frame-parameter nil 'alpha-background)))
(defhydra my/modify-frame-alpha-background ()
"
^Transparency^ ^Other^
^^^^^^^^^^^^^^------------------------
[_t_] increase transparency [_q_] quit
[_s_] decrease transparency
"
("q" nil :exit t)
("s" my/decrease-frame-alpha-background)
("t" my/increase-frame-alpha-background))
#+end_src
* Packages Configuration * Packages Configuration
:PROPERTIES: :PROPERTIES:
:CUSTOM_ID: Packages-Configurationije0fl6184j0 :CUSTOM_ID: Packages-Configurationije0fl6184j0
@ -5099,19 +5132,21 @@ servers on my repos though.
Be prepared, I have a lot of keybindings for org-mode! They are all Be prepared, I have a lot of keybindings for org-mode! They are all
prefixed with a comma ~,~ in normal mode. prefixed with a comma ~,~ in normal mode.
#+name: org-keybinds-various #+name: org-keybinds-various
| Key chord | Function | Description | | Key chord | Function | Description |
|-----------+---------------------+-------------| |-----------+---------------------------+-------------|
| RET | org-ctrl-c-ret | | | RET | org-ctrl-c-ret | |
| * | org-ctrl-c-star | | | * | org-ctrl-c-star | |
| , | org-ctrl-c-ctrl-c | | | , | org-ctrl-c-ctrl-c | |
| ' | org-edit-special | | | ' | org-edit-special | |
| - | org-ctrl-c-minus | | | - | org-ctrl-c-minus | |
| a | org-agenda | | | a | org-agenda | |
| c | org-capture | | | c | org-capture | |
| e | org-export-dispatch | | | e | org-export-dispatch | |
| l | org-store-link | | | l | org-store-link | |
| p | org-priority | | | p | org-priority | |
| r | org-reload | | | r | org-reload | |
| t | evil-next-visual-line | |
| s | evil-previous-visual-line | |
I then have a couple of babel-related functions. I then have a couple of babel-related functions.
#+name: org-keybinds-babel #+name: org-keybinds-babel
@ -6358,12 +6393,14 @@ unfortunately.
:general :general
(phundrak/evil (phundrak/evil
:keymaps 'markdown-mode-map :keymaps 'markdown-mode-map
:packages 'markdown-mode :packages '(markdown-mode evil)
"M-RET" #'markdown-insert-list-item "M-RET" #'markdown-insert-list-item
"M-c" #'markdown-promote "M-c" #'markdown-promote
"M-t" #'markdown-move-down "M-t" #'markdown-move-down
"M-s" #'markdown-move-up "M-s" #'markdown-move-up
"M-r" #'markdown-demote) "M-r" #'markdown-demote
"t" #'evil-next-visual-line
"s" #'evil-previous-visual-line)
(phundrak/major-leader-key (phundrak/major-leader-key
:keymaps 'markdown-mode-map :keymaps 'markdown-mode-map
:packages 'markdown-mode :packages 'markdown-mode
@ -8256,16 +8293,17 @@ The prefix here is ~T~.
:END: :END:
My toggle keybinds are prefixed by ~t~. My toggle keybinds are prefixed by ~t~.
#+name: keybinds-toggle #+name: keybinds-toggle
| Key | Function | Description | | Key | Function | Description |
|-----+-----------------------+--------------| |-----+---------------------------------------+--------------|
| | | toggles | | | | toggles |
| t | counsel-load-theme | | | t | my/modify-frame-alpha-background/body | |
| d | | debug | | T | counsel-load-theme | |
| de | toggle-debug-on-error | | | d | | debug |
| dq | toggle-debug-on-quit | | | de | toggle-debug-on-error | |
| i | | input method | | dq | toggle-debug-on-quit | |
| it | toggle-input-method | | | i | | input method |
| is | set-input-mode | | | it | toggle-input-method | |
| is | set-input-mode | |
** Windows ** Windows
:PROPERTIES: :PROPERTIES: