Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
syl20bnr committed Oct 31, 2014
2 parents d80a239 + 98b5625 commit 21414cc
Show file tree
Hide file tree
Showing 5 changed files with 73 additions and 30 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,6 @@
[submodule "contrib/syl20bnr/extensions/o-blog"]
path = contrib/syl20bnr/extensions/o-blog
url = https://github.com/renard/o-blog.git
[submodule "spacemacs/extensions/evil-nerd-commenter"]
path = spacemacs/extensions/evil-nerd-commenter
url = https://github.com/redguardtoo/evil-nerd-commenter
17 changes: 12 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -275,8 +275,13 @@ You have to manually copy the `~/.emacs.d/.spacemacs.template` file to

### Key bindings

`Spacemacs` defines hundreds of key bindings, you can easily discover them
inside Emacs by pressing:
1) By default, [guide-key][] and [guide-key-tip][] are enabled.

Whenever you press a prefix command (like `<SPC>`) and wait for one second,
a tool tip (GUI) or buffer (terminal) appear listing the possible keys
following this prefix.

2) You can also easily get a full list of all the key bindings by pressing:

<SPC> ?

Expand Down Expand Up @@ -683,14 +688,14 @@ The minor mode area can be toggled on and off with:
-------------|-----------------------------------------------------------------
⊞ | [golden-ratio][golden-ratio] mode
Ⓐ | [auto-complete][auto-complete] mode
Ⓗ | [auto-highlight-symbol][auto-highlight] mode
Ⓒ | [centered-cursor][centered-cursor] mode
eⓅ | [e-project][e-project] mode
Ⓕ | flycheck mode
Ⓕ2 | flymake mode
Ⓖ | guide-key mode
(Ⓟ) | paredit mode
Ⓢ | flyspell mode
(Ⓢ) | [smartparens][sp] mode
(Ⓟ) | paredit mode
Ⓨ | [yasnippet][yasnippet] mode

**Note:** in terminal the regular indicators are used instead of the utf-8
Expand Down Expand Up @@ -1133,8 +1138,8 @@ The only bound key for `projectile` is `projectile-commander` which is:
`d` | find directory in project
`D` | open project root in `dired`
`f` | find file in project
`F` | find file in project using `helm`
`g` | run `grep` on project
`h` | find file in project using `helm`
`j` | find a tag in project
`k` | kill all project buffers
`o` | run `multi-occur` on project
Expand Down Expand Up @@ -1658,3 +1663,5 @@ Thank you to the whole Emacs community from core developers to elisp hackers!
[tern-auto-complete]: https://github.com/marijnh/tern/blob/master/emacs/tern-auto-complete.el
[tern]: http://ternjs.net/
[themes-megapack]: https://github.com/syl20bnr/spacemacs/tree/master/contrib/themes-megapack
[guide-key]: https://github.com/kai2nenobu/guide-key
[guide-key-tip]: https://github.com/aki2o/guide-key-tip
14 changes: 14 additions & 0 deletions spacemacs/extensions.el
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
centered-cursor
dos
emoji-cheat-sheet
evil-nerd-commenter
evil-org-mode
evil-plugins
helm-rcirc
Expand Down Expand Up @@ -51,6 +52,19 @@
(use-package emoji-cheat-sheet
:commands emoji-cheat-sheet))

(defun spacemacs/init-evil-nerd-commenter ()
(use-package evil-nerd-commenter
:init
(progn
(evil-leader/set-key
"ncl" 'evilnc-comment-or-uncomment-lines
"nct" 'evilnc-quick-comment-or-uncomment-to-the-line
"ncy" 'evilnc-copy-and-comment-lines
"ncp" 'evilnc-comment-or-uncomment-paragraphs
"ncr" 'comment-or-uncomment-region
"nci" 'evilnc-toggle-invert-comment-line-by-line
"ncc" 'evilnc-comment-operator))))

(defun spacemacs/init-evil-org-mode ()
(use-package evil-org
:commands evil-org-mode
Expand Down
1 change: 1 addition & 0 deletions spacemacs/extensions/evil-nerd-commenter
Submodule evil-nerd-commenter added at c54cee
68 changes: 43 additions & 25 deletions spacemacs/packages.el
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
evil-surround
evil-terminal-cursor-changer
evil-visualstar
evil-nerd-commenter
exec-path-from-shell
expand-region
fill-column-indicator
Expand All @@ -51,6 +50,7 @@
ghc
golden-ratio
google-translate
guide-key-tip
haskell-mode
helm
helm-css-scss
Expand Down Expand Up @@ -363,20 +363,6 @@ DELETE-FUNC when calling CALLBACK.
;; load surround
(use-package evil-surround
:init (global-evil-surround-mode 1))
;; load nerd-commenter
(if (version< emacs-version "24.4")
(use-package evil-nerd-commenter
:init
(progn
(evil-leader/set-key
"ncl" 'evilnc-comment-or-uncomment-lines
"nct" 'evilnc-quick-comment-or-uncomment-to-the-line
"ncy" 'evilnc-copy-and-comment-lines
"ncp" 'evilnc-comment-or-uncomment-paragraphs
"ncr" 'comment-or-uncomment-region
"nci" 'evilnc-toggle-invert-comment-line-by-line
"ncc" 'evilnc-comment-operator
))))
;; load evil-exchange
(use-package evil-exchange
:init (evil-exchange-install))
Expand Down Expand Up @@ -700,7 +686,7 @@ DELETE-FUNC when calling CALLBACK.
"sn" (lambda () (interactive) (eval '(progn (ahs-highlight-now) (ahs-forward)) nil))
"sN" (lambda () (interactive) (eval '(progn (ahs-highlight-now) (ahs-backward)) nil))
"ts" 'auto-highlight-symbol-mode))
(spacemacs//diminish auto-highlight-symbol-mode "")
(spacemacs//hide-lighter auto-highlight-symbol-mode)
;; micro-state to easily jump from a highlighted symbol to the others
(dolist (sym '(ahs-forward
ahs-forward-definition
Expand Down Expand Up @@ -1136,11 +1122,14 @@ DELETE-FUNC when calling CALLBACK.
(use-package golden-ratio
:defer t
:init
(evil-leader/set-key "tg"
'(lambda () (interactive)
(if (symbol-value golden-ratio-mode)
(progn (golden-ratio-mode -1)(balance-windows))
(golden-ratio-mode))))
(progn
(defun spacemacs/toggle-golden-ratio ()
"Toggle golden-ratio mode on and off."
(interactive)
(if (symbol-value golden-ratio-mode)
(progn (golden-ratio-mode -1)(balance-windows))
(golden-ratio-mode)))
(evil-leader/set-key "tg" 'spacemacs/toggle-golden-ratio))
:config
(progn
(setq golden-ratio-extra-commands
Expand All @@ -1167,6 +1156,18 @@ DELETE-FUNC when calling CALLBACK.
ess-eval-buffer-and-go
ess-eval-function-and-go
ess-eval-line-and-go)))

;; Disable auto-resizing for some buffers
(defun spacemacs/no-golden-ratio-for-buffers (bufname)
"Disable golden-ratio if BUFNAME is the name of a visible buffer."
(and (get-buffer bufname) (get-buffer-window bufname 'visible)))
(defun spacemacs/no-golden-ratio-guide-key ()
"Disable golden-ratio for guide-key popwin buffer."
(or (spacemacs/no-golden-ratio-for-buffers " *guide-key*")
(spacemacs/no-golden-ratio-for-buffers " *popwin-dummy*")))
(add-to-list 'golden-ratio-inhibit-functions
'spacemacs/no-golden-ratio-guide-key)

(spacemacs//diminish golden-ratio-mode ""))))

(defun spacemacs/init-google-translate ()
Expand All @@ -1189,6 +1190,26 @@ DELETE-FUNC when calling CALLBACK.
(setq google-translate-default-source-language "En")
(setq google-translate-default-target-language "Fr"))))

(defun spacemacs/init-guide-key-tip ()
(use-package guide-key-tip
:init
(progn
(defun spacemacs/toggle-guide-key ()
"Toggle golden-ratio mode on and off."
(interactive)
(if (symbol-value guide-key-mode)
(guide-key-mode -1)
(guide-key-mode)))
(evil-leader/set-key "tG" 'spacemacs/toggle-guide-key)
(setq guide-key/guide-key-sequence '("C-x" "C-c" "SPC" "g" "z" "C-h")
guide-key/recursive-key-sequence-flag t
guide-key/popup-window-position 'right
guide-key/idle-delay 1
guide-key/text-scale-amount 0
guide-key-tip/enabled (if window-system t))
(guide-key-mode 1)
(spacemacs//diminish guide-key-mode ""))))

(defun spacemacs/init-haskell-mode ()
(require 'haskell-yas)
(use-package haskell-mode
Expand Down Expand Up @@ -1575,12 +1596,9 @@ DELETE-FUNC when calling CALLBACK.
:config
(progn
(projectile-global-mode)
(def-projectile-commander-method ?F
(def-projectile-commander-method ?h
"Find file in project using helm."
(helm-projectile))
(def-projectile-commander-method ?r
"Replace a string in the project."
(projectile-replace))
(spacemacs//hide-lighter projectile-mode))))

(defun spacemacs/init-python ()
Expand Down

0 comments on commit 21414cc

Please sign in to comment.