只要联网,打开spacemacs就得1分钟?

为什么最近只要是联网状态打开spacemacs的话, 都需要1分多钟才能打开. 断网的话都是秒开.

(setq tramp-ssh-controlmaster-options
      "-o ControlMaster=auto -o ControlPath='tramp.%%C' -o ControlPersist=no")

好像没有效果, 我试了下在网络环境好的情况下, 打开速度回快很多. 应该是启动时候联网的问题.

这是我的 配置文件

;; -*- mode: emacs-lisp -*-
;; This file is loaded by Spacemacs at startup.
;; It must be stored in your home directory.

(defun dotspacemacs/layers ()
  "Configuration Layers declaration.
You should not put any user code in this function besides modifying the variable
values."
  (setq-default
   ;; Base distribution to use. This is a layer contained in the directory
   ;; `+distribution'. For now available distributions are `spacemacs-base'
   ;; or `spacemacs'. (default 'spacemacs)
   dotspacemacs-distribution 'spacemacs
   ;; Lazy installation of layers (i.e. layers are installed only when a file
   ;; with a supported type is opened). Possible values are `all', `unused'
   ;; and `nil'. `unused' will lazy install only unused layers (i.e. layers
   ;; not listed in variable `dotspacemacs-configuration-layers'), `all' will
   ;; lazy install any layer that support lazy installation even the layers
   ;; listed in `dotspacemacs-configuration-layers'. `nil' disable the lazy
   ;; installation feature and you have to explicitly list a layer in the
   ;; variable `dotspacemacs-configuration-layers' to install it.
   ;; (default 'unused)
   dotspacemacs-enable-lazy-installation 'unused
   ;; If non-nil then Spacemacs will ask for confirmation before installing
   ;; a layer lazily. (default t)
   dotspacemacs-ask-for-lazy-installation t
   ;; If non-nil layers with lazy install support are lazy installed.
   ;; List of additional paths where to look for configuration layers.
   ;; Paths must have a trailing slash (i.e. `~/.mycontribs/')
   dotspacemacs-configuration-layer-path '()
   ;; List of configuration layers to load.
   dotspacemacs-configuration-layers
   '(
     ;; ----------------------------------------------------------------
     ;; Example of useful layers you may want to use right away.
     ;; Uncomment some layer names and press <SPC f e R> (Vim style) or
     ;; <M-m f e R> (Emacs style) to install them.
     ;; ----------------------------------------------------------------
;; ------------------------ General layers ------------------------
     colors
     (syntax-checking :variables syntax-checking-enable-by-default nil)
     (spell-checking :variables spell-checking-enable-by-default nil)
     semantic
     restclient
     gtags
     (auto-completion :variables auto-completion-enable-sort-by-usage t
                      auto-completion-enable-help-tooltip nil
                      auto-completion-enable-snippets-in-popup t)
     helm
     theming
     (ibuffer :variables ibuffer-group-buffers-by 'projects)
     osx
     better-defaults
     prodigy
     deft
;; ------------------------ Programming and markup languages ------------------------
     ;;org
     emacs-lisp
     (c-c++ :variables
             c-c++-default-mode-for-headers 'c++-mode
             c-c++-enable-clang-support t)
     ;;python
     shell-scripts
;; ------------------------ Source control ------------------------
     (git :variables
          git-magit-status-fullscreen t
          magit-push-always-verify nil
          magit-save-repository-buffers 'dontask
          magit-revert-buffers 'silent
          magit-refs-show-commit-count 'all
          magit-revision-show-gravatars nil)
     (version-control :variables
                  version-control-global-margin t)
     github
     version-control
;; ------------------------ Tools ------------------------
     fasd
     ranger
     dash
     (spacemacs-layouts :variables layouts-enable-autosave nil
                        layouts-autosave-delay 300)
;; ------------------------ Vim ------------------------
     vinegar
     vim-empty-lines
     unimpaired
     evil-commentary
     evil-cleverparens
     evil-snipe
;; ------------------------------------------------------------------------
     )
   ;; List of additional packages that will be installed without being
   ;; wrapped in a layer. If you need some configuration for these
   ;; packages, then consider creating a layer. You can also put the
   ;; configuration in `dotspacemacs/user-config'.
   dotspacemacs-additional-packages '()
   ;; A list of packages that cannot be updated.
   dotspacemacs-frozen-packages '()
   ;; A list of packages that will not be install and loaded.
   dotspacemacs-excluded-packages '(smartparens spaceline company eldoc)
   ;; Defines the behaviour of Spacemacs when downloading packages.
   ;; Possible values are `used', `used-but-keep-unused' and `all'. `used' will
   ;; download only explicitly used packages and remove any unused packages as
   ;; well as their dependencies. `used-but-keep-unused' will download only the
   ;; used packages but won't delete them if they become unused. `all' will
   ;; download all the packages regardless if they are used or not and packages
   ;; won't be deleted by Spacemacs. (default is `used')
   dotspacemacs-download-packages 'used))

(defun dotspacemacs/init ()
  "Initialization function.
This function is called at the very startup of Spacemacs initialization
before layers configuration.
You should not put any user code in there besides modifying the variable
values."
  ;; This setq-default sexp is an exhaustive list of all the supported
  ;; spacemacs settings.
  (setq-default
   ;; If non nil ELPA repositories are contacted via HTTPS whenever it's
   ;; possible. Set it to nil if you have no way to use HTTPS in your
   ;; environment, otherwise it is strongly recommended to let it set to t.
   ;; This variable has no effect if Emacs is launched with the parameter
   ;; `--insecure' which forces the value of this variable to nil.
   ;; (default t)
   dotspacemacs-elpa-https t
   ;; Maximum allowed time in seconds to contact an ELPA repository.
   dotspacemacs-elpa-timeout 5
   ;; If non nil then spacemacs will check for updates at startup
   ;; when the current branch is not `develop'. (default t)
   dotspacemacs-check-for-update nil
   ;; One of `vim', `emacs' or `hybrid'.
   ;; `hybrid' is like `vim' except that `insert state' is replaced by the
   ;; `hybrid state' with `emacs' key bindings. The value can also be a list
   ;; with `:variables' keyword (similar to layers). Check the editing styles
   ;; section of the documentation for details on available variables.
   ;; (default 'vim)
   dotspacemacs-editing-style 'vim
   ;; If non nil output loading progress in `*Messages*' buffer. (default nil)
   dotspacemacs-verbose-loading nil
   ;; Specify the startup banner. Default value is `official', it displays
   ;; the official spacemacs logo. An integer value is the index of text
   ;; banner, `random' chooses a random text banner in `core/banners'
   ;; directory. A string value must be a path to an image format supported
   ;; by your Emacs build.
   ;; If the value is nil then no banner is displayed. (default 'official)
   dotspacemacs-startup-banner 'official
   ;; List of items to show in startup buffer or an association list of of
   ;; the form `(list-type . list-size)`. If nil it is disabled.
   ;; Possible values for list-type are:
   ;; `recents' `bookmarks' `projects' `agenda' `todos'."
   dotspacemacs-startup-lists '((recents . 5)
                                (projects . 7))
   ;; Default major mode of the scratch buffer (default `text-mode')
   dotspacemacs-scratch-mode 'text-mode
   ;; List of themes, the first of the list is loaded when spacemacs starts.
   ;; Press <SPC> T n to cycle to the next theme in the list (works great
   ;; with 2 themes variants, one dark and one light)
   dotspacemacs-themes '(;;spolsky
                         ;;brin
                         monokai
                         ;;spacemacs-dark
                         ;;spacemacs-light
                         )
   ;; If non nil the cursor color matches the state color in GUI Emacs.
   dotspacemacs-colorize-cursor-according-to-state t
   ;; Default font, or prioritized list of fonts. `powerline-scale' allows to
   ;; quickly tweak the mode-line size to make separators look not too crappy.
   dotspacemacs-default-font '("Courier New"
                               :size 16
                               :weight normal
                               :width normal
                               :powerline-scale 1.1)
   ;; The leader key
   dotspacemacs-leader-key "SPC"
   ;; The leader key accessible in `emacs state' and `insert state'
   ;; (default "M-m")
   dotspacemacs-emacs-leader-key "M-m"
   ;; Major mode leader key is a shortcut key which is the equivalent of
   ;; pressing `<leader> m`. Set it to `nil` to disable it. (default ",")
   dotspacemacs-major-mode-leader-key ","
   ;; Major mode leader key accessible in `emacs state' and `insert state'.
   ;; (default "C-M-m)
   dotspacemacs-major-mode-emacs-leader-key "C-M-m"
   ;; The key used for Emacs commands (M-x) (after pressing on the leader key).
   ;; (default "SPC")
   dotspacemacs-emacs-command-key "SPC"
   ;; These variables control whether separate commands are bound in the GUI to
   ;; the key pairs C-i, TAB and C-m, RET.
   ;; Setting it to a non-nil value, allows for separate commands under <C-i>
   ;; and TAB or <C-m> and RET.
   ;; In the terminal, these pairs are generally indistinguishable, so this only
   ;; works in the GUI. (default nil)
   dotspacemacs-distinguish-gui-tab nil
   ;; If non nil `Y' is remapped to `y$' in Evil states. (default nil)
   dotspacemacs-remap-Y-to-y$ nil
   ;; If non-nil, the shift mappings `<' and `>' retain visual state if used
   ;; there. (default t)
   dotspacemacs-retain-visual-state-on-shift t
   ;; If non-nil, J and K move lines up and down when in visual mode.
   ;; (default nil)
   dotspacemacs-visual-line-move-text nil
   ;; If non nil, inverse the meaning of `g' in `:substitute' Evil ex-command.
   ;; (default nil)
   dotspacemacs-ex-substitute-global nil
   ;; Name of the default layout (default "Default")
   dotspacemacs-default-layout-name "Default"
   ;; If non nil the default layout name is displayed in the mode-line.
   ;; (default nil)
   dotspacemacs-display-default-layout nil
   ;; If non nil then the last auto saved layouts are resume automatically upon
   ;; start. (default nil)
   dotspacemacs-auto-resume-layouts nil
   ;; Size (in MB) above which spacemacs will prompt to open the large file
   ;; literally to avoid performance issues. Opening a file literally means that
   ;; no major mode or minor modes are active. (default is 1)
   dotspacemacs-large-file-size 1
   ;; Location where to auto-save files. Possible values are `original' to
   ;; auto-save the file in-place, `cache' to auto-save the file to another
   ;; file stored in the cache directory and `nil' to disable auto-saving.
   ;; (default 'cache)
   dotspacemacs-auto-save-file-location 'cache
   ;; Maximum number of rollback slots to keep in the cache. (default 5)
   dotspacemacs-max-rollback-slots 5
   ;; If non nil, `helm' will try to minimize the space it uses. (default nil)
   dotspacemacs-helm-resize nil
   ;; if non nil, the helm header is hidden when there is only one source.
   ;; (default nil)
   dotspacemacs-helm-no-header nil
   ;; define the position to display `helm', options are `bottom', `top',
   ;; `left', or `right'. (default 'bottom)
   dotspacemacs-helm-position 'bottom
   ;; If non nil the paste micro-state is enabled. When enabled pressing `p`
   ;; several times cycle between the kill ring content. (default nil)
   dotspacemacs-enable-paste-transient-state nil
   ;; Which-key delay in seconds. The which-key buffer is the popup listing
   ;; the commands bound to the current keystroke sequence. (default 0.4)
   dotspacemacs-which-key-delay 0.4
   ;; Which-key frame position. Possible values are `right', `bottom' and
   ;; `right-then-bottom'. right-then-bottom tries to display the frame to the
   ;; right; if there is insufficient space it displays it at the bottom.
   ;; (default 'bottom)
   dotspacemacs-which-key-position 'bottom
   ;; If non nil a progress bar is displayed when spacemacs is loading. This
   ;; may increase the boot time on some systems and emacs builds, set it to
   ;; nil to boost the loading time. (default t)
   dotspacemacs-loading-progress-bar t
   ;; If non nil the frame is fullscreen when Emacs starts up. (default nil)
   ;; (Emacs 24.4+ only)
   dotspacemacs-fullscreen-at-startup t
   ;; If non nil `spacemacs/toggle-fullscreen' will not use native fullscreen.
   ;; Use to disable fullscreen animations in OSX. (default nil)
   dotspacemacs-fullscreen-use-non-native nil
   ;; If non nil the frame is maximized when Emacs starts up.
   ;; Takes effect only if `dotspacemacs-fullscreen-at-startup' is nil.
   ;; (default nil) (Emacs 24.4+ only)
   dotspacemacs-maximized-at-startup nil
   ;; A value from the range (0..100), in increasing opacity, which describes
   ;; the transparency level of a frame when it's active or selected.
   ;; Transparency can be toggled through `toggle-transparency'. (default 90)
   dotspacemacs-active-transparency 90
   ;; A value from the range (0..100), in increasing opacity, which describes
   ;; the transparency level of a frame when it's inactive or deselected.
   ;; Transparency can be toggled through `toggle-transparency'. (default 90)
   dotspacemacs-inactive-transparency 90
   ;; If non nil show the titles of transient states. (default t)
   dotspacemacs-show-transient-state-title t
   ;; If non nil show the color guide hint for transient state keys. (default t)
   dotspacemacs-show-transient-state-color-guide t
   ;; If non nil unicode symbols are displayed in the mode line. (default t)
   dotspacemacs-mode-line-unicode-symbols t
   ;; If non nil smooth scrolling (native-scrolling) is enabled. Smooth
   ;; scrolling overrides the default behavior of Emacs which recenters point
   ;; when it reaches the top or bottom of the screen. (default t)
   dotspacemacs-smooth-scrolling t
   ;; If non nil line numbers are turned on in all `prog-mode' and `text-mode'
   ;; derivatives. If set to `relative', also turns on relative line numbers.
   ;; (default nil)
   dotspacemacs-line-numbers 'relative
   ;; Code folding method. Possible values are `evil' and `origami'.
   ;; (default 'evil)
   dotspacemacs-folding-method 'evil
   ;; If non-nil smartparens-strict-mode will be enabled in programming modes.
   ;; (default nil)
   dotspacemacs-smartparens-strict-mode nil
   ;; If non-nil pressing the closing parenthesis `)' key in insert mode passes
   ;; over any automatically added closing parenthesis, bracket, quote, etc…
   ;; This can be temporary disabled by pressing `C-q' before `)'. (default nil)
   dotspacemacs-smart-closing-parenthesis nil
   ;; Select a scope to highlight delimiters. Possible values are `any',
   ;; `current', `all' or `nil'. Default is `all' (highlight any scope and
   ;; emphasis the current one). (default 'all)
   dotspacemacs-highlight-delimiters 'all
   ;; If non nil advises quit functions to keep server open when quitting.
   ;; (default nil)
   dotspacemacs-persistent-server nil
   ;; List of search tool executable names. Spacemacs uses the first installed
   ;; tool of the list. Supported tools are `ag', `pt', `ack' and `grep'.
   ;; (default '("ag" "pt" "ack" "grep"))
   dotspacemacs-search-tools '("ag" "pt" "ack" "grep")
   ;; The default package repository used if no explicit repository has been
   ;; specified with an installed package.
   ;; Not used for now. (default nil)
   dotspacemacs-default-package-repository nil
   ;; Delete whitespace while saving buffer. Possible values are `all'
   ;; to aggressively delete empty line and long sequences of whitespace,
   ;; `trailing' to delete only the whitespace at end of lines, `changed'to
   ;; delete only whitespace for changed lines or `nil' to disable cleanup.
   ;; (default nil)
   dotspacemacs-whitespace-cleanup nil
   ))

(defun dotspacemacs/user-init ()
  "Initialization function for user code.
It is called immediately after `dotspacemacs/init', before layer configuration
executes.
 This function is mostly useful for variables that need to be set
before packages are loaded. If you are unsure, you should try in setting them in
`dotspacemacs/user-config' first."

  ;;(setq package-archives '(("gnu" . "http://elpa.gnu.org/packages/")
  ;;                         ("marmalade" . "https://marmalade-repo.org/packages/")
  ;;                         ("melpa" . "http://melpa.org/packages/")))


  )

(defun dotspacemacs/user-config ()
;; -------------------------------------------------------------------- ;;
;; -------------------------------------------------------------------- ;;
;; -------------------------------------------------------------------- ;;
;;                  ||                              ||                  ;;
;;                  ||    [*** User Config ***]     ||                  ;;
;;                  ||                              ||                  ;;
;; -------------------------------------------------------------------- ;;
;;                   [ use only spaces and no tabs ]                    ;;
  (progn
    (setq indent-tabs-mode nil)
    (setq default-tab-width 4)
    (setq tab-width 4)
    (setq c-basic-offset 4)
    (setq ruby-indent-level 4)
  )


;; ----------------------------------------------------------------
;;                         [ yas-snippet ]
(add-to-list 'yas-snippet-dirs "/Users/pengc825/.emacs.d/private/snippets/yasnippet-snippets")


;; ----------------------------------------------------------------
;;                          [ 全局自动完成 ]
;;(add-hook 'after-init-hook 'global-company-mode)


;; ----------------------------------------------------------------
;;                          [ 自动显示行号 ]
   ;;(global-linum-mode)
   ;;(setq column-number-mode t)
   (setq linum-format "%3d \u2502")


;; ----------------------------------------------------------------
;;                          [ 高亮括号配对 ]
  (show-paren-mode t)
  (setq show-paren-style 'parenthesis)
  (electric-pair-mode t)


;; ----------------------------------------------------------------
;;                        [ 逗号后面自动加空格 ]
  (global-set-key (kbd ",")
                #'(lambda ()
                    (interactive)
                    (insert ", ")))


;; ----------------------------------------------------------------
;;                           [ 定义前景色 ]
  (set-face-foreground 'show-paren-match "goldenrod")


;; ----------------------------------------------------------------
;;                         [ 加粗显示括号匹配 ]
  (set-face-bold-p 'show-paren-match t)


;; ----------------------------------------------------------------
;;                           [ 定义背景色 ]
  (set-face-background 'show-paren-match nil)


;; ----------------------------------------------------------------
;;                     [ 美化默认的mode-line样式 ]
  (defun CoffeeXC/update-persp-name ()
    (when (bound-and-true-p persp-mode)
      ;; There are multiple implementations of
      ;; persp-mode with different APIs
      (progn
             (or (not (string= persp-nil-name (safe-persp-name (get-frame-persp))))
                 "Default")
             (let ((name (safe-persp-name (get-frame-persp))))
               (propertize (concat "[" name "] ")
                           'face 'font-lock-preprocessor-face
                           'help-echo "Current Layout name.")))))


  (defun spaceline--unicode-number (str)
    "Return a nice unicode representation of a single-digit number STR."
    (cond
     ((string= "1" str) "◀➊▶")
     ((string= "2" str) "◀➋▶")
     ((string= "3" str) "◀➌▶")
     ((string= "4" str) "◀➍▶")
     ((string= "5" str) "◀➎▶")
     ((string= "6" str) "◀➏▶")
     ((string= "7" str) "◀➐▶")
     ((string= "8" str) "◀➑▶")
     ((string= "9" str) "◀➒▶")
     ((string= "0" str) "◀➓▶")))

  (defun window-number-mode-line ()
    "The current window number. Requires `window-numbering-mode' to be enabled."
    (when (bound-and-true-p window-numbering-mode)
      (let* ((num (window-numbering-get-number))
             (str (when num (int-to-string num))))
        (spaceline--unicode-number str))))

  (defun mode-line-fill (face reserve)
    "Return empty space using FACE and leaving RESERVE space on the right."
    (unless reserve
      (setq reserve 20))
    (when (and window-system (eq 'right (get-scroll-bar-mode)))
      (setq reserve (- reserve 3)))
    (propertize " "
                'display `((space :align-to
                                  (- (+ right right-fringe right-margin) ,reserve)))
                'face face))

  (defun buffer-encoding-abbrev ()
    "The line ending convention used in the buffer."
    (let ((buf-coding (format "%s" buffer-file-coding-system)))
      (if (string-match "\\(dos\\|unix\\|mac\\)" buf-coding)
          (match-string 1 buf-coding)
        buf-coding)))

  (setq my-flycheck-mode-line
        '(:eval
          (pcase flycheck-last-status-change
            (`not-checked nil)
            (`no-checker (propertize " -" 'face 'warning))
            (`running (propertize " ✷" 'face 'success))
            (`errored (propertize " !" 'face 'error))
            (`finished
             (let* ((error-counts (flycheck-count-errors flycheck-current-errors))
                    (no-errors (cdr (assq 'error error-counts)))
                    (no-warnings (cdr (assq 'warning error-counts)))
                    (face (cond (no-errors 'error)
                                (no-warnings 'warning)
                                (t 'success))))
               (propertize (format "[%s/%s]" (or no-errors 0) (or no-warnings 0))
                           'face face)))
            (`interrupted " -")
            (`suspicious '(propertize " ?" 'face 'warning)))))

  (setq-default mode-line-format
            (list
             " %1"
             '(:eval (propertize
                      (window-number-mode-line)
                      'face
                      'font-lock-type-face))
             " "
             '(:eval (CoffeeXC/update-persp-name))

             "%1 "
             ;; the buffer name; the file name as a tool tip
             '(:eval (propertize "%b " 'face 'font-lock-keyword-face
                                 'help-echo (buffer-file-name)))


             " [" ;; insert vs overwrite mode, input-method in a tooltip
             '(:eval (propertize (if overwrite-mode "Ovr" "Ins")
                                 'face 'font-lock-preprocessor-face
                                 'help-echo (concat "Buffer is in "
                                                    (if overwrite-mode
                                                        "overwrite"
                                                      "insert") " mode")))

             ;; was this buffer modified since the last save?
             '(:eval (when (buffer-modified-p)
                       (concat ","  (propertize "Mod"
                                                'face 'font-lock-warning-face
                                                'help-echo "Buffer has been modified"))))

             ;; is this buffer read-only?
             '(:eval (when buffer-read-only
                       (concat ","  (propertize "RO"
                                                'face 'font-lock-type-face
                                                'help-echo "Buffer is read-only"))))
             "] "

             ;; anzu
             anzu--mode-line-format

             ;; relative position, size of file
             "["
             (propertize "%p" 'face 'font-lock-constant-face) ;; % above top
             "/"
             (propertize "%I" 'face 'font-lock-constant-face) ;; size
             "] "

             ;; the current major mode for the buffer.
             '(:eval (propertize "%m" 'face 'font-lock-string-face
                                 'help-echo buffer-file-coding-system))

             "%1 "
             my-flycheck-mode-line
             "%1 "
             ;; evil state
             '(:eval evil-mode-line-tag)

             ;; minor modes
             minor-mode-alist
             " "
             ;; git info
             `(vc-mode vc-mode)

             " "

             ;; global-mode-string goes in mode-line-misc-info
             mode-line-misc-info

             (mode-line-fill 'mode-line 20)

             ;; line and column
             "(" ;; '%02' to set to 2 chars at least; prevents flickering
             (propertize "%02l" 'face 'font-lock-type-face) ","
             (propertize "%02c" 'face 'font-lock-type-face)
             ") "

             '(:eval (buffer-encoding-abbrev))
             mode-line-end-spaces
             ;; add the time, with the date and the emacs uptime in the tooltip
             ;; '(:eval (propertize (format-time-string "%H:%M")
             ;;                     'help-echo
             ;;                     (concat (format-time-string "%c; ")
             ;;                             (emacs-uptime "Uptime:%hh"))))
             ))


;; ----------------------------------------------------------------
;;                          [ 设置mode-line外观 ]
(display-time-mode 1) ; 显示时间
(setq display-time-24hr-format t) ; 24小时格式
(set-face-attribute 'mode-line nil  :height 145) ; 设置mode-line 行高


;; ----------------------------------------------------------------
;;                               [ UI设置 ]
;; more useful frame title, that show either a file or a
;; buffer name (if the buffer isn't visiting a file)
(define-fringe-bitmap 'right-curly-arrow
  [#b00000000
   #b00000000
   #b00000000
   #b00000000
   #b01110000
   #b00010000
   #b00010000
   #b00000000])

(define-fringe-bitmap 'left-curly-arrow
  [#b00000000
   #b00001000
   #b00001000
   #b00001110
   #b00000000
   #b00000000
   #b00000000
   #b00000000])
;;(set-background-color "#4F4F4F")

;;(custom-theme-set-faces
;; 'monokai
;; '(font-lock-comment-face ((t (:foreground "#DFAF8F"))))
;; '(font-lock-comment-delimiter-face ((t (:foreground "#DFAF8F")))))


;; ----------------------------------------------------------------
;;                      [ 创建文件时自动穿件目录 ]
  (add-hook 'before-save-hook
          (lambda ()
            (when buffer-file-name
              (let ((dir (file-name-directory buffer-file-name)))
                (when (and (not (file-exists-p dir))
                           (y-or-n-p (format "Directory %s does not exist. Create it?" dir)))
                  (make-directory dir t))))))


;; ----------------------------------------------------------------
;;                     [ evil-state-tag 的设置 ]
(setq evil-normal-state-tag   (propertize "[✗ ♨ ✗]" 'face '((:background "#878787" :foreground "black")))
          evil-emacs-state-tag    (propertize "[E]" 'face '((:background "SkyBlue2" :foreground "black")))
          evil-insert-state-tag   (propertize "[✗ ☠ ✗]" 'face '((:background "#1C86EE") :foreground "white"))
          evil-motion-state-tag   (propertize "[ CoffeeXC ☭ ]" 'face '((:background "#008B00") :foreground "white"))
          evil-visual-state-tag   (propertize "[V]" 'face '((:background "gray" :foreground "black")))
          evil-operator-state-tag (propertize "[O]" 'face '((:background "purple"))))


;; ----------------------------------------------------------------
;;                    [ auto-complete-clang 的设置 ]
(add-to-list 'load-path "/Users/pengc825/git/auto-complete-clang")
(require 'auto-complete-clang)
(setq ac-clang-auto-save t)
(setq ac-auto-start t)
(setq ac-quick-help-delay 0.5)
;; (ac-set-trigger-key "TAB")
  (define-key ac-mode-map  [(control tab)] 'auto-complete)
  (define-key ac-completing-map (kbd "TAB") nil)
  (define-key ac-completing-map [tab] nil)

(defun my-ac-config ()
  (setq ac-clang-flags
        (mapcar(lambda (item)(concat "-I" item))
               (split-string
                "/usr/include/c++/4.2.1")))
  (setq-default ac-sources '(ac-source-abbrev ac-source-dictionary ac-source-words-in-same-mode-buffers))
  (add-hook 'emacs-lisp-mode-hook 'ac-emacs-lisp-mode-setup)
  (add-hook 'c-mode-common-hook 'ac-cc-mode-setup)
  (add-hook 'ruby-mode-hook 'ac-ruby-mode-setup)
  (add-hook 'css-mode-hook 'ac-css-mode-setup)
  (add-hook 'auto-complete-mode-hook 'ac-common-setup)
  (global-auto-complete-mode t)
  )
(defun my-ac-cc-mode-setup ()
  (setq ac-sources (append '(ac-source-clang ac-source-yasnippet) ac-sources)))
(add-hook 'c-mode-common-hook 'my-ac-cc-mode-setup)
;; ac-source-gtags
(my-ac-config)

(setq frame-title-format
      '("" " CoffeeXC - "
        (:eval (if (buffer-file-name)
                   (abbreviate-file-name (buffer-file-name)) "%b"))))



;; ----------------------------------------------------------------
;;                             [ 快捷键设置 ]
(global-set-key (kbd "C-l") 'yas/expand)
(global-set-key (kbd "C-c ;") 'whitespace-cleanup)

;;(setq tramp-ssh-controlmaster-options
;;      "-o ControlMaster=auto -o ControlPath='tramp.%%C' -o ControlPersist=no")
;; -------------------------------------------------------------------- ;;
;; -------------------------------------------------------------------- ;;
;; -------------------------------------------------------------------- ;;
;;                  ||                              ||                  ;;
;;                  ||    [*** User Config ***]     ||                  ;;
;;                  ||                              ||                  ;;
;; -------------------------------------------------------------------- ;;---
  )

;; Do not write anything past this comment. This is where Emacs will
;; auto-generate custom variable definitions.
(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.
 '(ansi-color-names-vector
   ["#151515" "#953331" "#546a29" "#909737" "#385e6b" "#7f355e" "#34676f" "#c6a57b"])
 '(custom-safe-themes
   (quote
    ("c39ae5721fce3a07a27a685c08e4b856a13780dbc755a569bb4393c932f226d7" default)))
 '(fci-rule-color "#151515" 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.
 )

@zilongshanren 山人能帮我看看么?

越过长城,走向世界

我是已经翻墙过了的

前几天没有这种情况, 就今天开始.

https://github.com/emacs-china/Spacemacs-rocks#emacs-也很美 把elpa地址改成山人的或者国内另一个同学的镜像?(具体地址找不到了,我从来不卡melpa就没看这里。总之spacemacs rocks season 2前10集里有)
断网就没问题,那翻墙了但是emacs没翻?

试过这个方法了, 还是没用, 之前我也以为是墙的问题, 所以试了下emacs也用代理, 仍然没有用, 因为换了网络环境就好很多, 如果是墙的问题所有网络环境都是一样的, 所以应该不是墙的问题.

我这边也没有碰到过类似的问题,请问你使用的是我的配置吗?

不知道你说的已经翻过是什么方法,如果是通过代理的话你可能需要 proxychains 或者是 proxifier 等软件,如果 MELPA 使用了 https 的话你可能还需要让 openssl 过墙而不仅仅是 emacs (针对 proxifier 而言)。

仅仅设置所谓的“全局代理”是不会对 emacs 生效的。

所以直接使用 http://elpa.emacs-china.org/

不是, 我的配置贴上去了.

我是用的ss + proxychains让emacs过墙的, 我的意思是, 我仅仅是换了一个同样没有过墙的网速快的网络, 打开速度就会快很多, 所以不会是墙的问题.

http://spacemacs.org/doc/FAQ.html#orgheadline14

1 个赞

解决啦, 谢谢!