Skip to content

Commit

Permalink
Merge branch 'develop' tweak before release of 0.63.0
Browse files Browse the repository at this point in the history
  • Loading branch information
syl20bnr committed Feb 25, 2015
2 parents e829866 + f55d1f1 commit d9cceb0
Show file tree
Hide file tree
Showing 7 changed files with 65 additions and 36 deletions.
26 changes: 26 additions & 0 deletions contrib/company-mode/config.el
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
;;; config.el --- Company mode configuration File for Spacemacs
;;
;; Copyright (c) 2012-2014 Sylvain Benner
;; Copyright (c) 2014-2015 Sylvain Benner & Contributors
;;
;; Author: Sylvain Benner <sylvain.benner@gmail.com>
;; URL: https://github.com/syl20bnr/spacemacs
;;
;; This file is not part of GNU Emacs.
;;
;;; License: GPLv3

;; Variables

(defvar company-mode-enable-yas t
"If non nil enable yasnippet for all backends.")

(defvar company-mode-use-tab-instead-of-enter nil
"If non nil use tab instead of enter for completion in company-mode")

(defvar company-mode-completion-cancel-keywords '("do"
"then"
"begin"
"case")
"Keywords on which to cancel completion so that you can use RET
to complet without blocking common line endings.")
17 changes: 4 additions & 13 deletions contrib/company-mode/packages.el
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,8 @@
'(auto-complete ac-ispell tern-auto-complete auto-complete-clang edts)
"Packages that use auto-complete that are no longer necessary and might conflict.")

(defvar company-mode/completion-cancel-keywords '("do" "then" "begin" "case")
"Keywords on which to cancel completion so that you can use RET to complet without blocking common line endings.")

(defvar company-mode/enable-yas t
"Enable yasnippet for all backends.")

(defvar company-mode/use-tab-instead-of-enter-to-complete nil
"use tab instead of enter for completion in company-mode")

(defun company-mode/backend-with-yas (backend)
(if (or (not company-mode/enable-yas) (and (listp backend) (member 'company-yasnippet backend)))
(if (or (not company-mode-enable-yas) (and (listp backend) (member 'company-yasnippet backend)))
backend
(append (if (consp backend) backend (list backend))
'(:with company-yasnippet))))
Expand All @@ -30,12 +21,12 @@
:config
(progn
;; this isn't needed if we use tab instead of enter
(if (not company-mode/use-tab-instead-of-enter-to-complete)
(if (not company-mode-use-tab-instead-of-enter)
(progn
(defun company-mode/keyword-cancel-transformer (candidates)
"company frontend that cancels completion when a keyword is typed
so that you don't have 'do' completed to 'downcase' in Ruby"
(if (member company-prefix company-mode/completion-cancel-keywords) '() candidates))
(if (member company-prefix company-mode-completion-cancel-keywords) '() candidates))
(setq
company-transformers '(company-mode/keyword-cancel-transformer company-sort-by-occurrence))
)
Expand Down Expand Up @@ -91,7 +82,7 @@ so that you don't have 'do' completed to 'downcase' in Ruby"
))

(defun company-mode/set-completion-key ()
(if company-mode/use-tab-instead-of-enter-to-complete
(if company-mode-use-tab-instead-of-enter
(progn
(define-key company-active-map (kbd "TAB") 'company-complete-selection) ;have tab stand in for enter
(define-key company-active-map (kbd "<tab>") 'company-complete-selection)
Expand Down
40 changes: 26 additions & 14 deletions contrib/git/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
- [Working with Git](#working-with-git)
- [Magit](#magit)
- [Quick guide for recurring use cases in Magit](#quick-guide-for-recurring-use-cases-in-magit)
- [Git time machine](#git-time-machine)
- [Git gutter](#git-gutter)
- [Github support](#github-support)
- [magit-gh-pulls](#magit-gh-pulls)
Expand Down Expand Up @@ -201,7 +202,6 @@ you can answer `y` with no issue.
- `L l` to open `log buffer`
- `E` on the second to last commit, it opens the `rebase buffer`
- `j` to put point on last commit
- `i` to pass in `insert state`
- `s` to squash it
- `C-c C-c` to continue to the `commit message buffer`
- `C-c C-c` again when you have finished to edit the commit message
Expand All @@ -218,19 +218,32 @@ you can answer `y` with no issue.
- `F -r C-u F` and choose `upstream` or the name you gave to it
- `P P` to push the commit to `origin`

### Git time machine

[git-timemachine] allows to quickly browse the commits of the current buffer.

Key Binding | Description
--------------------|------------------------------------------------------------
<kbd>SPC g t</kbd> | start git timemachine and initiate micro-state
<kbd>c</kbd> | show current commit
<kbd>n</kbd> | show next commit
<kbd>N</kbd> | show previous commit
<kbd>p</kbd> | show previous commit
<kbd>q</kbd> | leave micro-state and git timemachine

### Git gutter

With [git-gutter][] it is possible to navigate between hunks, stage them and
revert them.

Git gutter hunks commands start with `gh`:

Key Binding | Description
--------------------|------------------------------------------------------------
<kbd>g h n</kbd> | next hunk in buffer
<kbd>g h N</kbd> | previous hunk in buffer
<kbd>g h r</kbd> | revert current hunk
<kbd>g h s</kbd> | stage current hunk
Key Binding | Description
----------------------|------------------------------------------------------------
<kbd>SPC g h n</kbd> | next hunk in buffer
<kbd>SPC g h N</kbd> | previous hunk in buffer
<kbd>SPC g h r</kbd> | revert current hunk
<kbd>SPC g h s</kbd> | stage current hunk

`Spacemacs` has custom fringe bitmaps for [git-gutter-fringe][git-gutter]:

Expand Down Expand Up @@ -287,6 +300,12 @@ In the gist list buffer:
<kbd>V</kbd> | `visual-line state`
<kbd>y</kbd> | print URL and copy it

### github-browse-file

Key Binding | Description
----------------------|------------------------------------------------------------
<kbd>SPC g f b</kbd> | browse to file on github

[git]: http://git-scm.com/
[download page]: http://git-scm.com/downloads
[git-gutter]: https://github.com/syohex/emacs-git-gutter-fringe
Expand All @@ -297,10 +316,3 @@ In the gist list buffer:
[git-messenger]: https://github.com/syohex/emacs-git-messenger
[magit-gh-pulls]: https://github.com/sigma/magit-gh-pulls
[gist.el]: https://github.com/defunkt/gist.el

### github-browse-file

Key Binding | Description
----------------------|------------------------------------------------------------
<kbd>SPC g f b</kbd> | browse to file on github

2 changes: 1 addition & 1 deletion contrib/lang/clojure/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Clojure contribution layer for Spacemacs

![logo_clojure](img/clojure.png) _with_ ![logo_cider](img/cider.png)
![logo_clojure](img/clojure.png) ![logo_cider](img/cider.png)

<!-- markdown-toc start - Don't edit this section. Run M-x markdown-toc/generate-toc again -->
**Table of Contents**
Expand Down
4 changes: 2 additions & 2 deletions contrib/lang/haskell/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ Follow the instructions to install [ghci-ng][] (remember to add `:set +c` in `~/
next set the layer variable:
```elisp
;; List of configuration layers to load.
dotspacemacs-configuration-layers '(company-mode (haskell :variables haskell-ghci-ng-support t) git)
dotspacemacs-configuration-layers '(company-mode (haskell :variables haskell-enable-ghci-ng-support t) git)
```

Once ghci-ng is enabled, two of the old keybindings are overriden with improved versions from ghci-ng, and a new keybinding available:
Expand All @@ -113,7 +113,7 @@ Once ghci-ng is enabled, two of the old keybindings are overriden with improved
To enable shm, run `cabal install structured-haskell-mode` and set the layer variable:
```elisp
;; List of configuration layers to load.
dotspacemacs-configuration-layers '(company-mode (haskell :variables haskell-shm-support t) git)
dotspacemacs-configuration-layers '(company-mode (haskell :variables haskell-enable-shm-support t) git)
```

## Key bindings
Expand Down
4 changes: 2 additions & 2 deletions contrib/lang/haskell/config.el
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
;;; License: GPLv3

;; Variables
(defvar haskell-ghci-ng-support nil
(defvar haskell-enable-ghci-ng-support nil
"If non-nil ghci-ng support is enabled")

(defvar haskell-shm-support nil
(defvar haskell-enable-shm-support nil
"If non-nil structured-haskell-mode support is enabled")
8 changes: 4 additions & 4 deletions contrib/lang/haskell/packages.el
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
(defun haskell/init-shm ()
(use-package shm
:defer t
:if haskell-shm-support
:if haskell-enable-shm-support
:init
(add-hook 'haskell-mode-hook 'structured-haskell-mode)
:config
Expand Down Expand Up @@ -151,7 +151,7 @@
(defun haskell-hook ()
(ghc-init)
;; Use advanced indention
(if (not haskell-shm-support)
(if (not haskell-enable-shm-support)
(turn-on-haskell-indentation)
)

Expand Down Expand Up @@ -187,7 +187,7 @@
))
)

(if haskell-ghci-ng-support
(if haskell-enable-ghci-ng-support
(ghci-ng-setup)))))

(defun haskell/init-company-ghc ()
Expand All @@ -201,7 +201,7 @@
(use-package hi2
:diminish hi2-mode
:commands turn-on-hi2
:if (not haskell-shm-support)
:if (not haskell-enable-shm-support)
:init
(add-hook 'haskell-mode-hook 'turn-on-hi2)
:config
Expand Down

0 comments on commit d9cceb0

Please sign in to comment.