Revisions
-
alphapapa revised this gist
Aug 17, 2019 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -36,7 +36,7 @@ EOF # * Args args=$(getopt -n "$0" -o x -l no-x -- "$@") || { usage; exit 1; } eval set -- "$args" while true -
alphapapa created this gist
Aug 17, 2019 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,69 @@ #!/bin/bash # Run a standalone Magit editor! To improve startup speed, this # script ignores the user's Emacs init files and only loads the Emacs # libraries Magit requires. # Note that this does NOT install any packages. Magit and its # dependencies must already be installed in ~/.emacs.d. dependencies=(magit async dash with-editor git-commit transient) function load_paths { # Echo the "-L PATH" arguments for Emacs. Since multiple versions # of a package could be installed, and we want the latest one, we # sort them and take the top one. for package in "$@" do find ~/.emacs.d/elpa -maxdepth 1 -type d -iname "$package-2*" \ | sort -r | head -n1 | \ while read path do printf -- '-L %q ' "$path" done done } function usage { echo <<EOF It's Magit! Options: -h, --help This. -x, --no-x Display in terminal instead of in a GUI window. EOF } # * Args args=$(getopt -n "$0" -o x -l --no-x -- "$@") || { usage; exit 1; } eval set -- "$args" while true do case "$1" in -h|--help) usage exit ;; -x|--no-x) gui="-nw" ;; --) # Remaining args (required; do not remove) shift rest=("$@") break ;; esac shift done # * Main emacs -q $gui \ $(load_paths "${dependencies[@]}") \ -l magit -f magit-status \ --eval "(local-set-key \"q\" #'kill-emacs)" \ -f delete-other-windows