rg tries to be smart about printing line numbers in its output (if running
inside a TTY or not). On Windows, sometimes (always?) it chooses not to print
line number. However, we always want line numbers, so we need to pass -n flag.
Also fix a minor grammar mistake.
Getting FAQ candidates requires org to be loaded which in turn requires to
load magit (via orgit) etc...
This commit moves the FAQ helm source to a new feature helm-spacemacs-faq and
removes the FAQ source from SPC h SPC so the FAQs are only available as a helm
source via SPC h f.
But we have still the FAQ org file entry in SPC h SPC so it is easy to open
the file from the main help key binding.
Enabling a company backend for a specific mode was a tedious tasks with code
scattered at different locations, one for local variable definitions, one for
company hook function definitions and another where the backends were pushed to
the local variables (which was problematic, since we ended up pushing the same
backends over and over again with `SPC f e R`, pushes have been replaced by
add-to-list calls in the new macro).
All these steps are now put together at one place with the new macro
spacemacs|add-company-backends, check its docstring for more info on its
arguments.
This macro also allows to define arbitrary buffer local variables to tune
company for specific modes (similar to layer variables via a keyword :variables)
The code related to company backends management has been moved to the
auto-completion layer in the funcs.el file. A nice side effect of this move is
that it enforces correct encapsulation of company backends related code. We can
now easily detect if there is some configuration leakage when the
auto-completion layer is not used. But we loose macro expansion at file loading
time (not sue it is a big concern though).
The function spacemacs|enable-auto-complete was never used so it has been
deleted which led to the deletion of the now empty file core-auto-completion.el.
The example in LAYERS.org regarding auto-completion is now out of date and has
been deleted. An example to setup auto-completion is provided in the README.org
file of the auto-completion layer.
I find myself wanting to open the package.el and f3 is just too far away
in my keyboard. And I thought maybe this would be something people might
want. Also maybe we could have special binding for actions? like `C-1`
`C-2`, etc
- Apply `/` and `//` rules (double / is for private functions)
- Add missing `spacemacs/` prefixes
- Move functions used outside of spacemacs-base layer to
core/core-funcs.el
- Remove unused functions
Commit originally intented to only rename linum-update-window-scale-fix
to spacemacs/linum-update-window-scale-fix :-)
Fixes some edge cases like SPC f e R performed after SPC h SPC which
could wrongly install or uninstall packages.
Side effects is contained using the variable
configuration-layer--package-properties-read-onlyp, if non nil then
properties value of a package cannot be overwritten.
New value `manual` for auto-completion-enable-help-tooltip enables the
user to display help tooltip on-demand. Other values remain the same:
nil for no tooltip at all, t (or any non-nil non-manual value) for
automatic tooltip.
Minor fix: call `company-quickhelp-mode` just once, because it's a
global minor-mode.
Current implementation, #1644, doesn't handle the nested snippet
expansion properly, so you end up with smarparens disabled. Very
annoying.
I improved the implementation to remember the current state of
smartaperns before a top-level snippet expansion and preserve on any
nested snippet expansions.
Also, some housekeeping of the related code:
* Move hook handlers to the `funcs.el`.
* Add comments about yasnippet hooks subtleties relevant to the issue.
Fixes#1512
TL;DR Should get 20~25% speed improvement on startup, should get a big
improvement when using ivy or helm SPC h SPC. Users with layers.el files
in their layers must use `configuration-layer/declare-used-layer`
instead of `configuration-layer/declare-layer`
The implementation of the layer system made heavy use of `object-assoc`
and `object-assoc-list` functions which are not efficient. This PR
mainly replaces those object lists with hash maps in order to index the
objects by their name and achieve an O(1) access time.
The old object lists `configuration-layer--layers` and
`configuration-layer--packages` have been each by two variables each:
- `configuration-layer--indexed-layers` which is a hash-map of all the
layer objects and `configuration-layer--used-layers` which is a list of
all _used_ layers symbols,
- symmetrically `configuration-layer--indexed-packages` which is a
hash-map of all the package objects and
`configuration-layer--used-packages` which is a list of all _used_
packages symbols.
The hash map `configuration-layer--layer-paths` is gone, now we create
directly layer objects when discovering the layers and set the :dir
property. Note that previously the layer paths were the parent directory
of the layer, now :dir is the layer path.
The function `configuration-layer//make-layer` is now similar to its
counterpart `configuration-layer//make-package` in the sense that it
takes an optional `obj` to be able to override its properties.
The functions `configuration-layer/declare-layer` and
`configuration-layer/declare-layers` now takes an optional parameter
`usedp` in order to declare used or not used layers. For convenience
new functions have been added: `configuration-layer/declare-used-layer`
and `configuration-layer/declare-used-layers`, users _must_ update all
occurrences of `configuration-layer/declare-layer` by
`configuration-layer/declare-used-layers` in their `layers.el` files.
`helm-spacemacs-help` and `ivy-spacemacs-help` are updated to match the
changes in `core-configuration-layer.el`.
Rename some variables to make them more explicit:
`configuration-layer-no-layer` -> `configuration-layer-exclude-all-layers`
`configuration-layer-distribution` -> `configuration-layer-force-distribution`
With this new variable, user can load spacemacs anywhere, e.g.
"~/.emacs.d/spacemacs/". Only user's cache directory is still hard-coded
as "~/.emacs.d/.cache/". If user want to use spacemacs this way, drop
one line as the below in "~/.emacs.d/init.el":
(setq spacemacs-start-directory "~/.emacs.d/spacemacs/")
(load-file (concat spacemacs-start-directory "init.el"))
Implement a keymap for Spacemacs’ counsel search that supports saving
the results to a buffer (bound on F3 as in helm). Ensure that the new
buffer supports the GNE API.
As it was the case during the good old days when spacemacs was still a
baby, SPC h SPC now list correctly all the pre/init/post functions and
the associsted layer. It also now list properly the current owner of
a package so it is easy to find the owner of a package by narrowing
with `packagename owner`.
This new old functionality is possible by leveraging the last
improvements to the layer system (see previous commits).
TODO: update the sources for Ivy
Correctly augment the docstring based on the presence of b,f and /
bindings using dynamic hint.
b,f and / are not available if none of helm or ivy layers are used.
Invoking "make" or "project compilation" (<kbd>SPC c m</kbd>, <kbd>SPC c
c</kbd>) is currently not supported in ivy mode. The PR re-enables them
by adding helm-make to the ivy packages with ivy completion method.
Keep it in a recommendation in the README for the layer. Eval'ing the
custom-set-faces directly in the config makes it difficult to revert the
customizations.
Use a custom package name. Also dispatch functions to funcs.el files.
Disable ivy-hydra for now.
With this default configuration users using helm instead of ivy still
get a good ivy base configuration (UI and Key bindings).
Use a custom package name. Also dispatch functions to funcs.el files.
With this default configuration users using ivy instead of helm still
get a good helm base configuration (UI and Key bindings).
counsel-descbinds is accessible through SPC-?, and shadowing the C-h key
for which key makes pagination impossible. As this deviates from
which-key defaults, this should be up to user to config, not a base in
spacemacs-ivy.
Now Spacemacs will ask for layer installation when opening a file with
a known file type.
The auto-mode-alist entries are added by the file auto-layer.el in
the layers directory.
Easy insert of forms for lazy initialization can be done with the
interactive function configuration-layer//insert-lazy-install-form.
Change default value of dotspacemacs-enable-lazy-installation to t.
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.
It's not possible to get full backtraces in these instances when an
error is signaled, and I think we should generate full backtraces when
debug-on-error is enabled as a general rule.
I had to make this change at one place to track down the root of problem
2 in #5200.
Add actions for both helm and ivy.
TODO:
- see TODO in function body
- replace SPC h d p (list all packages, use spacemacs describe when
it is a layer package, otherwise use vanilla describe).
Can be used with counsel-git-grep to edit results in an occur buffer.
Handy!
Add wgrep bindings
",w" to enter wgrep mode
",," to commit changes
",a" to abort
counsel: Fix command output for wgrep
wgrep doesn't work with the column number in the command output
- port helm-perspectives
- port persp switch buffer
- port persp-close[kill]-other to use ivy
- layouts-ts: Make help more consistent
- layouts-ts: Reorganize docstring
Instead of one big list, try to organize into sections to make it easier
to find the right key
Introduce hjkl-completion-navigation-functions to hold the functions to
disable and enable hjkl navigation for ivy and/or helm. The hook is run
with args to indicate whether to enable or disable.
If " -- " appears in the search string split the search string on the
first occurrence with everything before treated as args to the search
and everything after treated as part of the regex.
This version of counsel--async-command feels smoother for me. Right now
it is just being used for the search functions. If others like it, I'll
propose it upstream.
Enable a global binding to access a list of available REPLs to run
everywhere. If the requested REPL depends on a major-mode that hasn't
been loaded, it will be loaded along its dependencies.
To make this work, a new `spacemacs/register-repl` function is included.
This function adds a major-mode and its repl function to a global
variable.
See issue #4605. When dotspacemacs-helm-header is changed from the
default nil, then the helm-source-header theming does not updated when
a new theme is loaded.
This was due to the helm-source-header-default-xxx variables being set
only once and not updated when a new theme is loaded. The fix adds an
advice to spacemacs/post-theme-init to update these variables.
This allows for all other code including theming to take place and then
set the variables correctly i.e
load-theme -> post-theme-init -> helm-header
This also ensures the code is correctly decoupled now that helm is one
of the optional completion layers.
When a single source helm is viewed the source face-attribute was
changed from helm-selection to default as this gives a more consistent
result for themes that have bright highlight lines and/or no helm face
values.
Key bindings should not be choosen given a package name, some helm
key bindings are under `SPC h` which are corrected the following way:
SPC h l for helm-resume to SPC r l (resume last completion)
SPC s l for last-search to SPC r s (resume search) (SPC s l is still
available)
SPC h L for helm-locate-library to SPC s L
Resolve#4592
SPC h . helm/ivy-spacemacs-help-dotspacemacs
SPC h SPC helm/ivy-spacemacs-help
SPC h f helm/ivy-spacemacs-help-faq
SPC h l helm/ivy-spacemacs-help-layers
SPC h p helm/ivy-spacemacs-help-packages
SPC h r helm/ivy-spacemacs-help-docs
SPC h t helm/ivy-spacemacs-help-toggles
There's not that many commands under `SPC h` so this gives easier access
to these commands. It also makes `SPC h SPC` get you straight to the
docs in both helm and ivy.
ivy-use-virtual-buffers was triggering recentf-mode to be called before
the recentf init function was called leading to problems with where the
recentf file was placed.
This layer configures spacemacs to use the ivy/counsel/swiper family of
packages. Default completion is done with ivy. This is meant to replace
helm for those who want it.