Skip to content

Instantly share code, notes, and snippets.

@jl2
Last active December 4, 2018 18:30
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 jl2/1fee16883af47a9f2717a80ec6904782 to your computer and use it in GitHub Desktop.
Save jl2/1fee16883af47a9f2717a80ec6904782 to your computer and use it in GitHub Desktop.
customize-target-features.lisp
(setq default-frame-alist
'((width . 124)))
(add-to-list 'load-path "~/.emacs_stuff/")
(load "~/.emacs_stuff/my_functions")
(load "~/src/gtd/config")
(autoload 'gid "idutils" nil t)
;; Source: http://www.emacswiki.org/emacs-en/download/misc-cmds.el
(defun revert-buffer-no-confirm ()
"Revert buffer without confirmation."
(interactive)
(revert-buffer :ignore-auto :noconfirm))
;; (setq vc-handled-backends nil)
(setq vc-handled-backends '(Git))
(global-set-key "\C-\M-j" 'goto-line)
(global-set-key "\C-\M-c" 'comment-region)
(global-set-key "\C-\M-u" 'uncomment-region)
(global-set-key (kbd "s-b") 'w3m-browse-url)
(global-set-key (kbd "s-n") 'next-error)
(global-set-key (kbd "s-p") 'previous-error)
(global-set-key [f5] 'revert-buffer-no-confirm)
(global-set-key "\C-\M-p" 'replace-python-exp)
(global-set-key [backtab] 'decrease-left-margin)
(global-set-key [( control tab)] 'increase-left-margin)
(global-set-key [?\C-.] 'next-error)
(global-set-key [?\C-\,] '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-\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 meta _ )] 'eval-region)
(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 "\C-\M-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))))
(global-set-key (kbd "C-X C-d") 'org-todo)
(add-to-list 'auto-mode-alist '("\\.sls\\'" . yaml-mode))
;; Org mode
(global-set-key "\C-cl" 'org-store-link)
(global-set-key "\C-ca" 'org-agenda)
(global-set-key "\C-cc" 'org-capture)
(global-set-key "\C-cb" 'org-switchb)
(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)
;; Doesn't do anything because mouse-4 and mouse-5 are overridden above...
;; (setq mouse-wheel-scroll-amount '(1 ((shift) . 1))) ;; one line at a time
;; (setq mouse-wheel-progressive-speed nil) ;; don't accelerate scrolling
;; (setq mouse-wheel-follow-mouse 't) ;; scroll window under mouse
;; (setq scroll-step 1
;; scroll-conservatively 10000)
(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)
;; (setq browse-url-browser-function 'browse-url-generic
;; browse-url-generic-program "chromium")
(setq browse-url-browser-function 'browse-url-generic
browse-url-generic-program "/home/jeremiah/src/lisp/next/source/next-gtk")
(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.
'(ansi-color-names-vector
["#212526" "#ff4b4b" "#b4fa70" "#fce94f" "#729fcf" "#e090d7" "#8cc4ff" "#eeeeec"])
'(backup-directory-alist '((".*" . "~/.backups")))
'(c-default-style
'((c-mode . "k&r")
(c++-mode . "java")
(java-mode . "java")
(awk-mode . "awk")
(other . "gnu")))
'(c-hanging-braces-alist
'((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
'((substatement-open . 0)
(substatement-open . 0)
(access-label . -)
(statement-case-open . 0)))
'(column-number-mode t)
'(compilation-scroll-output t)
'(compilation-window-height 50)
'(custom-enabled-themes '(farmhouse-dark))
'(custom-safe-themes
'("cdd26fa6a8c6706c9009db659d2dffd7f4b0350f9cc94e5df657fa295fffec71" "d8dc153c58354d612b2576fea87fe676a3a5d43bcc71170c62ddde4a1ad9e1fb" "eafda598b275a9d68cc1fbe1689925f503cab719ee16be23b10a9f2cc5872069" "32cafb607e5ae3bcdbdf5c20e935e0b9e78f80a804daf7656f10b6e4b3bc4d88" default))
'(describe-char-unidata-list
'(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))
'(diary-file "~/src/gtd/diary")
'(erc-fill-column 132)
'(erc-nick "jlarocco")
'(fill-column 120)
'(font-lock-maximum-size nil)
'(grep-command "grep -i -n -e ")
'(grep-window-height 50)
'(haskell-mode-hook
'(turn-on-haskell-doc turn-on-haskell-indent turn-on-haskell-indentation))
'(horizontal-scroll-bar-mode nil)
'(menu-bar-mode nil)
'(org-agenda-files
'("~/src/gtd/inbox.org" "~/src/gtd/gtd.org" "~/src/gtd/tickler.org") t)
'(org-babel-load-languages '((emacs-lisp . t) (shell . t) (lisp . t) (python . t)) t)
'(org-capture-templates
'(("t" "Todo [inbox]" entry
(file+headline "~/src/gtd/inbox.org" "Tasks")
"* TODO %i%? %t%")
("T" "Tickler" entry
(file+headline "~/src/gtd/tickler.org" "Tickler")
"* %i%?
%U")) t)
'(org-catch-invisible-edits 'smart t)
'(org-md-headline-style 'setext)
'(org-use-fast-todo-selection t t)
'(package-selected-packages
'(flycheck-pycheckers flycheck-pyflakes elpy htmlize lua-mode abyss-theme w3m slime-docker dylan-mode julia-shell geiser gopher markdown-mode haskell-mode))
'(pos-tip-tab-width 4)
'(safe-local-variable-values
'((Package . CLIM-GUI)
(Package . URL)
(Readtable . GLISP)
(Encoding . utf-8)
(Package . RENDERER)
(Package . CLOSURE/CLIM-DEVICE)
(Package . CLIM-INTERNALS)
(Syntax . Common-Lisp)
(Lowercase . Yes)
(Base . 10)
(Package . CLIM-DEMO)
(Syntax . ANSI-Common-Lisp)))
'(scroll-bar-mode nil)
'(shell-file-name "zsh")
'(show-paren-mode t)
'(size-indication-mode t)
'(slime-enable-evaluate-in-emacs t)
'(tab-width 4)
'(temp-buffer-max-height 50)
'(tool-bar-mode nil)
'(transient-mark-mode nil)
'(use-file-dialog nil)
'(visible-cursor t)
'(which-func-modes t)
'(which-function-mode t)
'(x-stretch-cursor t))
(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)
(setq package-archives
'(("marmalade" . "http://marmalade-repo.org/packages/")
("melpa" . "http://melpa.milkbox.net/packages/")))
(set-frame-parameter (selected-frame) 'alpha '(20 50))
(add-to-list 'default-frame-alist '(alpha 85 50))
(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 "/usr/local/bin/sbcl --noinform --control-stack-size 4 --merge-core-pages")
;; (defvar quicklisp-path (expand-file-name "~/quicklisp"))
;; (load (concat quicklisp-path "/slime-helper"))
(add-to-list 'load-path "~/src/lisp/slime")
(require 'slime-autoloads)
(setf slime-lisp-implementations
'((sbcl ("/usr/local/bin/sbcl" "--noinform --control-stack-size 4 --merge-core-pages") :coding-system utf-8-unix)
(ccl ("/home/jeremiah/oss_src/ccl/lx86cl64"))
(clisp ("/usr/bin/clisp"))))
(setq slime-default-lisp 'sbcl)
(slime-setup '(slime-fancy slime-mrepl slime-sprof slime-tramp))
(setq slime-net-coding-system 'utf-8-unix)
(setq slime-description-autofocus t)
(setf slime-scratch-file (expand-file-name "~/.slime-scratch.lisp"))
(setq erc-hide-list '("JOIN" "PART" "QUIT"))
(add-hook 'nim-mode-hook 'nimsuggest-mode)
(setq nimsuggest-path "/home/jeremiah/oss_src/Nim/bin/nimsuggest")
(add-hook 'prog-mode-hook 'flyspell-prog-mode)
(autoload 'run-prolog "prolog" "Start a Prolog sub-process." t)
(autoload 'prolog-mode "prolog" "Major mode for editing Prolog programs." t)
(add-to-list 'auto-mode-alist '("\\.pl\\'" . prolog-mode))
(server-start)
(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.
)
;; This org setup is copied from
;; https://emacs.cafe/emacs/orgmode/gtd/2017/06/30/orgmode-gtd.html
(setq org-todo-keywords '((sequence "TODO(t)" "WAITING(w)" "|" "DONE(d)" "CANCELLED(c)")))
(setq org-agenda-files
'("~/src/gtd/inbox.org" "~/src/gtd/gtd.org" "~/src/gtd/tickler.org"))
(setq org-babel-load-languages '((emacs-lisp . t) (shell . t) (lisp . t) (python . t)))
(setq org-catch-invisible-edits 'smart)
(setq org-use-fast-todo-selection t)
(setq org-capture-templates '(("t" "Todo [inbox]" entry
(file+headline "~/src/gtd/inbox.org" "Tasks")
"* TODO %i%?")
("T" "Tickler" entry
(file+headline "~/src/gtd/tickler.org" "Tickler")
"* %i%? \n %U")))
(setq org-refile-targets '(("~/src/gtd/gtd.org" :maxlevel . 3)
("~/src/gtd/someday.org" :level . 1)
("~/src/gtd/tickler.org" :maxlevel . 2)))
(setq org-todo-keywords '((sequence "TODO(t)" "WAITING(w)" "|" "DONE(d)" "CANCELLED(c)")))
(setq org-agenda-custom-commands
'(("o" "At the office" tags-todo "@office"
((org-agenda-overriding-header "Office")))))
(defun my-org-agenda-skip-all-siblings-but-first ()
"Skip all but the first non-done entry."
(let (should-skip-entry)
(unless (org-current-is-todo)
(setq should-skip-entry t))
(save-excursion
(while (and (not should-skip-entry) (org-goto-sibling t))
(when (org-current-is-todo)
(setq should-skip-entry t))))
(when should-skip-entry
(or (outline-next-heading)
(goto-char (point-max))))))
(defun org-current-is-todo ()
(string= "TODO" (org-get-todo-state)))
;; -*- mode: Lisp; fill-column: 75; comment-column: 50; -*-
;;(declaim (optimize (speed 3) (safety 1) (debug 1)))
#-quicklisp
(let ((quicklisp-init "/home/tst-jlarocco/quicklisp/setup.lisp"))
(when (probe-file quicklisp-init)
(load quicklisp-init)))
(ql:quickload '( :alexandria :uiop :quickproject))
(setf *read-default-float-format* 'double-float)
(ql:quickload :swank)
(when (find "--server" sb-ext:*posix-argv* :test #'string=)
(setf swank:*use-dedicated-output-stream* nil)
(setf swank:*communication-style* :fd-handler)
(swank:create-server :port 4005 :dont-close t))
;;-*-lisp-*-
(defparameter *exec-keys*
'(;; ("XF86Sleep" . "i3lock -d -t -i /home/jeremiah/bgs/seamless_flower.png")
;; ("XF86Eject" . "i3lock -d -t -i /home/jeremiah/bgs/seamless_flower.png")
("XF86Sleep" . "/home/jeremiah/bin/lock_screen")
("XF86Eject" . "/home/jeremiah/bin/lock_screen")
("XF86AudioPlay" . "clementine --play-pause")
("XF86AudioNext" . "clementine --next")
("XF86AudioPrev" . "clementine --prev")
("XF86AudioStop" . "clementine --stop")
("XF86AudioMute" . "amixer set Master 1+ toggle")
("XF86AudioLowerVolume" . "/usr/bin/amixer set Master,0 4-")
("XF86AudioRaiseVolume" . "/usr/bin/amixer set Master,0 4+")
("XF86LaunchA" . "/home/jeremiah/bin/term")))
(dolist (kc *exec-keys*)
(stumpwm:define-key stumpwm:*top-map* (stumpwm:kbd (car kc)) (format nil "exec ~a" (cdr kc) ) ))
(defparameter *other-keys*
'(("XF86Tools" . "windowlist")
("XF86Launch5" . "vsplit")
("XF86Launch6" . "hsplit")
("XF86Launch7" . "jl-remove-prev-split")
("XF86Launch8" . "jl-remove-next-split")))
(dolist (kc *other-keys*)
(stumpwm:define-key stumpwm:*top-map* (stumpwm:kbd (car kc)) (cdr kc)))
(run-shell-command "xsetroot -cursor_name left_ptr -solid black -name root-window")
(run-shell-command "feh --bg-scale /home/jeremiah/bgs/seamless_flower.png")
(run-shell-command "xmodmap ~/.xmodmap")
(run-shell-command "xset r rate 200 30")
(run-shell-command "numlockx on")
(setf *mode-line-timeout* 1)
(setf *window-format* "%m%n%s%c")
(setf *mouse-focus-policy* :click)
(setf (uiop:getenv "GDK_CORE_DEVICE_EVENTS") "1")
(setf (uiop:getenv "LD_LIBRARY_PATH") "/usr/local/3delight-1.2.5/Linux-x86_64/lib/")
(setf *screen-mode-line-format*
(list "[^B%n^b] %W^>"
" | %d"))
(toggle-mode-line (current-screen)
(current-head))
(require 'swank)
(swank:create-server :port 4567 :style swank:*communication-style* :dont-close t)
export LS_COLORS='di=33'
unset SBCL_HOME
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 ../.."
source /usr/local/3delight-1.2.5/.3delight_bash
export PATH=~/bin:~/oss_src/Nim/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/3delight-1.2.5/Linux-x86_64/lib/
export TEMP=/tmp
HISTFILE=~/.histfile
HISTSIZE=1000000
SAVEHIST=1000000
export PAGER=less
alias more=less
unsetopt beep
bindkey -e
LESS="-X"
export LESS
zstyle :compinstall filename '/home/jeremiah/.zshrc'
autoload -U colors && colors
export ALTERNATE_EDITOR=emacs
export PROMPT="%{$fg_bold[magenta]%}%D%{$reset_color%} %{$fg_bold[yellow]%}%*%{$reset_color%} %? %{$fg_bold[yellow]%} %~ %{$reset_color%} > "
export RPROMPT=
export EDITOR=emacsclient
export VISUAL=emacsclient
export BROWSER=google-chrome
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}'
unset GNOME_KEYRING_CONTROL
unset GNOME_KEYRING_PID
unset SBCL_HOME
(lambda (list)
(flet ((enable (x) (pushnew x list))
(disable (x) (setf list (remove x list))))
(mapcar #'enable
'(:sb-show-assem
:immobile-space
:compact-instance-header
:sb-thread
:sb-futex
:sb-xref-for-internals
))
list))
#!/bin/sh
exec /usr/bin/urxvt -fn "xft:Andale Mono:pixelsize=12.5" -rv -tr -sh 10 -blr 4x4 -e tmux -2 attach
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment