Skip to content

Commit

Permalink
Merge branch 'develop' (v0.40.0) First of 2015!
Browse files Browse the repository at this point in the history
Happy New Year !
  • Loading branch information
syl20bnr committed Jan 1, 2015
2 parents 365de21 + ad9441c commit ad7e009
Show file tree
Hide file tree
Showing 22 changed files with 2,186 additions and 187 deletions.
18 changes: 11 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ Any configuration layers you create must be explicitly loaded in your
## Dotfile (.spacemacs)

The `.spacemacs` file controls which features to load and provides a way to
customize Spacemacs' loading sequence.
customize Spacemacs.

The following command will create `.spacemacs` in your home directory:

Expand Down Expand Up @@ -278,32 +278,36 @@ first.

# FAQ

1. **Why installed packages with package-install are automatically deleted by
1. **Which version of Spacemacs am I running ?**
The version is displayed on the upper right corner of the loading screen. It
is also possible to display the version with <kbd>SPC f e v</kbd>.

2. **Why installed packages with package-install are automatically deleted by
Spacemacs when it starts ?**
To declare new packages you have to create a new configuration layer, see
the quick start guide [here](#configuration).

2. **Why the fonts on Windows looks so crappy ?**
3. **Why the fonts on Windows looks so crappy ?**
You can installed [MacType][] on Windows to get very nice looking fonts. It is
also recommended to disable the smooth scrolling on Windows.

3. **The Spacemacs banner is ugly, what should I do ?**
4. **The Spacemacs banner is ugly, what should I do ?**
Install the default font supported by Spacemacs or choose a fixed witdh font.
More information in the [font section][] of the documentation.

4. **Why the powerline has no arrows in terminal even with a patched font ?**
5. **Why the powerline has no arrows in terminal even with a patched font ?**
Emacs powerline implementation does not use patched fonts. There exist currently
no mode-lines in Emacs that support patched font.
The corresponding feature request for the powerline can be found
[here][pw-patched-fonts].

5. **Why the powerline colors are not correct on OS X ?**
6. **Why the powerline colors are not correct on OS X ?**
This is a [known issue][powerline-srgb-issue] as of Emacs 24.4 due to
`ns-use-srgb-colorspace` defaulting to true. It is recommended to use
the [emacs-mac-port][] build. See the [install OSX section][] for more
info on this.

6. **The powerline separators have no anti-aliasing, what can I do ?**
7. **The powerline separators have no anti-aliasing, what can I do ?**
Emacs powerline uses XMP images to draw the separators. Enabling anti-aliasing
may not be a trivial task so unfortunately you'll have to live with it.
Nevertheless it exists a [large number of different separators][powerline-seps]
Expand Down
22 changes: 21 additions & 1 deletion contrib/git/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
- [git contribution layer for Spacemacs](#git-contribution-layer-for-spacemacs)
- [Description](#description)
- [Install](#install)
- [Layer](#layer)
- [Github support](#github-support)
- [Magit auto-complete](#magit-auto-complete)
- [Git](#git)
- [Working with Git](#working-with-git)
- [Magit](#magit)
- [Quick guide for recurring use cases in Magit](#quick-guide-for-recurring-use-cases-in-magit)
Expand Down Expand Up @@ -37,6 +41,8 @@ This layer also provides support for Github with:

## Install

### Layer

To use this contribution add it to your `~/.spacemacs`

```elisp
Expand All @@ -45,6 +51,8 @@ To use this contribution add it to your `~/.spacemacs`
)
```

### Github support

To enable the Github support set the variable `git-enable-github-support`
to `t` in your `dotspacemacs/init` function.

Expand All @@ -54,6 +62,18 @@ to `t` in your `dotspacemacs/init` function.
)
```

### Magit auto-complete

Magit auto-complete feature is enabled. For this feature to work best you
have to setup your Git repository directory in your `dotspacemacs/config`
function (the path should end up with a `/` to respect Emacs conventions):

```elisp
(setq magit-repo-dirs '("~/git/"))
```

### Git

Of course if your OS does not ship with git (!) you'll have to install it
on your machine, [download page][].

Expand Down Expand Up @@ -88,7 +108,7 @@ To open a `status buffer`, type in a buffer of a Git repository:
<SPC> g s

`hjkl` navigation is enabled in all Magit buffers. The default Magit keys
on `hjkl` are remapped on `HJKL`.
on `hjkl` (if they exist) are remapped on `HJKL`.

Here are the often used bindings inside a `status buffer`:

Expand Down
2 changes: 2 additions & 0 deletions contrib/git/config.el
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
"If non nil the Github packages and extensions are enabled.")

(setq git/key-binding-prefixes '(("gh" . "gutter-hunks/highlight")))
(setq magit-completing-read-function 'magit-ido-completing-read)

(when git-enable-github-support
(push (cons "gf" "file") git/key-binding-prefixes)
(push (cons "gg" "gist") git/key-binding-prefixes))
Expand Down
78 changes: 73 additions & 5 deletions contrib/lang/haskell/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,40 @@

![logo](img/haskell.png)

<!-- markdown-toc start - Don't edit this section. Run M-x markdown-toc/generate-toc again -->
**Table of Contents**

- [Haskell contribution layer for Spacemacs](#haskell-contribution-layer-for-spacemacs)
- [Description](#description)
- [Install](#install)
- [Layer](#layer)
- [Cabal packages](#cabal-packages)
- [OS X](#os-x)
- [Key bindings](#key-bindings)
- [Haskell source code:](#haskell-source-code)
- [Haskell commands:](#haskell-commands)
- [Documentation commands:](#documentation-commands)
- [Cabal commands:](#cabal-commands)
- [Debug commands:](#debug-commands)
- [REPL commands:](#repl-commands)
- [Cabal files:](#cabal-files)

<!-- markdown-toc end -->

## Description

This layer adds support for the [Haskell][] language.
The layer uses company-ghc for completetion.

**This layer is still not fully adapted for Spacemacs, it needs you, Haskell experts, to
improve it and make it consistent with the Spacemacs experience.**
Features:
- auto-completion with [company-ghc][],
- auto-indentation with [hi2][].

**This layer is in construction, it needs your contributions and bug reports.**

## Install

### Layer

To use this contribution add it to your `~/.spacemacs`

```elisp
Expand All @@ -18,6 +44,47 @@ To use this contribution add it to your `~/.spacemacs`
)
```

### Cabal packages

This layer requires some [cabal][] packages:
- `ghc-mod`
- `hlint`
- `stylish-haskell`

To install them, use the following command:

```sh
cabal install stylish-haskell hlint ghc-mod
```

Next Emacs needs to know where to find these binaries, you can locate them with
the following shell command:

```sh
dirname $(which ghc-mod)
```

Then you have to add this path to your system `$PATH` (preferred):

```sh
export PATH=~/.cabal/bin/:$PATH
```

_or_ to the Emacs `exec-path` variable in the `dotspacemacs/init` function of
your `.spacemacs` file:

```elisp
(add-to-list 'exec-path "~/.cabal/bin/")
```

**Note:** it is important to add the path in the `dotspacemacs/init` function,
so that the path is added before any layers is loaded.

### OS X

Note that `emacs.app` for OS X does not pick up `$PATH` from `~/.bashrc` or
`~/.zshrc` when launched from outside a terminal.

## Key bindings

All Haskell specific bindings are prefixed with <kbd>SPC m</kbd>
Expand Down Expand Up @@ -95,6 +162,7 @@ REPL commands are prefixed by <kbd>SPC m s</kbd>:
<kbd>SPC m P</kbd> | go to previous section
<kbd>SPC m f</kbd> | find or create source-file under the cursor

**TODO**

[Haskell]: https://www.haskell.org/
[cabal]: https://www.haskell.org/cabal/
[company-ghc]: https://github.com/iquiw/company-ghc
[hi2]: https://github.com/nilcons/hi2
7 changes: 7 additions & 0 deletions contrib/lang/haskell/funcs.el
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
(defun spacemacs/haskell-show-hi2-guides ()
(when (and (boundp 'hi2-mode) hi2-mode)
(hi2-enable-show-indentations)))

(defun spacemacs/haskell-hide-hi2-guides ()
(when (and (boundp 'hi2-mode) hi2-mode)
(hi2-disable-show-indentations)))
17 changes: 15 additions & 2 deletions contrib/lang/haskell/packages.el
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
flycheck-haskell
ghc
haskell-mode
ghci-completion
hi2
))

;; Only load company-ghc if company-mode is enabled
Expand All @@ -25,7 +25,7 @@
(custom-set-variables
;; Use cabal-repl for the GHCi session. Ensures our dependencies are in scope.
;; cabal-dev is deprecated
'(haskell-process-type 'cabal-repl)
'(haskell-process-type 'auto)

;; Use notify.el (if you have it installed) at the end of running
;; Cabal commands or generally things worth notifying.
Expand Down Expand Up @@ -154,3 +154,16 @@
(add-to-list 'company-backends 'company-ghc)
(ghc-comp-init)
))

(defun haskell/init-hi2 ()
(use-package hi2
:diminish hi2-mode
:commands turn-on-hi2
:init
(add-hook 'haskell-mode-hook 'turn-on-hi2)
:config
(progn
;; Show indentation guides for hi2 only in insert state.
(add-hook 'evil-normal-state-entry-hook 'spacemacs/haskell-hide-hi2-guides)
(add-hook 'evil-insert-state-entry-hook 'spacemacs/haskell-show-hi2-guides)
(add-hook 'evil-insert-state-exit-hook 'spacemacs/haskell-hide-hi2-guides))))
72 changes: 54 additions & 18 deletions contrib/lang/scala/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@
<!-- markdown-toc start - Don't edit this section. Run M-x markdown-toc/generate-toc again -->
**Table of Contents**

- [Scala contribution layer for Spacemacs](#scala-contribution-layer-for-spacemacs)
- [Description](#description)
- [Install](#install)
- [Ensime](#ensime)
- [Key bindings](#key-bindings)
- [Description](#description)
- [Install](#install)
- [Ensime](#ensime)
- [Installation](#installation)
- [Usage](#usage)
- [Scalastyle](#scalastyle)

<!-- markdown-toc end -->

Expand All @@ -18,33 +19,68 @@
This layer adds support for the Scala language using the excellent [ENSIME][]
client/server.

**This layer is not adapted for Spacemacs, it needs you, Scala experts, to
improve it and make it consistent with the Spacemacs experience.**

## Install

To use this contribution add it to your `~/.spacemacs`
Add this contribution to your `~/.spacemacs`.

```elisp
(setq-default dotspacemacs-configuration-layers '(scala)
"List of contribution to load."
)
```

### Ensime
## Ensime

[ENSIME][] provides IDE-like features, such as refactoring, incremental
compilation and project-wide type-checking.

ENSIME requires a configuration file at the root of each Scala project. It
provides an SBT plugin to generate these files.

### Installation

1. Configure the ENSIME sbt plugin by adding the following to
`~/.sbt/0.13/plugins/plugins.sbt`:

```scala
resolvers += Resolver.sonatypeRepo("snapshots")

addSbtPlugin("org.ensime" % "ensime-sbt" % "0.1.5-SNAPSHOT")
```

2. Run `sbt` at the shell to download and install the plugin.

There is nothing to install for ENSIME to work but you have to create a
`.ensime` file at the root of your project.
See the [ENSIME quickstart][] guide for further information.

This project can be created manually using the [template here][dotensime],
but it is recommended to use the [ENSIME sbt-plugin][sbt-plugin] if your
project uses [SBT][].
### Usage

## Key bindings
1. Create a `.ensime` file at the root of your Scala project using `sbt
gen-ensime` at the shell.

**TODO**
2. Run `M-x ensime` within Emacs to start an ENSIME session.

Each Scala project uses a dedicated ENSIME session, so you only need to run `M-x
ensime` once per project. Any Scala files you create or visit within the project
will automatically use ENSIME for the remainder of your editing session.

## Scalastyle

[Scalastyle][] provides style-checking and linting. The Emacs functionality is
provided by Flycheck.

To use scalastyle,

1. Download the [scalastyle jar][] and put it somewhere sensible
2. Customise the `flycheck-scalastyle-jar` variable and set it to the path of
the jar.

See the [flycheck documentation][] for up-to-date configuration instructions.

[ENSIME quickstart]: https://github.com/ensime/ensime-server/wiki/Quick-Start-Guide#installing-the-ensime-sbt-plugin
[ENSIME]: https://github.com/ensime
[Scalastyle]: http://flycheck.readthedocs.org/en/latest/guide/languages.html#el.flycheck-checker.scala-scalastyle
[dotensime]: https://github.com/ensime/ensime-server/wiki/Example-Configuration-File
[sbt]: http://www.scala-sbt.org/
[flycheck documentation]: http://flycheck.readthedocs.org/en/latest/guide/languages.html#el.flycheck-checker.scala-scalastyle
[sbt-plugin]: https://github.com/ensime/ensime-server/wiki/Quick-Start-Guide#installing-the-ensime-sbt-plugin
[sbt]: http://www.scala-sbt.org/
[scalastyle jar]: https://oss.sonatype.org/content/repositories/releases/org/scalastyle/scalastyle_2.11/0.6.0/
30 changes: 30 additions & 0 deletions contrib/lang/scala/funcs.el
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
(defun spacemacs/ensime-refactor-accept ()
(interactive)
(funcall continue-refactor)
(ensime-popup-buffer-quit-function))

(defun spacemacs/ensime-refactor-cancel ()
(interactive)
(funcall cancel-refactor)
(ensime-popup-buffer-quit-function))

(defun spacemacs/scala-join-line ()
"Adapt `scala-indent:join-line' to behave more like evil's line join.
`scala-indent:join-line' acts like the vanilla `join-line',
joining the current line with the previous one. The vimmy way is
to join the current line with the next.
Try to move to the subsequent line and then join. Then manually move
point to the position of the join."
(interactive)
(let (join-pos)
(save-excursion
(goto-char (line-end-position))
(unless (eobp)
(forward-line)
(call-interactively 'scala-indent:join-line)
(setq join-pos (point))))

(when join-pos
(goto-char join-pos))))
Loading

0 comments on commit ad7e009

Please sign in to comment.