Giter VIP home page Giter VIP logo

emacs-magit-config's Introduction

emacs-magit-config

A quick and easy pre-configured Emacs for using magit.

License

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Prerequisites

It's easier if you're running Linux or OS X. If you're on Windows, there is no guarantee whether anything described will work.

Download

Run the following to clone this repo and its dependencies:

$ git clone https://github.com/chrisdone/emacs-magit-config.git --recursive

That shouldn't take a minute.

Running

In the repo directory, run this:

$ emacs -Q -l init.el

The -Q is short for "quick" and means it will not use any existing Emacs configuration that you already have.

The -l init.el will load this repo's init configuration.

If you decide you want to use this configuration as-is or as a base, you can put the following in your ~/.emacs file:

(load "/path/to/emacs-magit-config/init.el")

Then run Emacs from the terminal as simply:

$ emacs

Using

Run emacs in the given directory:

$ emacs

And it will automatically run the equivalent of typing M-x magit-status RET in Emacs.

magit commands themselves can be accessed via ? that lists the regular commands, hitting a further key of those listed (e.g. c) shows more help for that command. Ctrl-g cancels any popup of any kind in Emacs.

Common keybindings

  • g - refresh the buffer
  • l - log (n/p inside the log also does the expected thing)
  • q - close a buffer (e.g. the log)
  • n/p - move to next/prev hunk/section
  • TAB - expand a changeset
  • s - stage a hunk. You can select parts of a hunk to stage just that part.
  • u - unstage the thing the cursor is on. Again, you can select what to unstage if necessary.
  • - / + - increase/decrease hunk granularity.
  • k - kill/delete a hunk.
  • c - commit
  • C-c C-c - inside
  • b - checkout a branch or a specific commit
  • s - stash the current working changeset
  • F - pull from the remote
  • F - r F - pull --rebase
  • P - push
  • R - rebase
  • m - merge

Regular Emacs commands (especially window management):

  • Ctrl-x k - kill the current buffer
  • Ctrl-g - cancel whatever prompt is prompting you
  • Ctrl-x 1 - just show one window
  • Ctrl-x 0 - close the current window
  • Ctrl-x 2 - split window in twine, one above the other
  • Ctrl-x 3 - split window in twine, side-by-side

emacs-magit-config's People

Contributors

chrisdone avatar

Stargazers

Sumit avatar Ketzacoatl avatar Priyadarshan avatar Guillaume Marceau avatar Kevin Cotrone avatar

Watchers

 avatar James Cloos avatar  avatar

emacs-magit-config's Issues

Who is the target audience

Who is this intended for? Non-emacs users who want to use just Magit?

If so, it should probably provide shell commands like magit status or magit diff --staged. Something like this kinda exists at https://github.com/magit/magit.sh. Would you be interested in maintaining that and/or integrating it into this configuration?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.