Skip to content

Commit

Permalink
[editing] Integrate evil-vimish-fold via dotspacemacs-folding-method
Browse files Browse the repository at this point in the history
Not confident that I have plugged this in everywhere that I should have. However
I tested locally and it seems to be working.
  • Loading branch information
Keith Pinson authored and smile13241324 committed Oct 15, 2020
1 parent e98d865 commit f4a050b
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 6 deletions.
6 changes: 4 additions & 2 deletions CHANGELOG.org
Original file line number Diff line number Diff line change
Expand Up @@ -1310,7 +1310,7 @@
=dotspacemacs-command-key=. This variable represents the key to press after
the leader key to execute =M-x=. Default value is ~SPC~.
- New variable =dotspacemacs-folding-method= to allow choosing between
different code folding methods. Currently supported are =evil= and =origami=.
different code folding methods. Currently supported are =evil=, =origami= and =vimish=.
Default value is =evil=. (thanks to ralesi)
- New variable =dotspacemacs-ex-substitute-global=, if non-nil then
the behavior of the =g= flag in =:substitute= ex-command is inverted.
Expand Down Expand Up @@ -1342,7 +1342,9 @@
*** Distribution layer changes
- Add package =evil-ediff= (thanks to justbur)
- Add package =evil-visual-mark-mode= (thanks to nixmaniack)
- Add package =origmai= (used only if new variable =dotspacemacs-folding-method=
- Add packages =vimish-fold= and =evil-vimish-fold= (used only if new variable =dotspacemacs-folding-method=
is set to =origami=) (thanks to Keith Pinson)
- Add package =origami= (used only if new variable =dotspacemacs-folding-method=
is set to =origami=) (thanks to ralesi)
- Add package =link-hint=:
- ~SPC x o~ to use avy to select a link in the frame and open it
Expand Down
2 changes: 1 addition & 1 deletion core/core-dotspacemacs.el
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ pressing `<leader> m`. Set it to `nil` to disable it.")
running Emacs in terminal.")

(defvar dotspacemacs-folding-method 'evil
"Code folding method. Possible values are `evil' and `origami'.")
"Code folding method. Possible values are `evil', `origami' and `vimish'.")

(defvar dotspacemacs-default-layout-name "Default"
"Name of the default layout.")
Expand Down
2 changes: 1 addition & 1 deletion core/templates/.spacemacs.template
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ It should only modify the values of Spacemacs settings."
;; (default nil)
dotspacemacs-line-numbers nil

;; Code folding method. Possible values are `evil' and `origami'.
;; Code folding method. Possible values are `evil', `origami' and `vimish'.
;; (default 'evil)
dotspacemacs-folding-method 'evil

Expand Down
2 changes: 1 addition & 1 deletion layers/+spacemacs/spacemacs-editing/README.org
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ This layer adds packages to improve editing with Spacemacs.
- Support for selecting, copying and opening links using =avy= via =link-hint=.
- Adding of sample text via =lorem-ipsum=.
- Transient state for moving text via =move-text=.
- Support for folding of code via =origami=.
- Support for folding of code via =origami= and =evil-vimish-fold=.
- Support for password generation via =password-generator=.
- Support for improving parenthesis handling via =smartparens=.
- Automatic whitespace cleanup on save via =spacemacs-whitespace-cleanup=.
Expand Down
14 changes: 14 additions & 0 deletions layers/+spacemacs/spacemacs-editing/packages.el
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
string-inflection
undo-tree
uuidgen
(vimish-fold :toggle (eq 'vimish dotspacemacs-folding-method))
(evil-vimish-fold :toggle (eq 'vimish dotspacemacs-folding-method))
ws-butler))

;; Initialization of packages
Expand Down Expand Up @@ -275,6 +277,18 @@
;; Note: The key binding for the fold transient state is defined in
;; evil config

(defun spacemacs-editing/init-vimish-fold ()
(use-package vimish-fold
:ensure
:after evil))

(defun spacemacs-editing/init-evil-vimish-fold ()
(use-package evil-vimish-fold
:ensure
:after vimish-fold
:init
(setq evil-vimish-fold-target-modes '(prog-mode conf-mode text-mode))
:config (global-evil-vimish-fold-mode)))

(defun spacemacs-editing/init-password-generator ()
(use-package password-generator
Expand Down
2 changes: 1 addition & 1 deletion layers/LAYERS.org
Original file line number Diff line number Diff line change
Expand Up @@ -840,7 +840,7 @@ Features:
- Support for selecting, copying and opening links using =avy= via =link-hint=.
- Adding of sample text via =lorem-ipsum=.
- Transient state for moving text via =move-text=.
- Support for folding of code via =origami=.
- Support for folding of code via =origami= or =evil-vimish-fold=.
- Support for password generation via =password-generator=.
- Support for improving parenthesis handling via =smartparens=.
- Automatic whitespace cleanup on save via =spacemacs-whitespace-cleanup=.
Expand Down

0 comments on commit f4a050b

Please sign in to comment.