.emacs
(add-to-list 'load-path "~/.emacs.d")
(autoload 'js2-mode "js2" nil t)
(add-to-list 'auto-mode-alist '("\\.js$" . js2-mode))
(setq js2-highlight-level 3)
(require 'ido)
(ido-mode t)
(require 'cua-base)
(cua-mode t)
(setq erlang-root-dir "/usr/local/lib/erlang")
(setq load-path (cons "/usr/local/lib/erlang/lib/tools-2.6.2/emacs" load-path))
(setq exec-path (cons "/usr/local/lib/erlang/bin" exec-path))
(require 'erlang-start)
;;(setenv "ACE_ROOT" ".../lib/ACE")
;;(setenv "LD_LIBRARY_PATH"
;; (concat (getenv "ACE_ROOT")
;; "/lib"
;; ":"
;; (getenv "LD_LIBRARY_PATH")))
(require 'slime)
(add-hook 'lisp-mode-hook (lambda () (slime-mode t)))
(add-hook 'inferior-lisp-mode-hook (lambda () (inferior-slime-mode t)))
(setq inferior-lisp-program "/usr/bin/sbcl –noinform –no-linedit")
(set-default-font "-Misc-Fixed-Medium-R-Normal--15-140-75-75-C-90-ISO8859-1")
(fset 'yes-or-no-p (symbol-function 'y-or-n-p))
(tool-bar-mode nil)
(show-paren-mode t)
(column-number-mode 1)
(line-number-mode 1)
(setq-default
frame-title-format
(list
'((buffer-file-name
" %f"
(dired-directory
dired-directory
(revert-buffer-function
" %b"
("%b - Dir: " default-directory)))))))
(c-set-offset 'substatement-open 0)
(setq
indent-tabs-mode nil
c-basic-offset 4
default-tab-width 4
default-frame-alist '((cursor-type . bar))
inhibit-startup-message t
next-line-add-newlines nil
require-final-newline t
delete-old-versions t
delete-auto-save-files t
make-backup-files nil
scroll-step 1
scroll-preserve-screen-position t
default-tab-width 4
search-highlight t
apropos-do-all nil)
(global-set-key [home] 'beginning-of-buffer)
(global-set-key [end] 'end-of-buffer)
(global-set-key [(control z)] 'undo)
(global-set-key "\C-xg" 'goto-line)
(global-set-key "\M-g" 'goto-line)
(global-set-key "\M-c" 'cua-copy-region)
(global-set-key "\M-v" 'cua-paste)
(global-set-key [(s x)] 'cua-cut-region)
(global-set-key [f2] 'save-buffer)
(global-set-key (quote [S-iso-lefttab]) (quote dabbrev-expand))
(global-set-key (quote [S-tab]) (quote dabbrev-expand))
;; gnu, k&r, bsd, stroustrup, linux, python, java, whitesmith, ellemtel, cc-mode, and user
(setq c-default-style "ellemtel")
(global-set-key (quote [S-iso-lefttab]) (quote dabbrev-expand))
(global-set-key (quote [S-tab]) (quote dabbrev-expand))
(defun my-c-mode()
"C/C++ mode"
(interactive)
(global-set-key [f7] 'compile)
(global-set-key [f5] 'gdb)
(local-set-key [f9] 'hs-hide-block)
(local-set-key [f10] 'hs-show-block)
(local-set-key [f11] 'hs-hide-all)
(local-set-key [f12] 'hs-show-all)
(local-set-key [f3] 'comment-region)
(local-set-key [f4] 'uncomment-region)
(local-set-key [return] 'reindent-then-newline-and-indent))
(add-hook 'c-mode-hook 'my-c-mode)
(add-hook 'c++-mode-hook 'my-c-mode)
;; .h .i c++ mode
(setq auto-mode-alist
(append '(("\\.h$" . c++-mode))
'(("\\.i$" . c++-mode))
auto-mode-alist))
(defun indent-buffer ()
(interactive)
(delete-trailing-whitespace)
(indent-region (point-min) (point-max) nil)
(untabify (point-min) (point-max)))
(defun fs ()
(interactive)
(if (featurep 'aquamacs)
(aquamacs-toggle-full-frame)
(set-frame-parameter nil 'fullscreen
(if (frame-parameter nil 'fullscreen) nil 'fullboth))))
(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.32"))
(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.
)