Skip to content

Instantly share code, notes, and snippets.

@wesleyit
Created December 7, 2015 17:16
Show Gist options
  • Save wesleyit/4188b2cd0da05ea9c798 to your computer and use it in GitHub Desktop.
Save wesleyit/4188b2cd0da05ea9c798 to your computer and use it in GitHub Desktop.
This is my emacs24 config file
;;; init.el --- Wesley's Emacs Config
;;
;; An Ex-VIMmer trying Emacs :-)
;;
;;; ---------------------------------
;; Here some packages I need
(setq package-list '(ssh-file-modes ssh-config-mode sass-mode salt-mode ruby-test-mode ruby-refactor ruby-end ruby-block rpm-spec-mode rainbow-identifiers rainbow-delimiters password-generator ox-twbs ox-ioslide ox-impress-js ox-gfm osx-plist org2jekyll org2blog org-webpage org-presie org-present org-magit org-bullets org-blog nasm-mode mvn-help mvn matlab-mode math-symbols markdown-mode magit-find-file lorem-ipsum kanban js3-mode js2-refactor js2-mode js2-highlight-vars jquery-doc jq-mode jekyll-modes haml-mode flycheck-css-colorguard flycheck feature-mode eruby-mode erlang ecukes dired-rainbow dired-details crontab-mode apache-mode))
;; Repositories
(setq package-archives '(
("gnu" . "http://elpa.gnu.org/packages/")
("marmalade" . "http://marmalade-repo.org/packages/")
("melpa" . "http://melpa.milkbox.net/packages/")))
(package-initialize)
;; fetch the list of packages available
(unless package-archive-contents
(package-refresh-contents))
;; install the missing packages
(dolist (package package-list)
(unless (package-installed-p package)
(package-install package)))
;; Hide splash-screen and startup-message
(setq inhibit-splash-screen t)
(setq inhibit-startup-message t)
;; Windows Layout: Full Screen and no Toolbars
(toggle-frame-fullscreen)
(menu-bar-mode 1)
(scroll-bar-mode 1)
(tool-bar-mode -1)
;; Enable Line numbers and Status Bar information
(global-linum-mode t)
(column-number-mode 1)
(display-time)
;; Windows Fonts and Theme
(load-theme 'manoj-dark)
(set-face-attribute 'default nil :family "Source Code Pro for Powerline" :height 160)
;; Changes all yes/no questions to y/n
(fset 'yes-or-no-p 'y-or-n-p)
;; Change the backups directory
(setq backup-directory-alist '(("." . "~/.emacs.d/backups")))
;; There are some local modules that I think they should
;; be on every buffer. In this section I declare them as global...
(define-globalized-minor-mode g-rainbow-mode rainbow-mode rainbow-mode)
(define-globalized-minor-mode g-electric-pair-mode electric-pair-mode electric-pair-mode)
(define-globalized-minor-mode g-show-paren-mode show-paren-mode show-paren-mode)
(define-globalized-minor-mode g-which-function-mode which-function-mode which-function-mode)
(define-globalized-minor-mode g-delete-selection-mode delete-selection-mode delete-selection-mode)
(define-globalized-minor-mode g-hl-line-mode hl-line-mode hl-line-mode)
;;... and here I call them to initialize with Emacs.
(g-rainbow-mode t) ;; colored named colors
(g-electric-pair-mode t) ;; autoclose quotes, braces, etc.
(g-show-paren-mode t) ;; highlight pairs of parenthesis
(g-which-function-mode t) ;; show in which function the cursor is in
(g-delete-selection-mode t) ;; delete or replace selected text
(g-hl-line-mode t) ;; highlight the current line
;; Autocomplete configuration
(ac-config-default)
(auto-complete-mode t)
(fset 'my-complete-file-name
(make-hippie-expand-function '(try-complete-file-name-partially
try-complete-file-name)))
(global-set-key "\M-/" 'my-complete-file-name)
(global-set-key "\M-\\" 'comint-dynamic-complete-filename)
;; We have autocomplete, now we want snippets :-)
(yas-global-mode t)
;; MODES CONFIG BEGIN
;; Now it is time to configure individual modes
;; MODES CONFIG END
;; Finally, let's load the custom module on all most used major modes
;; (add-hook 'after-init-hook 'my-settings-mode)
;; Opens my TODO list on startup
(find-file "~/Documents/Wesley_TODO.org")
;(provide 'init.el)
;;; init.el ends here
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment