Spacemacs - General Discussion, Blog Posts, Wiki

Packages that support package.el can be inserted in the dotspacemacs-additional-packages list. Also you can insert arbitrary code into dotspacemacs/user-init and dotspacemacs/user-config. As it is explained in the .spacemacs-file, I’d try the latter first and only if it doesn’t work, insert that snippet into the first function.

But there is already a spacemacs native smooth-scroller available and activated by default if I read that file correctly:

https://github.com/syl20bnr/spacemacs/blob/b7e51d70aa3fb81df2da6dc16d9652a002ba5e6b/layers/%2Bspacemacs/spacemacs-ui-visual/packages.el#L22

3 Likes

Thanks Nobbz. The included smooth-scroll, seems to be related to how Emacs centres text while scrolling (I think). I am looking for smooth scrolling when scrolling down the page with a mouse or trackpad (at the moment, it seems to ‘jump’ a few lines rather than scroll smoothly).

What is the correct formatting when adding additional packages? I tried this but it’s reporting an error:

dotspacemacs-additional-packages '()
;; A list of packages that cannot be updated.
(require 'smooth-scroll)
(smooth-scroll-mode t)

Also, where do I put the file? Just inside the .emacs folder?

1 Like

I got it working by doing this:

  1. Save the file anywhere on your machine, note the location’s directory (let’s say it’s "/path/to/dir/smooth-scroll.el")

  2. Go to the dotspacemacs/user-config () part of your .spacemacs.

  3. Change it to

(defun dotspacemacs/user-config ()
  ;; comments and other configurations may exist
  (add-to-load-path "/path/to/dir/")
  (autoload 'smooth-scroll-mode "smooth-scroll.el")
  (smooth-scroll-mode t)
  )

Basically, it will add the path to the file to load-path and loads it as 'smooth-scroll-mode. The (smooth-scroll-mode t) activates the setting. After adding that, restart your spacemacs using SPC q r. If successful, as stated in the file’s docs, you would see the string SScr on the mode line (status bar), bottom left.

I don’t know if this is the best way to do it, though. Still new to both emacs and spacemacs :slight_smile: Btw, the smooth-scroll is kinda clunky for me… I don’t know if you’ll find it acceptable.

The dotspacemacs-additional-packages is for adding extra MELPA packages that is not included in layers. For example, I have:

dotspacemacs-additional-packages '(atom-one-dark-theme)
2 Likes

Thanks Bobby. I looked through some of the older posts here and also put it in dotspacemacs/user-config :slight_smile:

With regards to the file, I just put it in ~/.emacs/core/libs. I would have thought there was a ~/.emacs/user or ~/.emacs/custom type folder for user packages :confused:

I wonder what the recommended method is? (Don’t want to put incorrect advice in the wiki).

The smooth-scroll itself, didn’t make any difference :lol: from what I remember I think I had to change some other settings as well… when I get more time I will go through this thread again and see if anything jogs my memory.

In the meantime, if anyone can confirm the idiomatic way to add packages that would be great :023:

Core/libs is meant for spacemacs core stuff, so it’s forbidden for us. AFAIR there is some private folder which content is ignored by git and where private packages, scripts and layers should be put.

1 Like

If you create a .spacemacs.d directory and rename your .spacemacs to init.el and drop it in there, you have a handy place to put lisp files you can commit to source control.

That said, if you want to install smooth-scroll, add it to the dotspacemacs-additional-packages property like this

Feel free to poke around my spacemacs.d as well.

1 Like

I have problem with latest version of Spacemacs after upgrade. Maybe someone could help.
Spacemacs version 0.200.5@24.5.1

- Unknown layer company-mode declarated in dotfile

My part of configuration file.

 dotspacemacs-configuration-layers
   '(
     ;; ----------------------------------------------------------------
     ;; Example of useful layers you may want to use right away.
     ;; Uncomment some layer names and press <SPC f e R> (Vim style) or
     ;; <M-m f e R> (Emacs style) to install them.
     ;; ----------------------------------------------------------------
     ;; auto-completion
     ;; better-defaults
     emacs-lisp
     markdown
     syntax-checking
     auto-completion
     erlang
     elixir
     git
     dash
     html
     org
     colors
     themes-megapack
     haskell
     javascript
     company-mode

Hmm, I have no company-mode layer in mine, unless it is something you want then I’d say just remove it. :slight_smile:

Does alchemist (or languages ) require company-mode for auto complete? If not I can remove it :slight_smile:

Just delete it you have completion in the auto-completion layer where company-mode is included.

You also have yasnippet there which I encourage the use of

Thanks for the help everyone :023: I’ve been talking to the people in the SpaceMacs Gitter chat and have updated our wiki with their recommended way of doing things.

I think the wiki is now a really good starting point for anyone wanting to give SpaceMacs a try :slight_smile:

2 Likes

Ooo, awesome! Will be nice to hand out a link to here. :smiley:

1 Like

anybody want to share a working config for git-gutter (version-control-diff-tool) and relative line number?

it seems that spacemacs currently couldn’t support this.

It is the only thing that is missing for me.:disappointed:

1 Like

Git-gutter , git gutter+ is part of the version control layer, doesn`t really need too much setup

just add this beneath the version-control layer declaration in the config file
(version-control :variables
version-control-diff-tool 'git-gutter)

Reference for keybinds etc:
http://spacemacs.org/layers/+source-control/version-control/README.html

1 Like

Oh and relative linenumbers are in the config file as well ! jsut scroll down until this text hits you

;; If non nil line numbers are turned on in all prog-mode' andtext-mode’
;; derivatives. If set to `relative’, also turns on relative line numbers.
;; (default nil)
dotspacemacs-line-numbers 'prog-mode
just change prog-mode to relative If I remember correctly nil is default.

it doesn’t work when combined with relative line number

could you share your .spacemacs?

i’m using os x, it doesn’t work.

have you tried this ?

I did, many times.

Still not working.