Dumped Spacemacs for Vanilla Emacs

<2018-04-14 Sat>

The startup time for Spacemacs used to be pretty high. So I've tried unsetting few layers, but the problem still persists.

I'd planned on dumping Spacemacs but I've started my emacs journey with Spacemacs, So learning the underlying layer of emacs was too difficult to me.

I've seen myself deleting Spacemacs, giving a try on Emacs and coming back to Spacemacs again.

Most of the times the common problems I've faced was I can't find any packages.

I wish I've known about Melpa not showing me newer packages. I've gone through the Melpa Installation steps, which was the starting point to configure Emacs with my own configuration.

By copy pasting certain elisp commands on .emacs I've found elisp to be a lot simpler and I could clearly understand what's happening in the background as well.

Autocomplete

Autocomplete is a must. You really need it if you need some cool auto-completition for other languages as well.

M-x package-install [RET] auto-complete [RET]
;;.emacs
;; Autocomplete
(ac-config-default)

C/C++

I love clang. And you must love it too. Irony provides better editing experience for C and C++, and is based on libclang.

M-x package-install [RET] irony [RET]
;;.emacs
;; irony

(add-hook 'c++-mode-hook 'irony-mode)
(add-hook 'c-mode-hook 'irony-mode)
(add-hook 'objc-mode-hook 'irony-mode)

(add-hook 'irony-mode-hook 'irony-cdb-autosetup-compile-options)

Python Mode

I'm using anaconda-mode as my python environment. The elpy is another python environment with automatic code rules.

M-x package-install [RET] anaconda-mode [RET]
;;.emacs
;; Anaconda-mode python
(add-hook 'python-mode-hook' 'anaconda-mode)

Web

You definitly need it.

M-x package-install [RET] web-mode [RET]
M-x package-install [RET] tide [RET]
;;.emacs
;;; HTML

(require 'web-mode)
(add-to-list 'auto-mode-alist '("\\.html?\\'" . web-mode))

;; tide typescript
(defun setup-tide-mode ()
  (interactive)
  (tide-setup)
  (flycheck-mode +1)
  (setq flycheck-check-syntax-automatically '(save mode-enabled))
  (eldoc-mode +1)
  (tide-hl-identifier-mode +1)
  ;; company is an optional dependency. You have to
  ;; install it separately via package-install
  ;; `M-x package-install [ret] company`
  (company-mode +1))

;; aligns annotation to the right hand side
(setq company-tooltip-align-annotations t)

;; formats the buffer before saving
(add-hook 'before-save-hook 'tide-format-before-save)

;; tide typescript
(add-hook 'typescript-mode-hook #'setup-tide-mode)

Git

Finally.

M-x package-install [RET] magit [RET]
;;.emacs
;; magit
(global-set-key (kbd "C-x g") 'magit-status)

Melpa

Add the following in your .emacs and your are done.

(require 'package)
(let* ((no-ssl (and (memq system-type '(windows-nt ms-dos))
                    (not (gnutls-available-p))))
       (proto (if no-ssl "http" "https")))
  ;; Comment/uncomment these two lines to enable/disable MELPA and MELPA Stable as desired
  (add-to-list 'package-archives (cons "melpa" (concat proto "://melpa.org/packages/")) t)
  ;;(add-to-list 'package-archives (cons "melpa-stable" (concat proto "://stable.melpa.org/packages/")) t)
  (when (< emacs-major-version 24)
    ;; For important compatibility libraries like cl-lib
    (add-to-list 'package-archives '("gnu" . (concat proto "://elpa.gnu.org/packages/")))))
(package-initialize)

Spacemacs-theme

If you love spacemacs-theme, then this one's for you

M-x package-install [RET] spacemacs-theme [RET]
;;.emacs
(load-theme 'spacemacs-dark t)

Thinks are a bit fast now though. The startup time has decreased by 75%. I'm finally experiencing the same joy I've got while using spacemacs.

Well, you could mail, play games, listen to songs and do most of the things without leaving Emacs.

Hey, do You know you could even control butterflies without leaving emacs?

ds-butterfly.png