From 848e117e2445ab3d85c56630fdb853c98c451397 Mon Sep 17 00:00:00 2001 From: George Xanthakis Date: Sat, 24 Oct 2020 00:16:47 +0300 Subject: [PATCH 1/6] Add vimish-fold binds when evil is off --- modules/editor/fold/config.el | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/modules/editor/fold/config.el b/modules/editor/fold/config.el index fd478b236..2666b11bf 100644 --- a/modules/editor/fold/config.el +++ b/modules/editor/fold/config.el @@ -85,3 +85,14 @@ "zE" #'vimish-fold-delete-all) :config (vimish-fold-global-mode +1)) + +(when (not (featurep! :editor evil)) + (use-package! vimish-fold + :init + (define-key! 'global + "C-c f v" #'vimish-fold + "C-c f a v" #'vimish-fold-refold-all + "C-c u v" #'vimish-fold-unfold + "C-c u a v" #'vimish-fold-unfold-all + "C-c d v" #'vimish-fold-delete + "C-c d a v" #'vimish-fold-delete-all))) From 3afc81662af01a2c4dc503831a5b4b145b2bf040 Mon Sep 17 00:00:00 2001 From: George Xanthakis Date: Sat, 24 Oct 2020 00:27:09 +0300 Subject: [PATCH 2/6] Add documentation for the fold module --- modules/editor/fold/README.org | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/modules/editor/fold/README.org b/modules/editor/fold/README.org index 55c93ff78..b74c128a8 100644 --- a/modules/editor/fold/README.org +++ b/modules/editor/fold/README.org @@ -4,13 +4,13 @@ #+STARTUP: inlineimages * Table of Contents :TOC_3:noexport: -- [[Description][Description]] - - [[Module Flags][Module Flags]] - - [[Plugins][Plugins]] -- [[Prerequisites][Prerequisites]] -- [[Features][Features]] -- [[Configuration][Configuration]] -- [[Troubleshooting][Troubleshooting]] +- [[#description][Description]] + - [[#module-flags][Module Flags]] + - [[#plugins][Plugins]] +- [[#prerequisites][Prerequisites]] +- [[#features][Features]] +- [[#configuration][Configuration]] +- [[#troubleshooting][Troubleshooting]] * Description This module marries hideshow, vimish-fold and outline-minor-mode to bring you @@ -20,13 +20,25 @@ marker, indent and syntax-based code folding for as many languages as possible. This module provides no flags. ** Plugins -+ evil-vimish-fold* ++[[https://github.com/alexmurray/evil-vimish-fold][evil-vimish-fold]] ++[[https://github.com/matsievskiysv/vimish-fold][vimish-fold]] * Prerequisites This module has no prerequisites. -* TODO Features +* Features + +Emacs keybinds when evil +everywhere is disabled. +| Keybind | Description | +|--------------------+---------------------------| +| =C-c f v= | Fold region | +| =C-c f a v= | Refold all regions | +| =C-c u v= or =C `= | Unfold region | +| =C-c u a v= | Unfold all regions | +| =C-c d v= | Delete folded region | +| =C-c d a v= | Delete all folded regions | * TODO Configuration -* TODO Troubleshooting +* Troubleshooting +Sometimes an unfolded region does not fold back with =C-c f v=. To bypass this bug you must delete the folded region (=C-c d v=) and then fold it(=C-c f v=) again. From 7eaf402c0bc7130cf122a642ff9199546f1ec4b4 Mon Sep 17 00:00:00 2001 From: George Xanthakis Date: Thu, 29 Oct 2020 23:35:05 +0200 Subject: [PATCH 3/6] Lazy load vimish-fold --- modules/editor/fold/config.el | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/modules/editor/fold/config.el b/modules/editor/fold/config.el index 2666b11bf..7481116e8 100644 --- a/modules/editor/fold/config.el +++ b/modules/editor/fold/config.el @@ -86,13 +86,6 @@ :config (vimish-fold-global-mode +1)) -(when (not (featurep! :editor evil)) - (use-package! vimish-fold - :init - (define-key! 'global - "C-c f v" #'vimish-fold - "C-c f a v" #'vimish-fold-refold-all - "C-c u v" #'vimish-fold-unfold - "C-c u a v" #'vimish-fold-unfold-all - "C-c d v" #'vimish-fold-delete - "C-c d a v" #'vimish-fold-delete-all))) +(use-package! vimish-fold + :unless (featurep! :editor evil) + :defer t) From 250b7d1d8b11d2dd135a4698229667b3a6b4e8c2 Mon Sep 17 00:00:00 2001 From: George Xanthakis Date: Thu, 29 Oct 2020 23:35:21 +0200 Subject: [PATCH 4/6] Move keybinds to +emacs-bindings --- modules/config/default/+emacs-bindings.el | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/modules/config/default/+emacs-bindings.el b/modules/config/default/+emacs-bindings.el index 68eb1d2dd..108553153 100644 --- a/modules/config/default/+emacs-bindings.el +++ b/modules/config/default/+emacs-bindings.el @@ -568,3 +568,13 @@ (:when (featurep! :ui treemacs) "" #'+treemacs/toggle "" #'treemacs-find-file)) + +(map! :leader + (:when (featurep! :editor fold) + (:prefix ("C-f" . "fold") + "C-d" #'vimish-fold-delete + "C-a C-d" #'vimish-fold-delete-all + "C-f" #'+fold/toggle + "C-a C-f" #'+fold/close-all + "C-u" #'+fold/open + "C-a C-u" #'+fold/open-all))) From a88d29580da311758591299fd5921fca5847a1db Mon Sep 17 00:00:00 2001 From: George Xanthakis Date: Fri, 30 Oct 2020 20:27:24 +0200 Subject: [PATCH 5/6] Update documentation with new keybinds --- modules/editor/fold/README.org | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/modules/editor/fold/README.org b/modules/editor/fold/README.org index b74c128a8..517c83714 100644 --- a/modules/editor/fold/README.org +++ b/modules/editor/fold/README.org @@ -29,16 +29,16 @@ This module has no prerequisites. * Features Emacs keybinds when evil +everywhere is disabled. -| Keybind | Description | -|--------------------+---------------------------| -| =C-c f v= | Fold region | -| =C-c f a v= | Refold all regions | -| =C-c u v= or =C `= | Unfold region | -| =C-c u a v= | Unfold all regions | -| =C-c d v= | Delete folded region | -| =C-c d a v= | Delete all folded regions | +| Keybind | Description | +|------------------------+---------------------------| +| =C-c C-f C-f= | Fold region | +| =C-c C-f C-u= or =C `= | Unfold region | +| =C-c C-f C-d= | Delete folded region | +| =C-c C-a C-f= | Refold all regions | +| =C-c C-a C-u= | Unfold all regions | +| =C-c C-a C-d= | Delete all folded regions | * TODO Configuration * Troubleshooting -Sometimes an unfolded region does not fold back with =C-c f v=. To bypass this bug you must delete the folded region (=C-c d v=) and then fold it(=C-c f v=) again. +Sometimes an unfolded region does not fold back with =C-c C-f C-f=. To bypass this bug you must delete the folded region (=C-c C-f C-d=) and then fold it(=C-c C-f C-f=) again. From d50b1528b89af6d0a0a3c66c66c8145fcf2b5aed Mon Sep 17 00:00:00 2001 From: George Xanthakis Date: Wed, 4 Nov 2020 11:43:26 +0200 Subject: [PATCH 6/6] Remove unnecessary use-package statement --- modules/editor/fold/config.el | 4 ---- 1 file changed, 4 deletions(-) diff --git a/modules/editor/fold/config.el b/modules/editor/fold/config.el index 7481116e8..fd478b236 100644 --- a/modules/editor/fold/config.el +++ b/modules/editor/fold/config.el @@ -85,7 +85,3 @@ "zE" #'vimish-fold-delete-all) :config (vimish-fold-global-mode +1)) - -(use-package! vimish-fold - :unless (featurep! :editor evil) - :defer t)