Spacemacs - General Discussion, Blog Posts, Wiki



Thanks… but I couldn’t get it to work :frowning: is this right?

(defun dotspacemacs/user-config ()
  "Configuration function for user code.
This function is called at the very end of Spacemacs initialization after
layers configuration. You are free to put any user code."
  (add-hook 'alchemist-mode-hook 'company-mode)
  (global-linum-mode) ; Show line numbers by default
  (global-set-key (kbd "M-3") '(lambda () (interactive) (insert "#"))) ; Allow hash to be entered
  (setq-default dotspacemacs-themes '(codeschool spacemacs-dark))


did you want this to occur in insert mode or normal mode? Ill have a crack at getting it setup not that I immediately see any issues with this.


Yep, insert mode please :slight_smile:


Btw if anyone’s interested, I’ve just ported my Codeschool theme over (it probably needs some work yet tho).


(define-key evil-insert-state-map (kbd "M-3") '(lambda () (interactive) (insert "#")))

Is what you want.


Awesome, thanks - it works!! :023:

(I am beginning to think we need a whole section for code editors because they are such a huge part of programming…)


Question, I am working with Clojure and Cursive plugin for Intelij and want to do the same with Spacemacs:

  • Reload one module or all modules into iex
  • Select line of code and run it into iex


I noticed that @kblake tweeted how to do this earlier…

How to execute a region of elixir code in Spacemacs:
Select/highlight a region of code and then SPC m e r


Ok but this not exactly what I wanted. Yes this command evaluates current line but in new context.
But what I want is to load module(s)/mix project into iex (and also possible to reload these modules), and then run current selected text using code from these modules.


Anyone using Spacemacs with Macintosh Computers an European (German) Keyboard?



With vim, I’ve gotten used to using Shift+up arrow (Shift+down arrow) to scroll page up (and down).
Do you know how I can map these keys to obtain the same behavior in spacemacs ?


Ok so I think I finally found a way to do what I was looking for.
I added these lines in the dotspacemacs/user-config block in my ~/.spacemacs config:

  (define-key evil-motion-state-map (kbd "S-<up>") 'evil-scroll-page-up)
  (define-key evil-motion-state-map (kbd "S-<down>") 'evil-scroll-page-down)

Not sure if that’s the recommended way but it seems to work

Which code editor (or IDE) do you use?

How to transform Atom to Spacemacs :slight_smile:


Alchemist v1.8.0 is out


  • [Hex] Add Hex package interface for fetching specific package informations.
  • [Refcard] Update dynamic generated refcard with phoenix-mode

See Alchemist-Hex in action here:


If you are -like me- having trouble installing the latest Emacs 24.5 on Ubuntu 14.04 the following script comes in quite handy:


Couple of questions.

Is there something like StyleCop available to enforce Elixer style like for example this one?

Is it possible to autocorrect or apply the style to your code like proper indentation, use of parenthesis for functions etc. (as prescribed in the style) like for example:

# not preferred
def some_function arg1, arg2 do
   # body omitted


# preferred
def some_function(arg1, arg2) do
   # body omitted

Is it possible to “desugar” code like for example:

[ name : "J. Doe" ]


[ { :name, "J. Doe" } ]

Or remove shorthand like:

add_one = &(&1 + 1)


add_one = fn (n) -> n + 1 end


There are som hex modules available which do some suggestions on styling. Spontaniously I can think off dogma and credo.

Both do provide you with a mix task to check your code style, but as far as I know, there is no integration into any editor for them so far.


I like Credo and I use it in some of my projects. That said, I don’t think alchemist should include support for credo, except for being able to enter a mix command and display the output in a buffer—which alchemist is already capable of doing. The reason behind my thinking: While I think Credo is good I could imagine other style checker libraries coming out that I might prefer in the future for any reason.

But—this is Emacs. We can customise it to our hearts content! This doesn’t need to be part of Alchemist. We can use some of the stuff in alchemist to shoehorn credo integration into our Alchemist installation. I got the following in my Emacs configuration where I configure my Elixir environment:

(defun mg/alchemist-run-credo-on-project ()
  "Run credo on project"
  (alchemist-mix-execute "credo"))

(define-key alchemist-mode-keymap (kbd "p c") 'mg/alchemist-run-credo-on-project) 

I define a «run credo» function and bind it to the alchemist keybinding; which means that credo is run when i hit C-c a p c (I use vanilla Emacs)


The most important parts of Spacemacs run okay when I use PuTTY except some of the coloring and special characters.

Any idea on how to get this working?


Having that ugly colors is typical for emacs in a terminal. It can get even worse than what you showed us, if you activate whitespace-mode.

But I haven’t seen that black on black until now…

And the special characters is a typical problem when having unicode in a windows terminal. It just doesn’t work, because windows has a different encoding there. Perhaps you can check if putty allows some conversion?