Skip to content

Instantly share code, notes, and snippets.

@sdilts
Created August 4, 2021 17:33
Show Gist options
  • Save sdilts/c4c591b2e4b7086ea2941297d8a70be3 to your computer and use it in GitHub Desktop.
Save sdilts/c4c591b2e4b7086ea2941297d8a70be3 to your computer and use it in GitHub Desktop.
Script to open magit buffer in current project
#!/bin/sh
if [ -z "$1" ]
then
OPEN_DIR=$(PWD)
else
OPEN_DIR=$1
fi
cd $OPEN_DIR
emacs --eval="(progn (magit-status (if-let ((cur-project (project-current))) (cdr cur-project) default-directory)) (delete-other-windows))" &
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment