Fork me on GitHub
#spacemacs
<
2018-07-25
>
practicalli-john00:07:55

@chase-lambert I would type {:name “left” :size 1} as it’s the most common pattern. Then copy that into the kill ring. Then type 18 followed by the vim command p and it will paste 18 times. Then just edit the bits that were different using append or cw. You could use lisp mode to jump to the end of each map, or the any-jump commands under SPC j might be easier to jump to the right places, e.g you could jump to the next number 1 and use r to replace where required.

Chase00:07:42

cool, thanks. seems like i was basically on the right track except could have used more of those shortcuts for the actual navigation. i know i'm just scratching the surface of the editing capabilities in vim/emacs so just wanted to make sure i wasn't missing a super useful navigation shortcut.

Aleksander08:07:26

you could record a macro deleting the word in double quotes and the letters

Aleksander08:07:35

or use a regex for that

Igor Garcia11:07:22

I would start with the simple list of pairs like:

head 3
left-eye 1
left-ear 1
...
Then I would replace (`:%s`) all line starts with {:name ", the spaces with " :size " and the ends with }\n

Igor Garcia11:07:18

I've just tried here. Spaces would mess up if you do the :name first but if you use tabs it will work just fine:

head	3
left-eye	1
left-ear	1
mouth	1
nose	1
neck	2
left-shoulder	3
left-upper-arm	3
chest	10
back	10
left-forearm	3
abdomen	6
left-kidney	1
left-hand	2
left-knee	2
left-thigh	4
left-lower-leg	3
left-achilles	1
left-foot	2


:%s/^/{:name \"/g
:%s/\t/\" :size /g 
:%s/\n/}\r/g

eggsyntax15:07:20

So in my user-config I try to bind a key to cider-repl-clear-buffer, but somehow it gets overridden by cider-repl-previous-input. If possible I'd like to stick with that key for consistency with other contexts. I'm binding it with

(with-eval-after-load 'cider-repl-mode-map
   (evil-define-key '(normal insert) cider-repl-mode-map
     (kbd (right-mod "k")) 'cider-repl-clear-buffer)
(`right-mod` is a personal one that refers to different keys on linux & mac). I'm binding plenty of other stuff like this in the same way, but somehow just this one gets overridden. I would think that given the with-eval-after-load, the define-key would be run after cider-repl-previous-input gets defined. BTW I can eval that manually after the repl is already up and running, and it binds just fine at that point. But it's pretty annoying to have to remember to eval it every time, even thought I've wrapped it in a fn to make it easier. Anyone have any ideas on why this is happening? And/or how to work around it?