Skip to content

Instantly share code, notes, and snippets.

@rredkovich
Last active June 14, 2016 07:33
Show Gist options
  • Save rredkovich/4b8bd423c2f027c638b5 to your computer and use it in GitHub Desktop.
Save rredkovich/4b8bd423c2f027c638b5 to your computer and use it in GitHub Desktop.
with elpy and OsX 10.11 El Capitan fix
(setq inhibit-startup-message t)
(tool-bar-mode -1)
(hl-line-mode )
(require 'package)
(push '("marmalade" . "http://marmalade-repo.org/packages/")
package-archives )
(push '("melpa" . "http://melpa.milkbox.net/packages/")
package-archives)
(package-initialize)
(elpy-enable)
(setq elpy-rpc-python-command "/usr/local/bin/python3")
(elpy-use-cpython "/usr/local/bin/python3")
(require 'evil)
(evil-mode 1)
;;(define-key evil-normal-state-map "M-x" 'execute-extended-command)
(global-set-key (kbd "M-x") 'execute-extended-command)
(eldoc-mode 1)
(require 'web-mode)
(add-to-list 'auto-mode-alist '("\\.html?\\'" . web-mode))
(add-to-list 'auto-mode-alist '("\\.tag\\'" . web-mode))
(setq global-flycheck-mode t)
(setq x-alt-keysym 'meta)
(add-hook 'after-init-hook 'global-company-mode)
(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.
'(custom-safe-themes
(quote
("40f6a7af0dfad67c0d4df2a1dd86175436d79fc69ea61614d668a635c2cd94ab" "bcc6775934c9adf5f3bd1f428326ce0dcd34d743a92df48c128e6438b815b44f" "222113f148cd70d99c44d84bf4e3a76795f001bd6cfd449b7ff27aeda65ffd78" "8db4b03b9ae654d4a57804286eb3e332725c84d7cdab38463cb6b97d5762ad26" "8aebf25556399b58091e533e455dd50a6a9cba958cc4ebb0aab175863c25b9a4" "a8245b7cc985a0610d71f9852e9f2767ad1b852c2bdea6f4aadc12cce9c4d6d0" default)))
'(safe-local-variable-values (quote ((encoding . utf-8)))))
(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.
)
;; colored cursor
(setq evil-emacs-state-cursor '("red" box))
(setq evil-normal-state-cursor '("green" box))
(setq evil-visual-state-cursor '("orange" box))
(setq evil-insert-state-cursor '("red" bar))
(setq evil-replace-state-cursor '("red" bar))
(setq evil-operator-state-cursor '("red" hollow))
;; python tools for emacs
;; anaconda for PEP8 and etc. stuff
;; company-anaconda for docs
;;(add-hook 'python-mode-hook 'eldoc-mode)
;;(eval-after-load 'company
;; '(push 'company-anaconda company-backends))
;;(add-hook 'python-mode-hook 'anaconda-mode)
;;(global-set-key "\t" 'company-complete-common)
;;Exit insert mode by pressing j and then j quickly
(setq key-chord-two-keys-delay 0.5)
(key-chord-define evil-insert-state-map "jj" 'evil-normal-state)
(key-chord-mode 1)
;; Custom fonts (doesn't work for some reason)
(add-to-list 'default-frame-alist '(font . "Anonymous Pro"))
;;(set-face-attribute 'default t :font "Anonymous Pro Regular")
;;(set-face-attribute 'default t :font "Monaco")
(set-face-attribute 'default nil :height 145)
;; 80 Column rule
(setq column-number-mode t)
(setq-default header-line-format
(list " " (make-string 79 ?-) "|"))
(require 'whitespace)
(setq whitespace-line-column '119)
(setq whitespace-style '(face empty tabs lines-tail trailing))
(setq whitespace-global-modes '(not yaml-mode web-mode))
(global-whitespace-mode t)
;;(load-theme 'misterioso)
;; JS config
(setq-default indent-tabs-mode nil)
;;(setq js-indent-level 2)
(defun set-exec-path-from-shell-PATH ()
(let ((path-from-shell (replace-regexp-in-string
"[ \t\n]*$"
""
(shell-command-to-string "$SHELL --login -i -c 'echo $PATH'"))))
(setenv "PATH" path-from-shell)
(setq exec-path (split-string path-from-shell path-separator))))
;;(when (and window-system (eq system-type 'darwin))
;; When started from Emacs.app or similar, ensure $PATH
;; is the same the user would see in Terminal.app
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment