Commit graph

1240 commits

Author SHA1 Message Date
syl20bnr 2d61e5304e core: add support for :variables keyword in dotspacemacs-editing-style
Add variable `hybrid-mode-enable-hjkl-bindings` to enable hjkl
navigation in hybrid mode.

example:

dotspacemacs-editing-style '(hybrid :variables
                                     hybrid-mode-enable-hjkl-bindings t
                                     hybrid-mode-default-state 'normal)
2016-03-16 22:43:50 -04:00
syl20bnr c2296f71f8 Put back holy and hybrid in spacemacs base layer
They are not optional
Also fixes some bugs like toggling hybrid mode from holy mode and
toggling off the hybrid mode.
2016-03-16 21:59:44 -04:00
syl20bnr cfdfcfab40 Revert hybrid mode to use an evil hybrid state
To follow with the refactor of the holy-mode which uses the
emacs state of evil mode, the hybrid mode now uses the evil hybrid
state.

We have now a clean symmetry between all the editing styles where each
of them has an associated state:
- vim = insert state
- emacs = emacs state
- hybrid = hybrid state

This gives consistent properties to all editing styles and most
importantly allows to have true isolation of key binding maps. It has
the huge benefit to be easier to explain since now everything can
leverage the evil API regarding key bindings.

Note: Regular Emacs key binding functions can still be used for emacs
and hybrid states so there is no regression with the previous
implementation, we just gain better isolation at the cost of a few
duplicated lines of code which will be easy to update as needed if
evil upstream code changes (this code has been commented with a link
to the upstream code).
2016-03-16 21:30:03 -04:00
syl20bnr 82fdd9a511 Use evil in holy-mode
Motivation

While disabling Evil in holy-mode makes its implementation shorter and
sounds elegant on the paper, in practice it puts a big burden on the
configuration parts which need to know if Evil is enable or not. This is
a bad separation of concerns and the bunch of fixes that we were forced
to do in the past weeks shows this issue. Those fixes were about
removing the knowledge of the activation of Evil by implementing new
dispatching functions to be used by layers, this is cumbersome and makes
Spacemacs layer configuration more subtle which is not good. There was
additional bad consequences of the removal of Evil state like the
impossibility to use Evil lisp state or iedit states, or we would have
been forced to implement a temporary activation of Evil which is
awkward.

Instead I reintroduce Evil as the central piece of Spacemacs design thus
Evil is now re-enabled in holy-mode. It provides the abstraction we need
to isolate editing styles and be able to grow the Spacemacs
configuration coverage sanely. Layers don't need to check whether the
holy mode is active or not and they don't need to know if Evil is
available (it is always available). We also don't need to write
additional dispatching functions, this is the job of Evil, and I think
it provides everything for this. Ideally configuration layer should be
implemented with only Evil in mind and the holy-mode (and hybrid-mode)
should magically make it work for Emacs style users, for instance we can
freely use `evil-insert-state` anywhere in the code without any guard.

Evil is now even more part of Spacemacs, we can really say that
Spacemacs is Emacs+Evil which is now an indivisible pair. Spacemacs
needed this stable API to continue on the right track.

While these changes should be rather transparent to the user, I'm sorry
for this experimental period, I failed to see all the implications of
such a change, I was just excited about the possibility to make Evil
optional. The reality is that Spacemacs has to embrace it and keep its
strong position on being Emacs+Evil at the core.

Implementation

- insert, motion and normal states are forced to emacs state using an
advice on `evil-insert-state`, `evil-motion-state` and
`evil-normal-state` respectively. These functions can be used freely in
the layer configuration.
- A new general hook `spacemacs-editing-style-hook` allow to hook any
code that need to be configured based on the editing style. Functions
hooked to this hook takes the current style as parameter, this
basically generalize the hook used to setup hjkl navigation bindings.
- ESC has been removed from the emacs state map.
- Revert unneeded changes
  - Revert "evil: enter insert-state only from normal-state"
    commit bdd702dfbe.
  - Revert "avoid being evil in deft with emacs editing style"
    commit f3a16f49ed.

Additional changes

All editing style packages have been moved to a layer called
`spacemacs-editing-styles`

Notes

I did not have time to attack hybrid mode, I should be able to do it
later.
2016-03-13 21:16:55 -04:00
syl20bnr 4d46a5e423 layouts: prefer symbol-value instead of eval
See first paragraph of
https://www.gnu.org/software/emacs/manual/html_node/elisp/Eval.html
2016-03-12 13:58:46 -05:00
syl20bnr 08a8f13b4d Update layers.org 2016-03-12 13:51:25 -05:00
syl20bnr 4e7a814676 org: set org-publish-timestamp-directory to .cache 2016-03-12 13:51:25 -05:00
Eivind Fonn 88f7467f6f Fix persp-mode config for erc and rcirc 2016-03-12 17:59:28 +01:00
Eivind Fonn 3412429360 Custom layout: eval name and binding 2016-03-12 17:59:28 +01:00
Eivind Fonn 1b503000c8 Move layouts functions to packages-funcs.el 2016-03-12 17:59:28 +01:00
Diego Berrocal a86a0ee1ca Add IRC buffers to respective perspectives
This attempts to fix https://github.com/syl20bnr/spacemacs/issues/4781
2016-03-12 17:59:28 +01:00
Eivind Fonn 0585c4047b Fix indentation 2016-03-12 17:55:29 +01:00
M. Tong d2d82e2312 Fix error when using `spacemacs/counsel-search' wihout initial input. 2016-03-12 17:54:43 +01:00
Muneeb Shaikh f903460994 source-control: git-timemachine goto nth revision
Allows you to goto arbitrary revision by inputting rev number. e.g. To
goto 1st revision of the file, enter 1.
2016-03-12 17:51:50 +01:00
Eivind Fonn b045d451fd Fix long lines in evil-snipe readme 2016-03-12 17:51:13 +01:00
denin 252cb1c28b update evil-snipe readme about symbol groups 2016-03-12 17:49:48 +01:00
Eivind Fonn ee6e84de10 Enhance compilation keybindings
- Make sure to defer after load of compile
- Use `gr' instead of `g' for recompilation
2016-03-12 17:49:20 +01:00
denin a4ce07dd12 restore evil-binding of 'g' key in a compilation buffer
By default, recompile is bound to 'g' in compilation buffer.
It was rebound to 'r' key.
2016-03-12 17:47:18 +01:00
Fabien Dubosson 68e88df3c8 Correct SPC q D prompt and simplify the function 2016-03-12 17:46:31 +01:00
Eivind Fonn 47789270d9 Don't nest `when' 2016-03-12 17:45:41 +01:00
Muneeb Shaikh 6c17e3bc3a fix #5448: guard nil buffer size 2016-03-11 17:00:13 +05:30
syl20bnr d52eb414bb Remove dotspacemacs-use-ido
Users should now bind ido commands themselves.
2016-03-10 23:13:19 -05:00
Ista Zahn 2d353a329e Default to using helm for files and buffers. 2016-03-10 23:13:19 -05:00
ralesi 3f376a431b Prompt to open file literally when opening large files. 2016-03-10 23:13:19 -05:00
syl20bnr 9e47cf1f97 Fix C-c C-e key binding in helm-find-files 2016-03-10 23:13:19 -05:00
Aaron Jensen da66ac312f spacemacs-helm: Add C-c C-e to switch to wdired
Fixes #3724
2016-03-10 23:13:19 -05:00
syl20bnr 6b5ed8245b c-c++: fix c-c++/post-init-semantic 2016-03-10 23:13:19 -05:00
Eivind Fonn 411be27ed1 Remove enable-semantic-mode function
- No reason to require semantic manually
- Don't set submodes in a hook function (hard to change for user)
2016-03-10 23:13:19 -05:00
Eivind Fonn 0ca02549dc Move srefactor toggle to owning layer 2016-03-10 23:13:19 -05:00
sooheon ec3bbd4176 Use evil-define-minor-mode-key over define-key
This keeps the keybinding specific to the visual-line minor mode, and
fixes #5418. Reverting the bindings on the :off toggle is no longer
necessary as well, turning off visual-line-mode will handle it.
2016-03-10 23:12:35 -05:00
Tu Do ceafd688f3 srefactor requires Emas 24.4 or above, not older 2016-03-10 14:22:06 +01:00
Fabien Dubosson b9cd9c1cd8 Remove rainbow-delimiters-mode from mode-specific hooks
`spacemacs` now handles `rainbow-delimiters-mode` by adding it to the
`prog-mode-hook`, if wanted by the user. Some layers are adding it on
their own mode-hook, having for effect that `rainbow-delimiters-mode` is
called twice, which disable it.

This commit remove these layer-specific definitions of
`rainbow-delimiters` as it is now handled by the `spacemacs`
distribution. It also takes care of running `prog-mode-hook` in modes
that are not derived from it.

Fixes #3902
2016-03-09 20:23:29 -05:00
Jeremy Bi 343b7ac1d0 projectile: autoload projectile-project-p
Fix #5127
2016-03-09 20:14:21 -05:00
sooheon fa52c93078 Keep escape binding in evil-visual-state default
While seemingly equivalent, this binding change can cause brittle
behavior in at least one case (used in conjunction with
multiple-cursors). Such a highly niche customization would probably be
better in a personal config, unless a case can be made that all
spacemacs users would benefit.
2016-03-09 20:12:48 -05:00
Muneeb Shaikh dfceb3deb9 spacemacs-ivy: escape special chars in counsel input 2016-03-09 20:12:01 -05:00
syl20bnr b1a6d8977a react: prefer named function over lambda for hooks 2016-03-09 20:10:58 -05:00
huaoguo 70d4c2c784 Fix bug: helm-imenu doesn't work in react-mode
In react-mode, when invoke helm-imenu, the list is empty. Because this
feature is only enabled in js2-mode, not js2-minor-mode.

So we should enable it by ourself.

link: https://github.com/mooz/js2-mode/blob/master/js2-mode.el#L11557
2016-03-09 20:09:07 -05:00
Muneeb Shaikh 6fee0a3666 change insert map only for vim editing style
For now, prevent cluttering hybrid insert state map until there's
cleaner solution.
2016-03-09 20:01:37 -05:00
syl20bnr 4d6053695f Reapply lost commit 55ef063
Add smartparens to comint-mode
2016-03-09 19:59:17 -05:00
syl20bnr 6efd7c1362 Reapply lost commit 4b00495
Allow <count>G in doc-view to go to page
2016-03-09 19:57:12 -05:00
bmag 3a3d8f34ca Use window-numbering-assign-func for neotree number
Using window-numbering-assign is simpler and more reliable than using
window-numbering-before-hook and neo-after-create-hook.

Duplicates older commit 2ff22934e7 which
somehow didn't survive the splitting of spacemacs layer into smaller
spacemacs-* layers.
2016-03-08 16:41:56 +02:00
NJBS 9026652dcf Fix scrolling transient state keybindings typo 2016-03-06 19:50:49 -05:00
Muneeb Shaikh c955014102 spacemacs-ivy: hide lighter counsel 2016-03-06 19:50:17 -05:00
Eivind Fonn 2e99aa5bb6 Fix auto-completion toggle without default 2016-03-06 17:49:59 -05:00
syl20bnr 01f9879d7f octave: explicitly list it as a built-in package 2016-03-06 17:48:51 -05:00
syl20bnr 1bc773cc5f elixir: fix lazy installation configuration 2016-03-05 23:25:00 -05:00
Eivind Fonn a8bd6dcb23 Disable global-hl-line-mode in shell-like buffers 2016-03-05 21:02:15 +01:00
justbur 5da4ce9d6c counsel: Use counsel-mode
Minor mode that remaps all built-in Emacs commands that have a counsel
replacement.
2016-03-05 21:01:46 +01:00
Adam Sokolnicki c83a553e5f Fix chruby in the ruby layer
This commit replaces the code used for finding out the ruby version to
use with `chruby-use-corresponding`.
2016-03-05 20:54:57 +01:00
Eivind Fonn 86286574a3 Move rake popwin config to post-init-popwin 2016-03-05 20:54:17 +01:00