Right now, instead of pressing just
cc in magit-mode, I have to press
c-vc every time to enable
Is it possible to make it enabled by default?
v2.1.0, Magit uses the library
magit-popup.el to implement such "popup buffers" or "prefix-infix-suffix combos". Despite its name, that library can be used by packages not related to Magit, and is therefore made available as a separate Elpa package. It even has its own manual now!
Default arguments can now be set directly from a popup buffer. To always use
--verbose when committing do this:
By default all popup buffers end with a section named "Common Commands". If not, use C-t to show it. You probably don't want to see that section all the time and should therefore set
Of course it is also possible to set the value of
magit-commit-arguments and other such variables using the Custom interface,
add-to-list. But I recommend against that, because that would make it impossible to change the defaults on-the-fly.
As far as I can tell Magit does not keep track of "default" options, but we can make it "press
-v" every time the Committing buffer pops up:
(advice-add #'magit-key-mode-popup-committing :after (lambda () (magit-key-mode-toggle-option (quote committing) "--verbose")))
To find what function to advise, I opened a
magic-status buffer and pressed
C-h k c. This led me to
magit-key-mode-popup-committing. Then (with the Committing buffer still displayed) I pressed
C-h k -v to find the
lambda form Magit calls when you press
-v in the Committing window.
Update: I did write this answer independently, but see Can I have the git-log “--all” option be initially selected?, the answer given there, and comments to that answer.
While it's not exactly what you want (diff in your commit buffer), you can set magit to expand the staged diffs in the status window:
(setq magit-expand-staged-on-commit 'full)
The magit workflow seems to always be open status buffer and then open split with commit buffer, you always end up with two buffers displayed. The above setting will make the second (previously not useful) buffer display your diff.
You can also use
t to only expand the diff headers (so it shows the line numbers):
(setq magit-expand-staged-on-commit t)
While writing your diff, you can switch to the status buffer and use
TAB to expand (or fold) the diffs.
Alternatively, you can use
C-c C-d from the commit buffer to open another buffer with a diff with
magit-diff-staged. (See this issue.)