Skip to content

Instantly share code, notes, and snippets.

@yanolab
Created November 11, 2011 02:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yanolab/1357049 to your computer and use it in GitHub Desktop.
Save yanolab/1357049 to your computer and use it in GitHub Desktop.
my emacs settings
;;;
;;; キーバインド
;;;
;;; undo
(define-key global-map (kbd "C-z") 'undo)
;;; コメント切り替え
(define-key global-map (kbd "C-c ;") 'comment-or-uncomment-region)
;;;
;;; マウス関係
;;;
;;; ホイールマウス
(mouse-wheel-mode t)
(setq mouse-wheel-follow-mouse t)
;;;
;;; カーソル関係
;;;
;;; カーソルの位置が何文字目かを表示する
(column-number-mode t)
;;; カーソルの位置が何行目かを表示する
(line-number-mode t)
;;; 対応する括弧を光らせる。
(show-paren-mode 1)
;;; ウィンドウ内に収まらないときだけ括弧内も光らせる。
(setq show-paren-style 'mixed)
;;; 行末の空白を表示
(setq-default show-trailing-whitespace t)
;;;
;;; メニュー関係
;;;
;;; emacs -nw で起動した時にメニューバーを消す
(if window-system (menu-bar-mode 1) (menu-bar-mode -1))
;;; ツールバーを消す
(tool-bar-mode -1)
;;;
;;; ウインドウ関係
;;;
;;; タイトルバーにファイル名を表示する
(setq frame-title-format (format "emacs@%s : %%f" (system-name)))
;;; ウインドウのサイズ分割時にウインドウサイズを調整できるようにする
(global-set-key [(ctrl up)] '(lambda (arg) (interactive "p") (shrink-window arg)))
(global-set-key [(ctrl down)] '(lambda (arg) (interactive "p") (shrink-window (- arg))))
;;; スクロールを一行ずつにする
(setq scroll-step 1)
;;; モードラインに時間を表示する
(display-time)
;;; 現在の関数名をモードラインに表示
(which-function-mode 1)
;;;
;;; ファイル関係
;;;
;;; 行の先頭でC-kを一回押すだけで行全体を消去する
(setq kill-whole-line t)
;;; 最終行に必ず一行挿入する
(setq require-final-newline t)
;;; バッファの最後でnewlineで新規行を追加するのを禁止する
(setq next-line-add-newlines nil)
;;;
;;; バックアップ関係
;;;
;;; バックアップファイルを作らない
(setq backup-inhibited t)
;;; 終了時にオートセーブファイルを消す
(setq delete-auto-save-files t)
;;;
;;; 補完関係
;;;
;;; 補完時に大文字小文字を区別しない
(setq completion-ignore-case t)
(setq read-file-name-completion-ignore-case t)
;;; 部分一致の補完機能を使う
;;; p-bでprint-bufferとか
(partial-completion-mode t)
;;; 補完可能なものを随時表示
;;; 少しうるさい
(icomplete-mode 1)
;;; スタートアップスクリーンを表示しない
(setq inhibit-startup-screen -1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment