-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.el
82 lines (66 loc) · 2.83 KB
/
init.el
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
;;; init.el --- Where all the magic begins
;;
;; Part of the Emacs Starter Kit
;;
;; This is the first thing to get loaded.
;;
;; set $PATH variable within emacs to match that from .bashrc
;; this will enable the emacs using the newly version of python
;; and ipython packages installed from Anaconda
;; Ensure that '~/anaconda/bin' is added in the $PATH
;; export PATH=$PATH:/home/james/anaconda/bin
(defun set-exec-path-from-shell-PATH ()
(interactive)
(let ((path-from-shell (replace-regexp-in-string "^.*\n.*shell\n" "" (shell-command-to-string "$SHELL --login -i -c 'echo $PATH'"))))
(setenv "PATH" path-from-shell)
(setq exec-path (split-string path-from-shell path-separator))))
(set-exec-path-from-shell-PATH)
;; setq dotfiles-dir (file-name-directory (or (buffer-file-name) load-file-name)))
(setq dotfiles-dir (file-name-directory (or load-file-name (buffer-file-name))))
(add-to-list 'load-path (expand-file-name
"lisp" (expand-file-name
"org" (expand-file-name
"src" dotfiles-dir))))
;; Common Lisp compatability
(require 'cl-lib)
;; Package Locations
(if (fboundp 'normal-top-level-add-subdirs-to-load-path)
(let* ((my-lisp-dir "~/.emacs.d/")
(default-directory my-lisp-dir))
(setq load-path (cons my-lisp-dir load-path))
(normal-top-level-add-subdirs-to-load-path)))
;; Font-face setup. Check the availability of a some default fonts, in
;; order of preference. The first of these alternatives to be found is
;; set as the default font, together with base size and fg/bg
;; colors. If none of the preferred fonts is found, nothing happens
;; and Emacs carries on with the default setup. We do this here to
;; prevent some of the irritating flickering and resizing that
;; otherwise goes on during startup. You can reorder or replace the
;; options here with the names of your preferred choices.
(defun font-existsp (font)
"Check to see if the named FONT is available."
(if (null (x-list-fonts font))
nil t))
;; Set default font. First one found is selected.
(cond
((eq window-system nil) nil)
((font-existsp "PragmataPro")
(set-face-attribute 'default nil :height 121 :font "PragmataPro"))
((font-existsp "Menlo")
(set-face-attribute 'default nil :height 121 :font "Menlo"))
((font-existsp "Consolas")
(set-face-attribute 'default nil :height 121 :font "Consolas"))
((font-existsp "Inconsolata")
(set-face-attribute 'default nil :height 121 :font "Inconsolata"))
)
;; Load up Org Mode and Babel
;; load up the main file
;; org-mode windmove compatibility
(setq org-replace-disputed-keys t)
(require 'org)
(org-babel-load-file (expand-file-name "starter-kit.org" dotfiles-dir))
;; activate vim mood
;(require 'evil)
;(evil-mode 1)
;;; init.el ends here
(put 'upcase-region 'disabled nil)