-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup_emacs.sh
executable file
·54 lines (48 loc) · 1.28 KB
/
setup_emacs.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/bin/bash
#
# Alex's Emacs setup script.
#
# Install the .emacs init script in my current home directory
# using symbolic links. Also create a ~/.emacs.d directory
# and copy in the .el files that are managed in this repo
#
# This script assumes its in the repo and all dotfiles need to go to $HOME
#
EMACS_CONFIG_HOME="$HOME/.emacs.d"
#
# Create the ./emacs.d
#
if [ ! -d "${EMACS_CONFIG_HOME}" ] ; then
echo "Creating .emacs.d"
mkdir ${EMACS_CONFIG_HOME}
fi
if [ ! -f ${EMACS_CONFIG_HOME}/init.el ] ; then
echo "Linking $file to .emacs.d"
linkfile=`pwd`/init.el
target=${EMACS_CONFIG_HOME}/init.el
echo "Linking $linkfile to $target"
ln -s $linkfile $target
fi
if [ ! -f ${EMACS_CONFIG_HOME}/mininit.el ] ; then
echo "Linking $file to .emacs.d"
linkfile=`pwd`/mininit.el
target=${EMACS_CONFIG_HOME}/mininit.el
echo "Linking $linkfile to $target"
ln -s $linkfile $target
fi
#
# Link in this directory
#
if [ ! -L ${EMACS_CONFIG_HOME}/my-elisp ]; then
echo "Linking in directory"
linkdir=`pwd`
ln -s $linkdir "${EMACS_CONFIG_HOME}/my-elisp"
fi
#
# Link to the snippets hierarchy
#
if [ ! -L ${EMACS_CONFIG_HOME}/my-snippets ]; then
echo "Linking in snippets"
linkdir=`pwd`/snippets
ln -s $linkdir "${EMACS_CONFIG_HOME}/my-snippets"
fi