zoukankan      html  css  js  c++  java
  • 我的.emacs配置文件

    刚刚使用emacs,主要是用来编写c程序,因此,这个配置文件也简单的很,针对自己的喜欢,进行了简单是设置。

    我也不知道有那些常用的配置可以加入进去,希望大家告诉我还可以加入那些常用的配置信息,感激不尽。

    (setq load-path (cons "~/el" load-path))
    (custom-set-variables
      ;; custom-set-variables was added by Custom.
      ;; If you edit it by hand, you could mess it up, so be careful.
      ;; Your init file should contain only one such instance.
      ;; If there is more than one, they won't work right.
    '(show-paren-mode t))
    (custom-set-faces
      ;; custom-set-faces was added by Custom.
      ;; If you edit it by hand, you could mess it up, so be careful.
      ;; Your init file should contain only one such instance.
      ;; If there is more than one, they won't work right.
    )
    (setq inhibit-startup-message t);;不显示启动界面
    (set-background-color "black") ;; 使用黑色背景
    (set-foreground-color "white") ;; 使用白色前景
    (set-face-foreground 'region "green")  ;; 区域前景颜色设为绿色
    (set-face-background 'region "blue") ;; 区域背景色设为蓝色
    (setq c-basic-offset 4)
    (tool-bar-mode -1) ;;不要工具条
    ;;(menu-bar-mode -1);;不要菜单栏
    (global-linum-mode t);;显示行号
    ;;========================================
    ;;C/C++语法设置
    ;;========================================
    ;;CC-mode配置参见:http://cc-mode.sourceforge.net/
    (require 'cc-mode)
    (c-set-offset 'inline-open 0)
    (c-set-offset 'friend '-)
    (c-set-offset 'substatement-open 0)
    
    (defun my-c-mode-common-hook()
    (setq tab-width 4 indent-tabs-mode nil)
    ;;在输入“;” ”{” “}”等字符时,自动开始新的一行并缩进,可以用C-c C-a开关
    ;;(c-toggle-auto-hungry-state 1)
    ;;按键定义
    (define-key c-mode-base-map [(control \`)] 'hs-toggle-hiding)
    (define-key c-mode-base-map [(return)] 'newline-and-indent)
    (define-key c-mode-base-map [(f7)] 'compile)
    (define-key c-mode-base-map [(f8)] 'ff-get-other-file)
    (define-key c-mode-base-map [(meta \`)] 'c-indent-command)
    ;; (define-key c-mode-base-map [(tab)] 'hippie-expand)
    (define-key c-mode-base-map [(tab)] 'my-indent-or-complete)
    (define-key c-mode-base-map [(meta ?/)] 'semantic-ia-complete-symbol-menu)
    ;;预处理设置
    (setq c-macro-shrink-window-flag t)
    (setq c-macro-preprocessor "cpp")
    (setq c-macro-cppflags " ")
    (setq c-macro-prompt-flag t)
    (setq hs-minor-mode t)
    (setq abbrev-mode t)
    (setq tab-width 4 indent-tabs-mode nil)
    (setq default-fill-column 80)
    )
    
    (add-hook 'c-mode-common-hook 'my-c-mode-common-hook)
    
    (defun my-c++-mode-hook()
    ;(setq tab-width 4 indent-tabs-mode nil)
    (c-set-style "stroustrup")
    (add-to-list 'c-cleanup-list 'defun-close-semi)
    ;; (add-to-list 'c-cleanup-list 'scope-operator)
    ;; (define-key c++-mode-map [f3] 'replace-regexp)
    )
    
    (add-hook 'c++-mode-hook 'my-c++-mode-hook)


    
    

  • 相关阅读:
    LeetCode 345. Reverse Vowels of a String 题解
    LeetCode 344. Reverse String 题解
    LeetCode 27. Remove Element 题解
    LeetCode 61. Rotate List 题解
    LeetCode 19.Remove Nth Node From End of List 题解
    Android耗电量
    Android 使用adb查看和修改电池信息
    Android AOP AspectJ 插桩
    Flask相关用法
    Monkey日志信息的11种Event percentage
  • 原文地址:https://www.cnblogs.com/booirror/p/3604311.html
Copyright © 2011-2022 走看看