文章详情

短信预约-IT技能 免费直播动态提醒

请输入下面的图形验证码

提交验证

短信预约提醒成功

emacs配置文件3

2023-01-31 01:10

关注
Emacs配置文件3
;;普通设置
(setq inhibit-startup-message t);关闭起动时闪屏
(setq visible-bell t);关闭出错时的提示声
(show-paren-mode t);显示括号匹配
;(set-default-font "-adobe-courier-medium-r-normal--14-100-100-100-m-90-iso10646-1");;字体设置
(column-number-mode t);显示列号
(setq frame-title-format "%n%F/%b");在窗口的栏上显示文件名称
(mouse-avoidance-mode 'animate);光标靠近鼠标指针时,让鼠标指针自动让开
(setq default-frame-alist '((height . 25) (width . 80) (menu-bar-lines . 80) (tool-bar-lines . 80)));设置窗口启动大小
(fset 'yes-or-no-p 'y-or-n-p);以 y/n代表 yes/no
(setq-default make-backup-files nil);;不要生成临时文件
(setq x-select-enable-clipboard t);;允许emacs和外部其他程序的粘贴
(setq mouse-yank-at-point t);支持中键粘贴







;(show-paren-mode 't); 高亮显示匹配括号
;;自动插入匹配的括号
;; enable skeleton-pair insert globally
(setq skeleton-pair t)
(global-set-key (kbd "(") 'skeleton-pair-insert-maybe)
(global-set-key (kbd "[") 'skeleton-pair-insert-maybe)
(global-set-key (kbd "{") 'skeleton-pair-insert-maybe)








;;热键设置
(global-set-key [f9] 'delete-window);F9 关闭d当前窗口
(global-set-key [f8] 'other-window);F8窗口间跳转
(global-set-key [(f2)] 'ansi-term);F2 切换到shell模式
;(global-set-key [f3] 'split-window-vertically);F3分割窗口
(global-set-key [f12] 'my-fullscreen);F12 全屏
(global-set-key [(f4)] 'compile);编译
(global-set-key [f5] 'gdb);启动gdb
(global-set-key [(f6)] 'gdb-many-windows);启动窗口gdb
(global-set-key [f1] 'goto-line);设置M-g为goto-line
;(global-set-key [f7] 'other-frame);跳到其它窗格
(global-set-key [(f3)] 'speedbar);打开speedbar








;;显示行号
(load-file "~/dos/emacs/display-line-number.el")
;;(autoload `display-line-number-mode-on "display-line-number" "display mode" t)
(require 'display-line-number)
(global-display-line-number-mode t)





;;鼠标滚轮,默认的滚动太快,这里改为3行
(defun up-slightly () (interactive) (scroll-up 3))
(defun down-slightly () (interactive) (scroll-down 3))
(global-set-key [mouse-4] 'down-slightly)
(global-set-key [mouse-5] 'up-slightly)







;;代码折
(add-hook 'c-mode-hook 'hs-minor-mode)
(add-hook 'c++-mode-hook 'hs-minor-mode)  







;全屏
(defun my-fullscreen ()
  (interactive)
  (x-send-client-message
   nil 0 nil "_NET_WM_STATE" 32
   '(2 "_NET_WM_STATE_FULLSCREEN" 0)))






;;配色方案
(load-file "~/dos/emacs/color-theme.el")
(require 'color-theme)
;(add-hook 'c-mode-common-hook 'color-theme-taylor)
;(add-hook 'c++-mode-common-hook 'color-theme-taylor)








;;打开多缓冲区
(load-file "~/dos/emacs/tabbar.el")
(require 'tabbar)
(global-set-key (kbd "<left>") 'tabbar-backward-tab)
(global-set-key (kbd "<right>") 'tabbar-forward-tab)
(global-set-key (kbd "<up>") 'tabbar-forward-group)
(global-set-key (kbd "<down>") 'tabbar-backward-group)










;;自动补全
(load-file "~/dos/emacs/msf-abbrev.el")
;; ensure abbrev mode is always on
(setq-default abbrev-mode t)
;; do not bug me about saving my abbreviations
(setq save-abbrevs nil)
;; load up modes I use
(require 'cc-mode)
(require 'perl-mode)
(require 'cperl-mode)
(require 'sh-script)
(require 'shell)
;(require 'tex-site) ;; I use AUCTeX
;(require 'latex)    ;; needed to define LaTeX-mode-hook under AUCTeX
;(require 'tex)      ;; needed to define TeX-mode-hook under AUCTeX
;; (require 'python)   ;; I use python.el from Emacs CVS, uncomment if you do also
;; load up abbrevs for these modes
(require 'msf-abbrev)
(setq msf-abbrev-verbose t) ;; optional
(setq msf-abbrev-root "~/dos/emacs/mode-abbrevs")
(global-set-key (kbd "C-c l") 'msf-abbrev-goto-root)
(global-set-key (kbd "C-c a") 'msf-abbrev-define-new-abbrev-this-mode)
(msf-abbrev-load)







;;导入cscope
(load-file "~/dos/emacs/cscope-15.6/contrib/xcscope/xcscope.el")
;(add-to-list 'load-path "~/dos/emacs/cscope-15.6/contrib/xcscope")
(require 'xcscope) ;;加载xcscope








;;导入cedet
(load-file "~/dos/emacs/cedet-1.0pre4/common/cedet.el")
;(add-to-list 'load-path "~/dos/emacs/cedet-1.0pre4/common/cedet.el")
(require 'cedet) ;;加载cedet
(define-key c-mode-base-map [(meta ?/)] 'semantic-ia-complete-symbol-menu)
;(semantic-load-enable-minimum-features)
;(semantic-load-enable-code-helpers)
;(semantic-load-enable-guady-code-helpers)
;(semantic-load-enable-excessive-code-helpers)
;(semantic-load-enable-semantic-debugging-helpers)









;;导入ecb
(add-to-list 'load-path "~/dos/emacs/ecb-2.32")
(require 'ecb)










;;;删除一行
(defun zl-delete-line nil
  "delete the whole line"
  (interactive)
  (beginning-of-line);光标移动到行首
  (push-mark);做个标记
  (beginning-of-line 2);移动到下一行行首
  (kill-region (point) (mark)));光标和标记之间的删掉

(global-set-key (kbd "M-k") 'zl-delete-line);删除一行






;;语言风格
;;(add-hook 'c-mode-hook
;;          '(lambda ()
;;             (c-set-style "gnu")))
;;(add-hook 'c++-mode-hook
;;          '(lambda ()
;;             (c-set-style "gnu")))


;(defun my-c-mode-common-hook()
;  (setq tab-width 4 indent-tabs-mode nil)
  ;;; hungry-delete and auto-newline
;  (c-toggle-auto-hungry-state 2)
  ;;按键定义
;  (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)
;)
;(add-hook 'c-mode-common-hook 'my-c-mode-common-hook)

;;;;我的C++语言编辑策略
;(defun my-c++-mode-hook()
;  (setq tab-width 4 indent-tabs-mode nil)
;  (c-set-style "stroustrup")
;;  (define-key c++-mode-map [f3] 'replace-regexp)
;)

;(add-hook 'c++-mode-hook 'my-c++-mode-hook)

;;;;C/C++语言启动时自动加载semantic对/usr/include的索引数据库
;(setq semanticdb-search-system-databases t)
;  (add-hook 'c-mode-common-hook
;          (lambda ()
;            (setq semanticdb-project-system-databases
;                  (list (semanticdb-create-database
;                           semanticdb-new-database-class
;                           "/usr/include")))))










(defun program-mode()
  (setq tab-width 8 indent-tabs-mode nil)
  (c-toggle-auto-hungry-state 1)
  (c-set-style "stroustrup"))

;(add-hook 'c-mode-hook 'program-mode)
;(add-hook 'c-mode-hook 'program-mode)







阅读原文内容投诉

免责声明:

① 本站未注明“稿件来源”的信息均来自网络整理。其文字、图片和音视频稿件的所属权归原作者所有。本站收集整理出于非商业性的教育和科研之目的,并不意味着本站赞同其观点或证实其内容的真实性。仅作为临时的测试数据,供内部测试之用。本站并未授权任何人以任何方式主动获取本站任何信息。

② 本站未注明“稿件来源”的临时测试数据将在测试完成后最终做删除处理。有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341

软考中级精品资料免费领

  • 历年真题答案解析
  • 备考技巧名师总结
  • 高频考点精准押题
  • 2024年上半年信息系统项目管理师第二批次真题及答案解析(完整版)

    难度     813人已做
    查看
  • 【考后总结】2024年5月26日信息系统项目管理师第2批次考情分析

    难度     354人已做
    查看
  • 【考后总结】2024年5月25日信息系统项目管理师第1批次考情分析

    难度     318人已做
    查看
  • 2024年上半年软考高项第一、二批次真题考点汇总(完整版)

    难度     435人已做
    查看
  • 2024年上半年系统架构设计师考试综合知识真题

    难度     224人已做
    查看

相关文章

发现更多好内容

猜你喜欢

AI推送时光机
位置:首页-资讯-后端开发
咦!没有更多了?去看看其它编程学习网 内容吧
首页课程
资料下载
问答资讯