Commit graph

306 commits

Author SHA1 Message Date
duianto 57b1ae7880 [version-control] Load SPC g v keys on startup 2020-05-08 22:27:11 +02:00
Maximilian Wolff 4b11590588
[git] Make M-X switch windows in magit buffers
Before M-1 M-2 M-3 M-4 were bound by magit to show fixed numbers
of details. Now these bindings are available with 1 2 3 4 instead.

The M-X bindings are now used for quick switching of windows as in the
rest of spacemacs.
2020-03-27 20:40:15 +01:00
Maximilian Wolff 96e7621f8a
Fix missing implicit dependency of the git layer to magit-section 2020-01-23 23:53:38 +01:00
madand 081d8f29d4 [version-control] Use :toggle to avoid installation of unused packages
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
2019-12-27 17:39:51 +01:00
duianto 1de8157a5c Unfold org headings from helm-ag and magit
Unfold org headings to a target line when opening a .org file from:
helm-ag, magit diff or blame buffers
2019-10-19 23:47:45 +02:00
Hong Xu e37b70cfa3 Bound counsel-git to gff and move magit-find-file to gfF.
counsel-git find a file in the current git repository. "gff" is
currently bound to magit-find-file. While counsel-git seemingly performs the
same functionality as magit-find-file, they are substantially different:
magit-find-file is not intended to find a file, contrary to what the
name indicates. See https://github.com/magit/magit/issues/3967 for
explanation. This is why we need another key binding for counsel-git.
2019-10-16 22:03:42 +02:00
Miciah Masters 8d6f736209 Delete old git-link and git-timemachine code
Delete integration code for git-link and git-timemachine, which is
superseded by upstream changes to git-link committed in August 2016:
433ba1dba7

* CHANGELOG.develop: Add an entry for this change.
* layers/+source-control/git/funcs.el (spacemacs/git-link-copy-url-only):
Replace call to spacemacs/git-link with a call to git-link.
(spacemacs/git-link-commit-copy-url-only): Replace call to
spacemacs/git-link-commit with a call to git-link-commit.
(spacemacs/git-link, spacemacs/git-link-commit): Delete functions.
* layers/+source-control/git/packages.el (git/init-git-link): Replace
binding to spacemacs/git-link with a binding to git-link.
2019-10-14 18:18:49 +02:00
Miciah Masters ec0a535b27 Show conflicts in smerge ts hint
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.
2019-10-13 10:09:42 +02:00
Roman Gonzalez 28f3b6289d Add spacemacs/git-permalink functionality
Context:

When using org files, one normally tends to add Github code links to an
algorithm/bug explanation so that readers are able to follow along with a PR
change.

The current `<SPC> g l L` command gets us the URL to the current branch; given
the code is in flux, the link becomes non-sensical rather quickly, loosing value
when trying to build a document with explanations about the code.

This PR allows us to get the Permalink (e.g. link associated to the commit, not
the branch); using this, the URL contents will never change with new commits
submitted to the repository.

Changes:

  * Add two new functions with associated keybindings:

    - `<SPC> g l p` maps to `spacemacs/git-permalink`

    - `<SPC> g l P` maps to `spacemacs/git-permalink-copy-url-only`

  * The above changes rely on mechanisms of `git-link`, so no new code needs to
    be introduced
2019-10-05 19:19:41 +02:00
syl20bnr 584392bd92 [core] Fix layer dependencies based on layer variables
There was a edge case with the declaration of the `lsp` layer in `layers.el`
files.
The `hy` layer depends on the `python` layer which in turn depends on the `lsp`
layer if and only if the `python-backend` layer variable is set to `lsp`.
When the `hy` layer was declared first then it declares the `python` layer
without its layer variables, thus the `lsp` layer was not declared because the
`python-backend` variable was not set.

The fix is to gather all the layer dependencies and resolve them only after all
the used layers have been declared.

* new function `configuration-layer/declare-layer-dependencies`
* replace all calls to `configuration-layer/declare-layer` by the new function
  except for distribution layers (we declare layer dependencies right away in
  distribution layers)
2019-09-30 02:00:48 -04:00
Compro-Prasad 42296a91df [org] Fix commit browsing via magit blame in org buffers 2019-09-22 19:21:53 +02:00
emacspace 3747afb4b0 documentation formatting: Fri Aug 23 17:22:19 UTC 2019 2019-08-24 00:03:42 +02:00
syl20bnr 015414ae8c [Github] Do not install forge pacakge on Windows by default 2019-08-21 22:29:21 -04:00
Hong Xu 8485e69fa9 Remove documents for magithub in the github layer, as it has already been removed. 2019-07-11 18:08:00 +02:00
JAremko 6c12121cec fix links 2019-07-08 23:56:07 +03:00
duianto 3868a5364f [doc] Fix typos and add missing/remove extra ~
Add missing ~ (tilde) around key bindings.
Remove an extra ~.
2019-06-01 20:40:22 +02:00
emacspace c7c348a676 documentation formatting: Sun May 26 20:58:52 UTC 2019 2019-05-27 01:23:35 +03:00
Anton-Latukha f6660f82d4
Switch to the new layers generator 2019-05-15 21:08:21 +03:00
JAremko 5d02b1c4bb Add more tags 2019-05-03 03:44:19 +03:00
emacspace 202da65b1c documentation formatting: Sun Apr 21 20:04:25 UTC 2019 2019-04-22 23:16:20 +02:00
yuhan0 57e47f6210 Update documentation
Also fixes the documentation of the Commit message editing section which had a mistakenly added table
2019-04-21 21:55:52 +02:00
yuhan0 c3e9980d09 Add leader key bindings to Forge topic and post modes 2019-04-21 21:55:52 +02:00
yuhan0 56ef7f5163 Add "accept", "cancel" leader key bindings to magit log mode 2019-04-21 21:55:51 +02:00
emacspace 1b87247bf4 documentation formatting: Sun Apr 21 11:40:05 UTC 2019 2019-04-21 22:04:17 +03:00
duianto d9b7ac64f3 Hide mode-line indicators: emoji and WE
emoji appeared in at least org mode.
WE appeared in the COMMIT_EDITMSG buffer.
2019-04-21 13:33:24 +02:00
duianto 4a8c59a146 [version-control] update readme
Unify "Key binding" headers.
Capitalize first word in descriptions.

Smerge transient state section:
Group by column/category.
Merge previous hunk bindings to one line.
Remove Smerge prefix in descriptions.

New Smerge transient state key bindings:
Merge action section:
Kill current

Diff section:
Diff base and mine
Diff mine and other
Diff base and other
Ediff
2019-04-21 11:48:48 +02:00
duianto 0ff31edcd8 [version-control] Smerge one char diff bindings
Reduce the Smerge transient state diff bindings from two to one character:
=< to <
== to =
=> to >
2019-04-21 11:48:48 +02:00
duianto b238516d1f [version-control] smerge add 2 keys, etc.
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.
2019-04-20 20:50:45 +02:00
duianto 677c06c759 [version-control] Smerge TS formatting
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.
2019-04-20 13:00:05 +02:00
Wang b21a7da680 Extend smerge transient-state with diff keybindings
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.
2019-04-20 10:02:23 +02:00
yuhan0 4696c5306a [vcs] Inhibit auto-indentation after reverting hunks
Fixes #11523, makes it easier to revert changes to non-standard indentation when
aggressive-indent mode is enabled.
2019-04-18 23:16:08 +02:00
duianto 76ba46893b Remove magit-log-arguments variable assignment
Magit removed the variable: magit-log-arguments
4641aa07e0
2019-04-18 10:14:14 +02:00
duianto f8d40a455c [git] Code formatting
Fix missing newline warning
Keep lines under 80 chars
2019-04-11 14:17:02 +02:00
yuhan0 cc094c85d2 Move purpose-x config to spacemacs-purpose layer
This would otherwise cause a void-function error for users of the spacemacs-base
distribution without window-purpose installed.
2019-04-07 18:07:57 +02:00
Eric Zhang a4801bec7b Fix magit conflicting with golden-ratio 2019-04-04 12:41:01 +02:00
duianto 95c2488c66 Show magit-log-select and diff in two windows 2019-04-03 22:35:26 +02:00
syl20bnr b28f1a2aba github: add function to get repo for a forge notification error 2019-03-31 12:16:43 -04:00
duianto 3de7081950 Cleanup which-key names
Moved:
- ("ai" "irc") to both the `erc` and `rcirc` layers. They don't have to be
  renamed until the layers are loaded.

- ("ay" "ipython notebook") to the `ipython-notebook` layer.

- ("p$" "projects/shell")
  ("'"  "open shell")
  ("as" "shells")
  to the `shell` layer.

- The commands with keybindings from spacemacs-bootstrap/packages.el to
  spacemacs-defaults/keybindings.el.

Removed:
- ("gd" "diff") it seems to be an old group name, there's no `SPC g d` group at
  the moment.

- ("Re" "elisp") and ("Rp" "pcre") because they have moved to:
  ("xr" "regular expressions")
  ("xre" "elisp")
  ("xrp" "pcre")

- ("xm" "move") seems to be an old move text group, the current keybindings are
  `SPC x J` and `SPC x K` which opens the Move Text Transient State.

- ("b" "persp-buffers") because `SPC b` is also renamed as ("b" "buffers") which
  is more general and not persp-mode specific.
2019-02-18 14:35:00 -05:00
bmag b364cd3c61 Transient and magit-svn fixes
- magit-svn-popup renamed to magit-svn (more fallout of Transient)
- more reliable placement of Transient cache files
2019-02-18 14:26:41 -05:00
syl20bnr f6a42ef790 Reenable magit-gitflow 2019-02-18 12:56:45 -05:00
syl20bnr 79279f434b Disable magithub, please move it to your private layer is used 2019-02-18 12:55:22 -05:00
syl20bnr dd59f30aae Temporarily disable magit-gitflow to be able to SPC g s 2019-02-18 11:31:38 -05:00
yuhan0 d325c5027c [git] Add init function for transient package 2019-02-18 11:17:32 -05:00
syl20bnr 0bc5b54ebf Call magit-diff instead of magit-diff-buffer-file 2019-02-16 10:21:45 -05:00
bmag 99b355e2fa Adapt for Magit's move to Transient
Magit now uses Transient instead of magit-popup, and we must adapt. Also had to
replace the recently removed magit-diff-buffer-file-popup with
magit-diff-buffer-file (similar but doesn't offer a popup before displaying the
diff).

Note some upstream packages haven't adapted to this change, but when they do we
might need similar fixes:
- magithub
- magit-gitflow
- magit-svn
2019-02-16 10:21:45 -05:00
syl20bnr 63f9a92348 Revert "Mention breaking change for pull key binding with GitHub and forge"
This reverts commit 36c1291081.
2019-02-16 09:53:34 -05:00
Robert O'Connor 0b5ae3ccbf Remove magit-gh-pulls as magithub is so much better! 2019-01-20 22:33:59 +02:00
emacspace 03cb987c6d documentation formatting: Sun Jan 20 15:34:11 UTC 2019 2019-01-20 15:45:54 +00:00
Voleking a8567cbed3 Fix diff-hl-highlight function is set to nil 2019-01-20 17:12:53 +02:00
Anton-Latukha 059810f31d Fix magit-repository-directories documentation 2019-01-20 15:28:28 +02:00
emacspace f2c17ba15f documentation formatting: Thu Jan 17 14:07:30 UTC 2019 2019-01-17 16:56:39 +02:00
syl20bnr 36c1291081 Mention breaking change for pull key binding with GitHub and forge 2019-01-17 09:01:12 -05:00
Miciah Masters 01e2db9c42 github: Update forge key bindings
Update the documentation for forge per upstream changes to key bindings in
evil-magit[1].

[1] 49978d07d3

* layers/+source-control/github/README.org: Update key bindings for forge.
2019-01-17 08:48:27 -05:00
emacspace 7353d5670f documentation formatting: Mon Jan 14 23:15:53 UTC 2019 2019-01-14 23:19:02 +00:00
Miciah Masters 07aa9b01ed github: Add forge
Note that Forge binds the ' key to the Forge dispatch popup, but evil-magit
binds the ' key to the submodule dispatch popup (see
https://github.com/emacs-evil/evil-magit/issues/54), and evil-magit's key
binding takes precedence with the vim editing style.  Because Forge's key
binding does not always work, it is omitted from the README.

Note also that Magit binds the % key to its worktree dispatch popup, but
Spacemacs binds the % key to the magit-gitflow popup, and Spacemacs's key
binding takes precedence.  Because there is no available key binding for
the worktree dispatch popup, Forge's key binding under that dispatch popup
is omitted from the README.

* CHANGELOG.develop:
* layers/+source-control/github/README.org: Update.
* layers/+source-control/github/packages.el (github-packages): Add forge.
(github/init-forge): Load forge after magit. Configure forge to use
spacemacs-cache-directory.
(github/init-magithub): Disabling injecting issues and pull-requests
sections if forge is installed.
2019-01-15 00:48:48 +02:00
yuhan0 5b2e969b3b [git] Defer orgit package 2018-12-04 22:07:41 -05:00
emacspace 45276bd96f documentation formatting: Wed Dec 5 03:03:03 UTC 2018 2018-12-04 22:06:14 -05:00
emacspace 4912b54f24 documentation formatting: Mon Nov 12 22:12:39 UTC 2018 2018-11-12 22:24:27 +00:00
yuhan0 0596e90c3d Add 'z' recenter bindings for various transient states
By analogy with the "zz", "zb", "zt" vim / evil bindings, this adds an
additional key binding "z" for `recenter-top-bottom` to the following
transient states which navigate around the buffer in large jumps:
- auto-symbol-highlight
- error
- buffer
- vcs
- org-babel

This allows for repositioning of the buffer for visibility without having to
exit the transient state.

Minor updates are also made to documentation of other transient states.
2018-11-12 21:47:17 +00:00
Bjarke Vad Andersen cb4a156087 'magit-blame' renamed to 'magit-blame-addition' 2018-11-01 00:53:13 +02:00
deb0ch a23055b6cd add magit buffers to useless buffers 2018-10-26 10:46:53 +01:00
emacspace 901f35849a documentation fixes: Tue Oct 23 14:18:21 UTC 2018 2018-10-23 23:38:16 +03:00
JAremko cd39f80c24 Reformat documentation 2018-10-11 00:13:43 +03:00
deb0ch 2ac7ee8f9b
magit: enable colors in magit-log 2018-10-06 09:47:11 +03:00
Evan Klitzke 95f276bd21 Add helm-git-grep to the git layer 2018-09-04 00:06:03 +03:00
Miciah Masters 4408788799 github: Disable status, issues, and PRs by default
Try again to fix issue #11176.

* layers/+source-control/github/packages.el (github/init-magithub): Disable
the GitHub project status, pull requests, and issues sections by default.
* layers/+source-control/github/README.org: Document that these sections
are all disabled by default, and how to enable them.
2018-08-18 15:06:26 -04:00
Miciah Masters 6659088dc5 github: Make Magithub offline by default
Fix issue #11176.

* layers/+source-control/github/packages.el (github/init-magithub):
Configure Magithub to be offline by default.
* layers/+source-control/github/README.org: Add documentation about
Magithub's offline mode.
2018-08-18 13:22:37 +01:00
Miciah Masters 2148562982 Fix loading of Magithub
Fix issue #10760: Magithub sections are not added to Magit.

The problem is that the Spacemacs init function's use-package form for
Magithub specifies both :after magit and :defer t. It should specify only
the former so that Magithub will be loaded when Magit is loaded.

* layers/+source-control/github/packages.el (github/init-magithub): Delete
:defer argument.
2018-08-01 23:03:19 -04:00
JAremko 6fef4b7481 Fix git-timemachine link 2018-07-20 02:45:50 +03:00
Ruslan Kamashev ecc7eeda74 Add gitignore-templates 2018-07-03 23:48:50 +03:00
syl20bnr 666671a881 Sort key bindings alphabetically in version-control README.org 2018-06-24 02:54:07 -04:00
Masayuki Takemura ce6e28601f diff-mode: define key bindings with leader key for vim editing style
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.
2018-06-24 02:54:07 -04:00
syl20bnr acfc8c5814 version-control: correctly defer diff-hl and git-gutter packages 2018-06-14 10:08:38 -04:00
syl20bnr 31324f68bb Avoid loading all the diff packages in version-control layer 2018-06-14 02:51:24 -04:00
syl20bnr c3c7249234 Delay diff-hl loading by 5 seconds 2018-06-14 02:28:10 -04:00
syl20bnr c41a122b24 Lazy load diff-hl 2018-06-10 23:30:48 -04:00
syl20bnr b282e553ba Use dotspacemacs backward compatibility macro instead of aliases 2018-06-08 02:24:38 -04:00
Codruț Constantin Gușoi e1ae3448e6 Remove whitespace from readme 2018-05-27 22:54:25 +03:00
dh 496eb1db56 cleanup & change keybinding of magit-svn-popup 2018-05-27 22:46:44 +03:00
dh 24ba77e775 install magit-svn by default 2018-05-27 22:46:44 +03:00
dh 8cd8197348 enable magit-svn by default 2018-05-27 22:46:44 +03:00
syl20bnr 45e0c08c72 dump: require magit when dumping 2018-05-20 03:58:48 -04:00
Ag Ibragimov 5cdfeef2fa git: adds SPC g f d - for magit-diff-buffer-file-popup 2018-05-15 01:33:30 +03:00
Ag Ibragimov d691b916cd git: changes SPC g f h to SPC g f l - for 'git log' of current file 2018-05-15 01:33:30 +03:00
Aaron Jensen 40530100d6 Reenable magithub
Ghub and therefore magithub now support creating tokens automatically:

https://github.com/vermiculus/magithub/blob/master/magithub.org#authentication
https://magit.vc/manual/ghub/Interactively-Creating-and-Storing-a-Token.html#Interactively-Creating-and-Storing-a-Token
2018-05-10 23:05:14 +03:00
syl20bnr ebe4c60264 Revert "Defer packages by default using use-package-always-defer"
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.
2018-03-03 23:40:10 -05:00
syl20bnr 29c78ce841 Defer packages by default using use-package-always-defer
Warning now `:defer t` is implied, to force a package to load `:demand t` is
now necessary.
2018-02-27 23:32:52 -05:00
syl20bnr 83a6778eab Lazy load diff-hl and move lsp-ui-mode hook 2018-02-27 23:32:52 -05:00
smile13241324 d85eb092d0 Fixed the next bunch of documents
Fix doc for coq, semantic-web, source-control, evil-commentary
and spotify layer.
2018-02-04 06:21:18 +02:00
JAremko d2c3b847d8 doc fmt 2018-01-27 16:57:39 +02:00
denin 8009e1bf50 evilify vc-* buffers 2018-01-20 10:54:40 -05:00
syl20bnr 41e546f040 Move all use-package hook declaration to pre-init functions
Had to create dummy init functions at some places since the owner of a package
is the last layer that defines the init function of a package. And a package
can be installed only if it has an owner.
2018-01-10 23:57:18 -05:00
syl20bnr 6cd0cc31fc git: move evil-magit use-package hook declaration to pre-init 2018-01-10 23:33:15 -05:00
syl20bnr 42adde95ec git: remove old evilification of magit buffers 2018-01-10 23:33:03 -05:00
syl20bnr 269c385560 git: add use-package for defered loading of evil-magit 2018-01-10 23:32:49 -05:00
Muneeb Shaikh 4a34ef4673 git: toggle evil-magit based on editing style
Fix #10078
Fix #10054
2018-01-10 22:21:38 -05:00
Diego Berrocal 266322349e Move the key definition to the config hook of gh-pulls 2018-01-09 01:28:54 -05:00
smile13241324 5e0befba5b Fix doc for terraform, perforce, elfeed and evil-snipe layer 2018-01-08 01:44:19 -05:00
syl20bnr 326965d4ce Happy New Year 2018! 2018-01-04 02:00:25 -05:00
syl20bnr 7540c07c9d github: replace evilified-state-evilify by evilified-state-evilify-map 2017-10-15 11:08:01 -04:00