Created
September 9, 2012 14:09
-
-
Save sanketsudake/3684557 to your computer and use it in GitHub Desktop.
My init.el
This file contains 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
;;@@Requirements | |
(add-to-list 'load-path "~/.emacs.d/plugins/") | |
(add-to-list 'load-path "~/.emacs.d/plugins/rinari/") | |
;;Ido-mode | |
;;********************************************************* | |
(require 'ido) | |
(ido-mode t) | |
;;********************************************************* | |
;;Turn on electric mode for me | |
;;********************************************************* | |
(electric-indent-mode t) ;Auto Indent Any Lang Code | |
(electric-pair-mode t) ;Auto Pair | |
(electric-layout-mode t) ;Set Layout For My Text | |
;;********************************************************* | |
;;Animate_emacs on startup | |
;;******************************************************* | |
(defconst animate-n-steps 10) | |
(defun emacs-reloaded () | |
(animate-string (concat ";; Initialization successful, welcome to " | |
(substring (emacs-version) 0 16) | |
".") | |
0 0) | |
(newline-and-indent) (newline-and-indent)) | |
(add-hook 'after-init-hook 'emacs-reloaded) | |
;;****************************************************************** | |
;;Auto-Complete Mode | |
;;********************************************************************** | |
(require 'auto-complete) | |
(global-auto-complete-mode t) | |
(add-to-list 'load-path "/var/lib/gems/1.9.1/gems/rcodetools-0.8.5.0/") | |
(require 'rcodetools) | |
(when (require 'auto-complete nil t) | |
(require 'auto-complete-css) | |
(require 'auto-complete-cpp) | |
(require 'auto-complete-ruby)) | |
(global-auto-complete-mode t) | |
(setq ac-auto-start 3) | |
(define-key ac-complete-mode-map "\S-s" 'ac-stop) | |
(set-default 'ac-sources '( | |
ac-source-abbrev | |
ac-source-words-in-buffer | |
ac-source-files-in-current-dir | |
ac-source-symbols | |
)) | |
(define-key ac-complete-mode-map "\C-n" 'ac-next) | |
(define-key ac-complete-mode-map "\C-p" 'ac-previous) | |
;;********************************************************************** | |
;;Mode-Compile | |
;;********************************************************************** | |
(autoload 'mode-compile "mode-compile" | |
"Command to compile current buffer file based on the major mode" t) | |
(global-set-key "\C-cc" 'mode-compile) | |
(autoload 'mode-compile-kill "mode-compile" | |
"Command to kill a compilation launched by `mode-compile'" t) | |
(global-set-key "\C-ck" 'mode-compile-kill) | |
;;********************************************************************** | |
;;Full-Screen | |
;;********************************************************************** | |
(defun switch-full-screen () | |
(interactive) | |
(shell-command "wmctrl -r :ACTIVE: -btoggle,maximized_vert,maximized_horz" )) | |
(global-set-key (kbd "<f11>") 'switch-full-screen) | |
;;********************************************************************** | |
;;Customize | |
;;********************************************************************** | |
(add-hook 'before-save-hook 'delete-trailing-whitespace) | |
(setq-default indent-tabs-mode nil) | |
(transient-mark-mode 1) | |
(setq-default fill-column 80) | |
(setq-default indicate-empty-line t) | |
(global-font-lock-mode t) | |
(mouse-wheel-mode t) | |
(show-paren-mode t) | |
(display-time-mode) | |
(global-auto-revert-mode 1) | |
(setq disable-command-hook nil) | |
(setq inhibit-startup-message t) | |
(global-hl-line-mode t) | |
(global-linum-mode t) | |
;;********************************************************************** | |
;;************************************************************ | |
;;Disable Arrow Keys | |
(global-set-key (kbd "<up>") 'disabled-key) | |
(global-set-key (kbd "<down>") 'disabled-key) | |
(global-set-key (kbd "<left>") 'disabled-key) | |
(global-set-key (kbd "<right>") 'disabled-key) | |
(global-set-key (kbd "<C-up>") 'disabled-key) | |
(global-set-key (kbd "<C-down>") 'disabled-key) | |
(global-set-key (kbd "<C-left>") 'disabled-key) | |
(global-set-key (kbd "<C-right>") 'disabled-key) | |
(global-set-key (kbd "<home>") 'disabled-key) | |
(global-set-key (kbd "<end>") 'disabled-key) | |
;;End of init.el | |
;;************************************************************ | |
(if (fboundp 'scroll-bar-mode) (scroll-bar-mode -1)) | |
(if (fboundp 'tool-bar-mode) (tool-bar-mode -1)) | |
(if (fboundp 'menu-bar-mode) (menu-bar-mode -1)) | |
;;************************************************************ | |
(global-set-key "\C-cl" 'org-store-link) | |
(global-set-key "\C-ca" 'org-agenda) | |
(global-set-key "\C-cb" 'org-iswitchb) | |
;;************************************************************ | |
(defun c-begin-comment-box() | |
"Insert the beginnig of a comment ,followed by a string of asteriks" | |
(interactive) | |
(insert | |
"/************************************************\n") | |
) | |
(defun c-end-comment-box() | |
"Insert a string of asteriks,followed by the end of a comment." | |
(interactive) | |
(insert | |
"************************************************/\n") | |
) | |
(put 'upcase-region 'disabled nil) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment