├── .gitignore ├── screenshot.png ├── magit ├── init.el └── readme.org /.gitignore: -------------------------------------------------------------------------------- 1 | /straight/repos 2 | /straight/build 3 | /straight/build-cache.el 4 | -------------------------------------------------------------------------------- /screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gizmomogwai/magit/HEAD/screenshot.png -------------------------------------------------------------------------------- /magit: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | os=$(uname) 3 | args="--no-window-system --no-init-file --load $HOME/.magit/init.el" 4 | prefix= 5 | if [ "$#" -eq 1 ]; then 6 | cd $1 7 | fi 8 | 9 | if [ "$#" -eq 2 ]; then 10 | cd $1 11 | prefix="env SHA=$2" 12 | fi 13 | 14 | if [ $os == "Darwin" ]; then 15 | $prefix /Applications/Emacs.app/Contents/MacOS/Emacs $args 16 | else 17 | $prefix emacs $args 18 | fi 19 | -------------------------------------------------------------------------------- /init.el: -------------------------------------------------------------------------------- 1 | ;;; init --- minimal settings for magit 2 | ;;; Commentary: 3 | ;;; Code: 4 | (setq user-init-file (or load-file-name (buffer-file-name))) 5 | (setq user-emacs-directory (file-name-directory user-init-file)) 6 | 7 | (defvar bootstrap-version) 8 | (setq straight-disable-native-compile t) 9 | (let ((bootstrap-file 10 | (expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory)) 11 | (bootstrap-version 5)) 12 | (unless (file-exists-p bootstrap-file) 13 | (with-current-buffer 14 | (url-retrieve-synchronously 15 | "https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el" 16 | 'silent 'inhibit-cookies) 17 | (goto-char (point-max)) 18 | (eval-print-last-sexp))) 19 | (load bootstrap-file nil 'nomessage)) 20 | 21 | (straight-use-package 'use-package) 22 | (use-package magit :straight t) 23 | (use-package zenburn-theme :straight t :config (load-theme 'zenburn t)) 24 | 25 | (menu-bar-mode -1) 26 | (load-theme 'zenburn t) 27 | (kill-buffer "*scratch*") 28 | (defalias 'yes-or-no-p 'y-or-n-p) 29 | (setq inhibit-startup-screen t) 30 | (setq initial-scratch-message "") 31 | 32 | ;; bring up magit-status 33 | 34 | (let ((sha (getenv "SHA"))) 35 | (if sha 36 | (magit-log-setup-buffer (list "--all") nil nil nil sha) 37 | (magit-status)) 38 | (delete-other-windows)) 39 | (provide 'init) 40 | ;;; init.el ends here 41 | -------------------------------------------------------------------------------- /readme.org: -------------------------------------------------------------------------------- 1 | * magit "standalone version" 2 | [[http://magit.vc/][Magit]] is a fantastic git frontend for emacs. Altough it is an 3 | important part of my emacs workflow, I sometimes work in gitrepository 4 | on the naked commandline. Up until now I resolved to tig to get a fast 5 | and feature-rich text ui for simple commits, ammends, diffs when pure 6 | git was not right for me. 7 | 8 | This is a minimal emacs configuration that mimics tig but with the 9 | magit implementation. 10 | 11 | Obligatory screenshot 12 | [[./screenshot.png]] 13 | 14 | ** Installation 15 | The installation is tested with emacs 25.1.1. 16 | 17 | Clone the repository to =~/.magit=. One or all of the following: 18 | - make an alias that calls =emacs -q --load ~/.magit/init.el=. 19 | - put .magit in your path and call =magit=. 20 | - link =~/.magit/magit= to magit in a directory in your path. 21 | 22 | ** Usage 23 | This is to 99.99999% the default emacs configuration. So the almost all 24 | emacs users will be fine. For all the other users the most importation 25 | shortcut would be =C-x-c= which means hold Ctrl-Key and press first x 26 | and then c. 27 | 28 | Please refer to the excellent [[http://magit.vc/manual/magit/#Top][user manual]] on how to work with magit. 29 | 30 | ** Uninstallation 31 | If you don't like it, simple delete =~/.magit= and you are done. 32 | 33 | ** Implementation / Tuning 34 | - To switch to the local "magit" configuration the trick in 35 | [[http://emacs.stackexchange.com/a/4258/11102][stackoverflow]] is used. 36 | - [[https://github.com/raxod502/straight.el][straight]] is used to make sure magit with all dependencies is 37 | available. 38 | - I added my favorite [[https://github.com/bbatsov/zenburn-emacs][color-theme]] to the mix. 39 | - All customizations are done directly in init.el to keep the startup 40 | time as small as possible. Feel free to adjust the settings to your 41 | liking. 42 | --------------------------------------------------------------------------------