Skip to content

Instantly share code, notes, and snippets.

@jl2
Last active March 9, 2017 20:46
Show Gist options
  • Select an option

  • Save jl2/576a2b90f221fc7df3d93e1bc24ef1f9 to your computer and use it in GitHub Desktop.

Select an option

Save jl2/576a2b90f221fc7df3d93e1bc24ef1f9 to your computer and use it in GitHub Desktop.
;; (setq default-frame-alist
;; '((width . 120) (height . 36)
;; (cursor-color . "red")
;; (cursor-type . box)
;; (foreground-color . "gray90")
;; (background-color . "black")
;; (alpha . 50)))
(add-to-list 'load-path "~/.emacs_stuff/")
(load "~/.emacs_stuff/my_functions")
(load "~/.emacs_stuff/sf_functions")
(load "~/.emacs_stuff/nim-mode.elc")
(autoload 'gid "idutils" nil t)
(setq w3m-use-cookies t)
(setq browse-url-browser-function 'browse-url-generic
browse-url-generic-program "browser")
;; (setq browse-url-browser-function 'w3m-browse-url)
(autoload 'w3m-browse-url "w3m" "Ask a WWW browser to show a URL." t)
;; (setq vc-handled-backends nil)
(setq vc-handled-backends '(Hg Git))
(global-set-key [?\M-\C-j] 'goto-line)
(global-set-key [?\M-c] 'comment-region)
(global-set-key [?\M-\C-u] 'uncomment-region)
(global-set-key [f5] 'revert-buffer)
(global-set-key [f12] 'w3m-browse-url)
(global-set-key [?\M-\C-p] 'replace-python-exp)
(global-set-key [backtab] 'decrease-left-margin)
(global-set-key [( control tab)] 'increase-left-margin)
(global-set-key [?\M-.] 'next-error)
(global-set-key [?\M-\,] 'previous-error)
(global-set-key [?\C-\'] 'dabbrev-expand)
(global-set-key [mouse-4] 'scroll-down-3)
(global-set-key [mouse-5] 'scroll-up-3)
;; (global-set-key [?\M-\C-=] 'recompile)
(global-set-key [?\M-=] 'recompile)
(global-set-key [?\M-\C-+] 'compile)
(global-set-key [?\C-\]] 'match-paren)
(global-set-key [( control x) (p)] 'previous-multiframe-window)
(global-set-key [f7] 'toggle-kbd-macro-recording-on)
(global-set-key [f8] 'call-last-kbd-macro)
(global-set-key [( control _ )] 'undo)
(global-set-key [( control \) )] 'find-char)
(global-set-key [( control \( )] 'find-char-backward)
(global-set-key [( control meta \) )] 'find-char-before)
(global-set-key [( control meta \( )] 'find-char-backward-after)
(global-set-key [(control f9)] 'af-bookmark-toggle )
(global-set-key [f9] 'af-bookmark-cycle-forward )
(global-set-key [(shift f9)] 'af-bookmark-cycle-reverse )
(global-set-key [(control shift f9)] 'af-bookmark-clear-all )
(global-set-key [( meta z )] 'toggle-fullscreen)
(global-set-key (kbd "C-M-SPC") 'my-select-current-word)
(global-set-key [( control meta { )] 'eval-and-replace)
(global-set-key [( meta f12 )] 'sf-run-unit-test)
(global-set-key [( XF86AudioPlay )] 'sf-run-this-unit-test)
(global-set-key [( XF86AudioNext )] 'sf-debug-this-unit-test)
(global-set-key [?\M-\C-g] 'ddg-search)
(global-set-key [f6] 'ddg-search-region)
(global-set-key [( meta super q)] 'toggle-frame-maximized)
(global-set-key (kbd "C-x C-b") 'ibuffer)
(global-set-key (kbd "M-l") (lambda () (interactive) (insert (make-char 'greek-iso8859-7 107))))
(add-to-list 'auto-mode-alist '("\\.sls\\'" . yaml-mode))
(defun jl2-new-vertical-window-and-go-to-it ()
"Create a new vertical window and go to it."
(interactive)
(split-window-vertically)
(other-window 1))
(defun jl2-new-horizontal-window-and-go-to-it ()
"Create a new horizontal window and go to it."
(interactive)
(split-window-horizontally)
(other-window 1))
(setq split-window-keep-point 't)
(global-set-key [( control x ) ( 2 )] 'jl2-new-vertical-window-and-go-to-it)
;; (global-set-key [( control x ) ( 3 )] 'jl2-new-horizontal-window-and-go-to-it)
(defun isearch-yank-symbol-forward ()
"Put symbol at current point into search string."
(interactive)
(let ((sym (find-tag-default)))
(message sym)
(word-search-forward sym)))
(defun isearch-yank-symbol-backward ()
"Put symbol at current point into search string."
(interactive)
(let ((sym (find-tag-default)))
(message sym)
(word-search-backward sym)))
(global-set-key [(control =)] 'isearch-yank-symbol-forward)
(global-set-key [(control +)] 'isearch-yank-symbol-backward)
;; Turn off annoying splitting in Emacs 23.1
(setq split-width-threshold nil)
(setq split-height-threshold 15)
(put 'set-goal-column 'disabled nil)
(setq column-number-mode t)
(setq inhibit-startup-message t)
(setq inhibit-splash-screen t)
(setq compilation-window-height 50)
(setq grep-window-height 50)
(add-hook 'isearch-mode-end-hook 'my-goto-match-beginning)
(defun my-goto-match-beginning ()
(when (and isearch-forward isearch-other-end)
(goto-char isearch-other-end)))
(defadvice isearch-exit (after my-goto-match-beginning activate)
"Go to beginning of match."
(when (and isearch-forward isearch-other-end)
(goto-char isearch-other-end)))
;; ;; Added to use tabs instead of spaces
;; ;; Turn on tabs
(setq indent-tabs-mode nil)
(setq-default indent-tabs-mode nil)
;; (setq default-tab-width 4)
(setq tab-width 4) ; or any other preferred value
(defvaralias 'c-basic-offset 'tab-width)
(defvaralias 'cperl-indent-level 'tab-width)
(defvaralias 'js-indent-level 'tab-width)
(defun my-c-mode-hook ()
(c-set-offset 'topmost-intro '-))
(add-hook 'c-mode-hook 'my-c-mode-hook)
;; (dolist (mode '(c-mode-hook c++-mode-hook lisp-mode elisp-mode python-mode))
;; (add-hook mode (lambda () (flyspell-prog-mode))))
;; (setq browse-url-browser-function 'browse-url-generic
;; browse-url-generic-program "chromium-browser")
(put 'downcase-region 'disabled nil)
(put 'upcase-region 'disabled nil)
(fset 'yes-or-no-p 'y-or-n-p)
(defun in-directory ()
"Reads a directory name (using ido), then runs
execute-extended-command with default-directory in the given
directory."
(interactive)
(let ((default-directory
(ido-read-directory-name "In directory: "
nil nil t)))
(call-interactively 'execute-extended-command)))
(defvar *regions-highlighted* ())
(defun highlight-region ()
"Highlight the current region."
(interactive)
(let* ((rb (region-beginning))
(re (region-end))
(str (buffer-substring-no-properties rb re)))
(highlight-phrase str)
(setq *regions-highlighted* (cons str *regions-highlighted*))))
(defun unhighlight-all-regions ()
(interactive)
(dolist (region *regions-highlighted*)
(unhighlight-regexp region)))
(setq compile-command (concat "cd " (expand-file-name default-directory) " && ./scripts/dmake"))
(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.
'(backup-directory-alist (quote ((".*" . "~/.backups"))))
'(c-default-style
(quote
((c-mode . "k&r")
(c++-mode . "java")
(java-mode . "java")
(awk-mode . "awk")
(other . "gnu"))))
'(c-hanging-braces-alist
(quote
((block-open after)
(block-close . c-snug-do-while)
(statement-cont)
(substatement-open after)
(brace-list-open)
(brace-entry-open)
(extern-lang-open after)
(namespace-open after)
(module-open after)
(composition-open after)
(inexpr-class-open after)
(inexpr-class-close before)
(arglist-cont-nonempty))))
'(c-offsets-alist
(quote
((substatement-open . 0)
(substatement-open . 0)
(access-label . -)
(statement-case-open . 0))))
'(column-number-mode t)
'(compilation-scroll-output (quote first-error))
'(compilation-window-height 50)
'(custom-safe-themes
(quote
("1db337246ebc9c083be0d728f8d20913a0f46edc0a00277746ba411c149d7fe5" "f9574c9ede3f64d57b3aa9b9cef621d54e2e503f4d75d8613cbcc4ca1c962c21" "8db4b03b9ae654d4a57804286eb3e332725c84d7cdab38463cb6b97d5762ad26" "ace9f12e0c00f983068910d9025eefeb5ea7a711e774ee8bb2af5f7376018ad2" "eafda598b275a9d68cc1fbe1689925f503cab719ee16be23b10a9f2cc5872069" "32cafb607e5ae3bcdbdf5c20e935e0b9e78f80a804daf7656f10b6e4b3bc4d88" default)))
'(describe-char-unidata-list
(quote
(name old-name general-category canonical-combining-class bidi-class decomposition decimal-digit-value digit-value numeric-value mirrored iso-10646-comment uppercase lowercase titlecase)))
'(elfeed-feeds
(quote
("http://192.168.138.137:8080/job/dtest_jeremiah/rssFailed" "http://www.dpreview.com/feeds/articles" "http://blog.phaseone.com/feed/" "http://www.cambyte.com/" "http://xach.livejournal.com/data/atom" "http://lisptips.com/rss" "http://blog.practical-scheme.net/gauche?c=rss" "http://planet.lisp.org/rss20.xml" "http://planet.sbcl.org/rss20.xml" "http://lispblog.xach.com/rss" "http://malisper.me/feed/" "http://feeds.doughellmann.com/DougHellmann" "https://blogs.janestreet.com/category/ocaml/feed/" "http://planet.ocamlcore.org/atom.xml" "http://isocpp.org/blog/rss/category/news" "http://herbsutter.wordpress.com/feed/" "https://www.linkedin.com/pub/aya-maguire/a8/78/5bb" "http://awhan.wordpress.com/feed" "http://akrzemi1.wordpress.com/feed/" "http://scottmeyers.blogspot.com/feeds/posts/default?alt=rss" "http://feeds.feedburner.com/CppTruths" "http://blog.llvm.org/feeds/posts/default" "http://feeds.feedburner.com/SolarianProgrammer" "http://eli.thegreenplace.net/feed/" "http://static.wixstatic.com/media/1c89a1_8e5f400bb2784d8589ee142b4a896bdf.jpg_srz_p_600_621_75_22_0.50_1.20_0.00_jpg_srz" "n. Namely, plan9. It is still in many ways “for the teletype”, but" "http://ecx.images-amazon.com/images/I/31yDK1OPgML.jpg" "http://cpp-next.com/feed" "http://upload.wikimedia.org/wikipedia/commons/e/ef/IBM_2311_memory_unit.JPG" "his and he suggested something similar to what you said and I nudged him towards temporary code duplication to" "https://docs.google.com/viewer?a=v&pid=gmail&attid=0.1&thid=1449868843b09ffa&mt=application/pdf&authuser=0&url=https://mail.google.com/mail/u/0/%3fui=2&ik=7df0af9258&view=att&th=1449868843b09ffa&attid=0.1&disp=safe&realattid=f_hsdg9ili0&zw&sig=AHIEtbQIBQf7a1Q02bGSXN4v81n6j3CnzQ" "http://yapb-soc.blogspot.com/feeds/posts/default" "http://www.slashslash.info/feed/" "http://www.bfilipek.com/feeds/posts/default" "This was al" "http://github.com/blog.atom" "http://jsdelfino.blogspot.com/feeds/posts/default" "http://blog.golang.org/feeds/posts/default" "http://lambda-the-ultimate.org/rss.xml" "http://www.righto.com/feeds/posts/default" "http://bartoszmilewski.com/feed/" "http://pinboard.in/feed" "http://lwn.net/headlines/newrss" "http://feeds.feedburner.com/The-Goat" "http://arapahoebasin.blogspot.com/feeds/posts/default" "http://www.summitdaily.com/apps/pbcs.dll/section?Category=rss&Profile=1014&ExpNodes=1056&mime=xml" "http://www.freeheelgranola.com/feed" "http://303cycling.com/taxonomy/term/17/feed" "http://www.cxmagazine.com/feed" "http://theradavist.com/feed/" "http://feeds.feedburner.com/RetroThing" "http://blogs.opera.com/desktop/feed/")))
'(elfeed-initial-tags (quote (unread)))
'(fill-column 170)
'(font-lock-maximum-size nil)
'(grep-command "grep -i -n -e ")
'(grep-window-height 50)
'(haskell-mode-hook
(quote
(turn-on-haskell-doc turn-on-haskell-indent turn-on-haskell-indentation)))
'(horizontal-scroll-bar-mode nil)
'(menu-bar-mode nil)
'(package-selected-packages
(quote
(abyss-theme material-theme highlight-symbol rainbow-identifiers wanderlust excorporate elfeed yaml-mode w3m w3 vlf tuareg smart-tabs-mode smart-tab semi rust-mode rainbow-delimiters organic-green-theme magit leuven-theme haskell-mode fixme-mode ess ensime dylan-mode clippy cedit ample-zen-theme ack)))
'(pos-tip-tab-width 4)
'(scroll-bar-mode nil)
'(select-enable-clipboard t)
'(select-enable-primary t)
'(shell-file-name "zsh")
'(show-paren-mode t)
'(size-indication-mode t)
'(tab-width 4)
'(temp-buffer-max-height 50)
'(tool-bar-mode nil)
'(transient-mark-mode nil)
'(use-file-dialog nil)
'(visible-cursor t)
'(w3m-default-display-inline-images t)
'(which-func-modes t)
'(which-function-mode t)
'(x-stretch-cursor t))
(set-frame-font "-unknown-Ubuntu Mono-normal-normal-normal-*-15-*-*-*-m-0-iso10646-1")
(add-to-list 'auto-mode-alist '("\\.json" . javascript-mode))
(add-to-list 'auto-mode-alist '("\\.h" . c++-mode))
(add-to-list 'auto-mode-alist '("\\.ipp" . c++-mode))
(setq frame-title-format
'("Emacs - " (buffer-file-name "%f" (dired-directory dired-directory "%b"))))
(require 'package)
(package-initialize)
(add-to-list 'package-archives
'("marmalade" . "http://marmalade-repo.org/packages/") t)
(add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/") t)
(set-frame-parameter (selected-frame) 'alpha '(20 50))
(add-to-list 'default-frame-alist '(alpha 85 50))
(setq python-shell-interpreter "/usr/local/bin/python3.4")
(eval-when-compile (require 'cl))
(defun toggle-transparency ()
(interactive)
(if (/=
(cadr (frame-parameter nil 'alpha))
100)
(set-frame-parameter nil 'alpha '(100 100))
(set-frame-parameter nil 'alpha '(85 50))))
(global-set-key (kbd "C-c t") 'toggle-transparency)
(setq inferior-lisp-program "sbcl --noinform --control-stack-size 4 --merge-core-pages")
(setq slime-net-coding-system 'utf-8-unix)
(defvar quicklisp-path (expand-file-name "/~/quicklisp"))
(load (concat quicklisp-path "/slime-helper.elc"))
(slime-setup '(slime-fancy slime-mrepl slime-sprof slime-editing-commands))
(setf slime-scratch-file (expand-file-name "~/.slime-scratch.lisp"))
(eval-after-load "vc-hg"
'(defun vc-hg-annotate-command (file buffer &optional revision)
"Execute \"hg annotate\" on FILE, inserting the contents in BUFFER.
Optional arg REVISION is a revision to annotate from."
(vc-hg-command buffer 0 file "annotate" "-n" "-u" "--follow"
(when revision (concat "-r" revision)))))
;; (setq ibuffer-formats
;; '((mark modified read-only
;; ;; vc-status-mini " "
;; (name 18 18 :left :elide)
;; " "
;; (size 9 -1 :right)
;; " "
;; (mode 16 16 :left :elide)
;; " "
;; (vc-status 16 16 :left)
;; " "
;; filename-and-process)))
(setq erc-hide-list '("JOIN" "PART" "QUIT"))
(setq erc-log-channels-directory "~/.erc/logs/")
(setq erc-save-buffer-on-part t
erc-save-queries-on-quit t
erc-log-write-after-send t
erc-log-write-after-insert t)
(defun sf-cpp-setup ()
(c-set-offset 'innamespace 0))
(add-hook 'c++-mode-hook 'sf-cpp-setup)
(load-theme 'ample-zen t)
;; (load-theme 'material t)
(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.
)
(require 'ansi-color)
(defun colorize-compilation-buffer ()
(let ((inhibit-read-only t))
(ansi-color-apply-on-region (point-min) (point-max))))
(add-hook 'compilation-filter-hook 'colorize-compilation-buffer)
(add-hook 'prog-mode-hook #'highlight-symbol-mode)
(defun hn ()
(interactive)
(w3m-browse-url "https://news.ycombinator.com"))
(defun lobsters ()
(interactive)
(w3m-browse-url "https://lobste.rs"))
(require 'tramp)
(setq tramp-default-method "scp")
(setq slime-enable-evaluate-in-emacs t)
(server-start)
export LS_COLORS='di=33'
alias ls='ls --color=auto'
alias ll='ls -alF --color=auto'
alias la='ls -A --color=auto'
alias l='ls -CF --color=auto'
alias lsd='ls -d --color=auto */'
alias grep='grep -in --color=auto'
alias fgrep='fgrep -in --color=auto'
alias egrep='egrep -in --color=auto'
alias ..="cd .."
alias ...="cd ../.."
alias zkCli="rlwrap zkCli.sh"
export PATH=/usr/clang/bin:~/bin:$PATH
export IDPATH=/usr/include/ID
export TEMP=/tmp
HISTFILE=~/.histfile
HISTSIZE=10000
SAVEHIST=10000
setopt incappendhistory extendedhistory
export PAGER=less
alias more=less
unsetopt beep
bindkey -e
export LESS="-X -S -R"
zstyle :compinstall filename '/home/jeremiah/.zshrc'
autoload -U colors && colors
export PROMPT="%{$fg_bold[magenta]%}%D%{$reset_color%} %{$fg_bold[yellow]%}%*%{$reset_color%} %? %{$fg_bold[yellow]%} %~ %{$reset_color%} > "
export RPROMPT=
alias browse="/home/jeremiah/bin/browser"
export ALTERNATE_EDITOR=emacs
export EDITOR=emacsclient
export VISUAL=emacsclient
export BROWSER=/home/jeremiah/bin/browser
alias ec="emacsclient -n"
# Fix gdb silliness
alias gdb="gdb --data-directory=/usr/local/gdb-7.6.1-p1/python/gdb"
alias lisp="rlwrap lisp --noinform"
# Fix it for make gdbtest
export GDB_ARGS=--data-directory=/usr/local/gdb-7.6.1-p1/python/gdb
# export CXX=g++-4.8.1-p1
# export CXXFLAGS="--std=c++11 -Wall"
# export CC=gcc-4.8.1-p1
# export CFLAGS="--std=c11 -Wall"
export VERSIONIZE=0
export CHROME_DEVEL_SANDBOX=/home/jeremiah/oss/chrome-linux/chrome_sandbox
export PYTHONPATH=/home/jeremiah/solidfire/autotest2/jeremiah-autoplatform:/home/jeremiah/solidfire/autotest2/jeremiah-recorder-autotest-content:/home/jeremiah/solidfire/autotest2/jeremiah-recorder-autotest-content/steps
export KILN=https://solidfire.kilnhg.com/Code/Repositories/SolidFire
export CXX=g++-4.8.1-p1
export CC=gcc-4.8.1-p1
export BOOST_VERSION=1.57.0-p3
export CXX_VERSION=c++11
export CC_VERSION=c11
# export CC=clang
# export CXX=clang++
# export CXX1X="clang++ --std=c++11"
export BOOST_DIR=/usr/local/lib/boost
export LD_LIBRARY_PATH=$BOOST_DIR:/usr/local/lib/curl
setopt autopushd pushdignoredups
autoload -Uz compinit
compinit
zstyle ':completion:*' verbose yes
zstyle ':completion:*:descriptions' format '%B%d%b'
zstyle ':completion:*:messages' format '%d'
zstyle ':completion:*:warnings' format 'No matches for: %d'
zstyle ':completion:*' group-name ''
zstyle ":completion:*" matcher-list 'm:{A-Za-z}={a-zA-Z}'
#!/usr/bin/lisp --script
;;-*-lisp-*-
(declaim (optimize (speed 3) (safety 2) (debug 1)))
#-quicklisp
(let ((quicklisp-init (merge-pathnames "quicklisp/setup.lisp"
(user-homedir-pathname))))
(when (probe-file quicklisp-init)
(load quicklisp-init)))
(ql:update-dist "quicklisp")
(declaim (optimize (speed 3) (safety 2) (debug 1)))
(ql:quickload '(:alexandria
:st-json
:archive
:babel
:bordeaux-fft
:bordeaux-threads
:cl-cairo2
:cl-ppcre
:cl-spark
:cl-who
:closer-mop
:cxml
:cxml-stp
:closure-html
:drakma
:flexi-streams
:form-fiddle
:gzip-stream
:iterate
:lisp-unit
:local-time
:local-time-duration
:lparallel
:ltk
:postmodern
:purl
:split-sequence
:trivial-garbage
:trivial-indent
:trivial-main-thread
:trivial-ssh
:uiop
:usocket
:uuid
:swank
:quickproject
))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment