screen+emacs 配置文件

screen:

#
# ~/.screenrc
#

setenv LC_CTYPE en_US.UTF-8
defutf8 on

termcapinfo xterm 'hs:ts=\E]2;:fs=\007:ds=\E]2;screen\007'

# 启动时不显示欢迎屏幕
startup_message off

# 屏幕缓冲区 1024 行。
defscrollback 10240

# 在最下一行显示窗口列表和时钟
hardstatus on
hardstatus alwayslastline
#caption always "%{= kw}%-w%{= kG}%{+b}[%n %t]%{-b}%{= kw}%+w %=%d %M %0c %{g}%H%{-}"
hardstatus string "%{.bW}%-w%{= kG}%n %t%{-}%+w %=%{..G} %H %{..Y} %Y/%m/%d %c:%s "

# 关闭错误提示
# vbell off


emacs:

(add-to-list 'load-path "~/.emacs.d")

(setq-default indent-tabs-mode nil) ;;不要使用TAB
(setq whitespace-space nil)
(setq whitespace-chars nil)
(setq whitespace-newline 'color)

(show-paren-mode t)
(column-number-mode t)

;; Setup save options (auto and backup) -- still buggy need new Replace func
(setq auto-save-timeout 2000)
(setq make-backup-files t)
(setq
    backup-by-copying t ; 自动备份
    backup-directory-alist
    '(("." . "~/.emacs.d/autosaves")) ; 自动备份在目录"~/.saves"下
    delete-old-versions t ; 自动删除旧的备份文件
    kept-new-versions 6 ; 保留最近的6个备份文件
    kept-old-versions 2 ; 保留最早的2个备份文件
    version-control t) ; 多次备份

(define-key input-decode-map "\e[OD" [C-left])
;; Global Key Bindings
(global-set-key (kbd "C-x C-g") 'goto-line)
(global-set-key "\M-o" 'ff-find-other-file)
(define-key global-map "\C-B" 'global-whitespace-mode)
(define-key global-map "\C-l" 'global-linum-mode)
(define-key global-map [delete] 'delete-char)
(define-key global-map [backspace] 'delete-backward-char)
(define-key global-map [select] 'end-of-line)
(define-key global-map [f1] 'delete-window)
(define-key global-map [f2] 'split-window-vertically)
(define-key global-map [f3] 'split-window-horizontally)
(define-key global-map [f4] 'other-window)

;; Setup C mode
(autoload 'c++-mode  "cc-mode" "C++ Editing Mode" t)
(autoload 'c-mode    "cc-mode" "C Editing Mode" t)
(autoload 'c-mode-common-hook "cc-mode" "C Mode Hooks" t)
(autoload 'c-add-style "cc-mode" "Add coding style" t)

;; Associate extensions with modes
(add-to-list 'auto-mode-alist '("\\.h$" . c++-mode))

(set-face-foreground 'font-lock-string-face "yellow")
(set-face-foreground 'font-lock-comment-face "red")

;; No space before { and function sig indents 4 if argument overflow
(setq bws-c-style
      '((c-auto-newline                 . nil)
        (c-basic-offset                 . 4)
        (c-comment-only-line-offset     . 0)
        (c-echo-syntactic-information-p . nil)
        (c-hungry-delete-key            . t)
        (c-tab-always-indent            . t)
        (c-toggle-hungry-state          . t)
        (c-hanging-braces-alist         . ((substatement-open after)
                                          (brace-list-open)))
        (c-offsets-alist                . ((arglist-close . c-lineup-arglist)
                                           (innamespace . 0)
                                           (case-label . 4)
                                           (substatement-open . 0)
                                           (block-open . 0) ; no space before {
                                           (knr-argdecl-intro . -)))
        (c-hanging-colons-alist         . ((member-init-intro before)
                                           (inher-intro)
                                           (case-label after)
                                           (label after)
                                           (access-label after)))
        (c-cleanup-list                 . (scope-operator
                                           empty-defun-braces
                                           defun-close-semi))))

;; Construct a hook to be called when entering C mode
(defun lconfig-c-mode ()
  (progn (define-key c-mode-base-map "\C-m" 'newline-and-indent)
         (c-add-style "Brad's Coding Style" bws-c-style t)))
(add-hook 'c-mode-common-hook 'lconfig-c-mode)

;; 去掉行尾空格
(add-hook 'before-save-hook           'whitespace-cleanup)


你可能感兴趣的:(C++,function,delete,emacs,autoload,hook)