Skip to content

Instantly share code, notes, and snippets.

@NaokiKuzumi
Created November 9, 2010 15:48
Show Gist options
  • Save NaokiKuzumi/669258 to your computer and use it in GitHub Desktop.
Save NaokiKuzumi/669258 to your computer and use it in GitHub Desktop.
;;;;
;;;; emacs config
;;;;
;;;
;;; general config
;;;
;; set load-path
(setq load-path
(append
(list
(expand-file-name "~/.emacs.d/elisp/")
"/usr/local/share/nu/nu-mode/")
load-path))
;; ^H for backspace.
(keyboard-translate ?\C-h ?\C-?)
(define-key global-map "\C-x?" 'help)
;; set default charset
(set-default-coding-systems 'utf-8)
;; truncuate line when in 2 or more windows.
(setq truncate-partial-width-windows nil)
;; change tab behavior
(setq indent-line-function 'tab-to-tab-stop)
;;;
;;; scratch-log
;;;
(require 'scratch-log.el)
;; log file. default is "~/.emacs.d/.scratch-log"
;;(setq sl-scratch-log-file "~/.emacs.d/.scratch-log")
;; privious log file. default is "~/.emacs.d/.scratch-log-prev"
;;(setq sl-prev-scratch-string-file "~/.emacs.d/.scratch-log-prev")
;; nil なら emacs 起動時に,最後に終了したときの スクラッチバッファの内容を復元しない。初期値は t です。
(setq sl-restore-scratch-p nil)
;; nil なら スクラッチバッファを削除できるままにする。初期値は t です。
(setq sl-prohibit-kill-scratch-buffer-p nil)
;;;
;;; mode specific settings
;;;
;; tab for text mode
(define-key text-mode-map [tab] 'tab-to-tab-stop)
;;;
;;; some programming modes
;;;
;; ecmamode
(autoload 'ecmascript-mode "ecmascript-mode" nil t)
(setq auto-mode-alist (cons '("\\.js$" . ecmascript-mode) auto-mode-alist))
;; php mode
(autoload 'php-mode "php-mode" nil t)
(setq auto-mode-alist (cons '("\\.ctp" . php-mode) auto-mode-alist))
;; c mode
(add-hook 'c-mode-common-hook
'(lambda ()
(progn
(c-toggle-hungry-state 1)
(setq c-basic-offset 4 indent-tabs-mode nil))))
;; slime
(setq inferior-lisp-program "/opt/local/bin/sbcl")
(setq load-path
(append
(list
(expand-file-name "~/.emacs.d/elisp/slime-2009-11-16"))
load-path))
(require 'slime)
(slime-setup)
;; Nu
;(require 'nu)
;; set tramp for zsh sudo
(require 'tramp)
(setq tramp-shell-prompt-pattern "^.*[#$%>] ")
;; Show line number mode
;; not using now 2009/12/13
;(require 'linum)
;; set anything.el
(require 'anything-config)
(define-key anything-map "\C-p" 'anything-previous-line)
(define-key anything-map "\C-n" 'anything-next-line)
(define-key anything-map "\C-v" 'anything-next-page)
(define-key anything-map "\M-v" 'anything-previous-page)
(define-key ctl-x-map (kbd ";") 'anything)
;; setup cakephp mode
;(require 'cake)
;(global-cake t)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment