Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
216 lines (182 sloc) 7.54 KB
(tool-bar-mode -1)
(show-paren-mode 1)
(setq confirm-nonexistent-file-or-buffer 1)
;;(setq ns-right-option-modifier 'super)
(defun set-frame-size-according-to-resolution ()
(interactive)
(if window-system
(progn
;; use 120 char wide window for largeish displays
;; and smaller 80 column windows for smaller displays
;; pick whatever numbers make sense for you
(if (> (x-display-pixel-width) 1280)
(add-to-list 'default-frame-alist (cons 'width 150))
(add-to-list 'default-frame-alist (cons 'width 80)))
(if (> (x-display-pixel-width) 1280)
(add-to-list 'default-frame-alist (cons 'left 500))
(add-to-list 'default-frame-alist (cons 'left 100)))
(add-to-list 'default-frame-alist (cons 'top 50))
;; for the height, subtract a couple hundred pixels
;; from the screen height (for panels, menubars and
;; whatnot), then divide by the height of a char to
;; get the height we want
(add-to-list 'default-frame-alist
(cons 'height (/ (- (x-display-pixel-height) 250) (frame-char-height)))))))
(add-to-list 'load-path "~/src/emacs")
(add-to-list 'load-path "~/src/emacs/color-theme")
(add-to-list 'load-path "~/src/emacs/expand-region.el")
(add-to-list 'load-path "~/src/emacs/icicles")
(require 'icicles)
(require 'fuzzy-match)
(icy-mode 1)
(require 'handlebars-mode)
(require 'multi-term)
(require 'ace-jump-mode)
(define-key global-map (kbd "C-c SPC") 'ace-jump-mode)
(require 'expand-region)
(global-set-key (kbd "C-=") 'er/expand-region)
(if window-system
(setq multi-term-program "/bin/zsh")
(setq multi-term-program "/bin/bash")
)
(if window-system
(progn
(custom-set-variables
'(term-default-bg-color "#002b36")
'(term-default-fg-color "#839496"))
)
)
(if window-system
(progn
(require 'color-theme)
(eval-after-load "color-theme"
'(progn
(color-theme-initialize)
;; (color-theme-solarized 'light)
;; (color-theme-jsc-light2)
(color-theme-emacs-21)
)
)
)
)
(defadvice zap-to-char (after my-zap-to-char-advice (arg char) activate)
"Kill up to the ARG'th occurence of CHAR, and leave CHAR.
The CHAR is replaced and the point is put before CHAR."
(insert char)
(forward-char -1))
(set-frame-size-according-to-resolution)
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(ecb-options-version "2.40")
'(edts-man-root "~/.emacs.d/edts/doc/R16B")
'(initial-buffer-choice t)
'(safe-local-variable-values (quote ((allout-layout . t) (erlang-indent-level . 4))))
'(term-default-bg-color "#002b36")
'(term-default-fg-color "#839496"))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(default ((t (:inherit nil :stipple nil :background "white" :foreground "black" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 130 :width normal :foundry "apple" :family "Source_Code_Pro")))))
;; Erlang
(setq load-path (cons "~/src/emacs/erlang"
load-path))
(setq erlang-root-dir "/usr/local/lib/erlang")
(setq exec-path (cons "/usr/local/lib/erlang/bin" exec-path))
(require 'erlang-start)
(setq auto-mode-alist (append auto-mode-alist
'(("\\.rel$" . erlang-mode)
("\\.app$" . erlang-mode)
("\\.appSrc$" . erlang-mode)
("\\.app.src$" . erlang-mode)
("\\.hrl$" . erlang-mode)
("\\.erl$" . erlang-mode)
("\\.yrl$" . erlang-mode))))
;; Wrangler
;;(add-to-list 'load-path "/usr/local/share/wrangler/elisp")
;;(require 'wrangler)
;; Install mode-compile to give friendlier compiling support!
;;(add-to-list 'load-path "~/elisp")
;;(autoload 'mode-compile "mode-compile" "Command to compile current buffer file based on the major mode" t)
;;(global-set-key (kbd "C-c c") 'mode-compile)
;;(autoload 'mode-compile-kill "mode-compile" "Command to kill a compilation launched by `mode-compile'" t)
;;(global-set-key (kbd "C-c k") 'mode-compile-kill)
;; This is needed for Distel setup
;;(add-to-list 'load-path "/Users/steve/src/distel/elisp")
;;(require 'distel)
;;(distel-setup)
;; prevent annoying hang-on-compile
;;(defvar inferior-erlang-prompt-timeout t)
;; default node name to emacs@localhost
;;(setq inferior-erlang-machine-options '("-sname" "emacs"))
;; tell distel to default to that node
;;(setq erl-nodename-cache
;; (make-symbol
;; (concat
;; "emacs@"
;; ;; Mac OS X uses "name.local" instead of "name", this should work
;; ;; pretty much anywhere without having to muck with NetInfo
;; ;; ... but I only tested it on Mac OS X.
;; (car (split-string (shell-command-to-string "hostname"))))))
;; Some Erlang customizations
;;(add-hook 'erlang-mode-hook
;; (lambda ()
;; ;; when starting an Erlang shell in Emacs, default in the node name
;; (setq inferior-erlang-machine-options '("-sname" "emacs"))
;; ;; add Erlang functions to an imenu menu
;; (imenu-add-to-menubar "imenu")))
;; A number of the erlang-extended-mode key bindings are useful in the shell too
(defconst distel-shell-keys
'(
("\C-\M-i" erl-complete)
("\M-?" erl-complete)
("\M-." erl-find-source-under-point)
("\M-," erl-find-source-unwind)
("\M-*" erl-find-source-unwind)
)
"Additional keys to bind when in Erlang shell.")
;;(add-hook 'erlang-shell-mode-hook
;; (lambda ()
;; ;; add some Distel bindings to the Erlang shell
;; (dolist (spec distel-shell-keys)
;; (define-key erlang-shell-mode-map (car spec) (cadr spec)))))
;; Electric Ruby
(add-hook 'ruby-mode-hook
(lambda()
(add-hook 'local-write-file-hooks
'(lambda()
(save-excursion
(untabify (point-min) (point-max))
(delete-trailing-whitespace)
)))
(set (make-local-variable 'indent-tabs-mode) 'nil)
(set (make-local-variable 'tab-width) 2)
(imenu-add-to-menubar "IMENU")
(define-key ruby-mode-map "C-m" 'newline-and-indent) ;Not sure if this line is 100% right but it works!
(require 'ruby-electric)
(ruby-electric-mode t)
))
;; Key modifiers for Mac OS X Emacs.app in spanish MBP keyboard
(global-set-key (kbd "M-1") "|")
(global-set-key (kbd "M-2") "@")
(global-set-key (kbd "M-3") "#")
(global-set-key (kbd "M-º") "\\")
(global-set-key (kbd "M-ç") "}")
(global-set-key (kbd "M-+") "]")
(global-set-key (kbd "M-ñ") "~")
;; Anything
;; (add-to-list 'load-path "~/src/anything-config")
;;(require 'anything-config)
;;(require 'revbufs)
(setq make-backup-files nil)
;; Flash
(add-to-list 'auto-mode-alist '("\\.as\\'" . js-mode))
(when (require 'browse-kill-ring nil 'noerror)
(browse-kill-ring-default-keybindings))
(add-to-list 'load-path "~/src/edts")
(require 'edts-start)
(setq-default indent-tabs-mode nil)