Created
September 9, 2012 05:54
-
-
Save take-cheeze/3682845 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (add-to-list 'load-path "~/Dropbox/config/emacs/site-lisp") | |
| ;; sync clipboard | |
| (setq x-select-enable-clipboard t) | |
| ;; backspace and C-h problem | |
| (define-key key-translation-map [?\C-h] [?\C-?]) | |
| (global-set-key [(hyper h)] 'help-command) | |
| ;; indent setting | |
| (setq-default tab-width 2) | |
| (setq-default default-tab-width 2) | |
| (setq-default c-basic-offset 2) | |
| (setq-default c-tab-offset c-basic-offset) | |
| (setq-default c-auto-newline nil) | |
| (setq-default c-tab-always-indent t) | |
| (setq-default indent-tabs-mode nil) | |
| ;;(add-hook 'before-save-hook 'indent-buffer) | |
| ;; remove unnecessary space | |
| (add-hook 'before-save-hook 'delete-trailing-whitespace) | |
| ;; transient-mark-mode | |
| (transient-mark-mode t) | |
| ;; inhibit-startup-screen | |
| (setq inhibit-startup-screen t) | |
| ;; emacs server | |
| (server-start) | |
| ;; mouse | |
| ;;(xterm-mouse-mode t) | |
| ;;(mouse-wheel-mode t) | |
| ;; mode line | |
| (column-number-mode t) | |
| (display-time-mode t) | |
| (require 'battery) | |
| (when (and battery-status-function | |
| (not (string-match-p | |
| "N/A" | |
| (battery-format | |
| "%B" | |
| (funcall battery-status-function))))) | |
| (display-battery-mode 1)) | |
| (line-number-mode t) | |
| ;; menu bar | |
| (menu-bar-mode 0) | |
| ;; delete-selection-mode | |
| (delete-selection-mode t) | |
| ;; shift + cursor select | |
| (require `pc-select) | |
| (setq pc-select-selection-keys-only t) | |
| (pc-selection-mode t) | |
| ;; hi-line | |
| (global-hl-line-mode t) | |
| ;; eshell | |
| (require 'eshell) | |
| (setq eshell-hist-ignoredups t) | |
| (setq eshell-history-size 1000) | |
| (setq eshell-output-filter-functions | |
| (list | |
| 'eshell-handle-ansi-color | |
| 'eshell-handle-control-codes | |
| 'eshell-watch-for-password-prompt)) | |
| (setq eshell-prompt-function | |
| (lambda () | |
| (concat | |
| (user-login-name) "@" (system-name) " " | |
| "(" (vc-mode-line (eshell/pwd)) ") " | |
| (eshell/pwd) " " | |
| (if (= (user-uid) 0) | |
| "#" | |
| "$") | |
| " " | |
| ))) | |
| (setq system-uses-terminfo nil) | |
| (add-hook 'eshell-mode-hook 'ansi-color-for-comint-mode-on) | |
| ;; enable upcase region | |
| (put 'upcase-region 'disabled nil) | |
| ;; visible bell | |
| (setq visible-bell t) | |
| ;; character encoding | |
| (coding-system-put 'utf-8 'category 'utf-8) | |
| (set-default-coding-systems 'utf-8) | |
| (set-language-environment "Japanese") | |
| (set-terminal-coding-system 'utf-8) | |
| (set-keyboard-coding-system 'utf-8) | |
| (set-buffer-file-coding-system 'utf-8) | |
| (setq default-buffer-file-coding-system 'utf-8) | |
| (setq-default truncate-partial-width-windows t) | |
| (setq-default truncate-lines t) | |
| ;; window | |
| (global-set-key (kbd "C-t") (lambda () | |
| (interactive) | |
| (when (one-window-p) (split-window-horizontally)) | |
| (other-window 1))) | |
| (global-set-key (kbd "C-x <up>") 'windmove-up) | |
| (global-set-key (kbd "C-x <down>") 'windmove-down) | |
| (global-set-key (kbd "C-x <right>") 'windmove-right) | |
| (global-set-key (kbd "C-x <left>") 'windmove-left) | |
| ;; C-r replace-regexp | |
| (global-set-key (kbd "C-r") 'replace-regexp) | |
| (global-set-key (kbd "C-s") 'isearch-forward-regexp) | |
| ;; ruby | |
| (setq-default ruby-indent-level 2) | |
| (setq-default ruby-indent-tabs-mode nil) | |
| ;; el-get | |
| (setq | |
| el-get-sources | |
| '( | |
| (:name alert :type emacswiki) | |
| (:name ansi-color :type emacswiki) | |
| (:name powerline :type emacswiki) | |
| (:name fuzzy :type git :url "https://github.com/m2ym/fuzzy-el.git") | |
| (:name popup :type git :url "https://github.com/m2ym/popup-el.git") | |
| (:name auto-complete | |
| :type git :url "https://github.com/m2ym/auto-complete.git" | |
| :post-init | |
| (lambda () | |
| (require 'auto-complete) | |
| (add-to-list 'ac-dictionary-directories | |
| (expand-file-name "dict" pdir)) | |
| (require 'auto-complete-config) | |
| (ac-config-default) | |
| (global-auto-complete-mode t) | |
| (setq-default ac-auto-start t) | |
| (setq-default ac-quick-help-delay 0.1) | |
| (setq-default ac-sources | |
| '( | |
| ac-source-dictionary | |
| ac-source-filename | |
| ac-source-words-in-same-mode-buffers | |
| )) | |
| (add-hook 'auto-complete-mode-hook 'ac-common-setup) | |
| (add-hook 'emacs-lisp-mode-hook | |
| (lambda () (add-to-list 'ac-sources ac-source-symbols))) | |
| (add-to-list 'ac-modes 'js3-mode) | |
| (add-to-list 'ac-modes 'cmake-mode) | |
| (add-to-list 'ac-modes 'text-mode) | |
| (add-to-list 'ac-modes 'squirrel-mode) | |
| ) | |
| :depends (popup fuzzy)) | |
| ;; (:name auto-complete-clang | |
| ;; :depends auto-complete | |
| ;; :post-init (lambda () | |
| ;; (add-hook 'c-mode-common-hook '(lambda () | |
| ;; (add-to-list 'ac-sources 'ac-source-clang))) | |
| ;; )) | |
| (:name auto-complete-clang-async | |
| :type git :url "https://github.com/Golevka/emacs-clang-complete-async.git" | |
| :build ("make") :depends auto-complete | |
| :post-init | |
| (lambda () | |
| (require 'auto-complete-clang-async) | |
| (setq-default ac-clang-flags | |
| '("-I/usr/local/include" | |
| "-I/opt/local/include" | |
| "-I/opt/include" | |
| "-I/usr/include")) | |
| (setq-default ac-clang-prefix-header "~/Dropbox/config/boost.pch") | |
| (setq-default clang-complete-executable | |
| "~/.emacs.d/el-get/auto-complete-clang-async/clang-complete") | |
| (add-hook 'c-mode-common-hook | |
| (lambda() | |
| (add-to-list ac-sources ac-source-clang-async) | |
| (launch-completion-proc) | |
| )))) | |
| (:name basic-edit-toolkit :type emacswiki) | |
| ;; (:name elscreen | |
| ;; :type ftp-tar | |
| ;; :options ("xzf") | |
| ;; :url "ftp://ftp.morishima.net/pub/morishima.net/naoto/ElScreen/elscreen-1.4.6.tar.gz" | |
| ;; :post-init (lambda () | |
| ;; (load-library "elscreen" "ElScreen" t) | |
| ;; (require 'elscreen-tab))) | |
| (:name jaspace :type http | |
| :url "http://homepage3.nifty.com/satomii/software/jaspace.el" | |
| :post-init (lambda () | |
| (global-font-lock-mode t) | |
| (setq jaspace-alternate-jaspace-string "?") | |
| (setq jaspace-alternate-eol-string "\n") | |
| (setq jaspace-highlight-tabs "?^"))) | |
| (:name pcache :type git :url "https://github.com/sigma/pcache.git") | |
| (:name logito :type git :url "https://github.com/sigma/logito.git") | |
| (:name gh :type git :url "https://github.com/sigma/gh.el.git" | |
| :depends (pcache logito)) | |
| (:name tabulated-list :type git :url "https://github.com/sigma/tabulated-list.el.git") | |
| (:name gist | |
| :type git :url "https://github.com/defunkt/gist.el.git" | |
| :depends (gh tabulated-list) | |
| :post-init | |
| (lambda() | |
| (defadvice gist-region (around su/advice/gist/gist-region/around/dirty-hack a c pre) | |
| "Dirty hack to prevent gist-region from choking on buffers which contain `%' character" | |
| (save-window-excursion | |
| (let* ((delete-old-versions t) | |
| (dummy "foo") | |
| (beg (ad-get-arg 0)) | |
| (end (ad-get-arg 1)) | |
| (min-beg-end (min beg end)) | |
| (original-text (buffer-substring beg end)) | |
| gistid buf proc) | |
| (kill-region beg end) | |
| (insert-for-yank-1 dummy) | |
| (ad-set-arg 0 min-beg-end) | |
| (ad-set-arg 1 (point)) | |
| ad-do-it | |
| (sleep-for 0.5) ;; deep magic | |
| (dolist (buf (buffer-list)) | |
| (when (string-match "^\\s-\\*http api\\.github\\.com:443\\*$" (buffer-name | |
| buf)) | |
| (setq proc (get-buffer-process buf)) | |
| (when proc (kill-process proc)) | |
| )) | |
| (delete-region min-beg-end (point)) | |
| (insert-for-yank-1 original-text) | |
| (setq gistid (car (last (split-string (car kill-ring) | |
| "/")))) | |
| (setq buf (gist-fetch gistid)) | |
| (with-current-buffer buf | |
| (delete-region (point-min) | |
| (point-max)) | |
| (insert-for-yank-1 original-text) | |
| (gist-mode-save-buffer) | |
| (kill-buffer)) | |
| ))) | |
| )) | |
| (:name grep-edit :type emacswiki) | |
| (:name js3-mode | |
| :type git :url "https://github.com/thomblake/js3-mode.git" | |
| :post-init (lambda () | |
| (autoload 'js3-mode "js3" nil t) | |
| (setq-default js3-auto-indent-p t) | |
| (setq-default js3-enter-indents-newline t) | |
| (setq-default js3-indent-on-enter-key t) | |
| (add-to-list 'auto-mode-alist '("\\.js$" . js3-mode)) | |
| (add-to-list 'auto-mode-alist '("\\.nut\\'" . js3-mode)) | |
| (add-to-list 'auto-mode-alist '("\\.json\\'" . js3-mode)) | |
| )) | |
| (:name ky-indent | |
| :type git :url "git://gist.github.com/133159.git" | |
| :post-init (lambda () | |
| (require 'ky-indent) | |
| (ky-indent-init))) | |
| (:name linum-ex :type emacswiki | |
| :post-init (lambda () | |
| (setq linum-format "%4d|") | |
| (global-linum-mode t) | |
| (setq linum-mode-hook-list | |
| '(eshell-mode-hook | |
| w3m-mode-hook erc-mode-hook)) | |
| (mapc (lambda (h) | |
| (add-hook h '(lambda () (linum-mode nil)))) linum-mode-hook-list))) | |
| (:name ppindent :type emacswiki | |
| :post-init | |
| (lambda () | |
| (require 'ppindent) | |
| (setq ppindent-increment c-basic-offset) | |
| (message (format "%s" (current-buffer))) | |
| (add-hook | |
| 'c-mode-common-hook | |
| (lambda () | |
| (add-hook | |
| 'before-save-hook | |
| (lambda () | |
| (if (string-match-p "\\.[Hh][a-zA-Z]?[a-zA-Z]?$" buffer-file-name) (ppindent-h) | |
| (when (string-match-p "\\.[Cc][a-zA-Z]?[a-zA-Z]?$" buffer-file-name) (ppindent-c))))))))) | |
| (:name revive | |
| :type http :url "http://www.gentei.org/~yuuji/software/revive.el" | |
| :post-init (lambda () | |
| (require 'revive) | |
| (add-hook 'kill-emacs-hook 'save-current-configuration) | |
| (resume) | |
| (run-at-time t 300 'save-current-configuration) | |
| )) | |
| (:name multi-term :type emacswiki | |
| :post-init | |
| (lambda() | |
| (require 'multi-term) | |
| (add-to-list 'term-bind-key-alist '("M-<right>" . term-send-forward-word)) | |
| (add-to-list 'term-bind-key-alist '("C-<right>" . term-send-forward-word)) | |
| (add-to-list 'term-bind-key-alist '("M-<left>" . term-send-backward-word)) | |
| (add-to-list 'term-bind-key-alist '("C-<left>" . term-send-backward-word)) | |
| (add-to-list 'term-bind-key-alist '("C-v" . scroll-up)) | |
| )) | |
| (:name session | |
| :type http-tar | |
| :options ("xzf") | |
| :load-path "lisp" | |
| :url "http://downloads.sourceforge.net/project/emacs-session/session/session-2.3a.tar.gz" | |
| :post-init (lambda () | |
| (setq session-save-file-coding-system 'utf-8-unix) | |
| (setq session-initialize '(session places)) | |
| (setq session-globals-max-size 1024) | |
| (setq session-globals-max-string (* 1024 1024)) | |
| (setq session-globals-include | |
| '((kill-ring 512) | |
| (session-file-alist 512) | |
| (file-name-history 512) | |
| (tags-table-set-list 128) | |
| (tags-table-list 128))) | |
| (add-hook 'after-init-hook 'session-initialize) | |
| (run-at-time t 300 'session-save-session) | |
| )) | |
| ;; (:name tabbar | |
| ;; :type emacswiki | |
| ;; :post-init (lambda () | |
| ;; (tabbar-mode t))) | |
| (:name windows | |
| :description "Window manager for GNU Emacs." | |
| :type http | |
| :url "http://www.gentei.org/~yuuji/software/windows.el" | |
| :depends revive) | |
| (:name zencoding | |
| :type git :url "https://github.com/rooney/zencoding.git" | |
| :post-init (lambda () (add-hook 'sgml-mode-hook 'zencoding-mode))) | |
| (:name jade | |
| :type git :url "https://github.com/brianc/jade-mode.git" | |
| :post-init (lambda () | |
| (require 'sws-mode) | |
| (require 'jade-mode) | |
| (add-to-list 'auto-mode-alist '("\\.styl$" . sws-mode)) | |
| (add-to-list 'auto-mode-alist '("\\.jade$" . jade-mode)))) | |
| (:name flymake-python | |
| :type git :url "https://github.com/akaihola/flymake-python.git" | |
| :post-init | |
| (lambda() | |
| (when (load "flymake" t) | |
| (defun flymake-pylint-init () | |
| (let* ((temp-file (flymake-init-create-temp-buffer-copy | |
| 'flymake-create-temp-inplace)) | |
| (local-file (file-relative-name | |
| temp-file | |
| (file-name-directory buffer-file-name)))) | |
| (list "~/.emacs.d/pyflymake.py" (list local-file)))) | |
| ;; check path | |
| (add-to-list 'flymake-allowed-file-name-masks | |
| '("\\.py\\'" flymake-pylint-init))) | |
| )) | |
| )) | |
| (add-to-list 'load-path "~/.emacs.d/el-get/el-get") | |
| (unless (require 'el-get nil t) | |
| (url-retrieve "https://raw.github.com/dimitri/el-get/master/el-get-install.el" | |
| (lambda (s) (goto-char (point-max)) (eval-print-last-sexp)))) | |
| (el-get | |
| 'sync | |
| (append | |
| '(el-get | |
| package auto-install | |
| auto-complete-ruby auto-complete-css auto-complete-emacs-lisp | |
| auto-complete-etags auto-complete-extension | |
| byte-code-cache cmake-mode coffee-mode | |
| column-marker cssh dtrt-indent emacs-w3m emacschrome | |
| flymake-lua flymake-ruby fsharp-mode folding | |
| git-blame git-commit-mode git-emacs git-modeline go-mode | |
| google-c-style grep+ haskell-mode hlinum htmlize json linum-off | |
| lua-mode markdown-mode magit magithub mode-compile paredit | |
| php-mode-improved ruby-block ruby-compilation ruby-electric ruby-mode | |
| shadow squirrel-mode switch-window vline yaml-mode) | |
| (mapcar 'el-get-source-name el-get-sources))) | |
| (put 'downcase-region 'disabled nil) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment