Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
;; Configure appearance
(tooltip-mode -1) ; Remove tooltips
(menu-bar-mode -1) ; Remove menu bar
(tool-bar-mode -1) ; Remove toolbar
(scroll-bar-mode -1) ; Remove scroll bar
(setq inhibit-startup-message t) ; Remove startup message
(setq initial-scratch-message nil) ; Remove **scratch** message
(setq blink-cursor-mode nil) ; Stop that damned blinking cursor
(display-battery-mode t) ; Show battery status
;; Answer just y/n insted of yes or no
(fset 'yes-or-no-p 'y-or-n-p)
(show-paren-mode 1) ; Show matching brace
;; Disable annoying backup files (not yet perfectly working)
(setq make-backup-files nil)
(setq auto-save-default nil)
;; Always indent with 4 spaces instead of tabs
(setq indent-tabs-mode nil)
(setq tab-width 4)
;; Default directory
(setq default-directory "~/Development/")
;; Load path
(setq load-path
(append (list "~/.elisp/"
"~/.emacs/")
load-path))
;; Load c mode
(autoload 'awk-mode "modes/cc-modes" nil t)
;; Set mode autoload
(autoload 'php-mode "modes/php-mode" "Major mode for editing php code." t)
(autoload 'ruby-mode "modes/ruby-mode" "Major mode for editing ruby code." t)
;; Load require mode jit
(push '("\\.php\\|.inc.php\\|.php.dist" . php-mode) auto-mode-alist)
(push '("\\.Rakefile\\|.rb" . ruby-mode) auto-mode-alist)
;; Show line numbers in all buffers
(load "plugins/linum.el")
(global-linum-mode t)
;; Load color themes
(load "color-theme")
(eval-after-load "color-theme"
'(progn
(color-theme-initialize)
;; Select theme for window system
(if window-system
;; Theme for window system (X11)
(progn
(load "themes/tm")
(color-theme-tm))
;; Theme for tty
(progn
(load "themes/zenburn")
(color-theme-zenburn)))))
;; Act before saving file
(add-hook 'before-save-hook (lambda()
(delete-trailing-whitespace) ; Remove trailing spaces
))
;; Php mode customizations
(defconst tom-pear-php-style
'((setq php-mode-force-pear t) ; Force PEAR compliant coding standards
(c-toggle-auto-hungry-state 1) ; Auto newlines and hungry space delete
;; Automatic indentation rules
;; Automatically add newlines after these syntactic elements
(c-hanging-colons-alist . ((defun-block-intro after)
(member-init-intro before)
(inher-intro)
(case-label after)
(label after)
(access-label after)))
;; Automatically remove newlines ater these statements
(c-cleanup-list . (brace-else-brace
brace-catch-brace
brace-elseif-brace
empty-defun-brace))
;; Fine-tune the indentation to comply with PEAR coding standards
(c-offsets-alist . ((statement-block-intro . +)
comment-intro . 0)
(case-label . +) ;; Indent case-label
(arglist-close . 0))) ;; Ident array closing paren to its name
))
(c-add-style "tom-pear" tom-pear-php-style)
(add-hook 'php-mode-hook (lambda()
(c-set-style "tom-pear")
(outline-minor-mode t)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.