The intention to try Emacs is its orgmode, and this is a very basic setup so far.
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:
evil
, vim key sequencehelm
, code completionwakatime-mode
, time trackingsolarized-theme
, color themenyan-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)