Last active
December 20, 2015 12:39
-
-
Save prasoon2211/6133128 to your computer and use it in GitHub Desktop.
Emacs config
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(setq-default indent-tabs-mode nil) | |
(setq-default tab-width 4) | |
(setq indent-line-function 'insert-tab) | |
(mouse-wheel-mode t) | |
;; ========== Place Backup Files in Specific Directory ========== | |
;; Enable backup files. | |
(setq make-backup-files t) | |
;; Enable versioning with default values (keep five last versions, I think!) | |
(setq version-control t) | |
;; Save all backup file in this directory. | |
(setq backup-directory-alist (quote ((".*" . "~/.emacs_backups/")))) | |
;; Show line-number in the mode line | |
(line-number-mode 1) | |
;; Show column-number in the mode line | |
(column-number-mode 1) | |
(setq-default fill-column 79) | |
;; open with single window | |
(setq inhibit-startup-screen t) | |
(add-hook 'emacs-startup-hook 'delete-other-windows) | |
(if window-system | |
(tool-bar-mode -1) | |
) | |
(menu-bar-mode -1) | |
(add-to-list 'custom-theme-load-path "~/.emacs.d/themes/") | |
(load-theme 'deeper-blue t) | |
(global-linum-mode t) | |
(setq-default show-trailing-whitespace t) | |
;; Shift the selected region right if distance is postive, left if | |
;; negative | |
(defun shift-region (distance) | |
(let ((mark (mark))) | |
(save-excursion | |
(indent-rigidly (region-beginning) (region-end) distance) | |
(push-mark mark t t) | |
;; Tell the command loop not to deactivate the mark | |
;; for transient mark mode | |
(setq deactivate-mark nil)))) | |
(defun shift-right (amount) | |
(interactive "sAmount: ") | |
(shift-region amount)) | |
(defun shift-left (amount) | |
(interactive "sAmount: ") | |
(shift-region (- amount))) | |
;; Bind (shift-right) and (shift-left) function to your favorite keys. I use | |
;; the following so that Ctrl-Shift-Right Arrow moves selected text one | |
;; column to the right, Ctrl-Shift-Left Arrow moves selected text one | |
;; column to the left: | |
(global-set-key [C-S-right] 'shift-right) | |
(global-set-key [C-S-left] 'shift-left) | |
;; Auto enable IDO | |
(setq ido-enable-flex-matching t) | |
(setq ido-everywhere t) | |
(ido-mode 1) | |
;; Eabling packages | |
(when (>= emacs-major-version 24) | |
(require 'package) | |
(package-initialize) | |
(add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/") t) | |
) | |
;; Jedi Python autocomplete | |
(add-hook 'python-mode-hook 'jedi:setup) | |
(setq jedi:setup-keys t) ; optional | |
(setq jedi:complete-on-dot t) ; optional |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment