From 2d2c8b6a663dfef0e43b5fad9f4aa0bc2ae3a66e Mon Sep 17 00:00:00 2001 From: 10sr Date: Sun, 23 Oct 2011 03:25:25 +0900 Subject: [PATCH] set color for vertical border in terminal, and so on --- .emacs.el | 146 ++++++++++++++++++++++++++++++++---------------------- 1 file changed, 88 insertions(+), 58 deletions(-) diff --git a/.emacs.el b/.emacs.el index 2ee3bd3..3831d44 100644 --- a/.emacs.el +++ b/.emacs.el @@ -15,7 +15,8 @@ (defvar my-prefix-map (make-sparse-keymap)) -(global-set-key (kbd "C-q") my-prefix-map) +(global-set-key (kbd "C-z") my-prefix-map) +(define-key my-prefix-map (kbd "C-q") 'quoted-insert) (define-key my-prefix-map (kbd "C-z") 'suspend-frame) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -46,6 +47,7 @@ nbl)) (setq confirm-kill-emacs 'y-or-n-p) (setq gc-cons-threshold (* 1024 1024 4)) + (when window-system (add-to-list 'default-frame-alist '(cursor-type . box)) (add-to-list 'default-frame-alist '(background-color . "white")) @@ -60,17 +62,6 @@ (when (file-readable-p "~/.emacs") (load-file "~/.emacs")))) -(when (eq system-type 'Darwin) - (mac-set-input-method-parameter ’japanese ’cursor-color ”red”) - (mac-set-input-method-parameter ’roman ’cursor-color ”black”)) - -(when (and (boundp 'input-method-activate-hook) ;ちょっと正しいかわかんない - (boundp 'input-method-inactivate-hook)) - (add-hook 'input-method-activate-hook - (lambda () (set-cursor-color "red"))) - (add-hook 'input-method-inactivate-hook - (lambda () (set-cursor-color "black")))) - (cd ".") ; when using windows use / instead of \ in default-directory ;; locale @@ -86,11 +77,6 @@ ;; (comint-show-maximum-output) -;; change color for border -(set-face-foreground (make-face 'vertical-border-face) "red") -(set-display-table-slot standard-display-table 'vertical-border - (make-glyph-code #x3a 'vertical-border-face)) - ;; kill scratch (add-hook 'after-init-hook (lambda () @@ -163,11 +149,40 @@ (cua-mode 0) ;; key bindings +;; moving around +;; (global-set-key (kbd "M-j") 'next-line) +;; (global-set-key (kbd "M-k") 'previous-line) +;; (global-set-key (kbd "M-h") 'backward-char) +;; (global-set-key (kbd "M-l") 'forward-char) +;;(keyboard-translate ?\M-j ?\C-j) +(global-set-key (kbd "M-p") 'backward-paragraph) +(global-set-key (kbd "M-n") 'forward-paragraph) +(global-set-key (kbd "C-") (lambda () (interactive)(scroll-down 1))) +(global-set-key (kbd "C-") (lambda () (interactive)(scroll-up 1))) +(global-set-key (kbd "C-") 'scroll-down) +(global-set-key (kbd "C-") 'scroll-up) +(global-set-key (kbd "C-x M-x") 'execute-extended-command) +(global-set-key (kbd "C-x M-:") 'eval-expression) +(global-set-key (kbd "") 'previous-line-mark) - -;; C-h and DEL -;; (global-set-key (kbd "C-h") 'backward-delete-char-untabify) -;; (global-set-key (kbd "DEL") help-map) -(global-set-key (kbd "C-h") (lambda () - (interactive) - (call-interactively (key-binding (kbd "DEL"))))) -;; (keyboard-translate ?\^h ?\^?) ; scimにはC-hを送りたい -;; (keyboard-translate ?\b ?\^h) ; dont translate backspace - ;; (define-key my-prefix-map (kbd "C-h") help-map) (global-set-key (kbd "C-\\") help-map) (global-set-key (kbd "C-x DEL") help-map) @@ -499,10 +524,6 @@ return nil if LIB unfound and downloading failed, otherwise the path of LIB." (require 'xclip nil t) (turn-on-xclip)) -;; カーソルの場所を保存する -(when (require 'saveplace nil t) - (setq-default save-place t)) - ;; その他のhook (add-hook 'after-save-hook 'executable-make-buffer-file-executable-if-script-p) @@ -580,7 +601,6 @@ return nil if LIB unfound and downloading failed, otherwise the path of LIB." (compile (format "gcc -Wall -g -o %s %s" (file-name-sans-extension buffer-file-name) buffer-file-name))) -;; (define-key c-mode-base-map "\C-h" 'c-electric-backspace) ;; (when (require 'c nil t)(c-toggle-hungry-state t) (when (dllib-if-unfound "js2-mode" @@ -660,16 +680,22 @@ return nil if LIB unfound and downloading failed, otherwise the path of LIB." (define-key term-raw-map "\C-z" (lookup-key (current-global-map) "\C-z"))) (define-key term-raw-map (kbd "ESC") 'term-send-raw) (define-key term-raw-map [delete] 'term-send-raw) - (define-key term-mode-map "\C-c" 'term-send-raw) - (define-key term-raw-map "\C-c" 'term-send-raw) (define-key term-raw-map "\C-h" 'term-send-backspace) (define-key term-raw-map "\C-y" 'term-paste) ;; (dolist (key '("" "" "" "")) ;; (define-key term-raw-map (kbd key) 'term-send-raw)) ;; (define-key term-raw-map "\C-d" 'delete-char) - (set (make-variable-buffer-local 'scroll-margin) 0))) + (set (make-variable-buffer-local 'scroll-margin) 0) + ;; (set (make-variable-buffer-local 'cua-enable-cua-keys) nil) + ;; (cua-mode 0) + ;; (and cua-mode + ;; (local-unset-key (kbd "C-c"))) + ;; (define-key cua--prefix-override-keymap "\C-c" 'term-interrupt-subjob) + )) ;; (add-hook 'term-exec-hook 'forward-char) + + ;; (when (and (executable-find "git") ;; (require 'sgit-mode nil t)) ;; (add-hook 'find-file-hook @@ -1330,6 +1356,10 @@ Optional prefix ARG says how many lines to unflag; default is one line." ;; (goto-line line)) ;; (view-file (pop args)))))) +(defun eshell/git (&rest args) + "" + nil) + (defun eshell/o (&optional file) (my-x-open (or file ".")))