Skip to content

Instantly share code, notes, and snippets.

@ukolka
Last active August 29, 2015 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ukolka/ff791d24dd38e25d899c to your computer and use it in GitHub Desktop.
Save ukolka/ff791d24dd38e25d899c to your computer and use it in GitHub Desktop.
Emacs24 config
(package-initialize)
;; Require a newline at the end of a file
(setq require-final-newline t)
;; Make mouse work in text mode
(require 'mouse)
(xterm-mouse-mode t)
(defun track-mouse (e))
(setq mouse-sel-mode t)
;; enforce 80 column rule in all source modes
(add-hook 'prog-mode-hook 'column-enforce-mode)
;; shifted arrow keys for window navigation
(windmove-default-keybindings)
;; Git gutter port from Sublime
(global-git-gutter-mode +1)
;; Depending on what system enable pbcopy or xclip
;; Integration with pbcopy
;; Get it at https://gist.github.com/daniel-nelson/1023272
;; (add-to-list 'load-path "~/.emacs.d/")
;; (require 'pbcopy)
;; (turn-on-pbcopy)
;; Integration with xclip
;;(xclip-mode 1)
;; to setup tabs
(setq c-basic-indent 4)
(setq tab-width 4)
(setq-default indent-tabs-mode nil)
;; enable column mode by default
(setq column-number-mode t)
(require 'package)
(add-to-list 'package-archives
'("melpa" . "http://melpa.milkbox.net/packages/") t)
;; Get it at https://github.com/gabrielelanaro/emacs-for-python
(add-to-list 'load-path "~/.emacs.d/emacs-for-python-master") ;; tell where to load the various files
(require 'epy-setup) ;; It will setup other loads, it is required!
(require 'epy-python) ;; If you want the python facilities [optional]
(require 'epy-completion) ;; If you want the autocompletion settings [optional]
(require 'epy-editing) ;; For configurations related to editing [optional]
(require 'epy-bindings) ;; For my suggested keybindings [optional]
(require 'epy-nose) ;; For nose integration
;; Get it at https://github.com/akaihola/flymake-python
(when (load "flymake" t)
(defun flymake-pylint-init ()
(let* ((temp-file (flymake-init-create-temp-buffer-copy
'flymake-create-temp-inplace))
(local-file (file-relative-name
temp-file
(file-name-directory buffer-file-name))))
(list "~/.emacs.d/pyflymake.py" (list local-file))))
;; check path
(add-to-list 'flymake-allowed-file-name-masks
'("\\.py\\'" flymake-pylint-init)))
;; activate flymake automatically
(add-hook 'find-file-hook 'flymake-find-file-hook)
;; kick ass autocomplete
(add-hook 'python-mode-hook 'jedi:setup)
(setq jedi:complete-on-dot t)
;; Pydoc info
(require 'pydoc-info)
;; PHP flymake
(require 'flymake-php)
(add-hook 'php-mode-hook 'flymake-php-load)
;; Replace default JS mode
(add-to-list 'auto-mode-alist (cons (rx ".js" eos) 'js2-mode))
;; JavaScript flymake
(require 'flymake-jslint)
;;(require 'flymake-jshint)
(add-hook 'js2-mode-hook 'flymake-jslint-load)
;;(add-hook 'js-mode-hook 'flymake-jshint-load)
;; http://blog.binchen.org/posts/why-emacs-is-better-editor.html
(add-hook 'js2-mode-hook 'js2-imenu-extras-mode)
;; Format current region as JSON
(defun json-format ()
(interactive)
(save-excursion
(shell-command-on-region (mark) (point) "python -m json.tool" (buffer-name) t)))
;; HTML Emmet
(require 'emmet-mode)
(add-hook 'sgml-mode-hook 'emmet-mode)
;; SASS
;; setup files ending in “.scss” to open in sass-mode
(add-to-list 'auto-mode-alist '("\\.scss\\'" . sass-mode))
;; Color theme
;; Get it at
(require 'color-theme)
(require 'color-theme-solarized)
(eval-after-load "color-theme"
'(progn
(color-theme-initialize)
(color-theme-solarized-dark)))
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(canlock-password "7fd04b4953a3bcb5e1dbdaee5d4e82144922db8c")
'(ecb-layout-window-sizes (quote (("left8" (ecb-directories-buffer-name 0.2 . 0.2564102564102564) (ecb-sources-buffer-name 0.2 . 0.20512820512820512) (ecb-methods-buffer-name 0.2 . 0.358974358974359) (ecb-history-buffer-name 0.2 . 0.1282051282051282)))))
'(ecb-options-version "2.40"))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment