Skip to content

Instantly share code, notes, and snippets.

@pao
Last active November 16, 2016 11:09
Show Gist options
  • Save pao/59397a9892fc58dc0f5d to your computer and use it in GitHub Desktop.
Save pao/59397a9892fc58dc0f5d to your computer and use it in GitHub Desktop.
One of my config.el files...
(setq w32-get-true-file-attributes nil)
(add-to-list 'load-path
(concat user-emacs-directory
(convert-standard-filename "personal/modules")))
(prelude-require-packages
'(nyan-mode
ag
clang-format
erc-image
git-gutter-fringe+
helm-dash
helm-projectile
julia-mode
magit-svn
markdown-mode
protobuf-mode
sr-speedbar
tup-mode))
(setq prelude-guru nil)
(setq prelude-flyspell nil)
(defun disable-smartparens-strict-hook ()
(smartparens-strict-mode -1))
(setq prelude-lisp-coding-hook 'disable-smartparens-strict-hook)
(setq prelude-interactive-lisp-coding-hook 'disable-smartparens-strict-hook)
(add-to-list 'auto-mode-alist '("SConstruct" . python-mode))
(add-to-list 'auto-mode-alist '("SConscript" . python-mode))
(add-to-list 'auto-mode-alist '("\\.m$" . octave-mode))
(defun my-octave-mode-hook ()
(setq octave-block-offset 4)
(setq octave-continuation-string "...")
(setq octave-auto-indent 't))
(add-hook 'octave-mode-hook 'my-octave-mode-hook)
(defun my-c++-mode-hook ()
(setq c-basic-offset 4)
(setq indent-tabs-mode nil)
(c-set-offset 'substatement-open 0)
(c-set-offset 'innamespace 0))
(add-hook 'c++-mode-hook 'my-c++-mode-hook)
(add-to-list 'auto-mode-alist '("\\.h$" . c++-mode))
(require 'magit-svn)
(add-hook 'magit-mode-hook 'magit-load-config-extensions)
(setq magit-diff-options '("-b"))
(setq tramp-default-method "pscp")
(defun cpp-highlight-if-0/1 ()
"Modify the face of text in between #if 0 ... #endif."
(interactive)
(setq cpp-known-face '(background-color . "dim gray"))
(setq cpp-unknown-face 'default)
(setq cpp-face-type 'dark)
(setq cpp-known-writable 't)
(setq cpp-unknown-writable 't)
(setq cpp-edit-list
'((#("1" 0 1
(fontified nil))
nil
(background-color . "dim gray")
both nil)
(#("0" 0 1
(fontified nil))
(background-color . "dim gray")
nil
both nil)))
(cpp-highlight-buffer t))
(defun custom-c-mode-hook ()
(cpp-highlight-if-0/1)
(add-hook 'after-save-hook 'cpp-highlight-if-0/1 'append 'local))
(add-hook 'c-mode-common-hook 'custom-c-mode-hook)
(defun c-doc-hook ()
(interactive)
(setq-local helm-dash-docsets '("C" "C++" "OpenCV_C" "OpenCV_C++")))
(add-hook 'c-mode-common-hook 'c-doc-hook)
(defun emacs-doc-hook ()
(interactive)
(setq-local helm-dash-docsets '("Emacs_Lisp")))
(add-hook 'emacs-lisp-mode-hook 'emacs-doc-hook)
(setq default-input-method "TeX")
(nyan-mode t)
(setq nyan-wavy-trail t)
(scroll-bar-mode -1)
(global-set-key (kbd "C-c h") 'helm-command-prefix)
(setq helm-dash-docsets-path "~/AppData/Local/zeal/docsets")
(defun eww-split (url)
(interactive)
(select-window (split-window-below))
(eww url))
(setq helm-dash-browser-func 'eww-split)
(global-set-key (kbd "C-c h d") 'helm-dash-at-point)
(setq projectile-indexing-method 'alien)
(setq projectile-enable-caching t)
(require 'projectile-speedbar)
(defalias 'speedbar 'sr-speedbar-toggle)
(global-set-key (kbd "C-<tab>") 'sr-speedbar-toggle)
(make-variable-buffer-local 'erc-fill-column)
(add-hook 'window-configuration-change-hook
'(lambda ()
(save-excursion
(walk-windows
(lambda (w)
(let ((buffer (window-buffer w)))
(set-buffer buffer)
(when (eq major-mode 'erc-mode)
(setq erc-fill-column (- (window-width w) 2)))))))))
(setq erc-interpret-mirc-color nil)
;; (load-library "flycheck-julia")
(server-start)
;;; Uncomment the modules you'd like to use and restart Prelude afterwards
;; Emacs IRC client
(require 'prelude-erc)
(require 'prelude-ido) ;; Super charges Emacs completion for C-x C-f and more
(require 'prelude-helm) ;; Interface for narrowing and search
(require 'prelude-helm-everywhere) ;; Enable Helm everywhere
(require 'prelude-company)
;; (require 'prelude-key-chord) ;; Binds useful features to key combinations
;; (require 'prelude-mediawiki)
;; (require 'prelude-evil)
;;; Programming languages support
(require 'prelude-c)
;; (require 'prelude-clojure)
;; (require 'prelude-coffee)
;; (require 'prelude-common-lisp)
;; (require 'prelude-css)
(require 'prelude-emacs-lisp)
;; (require 'prelude-erlang)
;; (require 'prelude-go)
(require 'prelude-haskell)
(require 'prelude-js)
;; (require 'prelude-latex)
(require 'prelude-lisp)
;; (require 'prelude-ocaml)
(require 'prelude-org) ;; Org-mode helps you keep TODO lists, notes and more
(require 'prelude-perl)
(require 'prelude-python)
;; (require 'prelude-ruby)
;; (require 'prelude-scala)
(require 'prelude-scheme)
(require 'prelude-shell)
;; (require 'prelude-scss)
;; (require 'prelude-web) ;; Emacs mode for web templates
(require 'prelude-xml)
(require 'prelude-yaml)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment