Skip to content

Commit

Permalink
Merge branch 'develop' (v0.34.0)
Browse files Browse the repository at this point in the history
  • Loading branch information
syl20bnr committed Dec 16, 2014
2 parents 1d3b459 + fef0344 commit 2354134
Show file tree
Hide file tree
Showing 11 changed files with 207 additions and 60 deletions.
1 change: 1 addition & 0 deletions contrib/company-mode/packages.el
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
'(
company
company-tern
company-c-headers
))

(defvar company-mode-excluded-packages
Expand Down
21 changes: 14 additions & 7 deletions contrib/lang/clojure/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,15 @@ This layer adds support for [Clojure][] language using [Cider][].
## Packages Included

- [Cider][]
- [clojure-mode][](https://github.com/clojure-emacs/clojure-mode)
- [Clj Refactor][](https://github.com/clojure-emacs/clj-refactor.el)
- [Cider Auto Complete][](https://github.com/clojure-emacs/ac-cider)
- [clojure-mode][]
- [Clj Refactor][]
- [Cider Auto Complete][]
- [align-cljlet][]

### Goodies

- Pretty symbols for anonymous functions and set literals, like
`(λ [a] (+ a 5))`, `ƒ(+ % 5)`, and `∈{2 4 6}`.

## Install

Expand All @@ -51,8 +57,8 @@ instructions at the [cider repository][cider_install].

Key Binding | Description
----------------------|------------------------------------------------------------
<kbd>SPC m d d</kbd> | cider-doc
<kbd>SPC m d g</kbd> | cider-grimoire
<kbd>SPC m d d</kbd> | cider doc
<kbd>SPC m d g</kbd> | cider grimoire
<kbd>SPC m d j</kbd> | cider javadoc

### Evaluation
Expand Down Expand Up @@ -87,7 +93,8 @@ instructions at the [cider repository][cider_install].

[Clojure]: http://clojure.org
[Cider]: https://github.com/clojure-emacs/cider
[cider_install]: (https://github.com/clojure-emacs/cider#installation)
[cider_install]: https://github.com/clojure-emacs/cider#installation
[clojure-mode]: https://github.com/clojure-emacs/clojure-mode
[Clj Refactor]: https://github.com/clojure-emacs/clj-refactor.el
[Cider Auto Complete]: (https://github.com/clojure-emacs/ac-cider
[Cider Auto Complete]: https://github.com/clojure-emacs/ac-cider
[align-cljlet]: https://github.com/gstamp/align-cljlet
16 changes: 16 additions & 0 deletions contrib/lang/clojure/packages.el
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
cider
clj-refactor
ac-cider
align-cljlet
)
"List of all packages to install and/or initialize. Built-in packages
which require an initialization must be listed explicitly in the list.")
Expand All @@ -20,6 +21,20 @@ which require an initialization must be listed explicitly in the list.")

(evil-leader/set-key-for-mode 'clojure-mode "mj" 'cider-jack-in))))

(defun clojure/fancify-symbols ()
"Pretty symbols for Clojure's anonymous functions and sets,
like (λ [a] (+ a 5)), ƒ(+ % 5), and ∈{2 4 6}."
(font-lock-add-keywords 'clojure-mode
`(("(\\(fn\\)[\[[:space:]]"
(0 (progn (compose-region (match-beginning 1)
(match-end 1) "λ"))))
("\\(#\\)("
(0 (progn (compose-region (match-beginning 1)
(match-end 1) "ƒ"))))
("\\(#\\){"
(0 (progn (compose-region (match-beginning 1)
(match-end 1) "")))))))

(defun clojure/init-cider ()
(use-package cider
:defer t
Expand All @@ -39,6 +54,7 @@ which require an initialization must be listed explicitly in the list.")

:config
(progn
(clojure/fancify-symbols)
(evil-leader/set-key-for-mode 'clojure-mode "meb" 'cider-eval-buffer)
(evil-leader/set-key-for-mode 'clojure-mode "mer" 'cider-eval-region)
(evil-leader/set-key-for-mode 'clojure-mode "mes" 'cider-eval-last-sexp)
Expand Down
43 changes: 43 additions & 0 deletions contrib/lang/html/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# HTML contribution layer for Spacemacs

![logo](html.png)

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

- [HTML contribution layer for Spacemacs](#html-contribution-layer-for-spacemacs)
- [Description](#description)
- [Install](#install)
- [Key Bindings](#key-bindings)

<!-- markdown-toc end -->

## Description

This layer adds support for editing HTML and CSS.

Features:
- Editing HTML and CSS file using [web-mode][]
- Support for Scss and Less files
- Generate HTML and CSS coding using [emmet-mode][]

## Install

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

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

## Key Bindings

### commands

Key Binding | Description
---------------------|------------------------------------------------------------
<kbd>SPC m h</kbd> | quick navigate CSS rules using helm

[web-mode]: http://web-mode.org/
[emmet-mode]: https://github.com/smihica/emmet-mode
Binary file added contrib/lang/html/html.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
64 changes: 64 additions & 0 deletions contrib/lang/html/packages.el
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
(defvar html-packages
'(
emmet-mode
flycheck
helm-css-scss
less-css-mode
scss-mode
tagedit
web-mode
)
"List of all packages to install and/or initialize. Built-in packages
which require an initialization must be listed explicitly in the list.")

(defun html/init-helm-css-scss ()
(use-package helm-css-scss
:defer t
:init
(eval-after-load 'scss-mode
'(evil-leader/set-key-for-mode 'scss-mode "mh" 'helm-css-scss))))

(defun html/init-web-mode ()
(use-package web-mode
:defer t
:mode (("\\.phtml\\'" . web-mode)
("\\.tpl\\.php\\'" . web-mode)
("\\.html\\'" . web-mode)
("\\.htm\\'" . web-mode)
("\\.[gj]sp\\'" . web-mode)
("\\.as[cp]x\\'" . web-mode)
("\\.erb\\'" . web-mode)
("\\.mustache\\'" . web-mode)
("\\.djhtml\\'" . web-mode))))

(defun html/init-emmet-mode ()
(use-package emmet-mode
:defer t
:init
(progn
(add-hook 'web-mode-hook 'emmet-mode)
(add-hook 'html-mode-hook 'emmet-mode)
(add-hook 'css-mode-hook 'emmet-mode))
:config
(progn
;; buggy with undo-tree, need to take a look
;; (local-set-key (kbd "<tab>") 'emmet-expand-yas)
(spacemacs|hide-lighter emmet-mode))))

(defun html/init-scss-mode ()
(use-package scss-mode
:defer t
:mode ("\\.scss\\'" . scss-mode)))

(defun html/init-flycheck ()
(add-hook 'web-mode-hook 'flycheck-mode)
(add-hook 'scss-mode-hook 'flycheck-mode))

(defun html/init-tagedit ()
(use-package tagedit
:defer t
:config
(progn
(tagedit-add-experimental-features)
(add-hook 'html-mode-hook (lambda () (tagedit-mode 1)))
(spacemacs|diminish tagedit-mode ""))))
6 changes: 5 additions & 1 deletion core/dotspacemacs.el
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@ with `:' and Emacs commands are executed with `<leader> :'.")
"Guide-key delay in seconds.")

(defvar dotspacemacs-fullscreen-at-startup nil
"If non nil the frame is maximized when Emacs starts up (Emacs 24.4+ only).")
"If non nil the frame is fullscreen when Emacs starts up (Emacs 24.4+ only).")

(defvar dotspacemacs-maximized-at-startup nil
"If non nil the frame is maximized when Emacs starts up (Emacs 24.4+ only).
Takes effect only if `dotspacemacs-fullscreen-at-startup' is nil.")

(defvar dotspacemacs-smooth-scrolling t
"If non nil smooth scrolling (native-scrolling) is enabled. Smooth scrolling
Expand Down
5 changes: 4 additions & 1 deletion core/templates/.spacemacs.template
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,11 @@
;; Guide-key delay in seconds. The Guide-key is the popup buffer listing
;; the commands bound to the current keystrokes.
dotspacemacs-guide-key-delay 0.4
;; If non nil the frame is maximized when Emacs starts up (Emacs 24.4+ only)
;; If non nil the frame is fullscreen when Emacs starts up (Emacs 24.4+ only).
dotspacemacs-fullscreen-at-startup nil
;; If non nil the frame is maximized when Emacs starts up (Emacs 24.4+ only).
;; Takes effect only if `dotspacemacs-fullscreen-at-startup' is nil.
dotspacemacs-maximized-at-startup nil
;; If non nil smooth scrolling (native-scrolling) is enabled. Smooth scrolling
;; overrides the default behavior of Emacs which recenters the point when
;; it reaches the top or bottom of the screen
Expand Down
43 changes: 43 additions & 0 deletions doc/DOCUMENTATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@
- [Evil leader](#evil-leader)
- [Universal argument](#universal-argument)
- [Micro-states](#micro-states)
- [Differences between Vim, Evil and Spacemacs](#differences-between-vim-evil-and-spacemacs)
- [The vim-surround case](#the-vim-surround-case)
- [Color theme](#color-theme)
- [UI elements](#ui-elements)
- [Toggles](#toggles)
Expand Down Expand Up @@ -112,6 +114,7 @@
- [Python](#python)
- [JavaScript](#javascript)
- [rcirc](#rcirc)
- [HTML](#html)
- [Emacs Server](#emacs-server)
- [Connecting to the Emacs server](#connecting-to-the-emacs-server)
- [Keeping the server alive](#keeping-the-server-alive)
Expand Down Expand Up @@ -591,6 +594,39 @@ Additional information may as well be displayed in the minibuffer.
[Text scale micro-state](#change-font-size):
![spacemacs_scale_micro_state](img/spacemacs-scale-micro-state.png)

# Differences between Vim, Evil and Spacemacs

No doubt that `Evil` is one of the most advanced `Vim` emulation and you should
not see big difference between `Vim` and `Emacs`. I did not find any command I
used in Vim that I missed in Emacs with `Evil`.

Send a PR to add the differences you found in this section.

## The vim-surround case

There is one obvious visible difference though. It is not between `Evil` and
`Vim` but between `Spacemacs` and [vim-surround][]: the `surround` command is
on <kbd>S</kbd> in `vim-surround` whereas it is on <kbd>s</kbd> in `Spacemacs`.

This is something that can surprise some Vim users so let me explain why this is
the case:
- `s` and `c` do the same thing in `visual state`,
- `s` is only useful to delete _one_ character and add more than one character
which is a _very_ narrow use case,
- `c` accept motions and can do everything `s` can do in `normal state`,
- this is also true for `r` but `r` is more useful because it stays in
`normal state`.
- `surround` command is just a more powerful command that `s`

If you are not convinced, then here is the snippet to revert back to the default
`Vim + vim-surround` setup (add it to your `dotspacemacs/config` function or
your `~/.spacemacs`):

```elisp
(evil-define-key 'visual evil-surround-mode-map "s" 'evil-substitute)
(evil-define-key 'visual evil-surround-mode-map "S" 'evil-surround-region)
```

# Color theme

By default, `Spacemacs` uses the theme [solarized-light][solarized-theme].
Expand Down Expand Up @@ -1738,6 +1774,11 @@ More featured JavaScript support is provided by the javascript contribution. Ple
<kbd>CTRL+j</kbd> | next item in command history
<kbd>CTRL+k</kbd> | previous item in command history

### HTML and CSS

HTML contribution provides support for editing HTML, CSS, Scss and Less files. Please see
[html contribution][html-contrib] documentation for detail.

# Emacs Server

`Spacemacs` starts a server at launch. This server is killed whenever you close
Expand Down Expand Up @@ -1907,6 +1948,7 @@ developers to elisp hackers!
[vim-surround]: https://github.com/tpope/vim-surround
[evil-nerd-commenter]: https://github.com/redguardtoo/evil-nerd-commenter
[nerdcommenter]: https://github.com/scrooloose/nerdcommenter
[source code pro]: https://github.com/adobe-fonts/source-code-pro
[evil-escape]: https://github.com/syl20bnr/evil-escape
[evil-args]: https://github.com/wcsmith/evil-args
[evil-jumper]: https://github.com/bling/evil-jumper
Expand All @@ -1930,6 +1972,7 @@ developers to elisp hackers!
[javascript-contrib]: https://github.com/syl20bnr/spacemacs/tree/master/contrib/lang/javascript
[themes-megapack]: https://github.com/syl20bnr/spacemacs/tree/master/contrib/themes-megapack
[python-contrib]: https://github.com/syl20bnr/spacemacs/tree/master/contrib/lang/python
[html-contrib]: https://github.com/syl20bnr/spacemacs/tree/master/contrib/lang/html
[guide-key]: https://github.com/kai2nenobu/guide-key
[guide-key-tip]: https://github.com/aki2o/guide-key-tip
[gitter]: https://gitter.im/syl20bnr/spacemacs
Expand Down
7 changes: 4 additions & 3 deletions spacemacs/config.el
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,10 @@ Can be installed with `brew install trash'."

;; Emacs 24.4 new features
(unless (version< emacs-version "24.4")
(if (and (boundp 'dotspacemacs-fullscreen-at-startup)
dotspacemacs-fullscreen-at-startup)
(toggle-frame-maximized)))
(if dotspacemacs-fullscreen-at-startup
(toggle-frame-fullscreen)
(if dotspacemacs-maximized-at-startup
(add-hook 'window-setup-hook 'toggle-frame-maximized))))

;; ---------------------------------------------------------------------------
;; Session
Expand Down
Loading

0 comments on commit 2354134

Please sign in to comment.