Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
162 changes: 146 additions & 16 deletions init.el
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
;; Setting the default font
(set-default-font "Liberation Mono 12")
;;(add-to-list 'default-frame-alist '(font . "Source Code Pro-14"))
;;(set-face-attribute 'default nil :height 150)
(set-face-attribute 'default nil :height 80)
;;(set-face-attribute 'default nil :font "Liberation Mono 9")

;; Disable the toolbar
Expand Down Expand Up @@ -121,9 +121,12 @@
(setq recentf-auto-cleanup 'never)

;; IDO mode.
(add-to-list 'load-path "~/.emacs.d/plugins/ido-vertical-mode.el")
(require 'ido)
(require 'ido-vertical-mode)
(ido-mode t)
(ido-vertical-mode 1)
(setq ido-vertical-define-keys 'C-n-and-C-p-only)

(put 'upcase-region 'disabled nil)
(put 'downcase-region 'disabled nil)
Expand Down Expand Up @@ -191,6 +194,7 @@
(global-set-key [(f9)] 'compile)

;; To graphically indicate the character limit in a line
(add-to-list 'load-path "plugins/fill-column-indicator.el")
(require 'fill-column-indicator)
(setq-default fci-rule-column 80)
(setq-default fci-rule-color "#555555")
Expand Down Expand Up @@ -221,18 +225,27 @@
(put 'narrow-to-region 'disabled nil)
(put 'narrow-to-page 'disabled nil)

;; Zsh
(let ((path (shell-command-to-string ". ~/.zshrc; echo -n $PATH")))
(setenv "WORKON_HOME" (shell-command-to-string "source ~/.zshrc; echo -n $WORKON_HOME"))
(setenv "PATH" path)
(setq exec-path
(append
(split-string-and-unquote path ":")
exec-path)))

;; Python virtual environment
(push "~/.emacs.d/pyenv/emacs/bin" exec-path)
(setenv "PATH"
(concat
"~/.emacs.d/pyenv/emacs" ":"
(getenv "PATH")
))
(push (concat (getenv "WORKON_HOME") "emacs/bin") exec-path)
;; (push "~/.Envs/emacs/bin" exec-path)
;; (setenv "PATH"
;; (concat
;; "~/.emacs.d/pyenv/emacs" ":"
;; (getenv "PATH")
;; ))

;; For elpy
(require 'package)
(add-to-list 'package-archives
'("elpy" . "http://jorgenschaefer.github.io/packages/"))
(add-to-list 'load-path "plugins/elpy")
(require 'elpy)
(package-initialize)
(elpy-enable)
(elpy-use-ipython)
Expand All @@ -254,11 +267,6 @@
(unless (bound-and-true-p my-pmh-ran)
(run-hooks 'prog-mode-hook)))

;; simple-httpd
(add-to-list 'load-path "plugins/emacs-web-server")
(require 'simple-httpd)
(setq httpd-root "/var/www")

;; skewer mode
;; (add-to-list 'load-path "plugins/skewer-mode")
;; (require 'skewer-mode)
Expand Down Expand Up @@ -286,7 +294,7 @@
(nyan-start-animation)

;; Git Gutter mode
(add-to-list 'load-path "plugins/emacs-git-gutter")
(add-to-list 'load-path "plugins/git-gutter")
(load "git-gutter.el")
(require 'git-gutter)

Expand Down Expand Up @@ -334,3 +342,125 @@
;; When started from Emacs.app or similar, ensure $PATH
;; is the same the user would see in Terminal.app
(set-exec-path-from-shell-PATH))

;; Company; For completions
(add-to-list 'load-path "~/.emacs.d/plugins/company")
(add-hook 'after-init-hook 'global-company-mode)

;; yasnippet
(add-to-list 'load-path "~/.emacs.d/plugins/yasnippet")
(require 'yasnippet)
(yas-global-mode 1)

(setq js-indent-level 2)

;; The packages you want installed. You can also install these
;; manually with M-x package-install
;; Add in your own as you wish:
(defvar my-packages
'(;; makes handling lisp expressions much, much easier
;; Cheatsheet: http://www.emacswiki.org/emacs/PareditCheatsheet
;; paredit

;; key bindings and code colorization for Clojure
;; https://github.com/clojure-emacs/clojure-mode
clojure-mode

;; extra syntax highlighting for clojure
clojure-mode-extra-font-locking

;; integration with a Clojure REPL
;; https://github.com/clojure-emacs/cider
cider

;; allow ido usage in as many contexts as possible. see
;; customizations/navigation.el line 23 for a description
;; of ido
ido-ubiquitous

;; Enhances M-x to allow easier execution of commands. Provides
;; a filterable list of possible commands in the minibuffer
;; http://www.emacswiki.org/emacs/Smex
smex

;; project navigation
projectile

;; colorful parenthesis matching
rainbow-delimiters

;; edit html tags like sexps
tagedit

;; git integration
magit))

;; On OS X, an Emacs instance started from the graphical user
;; interface will have a different environment than a shell in a
;; terminal window, because OS X does not run a shell during the
;; login. Obviously this will lead to unexpected results when
;; calling external utilities like make from Emacs.
;; This library works around this problem by copying important
;; environment variables from the user's shell.
;; https://github.com/purcell/exec-path-from-shell
(if (eq system-type 'darwin)
(add-to-list 'my-packages 'exec-path-from-shell))

(dolist (p my-packages)
(when (not (package-installed-p p))
(package-install p)))


;; Place downloaded elisp files in ~/.emacs.d/vendor. You'll then be able
;; to load them.
;;
;; For example, if you download yaml-mode.el to ~/.emacs.d/vendor,
;; then you can add the following code to this file:
;;
;; (require 'yaml-mode)
;; (add-to-list 'auto-mode-alist '("\\.yml$" . yaml-mode))
;;
;; Adding this code will make Emacs enter yaml mode whenever you open
;; a .yml file
(add-to-list 'load-path "~/.emacs.d/vendor")


;;;;
;; Customization
;;;;

;; Add a directory to our load path so that when you `load` things
;; below, Emacs knows where to look for the corresponding file.
(add-to-list 'load-path "~/.emacs.d/customizations")

;; Sets up exec-path-from-shell so that Emacs will use the correct
;; environment variables
(load "shell-integration.el")

;; These customizations make it easier for you to navigate files,
;; switch buffers, and choose options from the minibuffer.
(load "navigation.el")

;; These customizations change the way emacs looks and disable/enable
;; some user interface elements
(load "ui.el")

;; These customizations make editing a bit nicer.
(load "editing.el")

;; Hard-to-categorize customizations
(load "misc.el")

;; For editing lisps
(load "elisp-editing.el")

;; Langauage-specific
(load "setup-clojure.el")
(load "setup-js.el")

(require 'multi-web-mode)
(setq mweb-default-major-mode 'html-mode)
(setq mweb-tags '((js-mode "<script +\\(type=\"text/javascript\"\\|language=\"javascript\"\\)[^>]*>" "</script>")
(css-mode "<style +type=\"text/css\"[^>]*>" "</style>")))
(setq mweb-filename-extensions '("htm" "html" "ctp" "phtml"))
(multi-web-global-mode 1)
Binary file added plugins/company/.DS_Store
Binary file not shown.
4 changes: 4 additions & 0 deletions plugins/company/.dir-locals.el
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
((nil . ((indent-tabs-mode . nil)
(fill-column . 80)
(sentence-end-double-space . t)
(emacs-lisp-docstring-fill-column . 75))))
5 changes: 5 additions & 0 deletions plugins/company/.elpaignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.travis.yml
.gitignore
Makefile
test/
company-tests.el
2 changes: 2 additions & 0 deletions plugins/company/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.elc
ert.el
24 changes: 24 additions & 0 deletions plugins/company/.travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# https://github.com/rolandwalker/emacs-travis

language: generic

env:
matrix:
- EMACS=emacs24
- EMACS=emacs-snapshot

install:
- if [ "$EMACS" = "emacs24" ]; then
sudo add-apt-repository -y ppa:cassou/emacs &&
sudo apt-get update -qq &&
sudo apt-get install -qq emacs24 emacs24-el;
fi
- if [ "$EMACS" = "emacs-snapshot" ]; then
sudo add-apt-repository -y ppa:ubuntu-elisp/ppa &&
sudo apt-get update -qq &&
sudo apt-get -qq -f install &&
sudo apt-get install -qq emacs-snapshot;
fi

script:
make test-batch EMACS=${EMACS}
31 changes: 31 additions & 0 deletions plugins/company/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
EMACS=emacs

.PHONY: ert test test-batch

package: *.el
@ver=`grep -o "Version: .*" company.el | cut -c 10-`; \
tar cjvf company-$$ver.tar.bz2 --mode 644 $$(find . -name \*.el)

elpa: *.el
@version=`grep -o "Version: .*" company.el | cut -c 10-`; \
dir=company-$$version; \
mkdir -p "$$dir"; \
cp $$(find . -name \*.el) company-$$version; \
echo "(define-package \"company\" \"$$version\" \
\"Modular in-buffer completion framework\")" \
> "$$dir"/company-pkg.el; \
tar cvf company-$$version.tar --mode 644 "$$dir"

clean:
@rm -rf company-*/ company-*.tar company-*.tar.bz2 *.elc ert.el

test:
${EMACS} -Q -nw -L . -l test/all.el \
--eval "(let (pop-up-windows) (ert t))"

test-batch:
${EMACS} -Q --batch -L . -l test/all.el \
--eval "(ert-run-tests-batch-and-exit '(not (tag interactive)))"

compile:
${EMACS} -Q --batch -L . -f batch-byte-compile company.el company-*.el
Loading