Browse files

some emacs and stuff

  • Loading branch information...
1 parent a8e7e42 commit 703d517dfd9e6132ad2e5ef151b6f351a93266b5 @myfreeweb committed May 24, 2012
Showing with 173 additions and 17 deletions.
  1. +1 −0 .gitignore
  2. +21 −0 .gitmodules
  3. +4 −1 ackrc
  4. +92 −0 emacs
  5. +1 −0 emacs.d/autopair
  6. +1 −0 emacs.d/clojure
  7. +1 −0 emacs.d/color-theme
  8. +1 −0 emacs.d/color-theme-solarized
  9. +1 −0 emacs.d/popwin
  10. +1 −0 emacs.d/smart-tab
  11. +1 −0 emacs.d/vimvars
  12. +3 −0 gitconfig
  13. +2 −0 install.sh
  14. +2 −2 offlineimaprc
  15. +39 −13 pythonrc.py
  16. +1 −1 vimrc
  17. +1 −0 zshrc
View
1 .gitignore
@@ -7,3 +7,4 @@ vim/tmp
weechat/weechat.log
weechat/logs
cache
+emacs.d/history
View
21 .gitmodules
@@ -193,3 +193,24 @@
[submodule "vim/bundle/splice"]
path = vim/bundle/splice
url = git://github.com/sjl/splice.vim.git
+[submodule "emacs.d/autopair"]
+ path = emacs.d/autopair
+ url = git://github.com/emacsmirror/autopair.git
+[submodule "emacs.d/popwin"]
+ path = emacs.d/popwin
+ url = git://github.com/m2ym/popwin-el.git
+[submodule "emacs.d/smart-tab"]
+ path = emacs.d/smart-tab
+ url = git://github.com/genehack/smart-tab.git
+[submodule "emacs.d/vimvars"]
+ path = emacs.d/vimvars
+ url = git://github.com/jamesyoungman/vimvars.git
+[submodule "emacs.d/color-theme"]
+ path = emacs.d/color-theme
+ url = git://github.com/haxney/color-theme.git
+[submodule "emacs.d/color-theme-solarized"]
+ path = emacs.d/color-theme-solarized
+ url = git://github.com/sellout/emacs-color-theme-solarized.git
+[submodule "emacs.d/clojure"]
+ path = emacs.d/clojure
+ url = git://github.com/technomancy/clojure-mode.git
View
5 ackrc
@@ -8,13 +8,16 @@
--ignore-dir=vendor
--ignore-dir=autodoc
--ignore-dir=doc
+--ignore-dir=docs
--ignore-dir=tmp
--ignore-dir=classes
--ignore-dir=migrations
--ignore-dir=coverage
--ignore-dir=.sass-cache
+--ignore-dir=build
+--ignore-dir=dist
--type-add=html=haml,jade,mustache,tpl,erb,slim
---type-add=css=sass,scss,less,styl,ccss,clevercss,
+--type-add=css=sass,scss,less,styl,ccss,clevercss
--type-add=js=coffee
--type-set=clojure=clj,cljs
--type-set=ronn=ronn,ron
View
92 emacs
@@ -0,0 +1,92 @@
+;;; This came from Greg V's dotfiles:
+;;; https://github.com/myfreeweb/dotfiles
+;;; Feel free to steal it, but attribution is nice
+
+(setq emacs-dir "~/.emacs.d")
+(add-to-list 'load-path emacs-dir)
+
+;;; Encoding, input
+(set-terminal-coding-system 'utf-8)
+(set-keyboard-coding-system 'utf-8)
+(prefer-coding-system 'utf-8)
+(set-language-environment "UTF-8")
+
+;;; General settings
+(fset 'yes-or-no-p 'y-or-n-p)
+(server-start t)
+(cua-mode t)
+(ido-mode t)
+(show-paren-mode t)
+(savehist-mode t)
+(recentf-mode t)
+(delete-selection-mode t)
+(toggle-truncate-lines -1)
+(auto-fill-mode -1)
+(when (functionp 'tooltip-mode)
+ (tooltip-mode -1))
+(when (functionp 'tool-bar-mode)
+ (tool-bar-mode -1))
+(if (featurep window-system)
+ (modify-frame-parameters nil '((wait-for-wm . nil)))
+ (menu-bar-mode -1))
+(if (featurep 'aquamacs) (one-buffer-one-frame-mode -1))
+
+(setq backup-directory-alist `((".*" . ,temporary-file-directory))
+ auto-save-file-name-transforms `((".*" ,temporary-file-directory t))
+ edit-server-new-frame nil
+ word-wrap nil
+ x-select-enable-clipboard t
+ confirm-nonexistent-file-or-buffer nil
+ delete-by-moving-to-trash t
+ next-line-add-newlines t
+ tooltip-use-echo-area t
+ vc-handled-backends '()
+ ido-create-new-buffer 'always
+ ido-enable-flex-matching t
+ ido-everywhere t
+ ido-ignore-buffers (append '(".*Completion" "*magit-process*" "*Pymacs*" "*Messages*") ido-ignore-buffers)
+ ido-ignore-extensions t
+ ido-confirm-unique-completion t
+ ido-max-directory-size 100500
+ ido-use-filename-at-point 'guess
+ kill-buffer-query-functions (remq 'process-kill-buffer-query-function
+ kill-buffer-query-functions)
+ redisplay-dont-pause t)
+(setq-default indent-tabs-mode nil
+ tab-width 4)
+
+;;; Aliases
+(defalias 'eb 'eval-buffer)
+(defalias 'er 'eval-region)
+(defalias 'qrr 'query-replace-regexp)
+(defalias 'ind 'indent-according-to-mode)
+(defalias 'lcs 'downcase-region)
+
+;;; Keyboard shortcuts
+(global-set-key (kbd "C-c C-f") 'find-grep-dired)
+(global-set-key (kbd "C-'") 'comment-or-uncomment-region)
+(global-set-key (kbd "C-k") 'kill-whole-line)
+
+;;; Plugins
+(add-to-list 'load-path (concat emacs-dir "/vimvars"))
+(require 'vimvars)
+(add-hook 'find-file-hook 'vimvars-obey-vim-modeline)
+
+(add-to-list 'load-path (concat emacs-dir "/smart-tab"))
+(require 'smart-tab)
+(global-smart-tab-mode t)
+
+(add-to-list 'load-path (concat emacs-dir "/popwin"))
+(require 'popwin)
+(setq display-buffer-function 'popwin:display-buffer)
+
+(add-to-list 'load-path (concat emacs-dir "/autopair"))
+(require 'autopair)
+(autopair-global-mode)
+
+(add-to-list 'load-path (concat emacs-dir "/color-theme"))
+(add-to-list 'load-path (concat emacs-dir "/color-theme-solarized"))
+(require 'color-theme)
+(require 'color-theme-solarized)
+(color-theme-initialize)
+(color-theme-solarized-light)
1 emacs.d/autopair
@@ -0,0 +1 @@
+Subproject commit c467d96a10c3503dea6d37f486eeea87e4912792
1 emacs.d/clojure
@@ -0,0 +1 @@
+Subproject commit 3e6b75607b49d03f49e947574a2c7e447731ff8a
1 emacs.d/color-theme
@@ -0,0 +1 @@
+Subproject commit e576b7263b9c96766f08e358e552eec29b6059ab
1 emacs.d/color-theme-solarized
@@ -0,0 +1 @@
+Subproject commit d929ae829ecf142927342445c8cf31d7682fe41a
1 emacs.d/popwin
@@ -0,0 +1 @@
+Subproject commit 9cc195dff283bcc72d8cd92db824c73a92f4afe1
1 emacs.d/smart-tab
@@ -0,0 +1 @@
+Subproject commit 4bd09377e201e72b980264a57719ad325b482f52
1 emacs.d/vimvars
@@ -0,0 +1 @@
+Subproject commit 1a3fa6acfc8575919dd9be82e8370767faed6b0e
View
3 gitconfig
@@ -13,6 +13,7 @@
legacyheaders = false
quotepath = false
pager = $PAGER
+ trustctime = false
[repack]
usedeltabaseoffset = true
[apply]
@@ -48,6 +49,7 @@
# common verbs: [c]reate, [l]ist, [d]iff, [r]eset/[r]emove
# [b]ranch
bc = checkout -b
+ bce = checkout --orphan
bl = branch --verbose
bm = merge
bmt = mergetool
@@ -63,6 +65,7 @@
cl = !git log --decorate --graph --abbrev-commit --date=relative --pretty='tformat:%C(yellow)%h%Creset}%Cgreen(%ar)%Creset}%C(bold blue)<%an>%Creset}%C(red)%d%Creset %s' $* | sed -Ee 's/(^[^<]*) ago)/\\1)/' | sed -Ee 's/(^[^<]*), [[:digit:]]+ .*months?)/\\1)/' | column -t -s '}' | less -FXRS
cp = cherry-pick -x
cr = reset --hard HEAD^
+ cs = show
# [f]ile
fa = add
faa = !git add --all && git ws
View
2 install.sh
@@ -22,6 +22,8 @@ link tmux.conf
link vim
link vimrc
link gvimrc
+link emacs
+link emacs.d
link inputrc
link nethackrc
link pentadactylrc
View
4 offlineimaprc
@@ -24,6 +24,7 @@ remoterepository = WM-Remote
[Repository WM-Local]
type = Maildir
localfolders = ~/Mail/WM
+nametrans = lambda f: f if f == 'INBOX' else 'INBOX.' + f
[Repository WM-Remote]
type = IMAP
@@ -32,8 +33,7 @@ remotehost = mail.wm.ru
remoteuser = greg@wm.ru
remoteport = 993
realdelete = no
-nametrans = lambda f: re.sub('^INBOX$', 'INBOX',
- re.sub('^INBOX\.', '', f))
+nametrans = lambda f: re.sub('^INBOX$', 'INBOX', re.sub('^INBOX\.', '', f))
[Account iCloud]
postsynchook = notmuch new
View
52 pythonrc.py
@@ -6,35 +6,61 @@
# https://github.com/zacharyvoase/dotfiles/blob/master/pythonrc
# https://github.com/sontek/dotfiles/blob/master/_pythonrc.py
# http://brianlyttle.com/2011/10/python-interpreter-tab-completion-on-os-x/
+# http://stackoverflow.com/questions/7116038/python-tab-completion-mac-osx-10-7-lion
+import rlcompleter
+import subprocess
+import readline
import inspect
+import atexit
import sys
import os
home = os.environ["HOME"]
+try:
+ from see import see
+except ImportError:
+ print >>sys.stderr, "Please pip install see"
+
+def src(obj):
+ def highlight(source):
+ try:
+ import pygments
+ import pygments.formatters
+ import pygments.lexers
+ except ImportError:
+ return source
+ lexer = pygments.lexers.get_lexer_by_name('python')
+ formatter = pygments.formatters.terminal.TerminalFormatter()
+ return pygments.highlight(source, lexer, formatter)
+ source = inspect.getsource(obj)
+ pager = subprocess.Popen(['less', '-R'], stdin=subprocess.PIPE)
+ pager.communicate(highlight(source))
+ pager.wait()
+
if not "bpython" in os.environ["_"]:
try:
- import rlcompleter
- import readline
+ class TabCompleter(rlcompleter.Completer):
+ """Completer that supports indenting"""
+ def complete(self, text, state):
+ if not text:
+ return (' ', None)[state]
+ else:
+ return rlcompleter.Completer.complete(self, text, state)
+ readline.set_completer(TabCompleter().complete)
readline.set_history_length(1000)
- readline.parse_and_bind(open("%s/.inputrc" % home).read())
- if sys.platform == "darwin":
- readline.parse_and_bind("bind ^I rl_complete")
- # screw you, libedit
+ if 'libedit' in readline.__doc__:
+ readline.parse_and_bind("bind '\t' rl_complete")
+ else:
+ readline.parse_and_bind(open("%s/.inputrc" % home).read())
HISTFILE = "%s/.pyhistory." % home
try:
readline.read_history_file(HISTFILE)
except: pass
- import atexit
- atexit.register(lambda: readline.write_history_file(HISTFILE))
+ atexit.register(readline.write_history_file, HISTFILE)
except:
print >>sys.stderr, "Couldn't get rlcompleter + readline working."
-try:
- from see import see
-except ImportError:
- print >>sys.stderr, "Please pip install see"
-
if "DJANGO_SETTINGS_MODULE" in os.environ:
from django.db.models.loading import get_models
from django.test.client import Client
View
2 vimrc
@@ -167,7 +167,7 @@ let mapleader=','
let maplocalleader=','
let g:mapleader=','
let g:CommandTMaxHeight=20
-let g:maintainer='{"name": "Grigory V.", "web": "http://floatboth.com"}'
+let g:maintainer='{"name": "Greg V", "web": "http://floatboth.com"}'
let vimclojure#SplitPos='bottom'
let g:vimclojure#DynamicHighlighting=1
let g:SuperTabDefaultCompletionType='context'
View
1 zshrc
@@ -16,6 +16,7 @@ fi
# brew must be in path before zshuery
export PATH=/usr/local/bin:/usr/local/sbin:$PATH
+export PYTHONPATH=/usr/local/lib/python2.7/site-packages:$PYTHONPATH
source $DOTFILES/vendor/zsh-hl/zsh-syntax-highlighting.zsh
source $DOTFILES/zshuery/zshuery.sh

0 comments on commit 703d517

Please sign in to comment.