Skip to content

Instantly share code, notes, and snippets.

@nefo-mi
Created July 26, 2011 00:43
Show Gist options
  • Save nefo-mi/1105648 to your computer and use it in GitHub Desktop.
Save nefo-mi/1105648 to your computer and use it in GitHub Desktop.
meadowの設定
;;; Window制御
(when window-system
(tool-bar-mode 0)
(menu-bar-mode 0)
(toggle-scroll-bar nil)
(server-start)
)
;;; グローバルキー
(global-set-key "\C-h" 'delete-backward-char)
(global-set-key "\M-\C-h" 'backward-kill-word)
(global-set-key "\C-j" 'dabbrev-expand)
(global-set-key "\C-cr" 'org-remember)
;;;Meadow起動初期画面カット
(setq inhibit-startup-message t)
;;;インデント
(global-set-key "\C-m" 'newline-and-indent)
;; 直前/直後の括弧に対応する括弧を光らせる
;(show-paren-mode)
;;;行番号を表示させる。M-x setnu-mode
(autoload 'setnu-mode "setnu" nil t)
;;;バックアップファイルを作成しない
(setq make-backup-files nil)
(setq backup-inhibited t)
;;; 終了時にオートセーブファイルを消す
(setq delete-auto-save-files t)
;;; 見にバッファの履歴を保存
(savehist-mode t)
;;; 時間を表示
(display-time)
;;; バッファの表示
(iswitchb-mode t)
;;(iswitchb-default-keybindings)
;;(global-set-key "\C-x\C-b" 'bs-show)
(setq read-buffer-function 'iswitchb-read-buffer)
(setq iswitchb-regexp t)
(setq iswitchb-rompt-newbuffer nil)
(ido-mode t)
(ido-everywhere t)
;;; リージョンに色をつける
(transient-mark-mode t)
;;; 必ず最終行を入れる
(setq reauire-final-newline t)
;;; 行表示
(line-number-mode t)
(column-number-mode t)
;;; yes or no を y or nに
(defalias 'yes-or-no-p 'y-or-n-p)
;;; ミニバッファを再帰的に
;;;(setq enable-recursive-minibufferst t)
;;; ダイアログは使わない
(setq use-dialog-box nil)
;;; C-kで行前全体を削除
(setq kill-whole-line t)
;;; 矩形選択を簡単に
(cua-mode t)
(setq cua-enable-cua-keys nil)
;;;; 保存時にタブを空白に変える
(add-hook 'before-save-hook '(lambda () (untabify 1 (point-max))))
;; タブは空白
(setq indent-tabs-mode nil)
;; 対応する括弧を表示
(show-paren-mode t)
;;;for-org
(global-set-key "\C-c\C-h" 'hide-body)
;;; orgファイルはorg-modeで開く
(add-to-list 'auto-mode-alist '("\\.org$" . org-mode))
(add-to-list 'auto-mode-alist '("\\.txt$" . org-mode))
(define-key global-map "\C-cl" 'org-store-link)
(define-key global-map "\C-ca" 'org-agenda)
(add-hook 'org-mode-hook 'turn-on-font-lock)
(setq org-log-done t)
(setq org-timeline-show-emptydates t)
(setq org-agenda-include-diary nil)
(setq org-return-follows-link t)
(setq org-todo-keywords
'((sequence "TODO(t)" "STARTED(s)" "WAITING(w)" "DONE(d)"))
)
(setq org-use-fast-todo-selection t)
(setq org-tag-alist '(
(:startgroup . nil)
("Idea" . ?i) ("Bug" . ?b)
(:endgroup . nil)
)
)
;;; org-remember
(org-remember-insinuate)
(setq org-directory "~/")
(setq org-default-notes-file (concat org-directory "gtd.txt"))
(setq org-remember-templates
'(
("Inbox" ?I "** %? \n %i%t" nil "Inbox")
("Todo" ?t "** TODO %?\n %i%t" nil "Inbox")
("Just do it!" ?j "** TODO %? \n %i%t" nil "Just do it!")
("Bug" ?b "** TODO %? :Bug:\n %i%t" nil "Inbox")
("Idea" ?i "** %? :Idea:\n %i%t" nil "Idea")
)
)
;;;背景関係を設定
(when window-system
(progn
(set-background-color "Black")
(set-foreground-color "LightGray")
(set-cursor-color "Gray")
(set-frame-parameter nil 'alpha 90)
)
)
;;; フォントの設定
(set-face-attribute 'default nil
:family "MS ゴシック"
:height 130)
(set-fontset-font "fontset-default"
'japanese-jisx0208
'("MS ゴシック" . "jisx0208-sjis"))
;;; for eshell
(setq eshell-cmpl-ignore-case t)
(setq eshell-ask-to-save-history (quote always))
(setq eshell-cmpl-cycle-completions t)
(setq eshell-cmpl-cycle-cutoff-length 5)
(setq eshell-hist-ignoredups t)
(setq eshell-prompt-function
(lambda nil
(concat
; (eshell/pwd)
(if (= (user-uid) 0) "# " "$ ")
)
))
(setq eshell-prompt-regexp "^[^#$]*[$#] ")
;;(add-hook 'after-init-hook (lambda() (eshell)))
(add-hook 'eshell-mode-hook
'(lambda ()
(progn
(define-key eshell-mode-map "\C-a" 'eshell-bol)
(define-key eshell-mode-map "\C-p" 'eshell-previous-matching-input-from-input)
(define-key eshell-mode-map "\C-n" 'eshell-next-matching-input-from-input)
(define-key eshell-mode-map (kbd "C-i") 'auto-complete)
)
))
;;; 起動時に前回開いていたファイルを開きなおす
(setq desktop-files-not-to-save "\\(^/[^/:]*:\\|\\.diary$\\)")
(autoload 'desktop-save "desktop" nil t)
(autoload 'desktop-clear "desktop" nil t)
(autoload 'desktop-load-default "desktop" nil t)
(autoload 'desktop-remove "desktop" nil t)
(desktop-read)
(add-hook 'kill-emacs-hook 'desktop-save-in-desktop-dir)
(global-set-key "%" 'match-paren)
(defun match-paren (arg)
"Go to the matching paren if on a paren; otherwise insert %."
(interactive "p")
(cond ((looking-at "\\s\(") (forward-list 1) (backward-char 1))
((looking-at "\\s\)") (forward-char 1) (backward-list 1))
(t (self-insert-command (or arg 1)))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment