Skip to content

Instantly share code, notes, and snippets.

@minimal
Created February 2, 2010 11:25
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 minimal/292589 to your computer and use it in GitHub Desktop.
Save minimal/292589 to your computer and use it in GitHub Desktop.
Emacs notes
selecting:
C-space start/stop mark mode
C-return select rectangle
esc C-\ indent region
ido mode:
C-f stops autocompletion so you can create a new file
paredit:
C-u del force delete
paredit-copy-as-kill copy s-expr
clojure-box:
easy way to make external libs work is to put them in "Clojure Box/lib"
view class path: (System/getProperty "java.class.path")
to load a file with a name space into the repl:
C-c C-k (compile and load file)
(ns mynamespace) (from repl)
http://learnclojure.blogspot.com/2009/12/favourite-keys-for-emacs-and-slime.html
"slime-
redirect-inferior-output". With that all stdout ends up in the repl
buffer.
macros:
C-x, ( start rec macro
C-x, ) stop rec macro
C-x, e execute macro
C-5 C-x e execute macro 5 times
C-x C-k r execute macro on region # end mark (C-space) first to stop from deleting selection
commenting:
M-; indent-for-comment # end of line comment do what I mean
Komodo Notes
C-e go to end of word
C-k, ( start rec macro
C-k, ) stop rec macro
C-k, _ execute last macro
Zsh notes
http://zshwiki.org/home/
pager:
put < sign before file
globbing:
brackets after glob to filter by a property
ls -ls *txt(U:chris) # filter for txt files owned by chris
ls -ls *txt(^U:chris) # filter for txt files not owned by chris
ls *(m0) # files modified today. m-1 last 24h
ls -la *(om) # order by mod date
ls -la *(om[1]) # last modified file
man zshexpn | less -p Qualifier
Other
# execute the last command with sudo
$ sudo !!
# start a Python HTTP server with webshare
$ alias webshare='python -c "import SimpleHTTPServer;SimpleHTTPServer.test()"'
$ webshare
less -p pattern # start at pattern match
/ forward search
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment