Emacs Basic Setup

The intention to try Emacs is its orgmode, and this is a very basic setup so far.

emacs

Emacs has builtin package manager, we can install package from sites like melpa

The equivalence of .vimrc in vim is ~/.emacs.d/init.el. The following code is all written to init.el. vimrc is written in vimscript, init.el is written in emacs lisp, and lisp is the power of emacs.

To enable melpa:

(require 'package) ;; You might already have this line
(let* ((no-ssl (and (memq system-type '(windows-nt ms-dos))
(not (gnutls-available-p))))
(url (concat (if no-ssl "http" "https") "://melpa.org/packages/")))
(add-to-list 'package-archives (cons "melpa" url) t))

Then restart emacs, type M-x(Meta is Alt on windows) to enter command. package-list-packages show lots of packages, C-s to search the package. Currently I have installed 5:

  1. evil, vim key sequence
  2. helm, code completion
  3. wakatime-mode, time tracking
  4. solarized-theme, color theme
  5. nyan-mode, funny stuff

The full init.el look like this:

(require 'package) ;; You might already have this line
(let* ((no-ssl (and (memq system-type '(windows-nt ms-dos))
                    (not (gnutls-available-p))))
       (url (concat (if no-ssl "http" "https") "://melpa.org/packages/")))
  (add-to-list 'package-archives (cons "melpa" url) t))
(package-initialize) ;; You might already have this line

(require 'wakatime-mode)
(require 'evil)
(require 'solarized-theme)
(require 'nyan-mode)
(require 'helm)

;; basics
(menu-bar-mode -1)
(toggle-scroll-bar -1)
(tool-bar-mode -1)
(set-default-font "consolas 9")
(setq inhibit-startup-screen t)
(load-theme 'solarized-dark t)
(global-linum-mode t)
(nyan-mode t)
(evil-mode t)

;; wakatime
(setq wakatime-api-key KEY)
(setq wakatime-cli-path PATH)
(global-wakatime-mode)

About delta

a lazy guy
This entry was posted in Miscellaneous and tagged . Bookmark the permalink.

Leave a comment