Skip to content

Instantly share code, notes, and snippets.

@kapilt
Created April 23, 2017 12:18
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save kapilt/b74d5d988e4c39f717de5e2e7939f2d6 to your computer and use it in GitHub Desktop.
(require 'package) ;; You might already have this line
(add-to-list 'package-archives
'("melpa" . "https://melpa.org/packages/"))
(package-initialize) ;;
(global-font-lock-mode t)
(setq inhibit-startup-mesage t)
(setq make-backup-files nil)
(add-hook 'after-init-hook #'global-flycheck-mode)
(require 'yaml-mode)
(add-to-list 'auto-mode-alist '("\\.yml$" . yaml-mode))
(add-to-list 'auto-mode-alist '("\\.yaml" . yaml-mode))
(require 'yasnippet)
(yas-global-mode 1)
(add-to-list 'load-path "~/.emacs.d") ;; check path
;; don't show these in dired
;; Get dired to consider .pyc and .pyo files to be uninteresting
(add-hook 'dired-load-hook
(lambda ()
(load "dired-x")
))
(add-hook 'dired-mode-hook
(lambda ()
(setq dired-omit-files-p t)
(setq dired-omit-files (concat dired-omit-files "\\|^\\..+$"))
))
(load "dired")
(setq dired-omit-extensions (append '(".pyc" ".pyo")
dired-omit-extensions))
(add-hook 'python-mode-hook
'(lambda ()
(hc-toggle-highlight-trailing-whitespace)))
(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 "/usr/local/bin/flake8" (list local-file))))
;; check path
(add-to-list 'flymake-allowed-file-name-masks
'("\\.py\\'" flymake-pylint-init)))
(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.
'(column-number-mode t)
'(display-battery-mode t)
'(display-time-mode t))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment