Add keybinding to toggle between a keyword & a string

The function `clojure-toggle-keyword-string` will convert a string to a keyword,
or keyword to a string.

The keybinding is added under the Clojure refactor menu, in the
"cycle/clean/convert" section.

`SPC m r c :`

As this is a `clojure-mode` function, it is defined in the clojure-mode
refactoring keybinding section of packages.el.
This commit is contained in:
John Stevenson 2017-07-13 17:09:41 +01:00 committed by bmag
parent c2fe26dd83
commit 2ecfbef20a
2 changed files with 50 additions and 48 deletions

View File

@ -240,7 +240,7 @@ As this state works the same for all files, the documentation is in global
*** Refactoring
| Key Binding | Description |
|---------------+-----------------------------|
|---------------+-----------------------------------|
| ~SPC m r ?~ | describe refactoring |
| ~SPC m r a d~ | add declaration |
| ~SPC m r a i~ | add import to ns |
@ -253,6 +253,7 @@ As this state works the same for all files, the documentation is in global
| ~SPC m r c {~ | convert coll to map |
| ~SPC m r c #~ | convert coll to set |
| ~SPC m r c [~ | convert coll to vector |
| ~SPC m r c :~ | toggle between keyword and string |
| ~SPC m r c i~ | cycle if |
| ~SPC m r c n~ | clean ns |
| ~SPC m r c p~ | cycle privacy |

View File

@ -133,7 +133,8 @@
"rc(" 'clojure-convert-collection-to-list
"rc'" 'clojure-convert-collection-to-quoted-list
"rc#" 'clojure-convert-collection-to-set
"rc[" 'clojure-convert-collection-to-vector)))
"rc[" 'clojure-convert-collection-to-vector
"rc:" 'clojure-toggle-keyword-string)))
;; cider-repl-mode only
(spacemacs/set-leader-keys-for-major-mode 'cider-repl-mode