zoukankan      html  css  js  c++  java
  • ~/.emacs emacs 配置文件

    windows ~/.emacs

    (when (>= emacs-major-version 24)
      (require 'package)
      (add-to-list
       'package-archives
       ;; '("melpa" . "http://stable.melpa.org/packages/") ; many packages won't show if using stable
       '("melpa" . "http://melpa.milkbox.net/packages/")
       t))
    
    ;; Added by Package.el.  This must come before configurations of
    ;; installed packages.  Don't delete this line.  If you don't want it,
    ;; just comment it out by adding a semicolon to the start of the line.
    ;; You may delete these explanatory comments.
    (package-initialize)
    
    (show-paren-mode 1)
    (setq show-paren-style 'parentheses)
    
    ;; electric-indent-mode
    (electric-indent-mode 1)
    
    ;; set language environment
    (set-language-environment 'UTF-8)
    (set-locale-environment "UTF-8")
    
    ;; set shell and eshell key binding
    (global-set-key "C-cs" 'shell)
    (global-set-key "C-ce" 'eshell)
    
    ;; show file path C-c z
    (defun show-file-name ()
      "Show the full path file name in the minibuffer."
      (interactive)
      (message (buffer-file-name))
      (kill-new (file-truename buffer-file-name)))
    (global-set-key "C-cz" 'show-file-name)
    
    (defun refresh-file ()
      (interactive)
      (revert-buffer t (not (buffer-modified-p)) t))
    (global-set-key [(f5)] 'refresh-file)
    (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.
     '(package-selected-packages (quote (react-snippets php-mode))))
    (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.
     )

    mac ~/.emacs

    ;; load emacs 24's package system. Add MELPA repository.
    
    ;; Added by Package.el.  This must come before configurations of
    ;; installed packages.  Don't delete this line.  If you don't want it,
    ;; just comment it out by adding a semicolon to the start of the line.
    ;; You may delete these explanatory comments.
    (when (>= emacs-major-version 24)
      (require 'package)
      (add-to-list
       'package-archives
       ;; '("melpa" . "http://stable.melpa.org/packages/") ; many packages won't show if using stable
       '("melpa" . "http://melpa.milkbox.net/packages/")
       t)
       (package-initialize)
    )
    
    (setq show-paren-mode t)
    (setq show-paren-style 'parenthesis)
    
    ;; set shell and eshell key binding
    (global-set-key "C-cs" 'shell)
    (global-set-key "C-ce" 'eshell)
    
    ;; text size scale
    (global-set-key (kbd "C-+") 'text-scale-increase)
    (global-set-key (kbd "C--") 'text-scale-decrease)
    (global-set-key (kbd "C-0") 'text-scale-adjust)
    
    ;; show file path C-c z
    (defun show-file-name ()
      "Show the full path file name in the minibuffer."
      (interactive)
      (message (buffer-file-name))
      (kill-new (file-truename buffer-file-name)))
    (global-set-key "C-cz" 'show-file-name)
    
    ;; set startup window location
    (set-frame-position (selected-frame) 650 10) ; pixels x y from upper left
    ;; set startup window size
    (add-to-list 'default-frame-alist '(height . 48))
    (add-to-list 'default-frame-alist '(width . 90))
    (let ((default-directory "~/Code"))
      (shell "*shell*"))
    
    (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.
     '(package-selected-packages
       (quote
        (web-mode flymake-php php-mode enclose groovy-mode gradle-mode autopair php-scratch json-reformat jsfmt emmet-mode ac-html ac-php))))
    (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.
     )
    

      

  • 相关阅读:
    Linux如何通过命令查看日志文件的某几行(中间几行或最后几行)
    将生成200 个激活码(或者优惠券)保存到 oracle关系型数据库中
    将你的 QQ 头像(或者微博头像)右上角加上红色的数字,类似于微信未读信息数量那种提示效果
    面试笔试题:多表关联的update语句、将in中的查询条件按顺序输出和SQL语句增加列、修改列、删除列
    sql中级到高级
    Linux常用命令
    类的特殊成员方法
    正则表达式的方法匹配规则
    启动ecilpse 报错an error has occurred. see the log file
    访问修饰符
  • 原文地址:https://www.cnblogs.com/mingzhanghui/p/9312909.html
Copyright © 2011-2022 走看看