Ever since I got back into using OrgMode full-time, I've been using Emacs every single minute of using a computer. In fact, these days, I can't even function without Emacs and OrgMode.
Naturally, it follows, that just like the days when I dived deep into Vim, I'm diving into Emacs these days.
I got interested in Emacs again because of BG's dotemacs, but to truly become familiar, I had to create my own configuration files. It was a great way to learn Emacs Lisp. I have breezed through the initial chapters of the Emacs Lisp Manual and after getting introduced to Clojure recently, Lisp and functional programming doesn't seem that alien any more.
This is how I got started - I created the following files under the
.emacs.d directory in my home directory, so it looked like this:
$HOME | \-> .emacs.d | \-> install.sh \-> Cask \-> init.elContents of the file
#!/bin/bash if [[ ! -e ~/.cask ]] then echo "Cloning Cask repo" git clone firstname.lastname@example.org:cask/cask.git ~/.cask fi if [[ $(grep "cask/bin" ~/.bash_profile) == "" ]] then echo "Adding \$HOME/.cask/bin to \$PATH in ~/.bash_profile" echo '' >> ~/.bash_profile echo "# Added by ~/.emacs.d/install.sh" >> ~/.bash_profile echo "export PATH=\$HOME/.cask/bin:\$PATH" >> ~/.bash_profile fi export PATH=$HOME/.cask/bin:$PATH cd ~/.emacs.d cask install # For Python / ELPY # Prerequisite: Install Python as per: # http://docs.python-guide.org/en/latest/#getting-started pip install --upgrade elpy flake8 rope jedi ipython
Contents of the file
Cask initially was (I've added more packages now, but this is the minimal list of packages that I would use, although ELPY is optional if you don't use Python):
(source "gnu" "http://elpa.gnu.org/packages/") (source "melpa" "http://melpa.milkbox.net/packages/") (source "marmalade" "http://marmalade-repo.org/packages/") (source "org" "http://orgmode.org/elpa/") (depends-on "ack-and-a-half") (depends-on "cask") (depends-on "elpy") (depends-on "exec-path-from-shell") (depends-on "flx-ido") (depends-on "magit") (depends-on "pallet") (depends-on "projectile") (depends-on "yasnippet") (depends-on "zenburn-theme")
;; /This/ file (~init.el~) that you are reading ;; should be in this folder (add-to-list 'load-path "~/.emacs.d/") ;; Package Manager ;; See ~Cask~ file for its configuration ;; https://github.com/cask/cask (require 'cask "~/.cask/cask.el") (cask-initialize) ;; Keeps ~Cask~ file in sync with the packages ;; that you install/uninstall via ~M-x list-packages~ ;; https://github.com/rdallasgray/pallet (require 'pallet) ;; Root directory (setq root-dir (file-name-directory (or (buffer-file-name) load-file-name))) ;; Theme ;; https://github.com/bbatsov/zenburn-emacs (load-theme 'zenburn t) (set-cursor-color "firebrick") ;; Font ;; https://www.mozilla.org/en-US/styleguide/products/firefox-os/typeface/#download-primary (set-frame-font "Fira Mono OT-14" nil t) ;; Don't show startup screen (setq inhibit-startup-screen t) ;; Show keystrokes (setq echo-keystrokes 0.02) ;; Path (require 'exec-path-from-shell) (when (memq window-system '(mac ns)) (exec-path-from-shell-initialize)) ;; Git (require 'magit) (eval-after-load 'magit (progn '(global-set-key (kbd "C-x g") 'magit-status))) ;; flx-ido completion system, recommended by Projectile (require 'flx-ido) (flx-ido-mode 1) ;; change it if you have a fast processor. (setq flx-ido-threshhold 1000) ;; Project management (require 'ack-and-a-half) (require 'projectile) (projectile-global-mode) ;; Snippets ;; https://github.com/capitaomorte/yasnippet (require 'yasnippet) (yas-load-directory (concat root-dir "snippets")) (yas-global-mode 1) ;; Python editing (require 'elpy) (elpy-enable) (elpy-use-ipython)
And that's it, a full-fledged Emacs setup is ready.
The best part is to play around with
M-x list-packages and browse around and decide which packages you want to try out and use, when you install a package, it automatically gets added to your
Cask file (that's what Pallet does), so you can convert this
.emacs.d folder into a Git repository and sync anywhere and have the same configuration available on multiple machines.
Getting back to Emacs after a decade has been so much fun.
@swaroopch did you try prelude or starter kit? I started with that and added customizations on my fork. Lotsa goodies in there.
@swaroopch all the best :) I tried emacs so many times but failed. Happy with VIM, I hope some day ll write A byte of emacs & I ll emacs den
@swaroopch i hope u got my thoughts :) will learn emacs when u will write A Byte of Emacs. Missed few words in last tweet ;)