;; INSTALLING
;; ==========
;; To install this library, save this file to a directory in your
;; load-path' (you can view the current load-path’ using “C-h v
;; load-path RET” within Emacs), then add the following line to your
;; .emacs startup file:
;;
;; (require 'smooth-scroll)
;; (smooth-scroll-mode t)
;;
;;
Where in the .spacemacs file should we add those two lines? And where in the .emacs directory should we copy the file? (/layers or /private or?). Once confirmed I’ll add this to the wiki as well
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:
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?
Save the file anywhere on your machine, note the location’s directory (let’s say it’s "/path/to/dir/smooth-scroll.el")
Go to the dotspacemacs/user-config () part of your .spacemacs.
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 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:
Thanks Bobby. I looked through some of the older posts here and also put it in dotspacemacs/user-config
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
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 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
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.
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
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
Thanks for the help everyone 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
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.