設置默認c文件縮進風格
;;define my c mode hook python
(defun mychook()
(c-set-style "linux"))
(add-hook 'c-mode-hook 'mychook) linux
M-x hs-minor-mode
For Emacs 21: ide
•C-c @ C-M-s show all
•C-c @ C-M-h hide all
•C-c @ C-s show block
•C-c @ C-h hide block
•C-c @ C-c toggle hide/show ui
(add-hook 'c-mode-hook 'hs-minor-mode) spa
indent and de-indent regexp
C-c > ip
C-c < emacs
================My Configuration File======================== it
(global-set-key [(meta g)] 'goto-line)
(global-set-key [(meta p)] 'backward-kill-word)
(global-set-key [(ctrl f)] 'hs-toggle-hiding) io
(global-set-key (kbd "C-c #") 'comment-region)
;;define my c mode hook
(defun mychook()
(c-set-style "linux"))
(add-hook 'c-mode-hook 'mychook)
(add-hook 'c-mode-hook 'hs-minor-mode)
;;open .bbclass or .bb files with python mode
(add-to-list 'auto-mode-alist '("\\.bbclass$" . python-mode))
(add-to-list 'auto-mode-alist '("\\.bb$" . python-mode))
=======================================================
2012-12-31
global-set-key [(meta g)] 'goto-line)
(global-set-key [(meta p)] 'backward-kill-word)
(global-set-key (kbd "C-c #") 'comment-region)
;;define my c mode hook
(defun mychook()
(c-set-style "linux"))
(add-hook 'c-mode-hook 'mychook)
(add-hook 'c-mode-hook 'hs-minor-mode)
;;open .bbclass or .bb files with python mode
(add-to-list 'auto-mode-alist '("\\.bbclass$" . python-mode))
(add-to-list 'auto-mode-alist '("\\.bb$" . python-mode))
(add-to-list 'auto-mode-alist '("\\.inc$" . python-mode))
;;make system c/p work with emacs's c/p
(setq x-select-enable-clipboard t)
(setq interprogram-paste-function 'x-cut-buffer-or-selection-value)
(require 'whitespace)
(setq whitespace-style '(face empty tabs lines-tail trailing))
(global-whitespace-mode t)
============= 2013-06-23 === 增長默認highlight===============
(global-set-key [(meta g)] 'goto-line) (global-set-key [(meta p)] 'backward-kill-word) (global-set-key (kbd "C-c #") 'comment-region) ;;define my c mode hook (defun mychook() (c-set-style "linux")) (add-hook 'c-mode-hook 'mychook) (add-hook 'c-mode-hook 'hs-minor-mode) ;;define hightlight hook (defun highlight() (highlight-regexp ".*\\[100%\\]" "hi-green") (highlight-regexp ".*\\[critical\\]" "hi-red-b") (highlight-regexp ".*\\[important\\]" "hi-red-b") (highlight-regexp ".*\\[to do\\]" "hi-blue") (highlight-regexp ".*\\[work\\]" "hi-yellow")) (add-hook 'text-mode-hook 'highlight) ;;open .bbclass or .bb files with python mode (add-to-list 'auto-mode-alist '("\\.bbclass$" . python-mode)) (add-to-list 'auto-mode-alist '("\\.bb$" . python-mode)) (add-to-list 'auto-mode-alist '("\\.inc$" . python-mode)) ;;make system c/p work with emacs's c/p (setq x-select-enable-clipboard t) (setq interprogram-paste-function 'x-cut-buffer-or-selection-value) (require 'whitespace) (setq whitespace-style '(face empty tabs lines-tail trailing)) (global-whitespace-mode t)