Today
-
Yesterday
-
Total
-
  • Emacs의 Programming 관련 공통 설정
    Practice/Emacs 2017.12.14 13:50

    elpa

    (require 'package)
    (add-to-list 'package-archives
                 '("melpa" . "https://melpa.org/packages/"))
    (add-to-list 'package-archives
                 '("melpa-stable" . "http://melpa-stable.milkbox.net/packages/"))
    (setq package-enable-at-startup nil)
    (setq package-archive-priorities '(("melpa-stable" . 1)))
    (package-initialize)

    use-package

    (unless (package-installed-p 'use-package)
      (package-refresh-contents)
      (package-install 'use-package))
    
    (setq use-package-verbose t)
    (setq use-package-always-bin "melpa-stable")
    
    (eval-when-compile
      (require 'use-package))

    flycheck

    (use-package flycheck
      :ensure t
      :diminish flycheck-mode
      :commands flycheck-mode
      :init (global-flycheck-mode)
      :config
      (setq flycheck-check-syntax-automatically '(save idle-change mode-enabled)
            flycheck-idle-change-delay 5.0))

    helm

    (use-package helm
      :ensure t
      :diminish helm-mode
      :bind (("C-c h" . helm-mini)
             ("C-h a" . helm-apropos)
             ;; ("C-x C-b" . helm-buffers-list)
             ;; ("C-x b" . helm-buffers-list)
             ("M-y" . helm-show-kill-ring)
             ("M-x" . helm-M-x)
             ("C-x c o" . helm-occur)
             ("C-x c s" . helm-swoop)
             ("C-x c y" . helm-yas-complete)
             ("C-x c Y" . helm-yas-create-snippet-on-region)
             ("C-x c b" . my/helm-do-grep-book-notes)
             ("C-x c SPC" . helm-all-mark-rings)
             ("C-x C-o" . ffap))
      :init
      (require 'helm-config)
      (setq helm-candidate-number-limit 100)
      (setq helm-yas-display-key-on-candidate t)
      ;; for pretty fast updates when hitting RET too quickly
      ;; after typing fast:
      (setq helm-idle-delay 0.0 ; update fast sources immediately (doesn't).
            helm-input-idle-delay 0.01  ; this actually updates things
                                            ; reeeelatively quickly.
            helm-quick-update t
            helm-M-x-requires-pattern nil
            helm-ff-skip-boring-files t)
      :config
      (use-package helm-descbinds
        :ensure t
        :config (helm-descbinds-mode)))

    projectile

    (use-package projectile
      :ensure t
      :diminish projectile-mode
      :config
      (setq projectile-enable-caching t
            projectile-indexing-method 'alien
            projectile-completion-system 'helm
            projectile-switch-project-action 'helm-projectile)
      ;; https://github.com/bbatsov/projectile/issues/1183
      (setq projectile-mode-line
            '(:eval (format " Projectile[%s]"
                            (projectile-project-name))))
      (projectile-global-mode))
    
    (use-package helm-projectile
      :ensure t
      :commands (helm-projectile)
      :after helm
      :config (helm-projectile-on))

    company

    (use-package company
      :ensure t
      :diminish company-mode
      :commands (company-complete company-mode)
      :bind (([remap dabbrev-expand] . company-complete)
             :map prog-mode-map
             ([tab] . company-indent-or-complete-common))
      :init (if (fboundp 'evil-declare-change-repeat)
                (mapc #'evil-declare-change-repeat
                      '(company-complete-common
                        company-select-next
                        company-select-previous
                        company-complete-selection
                        company-complete-number)))
      ;; (add-hook 'after-init-hook 'global-company-mode)
      :config
      (use-package company-statistics
                  :ensure t
                  :init
                  (company-statistics-mode))
      (setq company-idle-delay 0)
      (setq company-show-numbers "on")
      (add-hook 'prog-mode-hook 'company-mode))

    댓글 0

Designed by Tistory.