Skip to content

Instantly share code, notes, and snippets.

@prasoon2211
Created August 1, 2013 16:47
Show Gist options
  • Save prasoon2211/6133127 to your computer and use it in GitHub Desktop.
Save prasoon2211/6133127 to your computer and use it in GitHub Desktop.
(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:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment