Fork me on GitHub
#spacemacs
<
2018-02-09
>
joshkh13:02:46

i'm pretty new to spacemacs. i see it supports clojure symbol replacement using clojure-enable-fancify-symbols which works fine, but is there a way for me to add more symbols to replace such as defn?

chris13:02:20

if you look at the source for clojure/fancify-symbols (which is in funcs.el in the clojure layer)

chris13:02:40

you'll see that it is just adding things to font-lock-add-keywords MODE

chris14:02:05

so presumably you can just call that function directly from your code to add additional symbols

joshkh14:02:48

hey that's great, thanks chris!

joshkh14:02:59

apologies for the newbie questions, but is the standard way of wrapping with parens / brackets, expanding selections, slurping etc really to drop out of insert mode and use the SPC v and SPC k menus? is there a way to stay in insert mode? for instance in cursive i can just ctrl + shift + ( and my current form gets wrapped.

chris14:02:26

you can just use whatever you have set as dotspacemacs-emacs-leader-key k w

chris14:02:37

I just use evil-surround, personally

joshkh14:02:55

thanks. i'll look into it.

joshkh14:02:45

erm, last question, but how do i paste (yank?) from outside emacs into the buffer?

chris15:02:35

what part isn't working? That's pretty much always 'just worked' for me

joshkh15:02:29

i'm sure it's just me missing some fundamentals (and learning both vim modes and emacs). C + y was only pasting the first letter of what i had on the clipboard but hitting it again seemed to work. thanks!

chris15:02:18

hmm, that's weird. are you using hybrid editing mode?

joshkh15:02:48

fresh out of the box in evil mode, as far as i can tell

chris15:02:53

you're on spacemacs right? near the top of the dotspacemacs-init function there's a var called dotspacemacs-editing-style

chris15:02:06

mine is set to vim

chris15:02:33

and when I'm in insert most emacs style keybindings are not bound (so C-y doesn't yank into the buffer, for example)

chris15:02:03

if you set it to hybrid you can get most emacs things bound when in insert

chris15:02:23

ymmv though, the only time I used it (which was awhile ago) it was pretty buggy

joshkh15:02:40

yup, looks like i'm using vim mode as well. maybe i'll start over with a new spacemacs instance just for good luck.

jeff.terrell15:02:57

@joshkh - Regarding wrapping with parens etc, you can do that in insert mode. Try M-m k w in insert mode, for example. However, those SPC k commands take you out of insert mode afterward and into the transient state, so you can't really stay in insert mode with those anyway. (Other commands might let you.) I think if that's important to you, other paredit-style editing packages for emacs might serve you better.

jeff.terrell15:02:08

Also, in macOS, I have success pasting in insert mode with command-v like with other apps.

joshkh15:02:27

thanks for the info. i'll first wrap my head around the default setup before getting crazy with customization. i'm sure the community has put together a great starting point and that i'm just feeling the learning curve of a new editor. on a side note, chris, editing fancify-symbols worked well for me.

Drew Verlee15:02:31

if i want to run multiple Clojure projects whats the way to do that in spacemacs? In intelliji is multi projects. in emacs/spacemacs is it multiple buffers?

mccraigmccraig17:02:56

@drewverlee projectile works pretty well - although i'm not sure which spacemacs layer is bringing it in to my config

Drew Verlee17:02:53

yea. it seems its straight forward it just happend to not work with the directory i was trying to jump into.

Drew Verlee17:02:18

projectile-switch-project or something

ag18:02:40

>if i want to run multiple Clojure projects whats the way to do that in spacemacs? use layouts aka persps. SPC l

ag18:02:58

"layouts" and "eyebrowse" are two extremely handy tools, first one you'd use to keep separate context for every project, second - for multiple window configs within a single project

ag18:02:32

e.g. SPC l 1 foo then open "project Foo", SPC l 2 then open "project Bar" - you have two different contexts for two projects, you can switch between them using "layouts keys" - check SPC l ?

ag18:02:52

then within "project Foo" you may have one window config with two vertical splits for "code", and then if you want to have a different set of windows and buffers for "tests" you can create it with SPC l w