Usage of the `:if` keyword with `use-package` does not prevent Spacemacs form
installing the package, it only prevents the loading in run-time. This commit
employs the `:toggle` feature of the configuration layer system to prevent the
unneeded packages from being installed in the first place.
This further improves upon 31324f68bb
Use a dynamic hint for the smerge transient state in order to show the
current and total numbers of conflicts, and make the full hint toggleable.
* CHANGELOG.develop: Add an entry for this change.
* layers/+source-control/version-control/config.el
(spacemacs--smerge-ts-full-hint-toggle): New variable.
* layers/+source-control/version-control/funcs.el
(spacemacs//smerge-ts-hint): New function. Return a string indicating the
index of the current conflict and the total number of conflicts detected by
smerge-mode. If spacemacs--smerge-ts-full-hint-toggle is true, append the
smerge transient state's full hint.
(spacemacs//smerge-ts-toggle-hint): Toggle showing the full hint for the
smerge transient state.
* layers/+source-control/version-control/packages.el
(version-control/init-smerge-mode): Define the transient state in :init so
we can use spacemacs|transient-state-format-hint. Use
spacemacs//smerge-ts-hint to display a dynamic hint. Bind the ? key to
spacemacs//smerge-ts-toggle-hint.
Added key bindings:
`e` `smerge-ediff` to diff column
`K` `smerge-kill-current` to merge action column,
(used upper case K, because lower case k moves the cursor to the previous line)
Renamed "join curr/next hunk" to "Combine curr/next hunks", to match it's
command name: `smerge-combine-with-next`
and moved it from the "Merge Action" column to the "Other" column. Because the
merge action column handles versions while the combine command acts on hunks.
Sorted and groupped the backend keys to match the transient state columns.
Capitalize title and column headers.
Reduce two to one space between the key and description in the first column.
Rename and separate "move up/down" to "next line" and "prev line", to reduce the
first columns width, and to make it clear that it doesn't move the hunks.
Reduce four to two spaces between the first and second columns.
Rename "combine with next" to "join curr/next hunk" to indicate that the
hunks/conflicts are combined and not just of the versions.
Add a new column: Diff
Remove "diff" and "to" from diff key descriptions, to reduce the column width.
Move refine from the Other column to the new Diff column.
I often use these operations to ask how mine and other have diverged:
=< smerge-diff-base-mine
== smerge-diff-mine-other
=> smerge-diff-base-other
It's awkward to use their global keybindings under C-c ^ because that exits the
smerge transient-state.
Judging from issue GH-7378 there was no principled reason to omit them, only
that the author did not use them himself.
This patch defines key bindings with leader key instead of evilified state to
make it easier for people those who edit in vim style to use diff-mode for both
of editing and reviewing files/buffers.
There are two use cases for diff-mode:
(1) to manually edit diff in a patch file
(2) to review diff that is generated by `vc-diff' or similar commands
The evilified state is useful for the case (2), but is confusing for the
case (1). Usually, users of vim editing style expect that they are in normal
state when a new buffer is created. However, when evilified state is used for
the case (1), some keys insert their character in a buffer, which let the users
think they are in insert state and keep hitting keys to edit the buffer, while
other keys invoke commands or change contents of buffer, which let them think
they are in normal state, so finally the user get lost what state they are in if
they don't know evilified state is used for diff-mode.
The changeset 58d521af5 "Unbreak diff-mode", originally written on Apr 2 2017,
tried to avoid the confusion by removing the evilified state configuration.
However, it is overwritten by the other and older changeset 8009e1bf5 "evilify
vc-* buffers", which is written on Feb 22 2016, for some reason.
This patch respects both of the use cases listed above, thus defines key
bindings with leader key instead of just removing the evilified state
configuration.
This reverts commit 29c78ce841 and all other fixes
that have been made afterwards.
The motivation is that use-package is seen by many as a replacement for
`require`. Is use-package always defer the loading of packages then is breaks
this use case, this does not respect POLA so even if it was making Spacemacs
loading faster (up to 3s faster on some startup on my machine) we just cannot
use it, it would be irresponsible. Spacemacs should be easy to use, loading
performance will come with time but it is not a priority.
As it was, git-gutter and git-gutter+ get started as soon as emacs starts if
they're enabled. This added about 500ms to startup time on my machine, so this
will instead defer it until emacs has been idle for 5 seconds.
gd is now "diff"
gh is now "github"
gg is not changed for "github gist" (updated the prefix name)
Inverts gc and gC since commit is more frequent than checkout
Helm seems to treat "!" specially in pattern matching, so having a ! in
the pattern string when traversing directories is problematic. This
change fixes#2737, because as far as I can tell "+" has no special
meaning in a helm pattern.
Of course, we can choose a different character, but I'm fond of "+" as
representing "more layers here".
2015-09-11 00:13:51 -04:00
Renamed from layers/!source-control/version-control/packages.el (Browse further)