Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

blew up hemacs, ackrc additions, tmux powerline, mockery of a readme

  • Loading branch information...
commit 7a20373f748c0bf57188deaffd80c5b50e156989 1 parent b82d233
@waymondo authored
Showing with 2,075 additions and 1,545 deletions.
  1. +21 −0 .gitmodules
  2. +2 −29 README.md
  3. +9 −2 ackrc
  4. +0 −25 emacs.d/bindings.el
  5. +0 −50 emacs.d/carbon.el
  6. +0 −148 emacs.d/config.el
  7. +0 −15 emacs.d/custom.el
  8. +0 −225 emacs.d/defuns.el
  9. +0 −34 emacs.d/init.el
  10. +0 −74 emacs.d/modes.el
  11. +0 −22 emacs.d/packages.el
  12. +0 −193 emacs.d/vendor/less-css-mode.el
  13. +0 −252 emacs.d/vendor/mustache-mode.el
  14. +0 −1  emacs.d/vendor/rhtml-mode
  15. +0 −1  emacs.d/vendor/rinari
  16. +0 −409 emacs.d/vendor/slim-mode.el
  17. +2 −0  gitconfig
  18. +40 −0 ruco.rb
  19. +8 −1 tmux.conf
  20. +3 −0  tmux/tmux-powerline/.gitignore
  21. +19 −0 tmux/tmux-powerline/AUTHORS
  22. +14 −0 tmux/tmux-powerline/LICENSE
  23. +167 −0 tmux/tmux-powerline/README.md
  24. +12 −0 tmux/tmux-powerline/config.sh
  25. BIN  tmux/tmux-powerline/img/full.png
  26. BIN  tmux/tmux-powerline/img/left-status.png
  27. BIN  tmux/tmux-powerline/img/right-status.png
  28. BIN  tmux/tmux-powerline/img/right-status_no_mail.png
  29. BIN  tmux/tmux-powerline/img/right-status_no_mpd.png
  30. BIN  tmux/tmux-powerline/img/right-status_weather_battery.png
  31. +219 −0 tmux/tmux-powerline/lib.sh
  32. +11 −0 tmux/tmux-powerline/mute_statusbar.sh
  33. +18 −0 tmux/tmux-powerline/segments/Makefile
  34. +130 −0 tmux/tmux-powerline/segments/battery.sh
  35. +33 −0 tmux/tmux-powerline/segments/battery_mac.sh
  36. +21 −0 tmux/tmux-powerline/segments/cpu.sh
  37. +5 −0 tmux/tmux-powerline/segments/date_day.sh
  38. +5 −0 tmux/tmux-powerline/segments/date_full.sh
  39. +5 −0 tmux/tmux-powerline/segments/hostname.sh
  40. +35 −0 tmux/tmux-powerline/segments/lan_ip.sh
  41. +5 −0 tmux/tmux-powerline/segments/load.sh
  42. +14 −0 tmux/tmux-powerline/segments/mail_count_apple_mail.sh
  43. +78 −0 tmux/tmux-powerline/segments/mail_count_gmail.sh
  44. +18 −0 tmux/tmux-powerline/segments/mail_count_maildir.sh
  45. +26 −0 tmux/tmux-powerline/segments/np_audacious.sh
  46. +27 −0 tmux/tmux-powerline/segments/np_banshee.sh
  47. +23 −0 tmux/tmux-powerline/segments/np_itunes_mac.sh
  48. +31 −0 tmux/tmux-powerline/segments/np_mocp.sh
  49. +179 −0 tmux/tmux-powerline/segments/np_mpd.c
  50. +43 −0 tmux/tmux-powerline/segments/np_mpd.sh
  51. +31 −0 tmux/tmux-powerline/segments/np_mpd_simple.sh
  52. +29 −0 tmux/tmux-powerline/segments/np_rhythmbox.sh
  53. +31 −0 tmux/tmux-powerline/segments/np_spotify_linux_native.sh
  54. +28 −0 tmux/tmux-powerline/segments/np_spotify_linux_wine.sh
  55. +24 −0 tmux/tmux-powerline/segments/np_spotify_mac.sh
  56. +27 −0 tmux/tmux-powerline/segments/pwd.sh
  57. +5 −0 tmux/tmux-powerline/segments/time.sh
  58. +6 −0 tmux/tmux-powerline/segments/tmux_session_info.sh
  59. +3 −0  tmux/tmux-powerline/segments/uptime.sh
  60. +92 −0 tmux/tmux-powerline/segments/vcs_branch.sh
  61. +38 −0 tmux/tmux-powerline/segments/wan_ip.sh
  62. +129 −0 tmux/tmux-powerline/segments/weather_google.sh
  63. +112 −0 tmux/tmux-powerline/segments/weather_yahoo.sh
  64. +64 −0 tmux/tmux-powerline/segments/xkb_layout.c
  65. +31 −0 tmux/tmux-powerline/segments/xkb_layout.sh
  66. +60 −0 tmux/tmux-powerline/status-left.sh
  67. +125 −0 tmux/tmux-powerline/status-right.sh
  68. +0 −58 vimrc
  69. +17 −6 zshrc
View
21 .gitmodules
@@ -4,3 +4,24 @@
[submodule "emacs.d/vendor/rhtml-mode"]
path = emacs.d/vendor/rhtml-mode
url = git://github.com/eschulte/rhtml.git
+[submodule "emacs.d/vendor/bundler.el"]
+ path = emacs.d/vendor/bundler.el
+ url = git://github.com/tobiassvn/bundler.el.git
+[submodule "emacs.d/vendor/foreman.el"]
+ path = emacs.d/vendor/foreman.el
+ url = git://github.com/waymondo/foreman.el.git
+[submodule "emacs.d/vendor/cheat.el"]
+ path = emacs.d/vendor/cheat.el
+ url = https://github.com/defunkt/cheat.el.git
+[submodule "emacs.d/vendor/direx.el"]
+ path = emacs.d/vendor/direx.el
+ url = https://github.com/m2ym/direx-el
+[submodule "emacs.d/vendor/enhanced-ruby-mode"]
+ path = emacs.d/vendor/enhanced-ruby-mode
+ url = https://github.com/jacott/Enhanced-Ruby-Mode.git
+[submodule "emacs.d/vendor/powerline.el"]
+ path = emacs.d/vendor/powerline.el
+ url = https://github.com/milkypostman/powerline.git
+[submodule "emacs.d/vendor/smart-tab.el"]
+ path = emacs.d/vendor/smart-tab.el
+ url = https://github.com/genehack/smart-tab.git
View
31 README.md
@@ -1,30 +1,3 @@
-# dotfiles
+## dotfiles
-a mainly git, ruby, javascript, coffeesript, and less css set-up on osx with carbon emacs 24 as editor in chief and zsh in a single tmux-ed shell.
-
-## installation
-
-check it out into a directory of your choice:
-
-1. `git clone git://github.com/waymondo/dotfiles`
-2. `cd dotfiles`
-3. `rake install`
-
-### emacs 24
-
-installing emacs 24 is easy with [homebrew](http://mxcl.github.com/homebrew) =>
-
-`brew install emacs --cocoa --use-git-head --HEAD`
-`mv /usr/local/Cellar/emacs/HEAD/Emacs.app /Applications/`
-
-### while you are brewing
-
-`brew install zsh tmux rbenv ruby-build ack`
-
-### also makes use of:
-
-* [pow](http://pow.cx)
-* [oh my zsh](https://github.com/robbyrussell/oh-my-zsh)
-* [peepopen](http://peepcode.com/products/peepopen)
-* [pry](https://github.com/pry/pry)
-* [awesome_print](https://github.com/michaeldv/awesome_print)
+they are my dotfiles. what else did you expect.
View
11 ackrc
@@ -1,5 +1,12 @@
--type-add=ruby=.haml,.rake,.rsel,.sass,.scss,.feature,.less,.slim,.hbs
---type-set
-coffeescript=.coffee
+--type-set=hamlbars=.hamlbars
+--type-set=coffee=.coffee
+--type-set=slim=.slim
+--type-set=scss=.scss
+--type-set=less=.less
+--type-set=DUMB=.sql
--ignore-dir=node_modules
+--ignore-dir=development
+--ignore-dir=tmp
--ignore-dir=.bundle
+--ignore-dir=#{var}
View
25 emacs.d/bindings.el
@@ -1,25 +0,0 @@
-;; osx-ish
-(global-set-key (kbd "s-s") 'save-buffer)
-(global-set-key (kbd "s-z") 'undo)
-(global-set-key (kbd "s-w") 'kill-this-buffer)
-(global-set-key (kbd "s-F") 'ns-toggle-fullscreen)
-(global-set-key (kbd "C-=") 'text-scale-increase)
-(global-set-key (kbd "C--") 'text-scale-decrease)
-
-;; conveniency
-(global-set-key (kbd "s-=") 'ido-switch-buffer)
-(global-set-key (kbd "s--") 'switch-to-previous-buffer)
-(global-set-key [f1] 'magit-status)
-(global-set-key [f2] 'dired)
-(global-set-key [f3] 'open-project)
-(global-set-key (kbd "s-x") 'smex)
-(global-set-key (kbd "M-/") 'hippie-expand)
-
-;; shortcuts for common patterns
-(global-set-key (kbd "s->") 'arrow)
-(global-set-key (kbd "s-{") 'open-curlies-and-indent)
-(global-set-key (kbd "C-c k") 'bckwrd-kill-line)
-(global-set-key (kbd "s-u") 'dupe-line)
-(global-set-key (kbd "C-x \\") 'align-regexp)
-
-(provide 'bindings)
View
50 emacs.d/carbon.el
@@ -1,50 +0,0 @@
-(require 'volatile-highlights)
-(require 'auto-complete)
-(require 'textmate)
-(require 'magit)
-(require 'peepopen)
-(require 'ack-and-a-half)
-;(vendor 'rinari)
-(vendor 'rhtml-mode)
-
-(textmate-mode)
-(smex-initialize)
-(fringe-mode 0)
-
-(electric-pair-mode t)
-
-; autocomplete
-(global-auto-complete-mode t)
-(dolist (mode '(magit-log-edit-mode log-edit-mode org-mode text-mode
- yaml-mode html-mode nxml-mode sh-mode lisp-mode markdown-mode
- css-mode less-css-mode ruby-mode javascript-mode js-mode
- js2-mode js3-mode php-mode slim-mode coffee-mode rhtml-mode
- mustache-mode
- ))
-(add-to-list 'ac-modes mode))
-
-(volatile-highlights-mode t)
-
-; osx stuff
-(normal-erase-is-backspace-mode t)
-(setq default-input-method "MacOSX"
- delete-by-moving-to-trash t
- mac-command-key-is-meta nil
- browse-url-browser-function 'browse-url-default-macosx-browser
-)
-
-(setq x-select-request-type '(UTF8_STRING COMPOUND_TEXT TEXT STRING))
-
-(defun copy-from-osx ()
- (shell-command-to-string "pbpaste"))
-
-(defun paste-to-osx (text &optional push)
- (let ((process-connection-type nil))
- (let ((proc (start-process "pbcopy" "*Messages*" "pbcopy")))
- (process-send-string proc text)
- (process-send-eof proc))))
-
-(setq interprogram-cut-function 'paste-to-osx)
-(setq interprogram-paste-function 'copy-from-osx)
-
-(provide 'carbon)
View
148 emacs.d/config.el
@@ -1,148 +0,0 @@
-;; built-in
-(require 'uniquify)
-(require 'saveplace)
-(require 'recentf)
-
-;; vendored
-(require 'mustache-mode)
-(require 'slim-mode)
-(require 'less-css-mode)
-
-(setq inhibit-startup-message t)
-
-;; always update files, i.e. after git pull
-(global-auto-revert-mode 1)
-
-;; nice scrolling
-(setq scroll-margin 20)
-(setq scroll-conservatively 100000)
-(setq scroll-preserve-screen-position 1)
-
-;; disable auto-save files (#foo#)
-(setq auto-save-default nil)
-
-;; disable backup files (foo~)
-(setq backup-inhibited t)
-
-;; disable auto-save-list/.saves
-(setq auto-save-list-file-prefix nil)
-
-;; save place, save history, recentf
-(setq-default save-place t)
-(setq recentf-max-saved-items 200)
-(setq recentf-save-file "~/.emacs.d/recentf")
-(setq savehist-file "~/.emacs.d/savehist")
-(setq save-place-file "~/.emacs.d/places")
-(savehist-mode t)
-(recentf-mode t)
-
-;; shift+arrows to move between buffers
-(windmove-default-keybindings)
-
-;; ido
-(ido-mode t)
-(ido-everywhere t)
-(setq ido-enable-flex-matching t) ;; fuzzy matching
-(setq ido-use-virtual-buffers t) ;; include non-existent buffers
-(setq ido-auto-merge-work-directories-length nil)
-(setq ido-use-filename-at-point nil)
-(setq ido-max-window-height 29) ;; big ol window
-(setq ido-max-prospects 25)
-(setq ido-decorations (quote ("\n-> " "" "\n " "\n ..." "[" "]" " [No match]" " [Matched]" " [Not readable]" " [Too big]" " [Confirm]"))) ;; vertical results!
-(add-to-list 'ido-ignore-files "\\.DS_Store")
-(add-to-list 'ido-ignore-files "\\.ido.last")
-(add-to-list 'ido-ignore-files "\\.loaddefs.el")
-
-;; auto-complete in mini-buffer
-(icomplete-mode +1)
-
-;; tabs
-(setq-default tab-width 2)
-(setq-default indent-tabs-mode nil)
-
-;; utf-8
-(prefer-coding-system 'utf-8)
-(setq buffer-file-coding-system 'utf-8)
-
-;; meaningful names for buffers with the same name
-(setq uniquify-buffer-name-style 'forward)
-(setq uniquify-separator "")
-(setq uniquify-after-kill-buffer-p t) ; rename after killing uniquified
-(setq uniquify-ignore-buffers-re "^\\*") ; don't muck with special buffers
-
-;; prefs
-(fset 'yes-or-no-p 'y-or-n-p)
-(setq visible-bell t)
-(setq confirm-nonexistent-file-or-buffer nil)
-(setq max-lisp-eval-depth 100000)
-(setq show-trailing-whitespace t)
-(setq pop-up-windows nil)
-(setq ns-pop-up-frames nil)
-(setq vc-handled-backends nil)
-(setq mac-allow-anti-aliasing t)
-
-;; minor modes
-(transient-mark-mode t)
-(show-paren-mode t)
-(hl-line-mode t)
-(blink-cursor-mode t)
-(size-indication-mode t)
-
-;; dired - reuse current buffer by pressing 'a'
-(put 'dired-find-alternate-file 'disabled nil)
-
-;; hooks
-(add-hook 'before-save-hook 'delete-trailing-whitespace)
-
-;; automatically indenting yanked text if in programming-modes
-(defvar yank-indent-modes '(python-mode LaTeX-mode TeX-mode)
- "Modes in which to indent regions that are yanked (or yank-popped). Only
-modes that don't derive from `prog-mode' should be listed here.")
-
-(defvar yank-advised-indent-threshold 1000
- "Threshold (# chars) over which indentation does not automatically occur.")
-
-(defun yank-advised-indent-function (beg end)
- "Do indentation, as long as the region isn't too large."
- (if (<= (- end beg) yank-advised-indent-threshold)
- (indent-region beg end nil)))
-
-(defadvice yank (after yank-indent activate)
- "If current mode is one of 'yank-indent-modes,
-indent yanked text (with prefix arg don't indent)."
- (if (and (not (ad-get-arg 0))
- (or (derived-mode-p 'prog-mode)
- (member major-mode yank-indent-modes)))
- (let ((transient-mark-mode nil))
- (yank-advised-indent-function (region-beginning) (region-end)))))
-
-(defadvice yank-pop (after yank-pop-indent activate)
- "If current mode is one of 'yank-indent-modes,
-indent yanked text (with prefix arg don't indent)."
- (if (and (not (ad-get-arg 0))
- (or (derived-mode-p 'prog-mode)
- (member major-mode yank-indent-modes)))
- (let ((transient-mark-mode nil))
- (yank-advised-indent-function (region-beginning) (region-end)))))
-
-;; occur with isearch
-(define-key isearch-mode-map (kbd "C-o")
- (lambda () (interactive)
- (let ((case-fold-search isearch-case-fold-search))
- (occur (if isearch-regexp
- isearch-string
- (regexp-quote isearch-string))))))
-
-;; hippie expand match order
-(setq hippie-expand-try-functions-list '(try-expand-dabbrev
- try-expand-dabbrev-all-buffers
- try-expand-dabbrev-from-kill
- try-complete-file-name-partially
- try-complete-file-name
- try-expand-all-abbrevs
- try-expand-list
- try-expand-line
- try-complete-lisp-symbol-partially
- try-complete-lisp-symbol))
-
-(provide 'config)
View
15 emacs.d/custom.el
@@ -1,15 +0,0 @@
-(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.
- '(background-mode dark)
- '(css-electric-keys (quote (125 59 0)))
- '(css-indent-offset 2)
- '(custom-safe-themes (quote ("b7553781f4a831d5af6545f7a5967eb002c8daeee688c5cbf33bf27936ec18b3" "baed08a10ff9393ce578c3ea3e8fd4f8c86e595463a882c55f3bd617df7e5a45" "fc5fcb6f1f1c1bc01305694c59a1a861b008c534cae8d0e48e4d5e81ad718bc6" "1440d751f5ef51f9245f8910113daee99848e2c0" "485737acc3bedc0318a567f1c0f5e7ed2dfde3fb" "b0950b032aa3c8faab4864ae288296dd66b92eca" default))))
-(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.
- )
View
225 emacs.d/defuns.el
@@ -1,225 +0,0 @@
-
-(defun open-project (project)
- (interactive
- (list (read-directory-name "Peepopen project: " "~/code/")))
- (flet ((textmate-project-root () (file-truename project)))
- (peepopen-goto-file-gui)))
-
-(defun string-rtrim (str)
- "Remove trailing whitespace from `STR'."
- (replace-regexp-in-string "[ \t\n]*$" "" str))
-
-(defun set-exec-path-from-shell-PATH ()
- "Set up Emacs' `exec-path' and PATH environment variable to match that used by the user's shell.
- This is particularly useful under Mac OSX, where GUI apps are not started from a shell."
- (interactive)
- (let ((path-from-shell (string-rtrim (shell-command-to-string "$SHELL --login -i -c 'echo $PATH'"))))
- (setenv "PATH" path-from-shell)
- (setq exec-path (split-string path-from-shell path-separator))))
-(when (and *is-a-mac* window-system)
- (set-exec-path-from-shell-PATH))
-
-(defun add-auto-mode (mode &rest patterns)
- "Add entries to `auto-mode-alist' to use `MODE' for all given file `PATTERNS'."
- (dolist (pattern patterns)
- (add-to-list 'auto-mode-alist (cons pattern mode))))
-
-(defun rename-file-and-buffer (new-name)
- "Renames both current buffer and file it's visiting to NEW-NAME."
- (interactive "sNew name: ")
- (let ((name (buffer-name))
- (filename (buffer-file-name)))
- (if (not filename)
- (message "Buffer '%s' is not visiting a file!" name)
- (if (get-buffer new-name)
- (message "A buffer named '%s' already exists!" new-name)
- (progn
- (rename-file name new-name 1)
- (rename-buffer new-name)
- (set-visited-file-name new-name)
- (set-buffer-modified-p nil))))))
-
-(defun delete-this-file ()
- (interactive)
- (or (buffer-file-name) (error "no file is currently being edited"))
- (when (yes-or-no-p (format "Really delete '%s'?"
- (file-name-nondirectory buffer-file-name)))
- (delete-file (buffer-file-name))
- (kill-this-buffer)))
-
-(defun pretty-lambdas ()
- (font-lock-add-keywords
- nil `(("(?\\(lambda\\>\\)"
- (0 (progn (compose-region (match-beginning 1) (match-end 1)
- ,(make-char 'greek-iso8859-7 107))
- nil))))))
-
-(add-hook 'prog-mode-hook 'pretty-lambdas)
-
-(defun untabify-buffer ()
- (interactive)
- (untabify (point-min) (point-max)))
-
-(defun indent-buffer ()
- (interactive)
- (indent-region (point-min) (point-max)))
-
-(defun cleanup-buffer ()
- "Perform a bunch of operations on the whitespace content of a buffer."
- (interactive)
- (indent-buffer)
- (untabify-buffer)
- (delete-trailing-whitespace))
-
-(defun sudo-edit (&optional arg)
- (interactive "p")
- (if (or arg (not buffer-file-name))
- (find-file (concat "/sudo:root@localhost:" (ido-read-file-name "File: ")))
- (find-alternate-file (concat "/sudo:root@localhost:" buffer-file-name))))
-
-(defun lorem ()
- (interactive)
- (insert "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do "
- "eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim"
- "ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut "
- "aliquip ex ea commodo consequat. Duis aute irure dolor in "
- "reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla "
- "pariatur. Excepteur sint occaecat cupidatat non proident, sunt in "
- "culpa qui officia deserunt mollit anim id est laborum."))
-
-(defun dupe-line ()
- (interactive)
- (beginning-of-line)
- (copy-region-as-kill (point) (progn (end-of-line) (point)))
- (textmate-next-line)
- (yank)
- (beginning-of-line)
- (indent-according-to-mode))
-
-(defun insert-soft-tab ()
- (interactive)
- (insert " "))
-
-(defun bckwrd-kill-line ()
- (interactive)
- (kill-line 0))
-
-(defun arrow ()
- (interactive)
- (insert " => "))
-
-(defun open-curlies-and-indent()
- (interactive)
- (insert " {\n\n}")
- (indent-according-to-mode)
- (previous-line)
- (indent-according-to-mode))
-
-(defun insert-space-and-semicolon()
- (interactive)
- (insert ": ;")
- (backward-char))
-
-(defun word-count ()
- (interactive)
- (shell-command-on-region (point-min) (point-max) "wc -w"))
-
-(defun maximize-other-window ()
- (interactive)
- (other-window 1)
- (delete-other-windows))
-
-(defun switch-to-previous-buffer ()
- (interactive)
- (switch-to-buffer (other-buffer)))
-
-(defun hexcolour-luminance (color)
- "Calculate the luminance of a color string (e.g. \"#ffaa00\", \"blue\").
- This is 0.3 red + 0.59 green + 0.11 blue and always between 0 and 255."
- (let* ((values (x-color-values color))
- (r (car values))
- (g (cadr values))
- (b (caddr values)))
- (floor (+ (* .3 r) (* .59 g) (* .11 b)) 256)))
-
-(defun js-insert-console ()
- (interactive)
- (insert "console.log()")
- (backward-char))
-
-(defun ruby-insert-console ()
- (interactive)
- (insert "logger.info "))
-
-(defun recompile-init ()
- "Byte-compile all your dotfiles again."
- (interactive)
- (byte-recompile-directory "~/.emacs.d" 0))
-
-(defun rake (task)
- (interactive (list (completing-read "Rake (default: default): "
- (pcmpl-rake-tasks))))
- (shell-command-to-string (concat "rake " (if (= 0 (length task)) "default" task))))
-
-(defun close-buffer ()
- (interactive)
- (kill-buffer (current-buffer)))
-
-(defun esk-tabify-buffer ()
- (interactive)
- (tabify (point-min) (point-max)))
-
-(defun esk-cleanup-on-save ()
- (add-hook 'before-save-hook 'esk-cleanup-buffer))
-
-(defun esk-cleanup-buffer ()
- (interactive)
- (if indent-tabs-mode
- (esk-tabify-buffer)
- (esk-untabify-buffer))
- (delete-trailing-whitespace))
-
-(defun esk-ident-on-return ()
- (local-set-key (kbd "RET") 'newline-and-indent))
-
-(defun insert-empty-line ()
- "Insert an empty line after the current line and positon
-the curson at its beginning, according to the current mode."
- (interactive)
- (move-end-of-line nil)
- (open-line 1)
- (next-line 1)
- (indent-according-to-mode))
-
-(defun add-subfolders-to-load-path (parent-dir)
- "Adds all first level `parent-dir' subdirs to the
-Emacs load path."
- (dolist (f (directory-files parent-dir))
- (let ((name (concat parent-dir f)))
- (when (and (file-directory-p name)
- (not (equal f ".."))
- (not (equal f ".")))
- (add-to-list 'load-path name)))))
-
-(defun open-with ()
- "Simple function that allows us to open the underlying
-file of a buffer in an external program."
- (interactive)
- (when buffer-file-name
- (shell-command (concat
- (if (eq system-type 'darwin)
- "open"
- (read-shell-command "Open current file with: "))
- " "
- buffer-file-name))))
-
-(defun vendor (library)
- (let* ((file (symbol-name library))
- (normal (concat "~/.emacs.d/vendor/" file))
- (suffix (concat normal ".el")))
- (cond
- ((file-directory-p normal) (add-to-list 'load-path normal) (require library))
- ((file-directory-p suffix) (add-to-list 'load-path suffix) (require library))
- ((file-exists-p suffix) (require library)))))
-
-(provide 'defuns)
View
34 emacs.d/init.el
@@ -1,34 +0,0 @@
-(require 'cl)
-(setq *is-a-mac* (eq system-type 'darwin))
-
-; load paths
-(setq vendor-dir "~/.emacs.d/vendor"
- custom-file "~/.emacs.d/custom.el")
-(add-to-list 'load-path "~/.emacs.d")
-(when (file-exists-p custom-file) (load custom-file))
-(when (file-exists-p vendor-dir) (add-to-list 'load-path vendor-dir))
-
-; exec path
-(push "/usr/local/bin" exec-path)
-(push "~/.rbenv/shims" exec-path)
-
-; hide everything
-(dolist (mode '(tool-bar-mode scroll-bar-mode))
- (when (fboundp mode) (funcall mode -1)))
-
-; font = https://github.com/andreberg/Meslo-Font
-(set-face-font 'default "-apple-Meslo_LG_M_DZ-medium-normal-normal-*-16-*-*-*-m-0-fontset-auto3")
-
-; boot
-(require 'defuns)
-(when (and *is-a-mac* window-system)
- (require 'packages)
- (load-theme 'zenburn)
- (ns-toggle-fullscreen)
- (require 'carbon)
-)
-(require 'config)
-(require 'bindings)
-(require 'modes)
-
-(provide 'init)
View
74 emacs.d/modes.el
@@ -1,74 +0,0 @@
-;; file-types
-(add-to-list 'auto-mode-alist '("\\.slim" . slim-mode))
-(add-to-list 'auto-mode-alist '("\\.ya?ml$" . yaml-mode))
-(add-to-list 'auto-mode-alist '("\\.coffee$" . coffee-mode))
-(add-to-list 'auto-mode-alist '("Cakefile" . coffee-mode))
-(add-to-list 'auto-mode-alist '("\\.js$" . js-mode))
-(add-to-list 'auto-mode-alist '("\\.json$" . js-mode))
-(add-to-list 'auto-mode-alist '("\\.mustache$" . mustache-mode))
-(add-to-list 'auto-mode-alist '("\\.hbs$" . mustache-mode))
-(add-to-list 'auto-mode-alist '("\\.less$" . less-css-mode))
-(add-to-list 'auto-mode-alist '("\\.scss$" . css-mode))
-(add-to-list 'auto-mode-alist '("\\.m$" . objc-mode))
-(add-to-list 'auto-mode-alist '("\\.markdown" . markdown-mode))
-(add-to-list 'auto-mode-alist '("\\.md" . markdown-mode))
-(add-to-list 'auto-mode-alist '("Rakefile" . ruby-mode))
-(add-to-list 'auto-mode-alist '("Capfile" . ruby-mode))
-(add-to-list 'auto-mode-alist '("Gemfile" . ruby-mode))
-(add-to-list 'auto-mode-alist '("Guardfile" . ruby-mode))
-(add-to-list 'auto-mode-alist '("Procfile" . ruby-mode))
-(add-to-list 'auto-mode-alist '("\\.gems" . ruby-mode))
-(add-to-list 'auto-mode-alist '("\\.rake" . ruby-mode))
-(add-to-list 'auto-mode-alist '("\\.ru" . ruby-mode))
-(add-to-list 'auto-mode-alist '("\\.thor" . ruby-mode))
-(add-to-list 'auto-mode-alist '("\\.builder" . ruby-mode))
-(add-to-list 'auto-mode-alist '("\\.gemspec" . ruby-mode))
-(add-to-list 'auto-mode-alist '("\\.rabl" . ruby-mode))
-(add-to-list 'auto-mode-alist '("\\.rhtml\\'" . rhtml-mode))
-(add-to-list 'auto-mode-alist '("\\.erb\\'" . rhtml-mode))
-
-;; ruby
-(eval-after-load 'ruby-mode
- '(progn
- (ruby-end-mode +1)
- (subword-mode +1)
- (define-key ruby-mode-map (kbd "RET") 'reindent-then-newline-and-indent)
- (define-key ruby-mode-map (kbd "C-M-h") 'backward-kill-word)
- (define-key ruby-mode-map (kbd "C-l") 'ruby-insert-console)
-))
-
-;; styles
-(eval-after-load 'css-mode
- '(progn
- (define-key css-mode-map (kbd "s-:") 'insert-space-and-semicolon)
- (define-key css-mode-map (kbd "<s-return>") 'insert-empty-line)
- (define-key css-mode-map (kbd "RET") 'newline-and-indent)
- (add-hook 'css-mode-hook '(lambda () (electric-pair-mode)))
-))
-
-;; javascript
-(add-hook 'js-mode-hook
- '(lambda ()
- (setq js-indent-level 2)))
-(eval-after-load 'js-mode
- '(progn
- (define-key js-mode-map (kbd "RET") 'newline-and-indent)
- (define-key js-mode-map (kbd "C-l") 'js-insert-console)
-))
-
-;; coffeescript
-(eval-after-load 'coffee-mode
- '(progn
- (define-key coffee-mode-map (kbd "s-r") 'coffee-compile-buffer)
- (define-key coffee-mode-map (kbd "RET") 'newline)
- (define-key coffee-mode-map (kbd "C-l") 'js-insert-console)
-))
-
-;; html
-(eval-after-load 'html-mode
- '(progn
- (define-key html-mode-map (kbd "RET") 'newline-and-indent)
- (add-hook 'css-mode-hook '(lambda () (electric-pair-mode)))
-))
-
-(provide 'modes)
View
22 emacs.d/packages.el
@@ -1,22 +0,0 @@
-(require 'package)
-(setq package-archives '(("ELPA" . "http://tromey.com/elpa/")
- ("gnu" . "http://elpa.gnu.org/packages/")
- ("marmalade" . "http://marmalade-repo.org/packages/")))
-(package-initialize)
-
-(when (not package-archive-contents)
- (package-refresh-contents))
-
-(defvar packages
- '(ack-and-a-half anything auto-complete coffee-mode gist
- haml-mode inf-ruby less-css-mode magit magithub
- markdown-mode peepopen ruby-end sass-mode scss-mode
- slim-mode smex solarized-theme textmate
- volatile-highlights yaml-mode yari zenburn-theme)
- "A list of packages to ensure are installed at launch.")
-
-(dolist (package packages)
- (when (not (package-installed-p package))
- (package-install package)))
-
-(provide 'packages)
View
193 emacs.d/vendor/less-css-mode.el
@@ -1,193 +0,0 @@
-;;; less-css-mode.el --- Major mode for editing LESS CSS files (lesscss.org)
-;;
-;; Copyright 2011 Steve Purcell
-;;
-;; Author: Steve Purcell <steve@sanityinc.com>
-;; URL: https://github.com/purcell/less-css-mode
-;; Keywords: less css mode
-;; Version: DEV
-;;
-;; This program is free software; you can redistribute it and/or
-;; modify it under the terms of the GNU General Public License as
-;; published by the Free Software Foundation; either version 2 of
-;; the License, or (at your option) any later version.
-;;
-;; This program is distributed in the hope that it will be
-;; useful, but WITHOUT ANY WARRANTY; without even the implied
-;; warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-;; PURPOSE. See the GNU General Public License for more details.
-;;
-;;; Commentary:
-;;
-;; This mode provides syntax highlighting for LESS CSS files, plus
-;; optional support for `flymake-mode' and compilation of .less files
-;; to .css files at the time they are saved: use
-;; `less-css-compile-at-save' to enable the latter.
-;;
-;; Command line utility "lessc" is required if enabling flymake or
-;; setting `less-css-compile-at-save' to t. To install "lessc" using
-;; the Node.js package manager, run "npm install less"
-;;
-;; Also make sure the "lessc" executable is in emacs' PATH, example:
-;; (setq exec-path (cons (expand-file-name "~/.gem/ruby/1.8/bin") exec-path))
-;; or customize `less-css-lessc-command' to point to your "lessc" executable.
-;;
-;; `less-css-mode' is derived from `css-mode', and indentation of
-;; nested blocks may not work correctly with versions of `css-mode'
-;; other than that bundled with recent Emacs.
-;;
-;; You can specify per-file values for `less-css-compile-at-save',
-;; `less-css-output-file-name' or `less-css-output-directory' using a
-;; variables header at the top of your .less file, e.g.:
-;;
-;; // -*- less-css-compile-at-save: t; less-css-output-directory: "../css" -*-
-;;
-;; If you don't need CSS output but would like to be warned of any
-;; syntax errors in your .less source, enable `flymake-mode': support
-;; is provided for .less files, but note that the less compiler is a
-;; little slow, so there can be a delay of several seconds between
-;; editing and receiving feedback on any error.
-;;
-;;; Credits
-;;
-;; The original code for this mode was, in large part, written using
-;; Anton Johansson's scss-mode as a template -- thanks Anton!
-;; https://github.com/antonj
-;;
-;;; Code:
-
-(require 'derived)
-(require 'compile)
-(require 'flymake)
-
-(defgroup less-css nil
- "Less-css mode"
- :prefix "less-css-"
- :group 'css)
-
-(defcustom less-css-lessc-command "lessc"
- "Command used to compile LESS files, should be lessc or the
- complete path to your lessc executable, e.g.:
- \"~/.gem/ruby/1.8/bin/lessc\""
- :group 'less-css)
-
-(defcustom less-css-compile-at-save nil
- "If non-nil, the LESS buffers will be compiled to CSS after each save"
- :type 'boolean
- :group 'less-css)
-
-(defcustom less-css-lessc-options '()
- "Command line options for less executable.
-
-Use \"-x\" to minify output."
- :type '(repeat string)
- :group 'less-css)
-
-(defvar less-css-output-directory nil
- "Directory in which to save CSS, or nil to use the LESS file's directory.
-
-This path is expanded relative to the directory of the LESS file
-using `expand-file-name', so both relative and absolute paths
-will work as expected.")
-
-(make-variable-buffer-local 'less-css-output-directory)
-
-(defvar less-css-output-file-name nil
- "File name in which to save CSS, or nil to use <name>.css for <name>.less.
-
-This can be also be set to a full path, or a relative path. If
-the path is relative, it will be relative to the value of
-`less-css-output-dir', if set, or the current directory by
-default.")
-
-(make-variable-buffer-local 'less-css-output-file-name)
-
-(defconst less-css-default-error-regex "Syntax Error on line \\([0-9]+\\)\e\\[39m\e\\[31m in \e\\[39m\\([^ ]+\\)$")
-
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; Compilation to CSS
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
-(add-to-list 'compilation-error-regexp-alist-alist
- (list 'less-css (concat "\\(" less-css-default-error-regex "\\)") 3 2 nil nil 1))
-(add-to-list 'compilation-error-regexp-alist 'less-css)
-
-
-(defun less-css-compile-maybe ()
- "Runs `less-css-compile' on if `less-css-compile-at-save' is t"
- (if less-css-compile-at-save
- (less-css-compile)))
-
-(defun less-css--output-path ()
- "Calculate the path for the compiled CSS file created by `less-css-compile'."
- (expand-file-name (or less-css-output-file-name
- (concat (file-name-nondirectory (file-name-sans-extension buffer-file-name)) ".css"))
- (or less-css-output-directory default-directory)))
-
-;;;###autoload
-(defun less-css-compile ()
- "Compiles the current buffer to css using `less-css-lessc-command'."
- (interactive)
- (message "Compiling less to css")
- (compile
- (mapconcat 'shell-quote-argument
- (append (list less-css-lessc-command)
- less-css-lessc-options
- (list buffer-file-name (less-css--output-path)))
- " ")))
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; Minor mode
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
-;; TODO: interpolation ("@{val}"), escaped values (~"..."), JS eval (~`...`), custom faces
-(defconst less-css-font-lock-keywords
- '(;; Variables
- ("@[a-z_-][a-z-_0-9]*" . font-lock-constant-face)
- ("&" . font-lock-preprocessor-face)
- ;; Mixins
- ("\\(?:[ \t{;]\\|^\\)\\(\\.[a-z_-][a-z-_0-9]*\\)[ \t]*;" . (1 font-lock-keyword-face)))
- )
-
-;;;###autoload
-(define-derived-mode less-css-mode css-mode "LESS"
- "Major mode for editing LESS files, http://lesscss.org/
-Special commands:
-\\{less-css-mode-map}"
- (font-lock-add-keywords nil less-css-font-lock-keywords)
- ;; cpp-style comments
- (modify-syntax-entry ?/ "< 124b" less-css-mode-syntax-table)
- (modify-syntax-entry ?\n "> b" less-css-mode-syntax-table)
- (set (make-local-variable 'comment-start) "//")
- (set (make-local-variable 'comment-end) "")
-
- (add-hook 'after-save-hook 'less-css-compile-maybe nil t))
-
-(define-key less-css-mode-map "\C-c\C-c" 'less-css-compile)
-
-;;;###autoload
-(add-to-list 'auto-mode-alist '("\\.less" . less-css-mode))
-
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; Wiring for `flymake-mode'
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
-;;;###autoload
-(defun flymake-less-css-init ()
- "Flymake support for LESS files"
- (let* ((temp-file (flymake-init-create-temp-buffer-copy
- 'flymake-create-temp-inplace))
- (local-file (file-relative-name
- temp-file
- (file-name-directory buffer-file-name))))
- (list less-css-lessc-command (append less-css-lessc-options (list local-file)))))
-
-(push '(".+\\.less$" flymake-less-css-init) flymake-allowed-file-name-masks)
-
-(push (list less-css-default-error-regex 2 1 nil 2) flymake-err-line-patterns)
-
-
-(provide 'less-css-mode)
-;;; less-css-mode.el ends here
View
252 emacs.d/vendor/mustache-mode.el
@@ -1,252 +0,0 @@
-;;; mustache-mode.el --- A major mode for editing Mustache files.
-
-;; Author: Tony Gentilcore
-;; Chris Wanstrath
-;; Daniel Hackney
-
-;; Version: 1.2
-
-;; This file is not part of Emacs
-
-;; This file is free software; you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 2, or (at your option)
-;; any later version.
-
-;; This file is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING. If not, write to
-;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
-
-;;; Commentary:
-
-;; 1) Copy this file somewhere in your Emacs `load-path'. To see what
-;; your `load-path' is, run inside emacs: C-h v load-path<RET>
-;;
-;; 2) Add the following to your .emacs file:
-;;
-;; (require 'mustache-mode)
-
-;; While the Mustache language can be used for any types of text,
-;; this mode is intended for using Mustache to write HTML.
-
-;;; Known Bugs:
-
-;; The indentation still has minor bugs due to the fact that
-;; templates do not require valid HTML.
-
-;; It would be nice to be able to highlight attributes of HTML tags,
-;; however this is difficult due to the presence of CTemplate symbols
-;; embedded within attributes.
-
-(eval-when-compile
- (require 'font-lock))
-
-(defvar mustache-mode-version "1.2"
- "Version of `mustache-mode.el'.")
-
-(defvar mustache-mode-map
- (let ((map (make-sparse-keymap)))
- (define-key map "\C-m" 'reindent-then-newline-and-indent)
- (define-key map "\C-ct" 'mustache-insert-tag)
- (define-key map "\C-cv" 'mustache-insert-variable)
- (define-key map "\C-cs" 'mustache-insert-section)
- map)
- "Keymap for mustache-mode major mode")
-
-(defvar mustache-mode-syntax-table
- (let ((st (make-syntax-table)))
- (modify-syntax-entry ?< "(> " st)
- (modify-syntax-entry ?> ")< " st)
- (modify-syntax-entry ?\" ". " st)
- (modify-syntax-entry ?\\ ". " st)
- (modify-syntax-entry ?' "w " st)
- st)
- "Syntax table in use in mustache-mode buffers.")
-
-(defvar mustache-basic-offset 2
- "The basic indentation offset.")
-
-;; Constant regular expressions to identify template elements.
-(defconst mustache-mode-mustache-token "[a-zA-Z_.][a-zA-Z0-9_:=\?!.-]*?")
-(defconst mustache-mode-section (concat "\\({{[#^/]\s*"
- mustache-mode-mustache-token
- "\s*}}\\)"))
-(defconst mustache-mode-open-section (concat "\\({{#\s*"
- mustache-mode-mustache-token
- "\s*}}\\)"))
-(defconst mustache-mode-close-section (concat "{{/\\(\s*"
- mustache-mode-mustache-token
- "\s*\\)}}"))
-;; TODO(tonyg) Figure out a way to support multiline comments.
-(defconst mustache-mode-comment "\\({{!.*?}}\\)")
-(defconst mustache-mode-include (concat "\\({{[><]\s*"
- mustache-mode-mustache-token
- "\s*}}\\)"))
-(defconst mustache-mode-variable (concat "\\({{\s*"
- mustache-mode-mustache-token
- "\s*}}\\)"))
-(defconst mustache-mode-variable (concat "\\({{{?\s*"
- mustache-mode-mustache-token
- "\s*}}}?\\)"))
-(defconst mustache-mode-builtins
- (concat
- "\\({{\\<\s*"
- (regexp-opt
- '("BI_NEWLINE" "BI_SPACE")
- t)
- "\s*\\>}}\\)"))
-(defconst mustache-mode-close-section-at-start (concat "^[ \t]*?"
- mustache-mode-close-section))
-
-;; Constant regular expressions to identify html tags.
-;; Taken from HTML 4.01 / XHTML 1.0 Reference found at:
-;; http://www.w3schools.com/tags/default.asp.
-(defconst mustache-mode-html-constant "\\(&#?[a-z0-9]\\{2,5\\};\\)")
-(defconst mustache-mode-pair-tag
- (concat
- "\\<"
- (regexp-opt
- '("a" "abbr" "acronym" "address" "applet" "area" "b" "bdo"
- "big" "blockquote" "body" "button" "caption" "center" "cite"
- "code" "col" "colgroup" "dd" "del" "dfn" "dif" "div" "dl"
- "dt" "em" "fieldset" "font" "form" "frame" "frameset" "h1"
- "header" "nav" "footer" "section"
- "h2" "h3" "h4" "h5" "h6" "head" "html" "i" "iframe" "ins"
- "kbd" "label" "legend" "li" "link" "map" "menu" "noframes"
- "noscript" "object" "ol" "optgroup" "option" "p" "pre" "q"
- "s" "samp" "script" "select" "small" "span" "strike"
- "strong" "style" "sub" "sup" "table" "tbody" "td" "textarea"
- "tfoot" "th" "thead" "title" "tr" "tt" "u" "ul" "var")
- t)
- "\\>"))
-(defconst mustache-mode-standalone-tag
- (concat
- "\\<"
- (regexp-opt
- '("base" "br" "hr" "img" "input" "meta" "param")
- t)
- "\\>"))
-(defconst mustache-mode-open-tag (concat "<\\("
- mustache-mode-pair-tag
- "\\)"))
-(defconst mustache-mode-close-tag (concat "</\\("
- mustache-mode-pair-tag
- "\\)>"))
-(defconst mustache-mode-close-tag-at-start (concat "^[ \t]*?"
- mustache-mode-close-tag))
-
-(defconst mustache-mode-blank-line "^[ \t]*?$")
-(defconst mustache-mode-dangling-open (concat "\\("
- mustache-mode-open-section
- "\\)\\|\\("
- mustache-mode-open-tag
- "\\)[^/]*$"))
-
-(defun mustache-insert-tag (tag)
- "Inserts an HTML tag."
- (interactive "sTag: ")
- (mustache-indent)
- (insert (concat "<" tag ">"))
- (insert "\n\n")
- (insert (concat "</" tag ">"))
- (mustache-indent)
- (forward-line -1)
- (mustache-indent))
-
-(defun mustache-insert-variable (variable)
- "Inserts a tpl variable."
- (interactive "sVariable: ")
- (insert (concat "{{" variable "}}")))
-
-(defun mustache-insert-section (section)
- "Inserts a tpl section."
- (interactive "sSection: ")
- (mustache-indent)
- (insert (concat "{{#" section "}}\n"))
- (insert "\n")
- (insert (concat "{{/" section "}}"))
- (mustache-indent)
- (forward-line -1)
- (mustache-indent))
-
-(defun mustache-indent ()
- "Indent current line"
- ;; Set the point to beginning of line.
- (beginning-of-line)
- ;; If we are at the beginning of the file, indent to 0.
- (if (bobp)
- (indent-line-to 0)
- (let ((tag-stack 1) (close-tag "") (cur-indent 0) (old-pnt (point-marker))
- (close-at-start) (open-token) (dangling-open))
- (progn
- ;; Determine if this is a template line or an html line.
- (if (looking-at "^[ \t]*?{{")
- (setq close-at-start mustache-mode-close-section-at-start
- open-token "{{#")
- (setq close-at-start mustache-mode-close-tag-at-start
- open-token "<"))
- ;; If there is a closing tag at the start of the line, search back
- ;; for its opener and indent to that level.
- (if (looking-at close-at-start)
- (progn
- (save-excursion
- (setq close-tag (match-string 1))
- ;; Keep searching for a match for the close tag until
- ;; the tag-stack is 0.
- (while (and (not (bobp))
- (> tag-stack 0)
- (re-search-backward (concat open-token
- "\\(/?\\)"
- close-tag) nil t))
- (if (string-equal (match-string 1) "/")
- ;; We found another close tag, so increment tag-stack.
- (setq tag-stack (+ tag-stack 1))
- ;; We found an open tag, so decrement tag-stack.
- (setq tag-stack (- tag-stack 1)))
- (setq cur-indent (current-indentation))))
- (if (> tag-stack 0)
- (save-excursion
- (forward-line -1)
- (setq cur-indent (current-indentation)))))
- ;; This was not a closing tag, so we check if the previous line
- ;; was an opening tag.
- (save-excursion
- ;; Keep moving back until we find a line that is not blank
- (while (progn
- (forward-line -1)
- (and (not (bobp)) (looking-at mustache-mode-blank-line))))
- (setq cur-indent (current-indentation))
- (if (re-search-forward mustache-mode-dangling-open old-pnt t)
- (setq cur-indent (+ cur-indent mustache-basic-offset)))))
- ;; Finally, we execute the actual indentation.
- (if (> cur-indent 0)
- (indent-line-to cur-indent)
- (indent-line-to 0))))))
-
-(defconst mustache-mode-font-lock-keywords
- `((,mustache-mode-section (1 font-lock-keyword-face))
- (,mustache-mode-comment (1 font-lock-comment-face))
- (,mustache-mode-include (1 font-lock-function-name-face))
- (,mustache-mode-builtins (1 font-lock-variable-name-face))
- (,mustache-mode-variable (1 font-lock-reference-face))
- (,(concat "</?\\(" mustache-mode-pair-tag "\\)") (1 font-lock-function-name-face))
- (,(concat "<\\(" mustache-mode-standalone-tag "\\)") (1 font-lock-function-name-face))
- (,mustache-mode-html-constant (1 font-lock-variable-name-face))))
-
-;;;###autoload
-(define-derived-mode mustache-mode fundamental-mode "Mustache"
- (set (make-local-variable 'indent-line-function) 'mustache-indent)
- (set (make-local-variable 'indent-tabs-mode) nil)
- (set (make-local-variable 'font-lock-defaults) '(mustache-mode-font-lock-keywords)))
-
-(add-to-list 'auto-mode-alist '("\\.mustache$" . mustache-mode))
-
-(provide 'mustache-mode)
-
-;;; mustache-mode.el ends here
1  emacs.d/vendor/rhtml-mode
@@ -1 +0,0 @@
-Subproject commit 4d9e823c8490d9020242e9f310de31006589e52d
1  emacs.d/vendor/rinari
@@ -1 +0,0 @@
-Subproject commit 0f4a601cd809be66cfce267c1a9ff4fb65695edb
View
409 emacs.d/vendor/slim-mode.el
@@ -1,409 +0,0 @@
-;;; slim-mode.el --- Major mode for editing Slim files
-
-;; Copyright (c) 2007, 2008 Nathan Weizenbaum
-;; Modified slightly for Slim by Daniel Mendler
-
-;; Author: Nathan Weizenbaum
-;; URL: http://github.com/stonean/slim
-;; Version: 1.0
-;; Keywords: markup, language
-
-;;; Commentary:
-
-;; Because Slim's indentation schema is similar
-;; to that of YAML and Python, many indentation-related
-;; functions are similar to those in yaml-mode and python-mode.
-
-;; TODO: This whole file has to be reworked to provide optimal support
-;; for Slim. This is only a slightly adapted haml version.
-
-;; To install, save this on your load path and add the following to
-;; your .emacs file:
-
-;;
-;; (require 'slim-mode)
-
-;;; Code:
-
-(eval-when-compile (require 'cl))
-
-;; User definable variables
-
-(defgroup slim nil
- "Support for the Slim template language."
- :group 'languages
- :prefix "slim-")
-
-(defcustom slim-mode-hook nil
- "Hook run when entering Slim mode."
- :type 'hook
- :group 'slim)
-
-(defcustom slim-indent-offset 2
- "Amount of offset per level of indentation."
- :type 'integer
- :group 'slim)
-
-(defcustom slim-backspace-backdents-nesting t
- "Non-nil to have `slim-electric-backspace' re-indent all code
-nested beneath the backspaced line be re-indented along with the
-line itself."
- :type 'boolean
- :group 'slim)
-
-(defface slim-tab-face
- '((((class color)) (:background "hotpink"))
- (t (:reverse-video t)))
- "Face to use for highlighting tabs in Slim files."
- :group 'faces
- :group 'slim)
-
-(defvar slim-indent-function 'slim-indent-p
- "This function should look at the current line and return true
-if the next line could be nested within this line.")
-
-(defvar slim-block-openers
- `("^ *\\([\\.#a-z][^ \t]*\\)\\(\\[.*\\]\\)?[ \t]*$"
- "^ *[-=].*do[ \t]*\\(|.*|[ \t]*\\)?$"
- ,(concat "^ *-[ \t]*\\("
- (regexp-opt '("if" "unless" "while" "until" "else"
- "begin" "elsif" "rescue" "ensure" "when"))
- "\\)")
- "^ *|"
- "^ */"
- "^ *[a-z0-9_]:")
- "A list of regexps that match lines of Slim that could have
-text nested beneath them.")
-
-;; Font lock
-
-;; Helper for nested block (comment, embedded, text)
-(defun slim-nested-re (re)
- (concat "^\\( *\\)" re "\n\\(?:\\(?:\\1 .*\\)\n\\)*"))
-
-(defconst slim-font-lock-keywords
- `((,(slim-nested-re "/.*") 0 font-lock-comment-face) ;; Comment block
- (,(slim-nested-re "[a-z0-9_]+:") 0 font-lock-string-face) ;; Embedded block
- (,(slim-nested-re "[\|'`].*") 0 font-lock-string-face) ;; Text block
- ("^!.*" 0 font-lock-constant-face) ;; Directive
- ("^ *\\(\t\\)" 1 'slim-tab-face)
- ("\\('[^']*'\\)" 1 font-lock-string-face append) ;; Single quote string TODO
- ("\\(\"[^\"]*\"\\)" 1 font-lock-string-face append) ;; Double quoted string TODO
- ("@[a-z0-9_]+" 0 font-lock-variable-name-face append) ;; Class variable TODO
- ("^ *\\(#[a-z0-9_]+\/?\\)" 1 font-lock-keyword-face) ;; #id
- ("^ *\\(\\.[a-z0-9_]+\/?\\)" 1 font-lock-type-face) ;; .class
- ("^ *\\([a-z0-9_]+\/?\\)" 1 font-lock-function-name-face) ;; div
- ("^ *\\(#[a-z0-9_]+\/?\\)" (1 font-lock-keyword-face) ;; #id.class
- ("\\.[a-z0-9_]+" nil nil (0 font-lock-type-face)))
- ("^ *\\(\\.[a-z0-9_]+\/?\\)" (1 font-lock-type-face) ;; .class.class
- ("\\.[a-z0-9_]+" nil nil (0 font-lock-type-face)))
- ("^ *\\(\\.[a-z0-9_]+\/?\\)" (1 font-lock-type-face) ;; .class#id
- ("\\#[a-z0-9_]+" nil nil (0 font-lock-keyword-face)))
- ("^ *\\([a-z0-9_]+\/?\\)" (1 font-lock-function-name-face) ;; div.class
- ("\\.[a-z0-9_]+" nil nil (0 font-lock-type-face)))
- ("^ *\\([a-z0-9_]+\/?\\)" (1 font-lock-function-name-face) ;; div#id
- ("\\#[a-z0-9_]+" nil nil (0 font-lock-keyword-face)))
- ("^ *\\(\\(==?|-\\) .*\\)" 1 font-lock-preprocessor-face prepend) ;; ==, =, -
- ("^ *[\\.#a-z0-9_]+\\(==? .*\\)" 1 font-lock-preprocessor-face prepend))) ;; tag ==, tag =
-
-(defconst slim-embedded-re "^ *[a-z0-9_]+:")
-(defconst slim-comment-re "^ */")
-
-(defun* slim-extend-region ()
- "Extend the font-lock region to encompass embedded engines and comments."
- (let ((old-beg font-lock-beg)
- (old-end font-lock-end))
- (save-excursion
- (goto-char font-lock-beg)
- (beginning-of-line)
- (unless (or (looking-at slim-embedded-re)
- (looking-at slim-comment-re))
- (return-from slim-extend-region))
- (setq font-lock-beg (point))
- (slim-forward-sexp)
- (beginning-of-line)
- (setq font-lock-end (max font-lock-end (point))))
- (or (/= old-beg font-lock-beg)
- (/= old-end font-lock-end))))
-
-
-;; Mode setup
-
-(defvar slim-mode-syntax-table
- (let ((table (make-syntax-table)))
- (modify-syntax-entry ?: "." table)
- (modify-syntax-entry ?_ "w" table)
- table)
- "Syntax table in use in slim-mode buffers.")
-
-(defvar slim-mode-map
- (let ((map (make-sparse-keymap)))
- (define-key map [backspace] 'slim-electric-backspace)
- (define-key map "\C-?" 'slim-electric-backspace)
- (define-key map "\C-c\C-f" 'slim-forward-sexp)
- (define-key map "\C-c\C-b" 'slim-backward-sexp)
- (define-key map "\C-c\C-u" 'slim-up-list)
- (define-key map "\C-c\C-d" 'slim-down-list)
- (define-key map "\C-c\C-k" 'slim-kill-line-and-indent)
- map))
-
-;;;###autoload
-(define-derived-mode slim-mode fundamental-mode "Slim"
- "Major mode for editing Slim files.
-
-\\{slim-mode-map}"
- (set-syntax-table slim-mode-syntax-table)
- (add-to-list 'font-lock-extend-region-functions 'slim-extend-region)
- (set (make-local-variable 'font-lock-multiline) t)
- (set (make-local-variable 'indent-line-function) 'slim-indent-line)
- (set (make-local-variable 'indent-region-function) 'slim-indent-region)
- (set (make-local-variable 'parse-sexp-lookup-properties) t)
- (setq comment-start "/")
- (setq indent-tabs-mode nil)
- (setq font-lock-defaults '((slim-font-lock-keywords) nil t)))
-
-;; Useful functions
-
-(defun slim-comment-block ()
- "Comment the current block of Slim code."
- (interactive)
- (save-excursion
- (let ((indent (current-indentation)))
- (back-to-indentation)
- (insert "/")
- (newline)
- (indent-to indent)
- (beginning-of-line)
- (slim-mark-sexp)
- (slim-reindent-region-by slim-indent-offset))))
-
-(defun slim-uncomment-block ()
- "Uncomment the current block of Slim code."
- (interactive)
- (save-excursion
- (beginning-of-line)
- (while (not (looking-at slim-comment-re))
- (slim-up-list)
- (beginning-of-line))
- (slim-mark-sexp)
- (kill-line 1)
- (slim-reindent-region-by (- slim-indent-offset))))
-
-;; Navigation
-
-(defun slim-forward-through-whitespace (&optional backward)
- "Move the point forward at least one line, until it reaches
-either the end of the buffer or a line with no whitespace.
-
-If `backward' is non-nil, move the point backward instead."
- (let ((arg (if backward -1 1))
- (endp (if backward 'bobp 'eobp)))
- (loop do (forward-line arg)
- while (and (not (funcall endp))
- (looking-at "^[ \t]*$")))))
-
-(defun slim-at-indent-p ()
- "Returns whether or not the point is at the first
-non-whitespace character in a line or whitespace preceding that
-character."
- (let ((opoint (point)))
- (save-excursion
- (back-to-indentation)
- (>= (point) opoint))))
-
-(defun slim-forward-sexp (&optional arg)
- "Move forward across one nested expression.
-With `arg', do it that many times. Negative arg -N means move
-backward across N balanced expressions.
-
-A sexp in Slim is defined as a line of Slim code as well as any
-lines nested beneath it."
- (interactive "p")
- (or arg (setq arg 1))
- (if (and (< arg 0) (not (slim-at-indent-p)))
- (back-to-indentation)
- (while (/= arg 0)
- (let ((indent (current-indentation)))
- (loop do (slim-forward-through-whitespace (< arg 0))
- while (and (not (eobp))
- (not (bobp))
- (> (current-indentation) indent)))
- (back-to-indentation)
- (setq arg (+ arg (if (> arg 0) -1 1)))))))
-
-(defun slim-backward-sexp (&optional arg)
- "Move backward across one nested expression.
-With ARG, do it that many times. Negative arg -N means move
-forward across N balanced expressions.
-
-A sexp in Slim is defined as a line of Slim code as well as any
-lines nested beneath it."
- (interactive "p")
- (slim-forward-sexp (if arg (- arg) -1)))
-
-(defun slim-up-list (&optional arg)
- "Move out of one level of nesting.
-With ARG, do this that many times."
- (interactive "p")
- (or arg (setq arg 1))
- (while (> arg 0)
- (let ((indent (current-indentation)))
- (loop do (slim-forward-through-whitespace t)
- while (and (not (bobp))
- (>= (current-indentation) indent)))
- (setq arg (- arg 1))))
- (back-to-indentation))
-
-(defun slim-down-list (&optional arg)
- "Move down one level of nesting.
-With ARG, do this that many times."
- (interactive "p")
- (or arg (setq arg 1))
- (while (> arg 0)
- (let ((indent (current-indentation)))
- (slim-forward-through-whitespace)
- (when (<= (current-indentation) indent)
- (slim-forward-through-whitespace t)
- (back-to-indentation)
- (error "Nothing is nested beneath this line"))
- (setq arg (- arg 1))))
- (back-to-indentation))
-
-(defun slim-mark-sexp ()
- "Marks the next Slim block."
- (let ((forward-sexp-function 'slim-forward-sexp))
- (mark-sexp)))
-
-(defun slim-mark-sexp-but-not-next-line ()
- "Marks the next Slim block, but puts the mark at the end of the
-last line of the sexp rather than the first non-whitespace
-character of the next line."
- (slim-mark-sexp)
- (set-mark
- (save-excursion
- (goto-char (mark))
- (forward-line -1)
- (end-of-line)
- (point))))
-
-;; Indentation and electric keys
-
-(defun slim-indent-p ()
- "Returns true if the current line can have lines nested beneath it."
- (loop for opener in slim-block-openers
- if (looking-at opener) return t
- finally return nil))
-
-(defun slim-compute-indentation ()
- "Calculate the maximum sensible indentation for the current line."
- (save-excursion
- (beginning-of-line)
- (if (bobp) 0
- (slim-forward-through-whitespace t)
- (+ (current-indentation)
- (if (funcall slim-indent-function) slim-indent-offset
- 0)))))
-
-(defun slim-indent-region (start end)
- "Indent each nonblank line in the region.
-This is done by indenting the first line based on
-`slim-compute-indentation' and preserving the relative
-indentation of the rest of the region.
-
-If this command is used multiple times in a row, it will cycle
-between possible indentations."
- (save-excursion
- (goto-char end)
- (setq end (point-marker))
- (goto-char start)
- (let (this-line-column current-column
- (next-line-column
- (if (and (equal last-command this-command) (/= (current-indentation) 0))
- (* (/ (- (current-indentation) 1) slim-indent-offset) slim-indent-offset)
- (slim-compute-indentation))))
- (while (< (point) end)
- (setq this-line-column next-line-column
- current-column (current-indentation))
- ;; Delete whitespace chars at beginning of line
- (delete-horizontal-space)
- (unless (eolp)
- (setq next-line-column (save-excursion
- (loop do (forward-line 1)
- while (and (not (eobp)) (looking-at "^[ \t]*$")))
- (+ this-line-column
- (- (current-indentation) current-column))))
- ;; Don't indent an empty line
- (unless (eolp) (indent-to this-line-column)))
- (forward-line 1)))
- (move-marker end nil)))
-
-(defun slim-indent-line ()
- "Indent the current line.
-The first time this command is used, the line will be indented to the
-maximum sensible indentation. Each immediately subsequent usage will
-back-dent the line by `slim-indent-offset' spaces. On reaching column
-0, it will cycle back to the maximum sensible indentation."
- (interactive "*")
- (let ((ci (current-indentation))
- (cc (current-column))
- (need (slim-compute-indentation)))
- (save-excursion
- (beginning-of-line)
- (delete-horizontal-space)
- (if (and (equal last-command this-command) (/= ci 0))
- (indent-to (* (/ (- ci 1) slim-indent-offset) slim-indent-offset))
- (indent-to need)))
- (if (< (current-column) (current-indentation))
- (forward-to-indentation 0))))
-
-(defun slim-reindent-region-by (n)
- "Add N spaces to the beginning of each line in the region.
-If N is negative, will remove the spaces instead. Assumes all
-lines in the region have indentation >= that of the first line."
- (let ((ci (current-indentation)))
- (save-excursion
- (replace-regexp (concat "^" (make-string ci ? ))
- (make-string (max 0 (+ ci n)) ? )
- nil (point) (mark)))))
-
-(defun slim-electric-backspace (arg)
- "Delete characters or back-dent the current line.
-If invoked following only whitespace on a line, will back-dent
-the line and all nested lines to the immediately previous
-multiple of `slim-indent-offset' spaces.
-
-Set `slim-backspace-backdents-nesting' to nil to just back-dent
-the current line."
- (interactive "*p")
- (if (or (/= (current-indentation) (current-column))
- (bolp)
- (looking-at "^[ \t]+$"))
- (backward-delete-char arg)
- (save-excursion
- (let ((ci (current-column)))
- (beginning-of-line)
- (if slim-backspace-backdents-nesting
- (slim-mark-sexp-but-not-next-line)
- (set-mark (save-excursion (end-of-line) (point))))
- (slim-reindent-region-by (* (- arg) slim-indent-offset))
- (back-to-indentation)
- (pop-mark)))))
-
-(defun slim-kill-line-and-indent ()
- "Kill the current line, and re-indent all lines nested beneath it."
- (interactive)
- (beginning-of-line)
- (slim-mark-sexp-but-not-next-line)
- (kill-line 1)
- (slim-reindent-region-by (* -1 slim-indent-offset)))
-
-(defun slim-indent-string ()
- "Return the indentation string for `slim-indent-offset'."
- (mapconcat 'identity (make-list slim-indent-offset " ") ""))
-
-;;;###autoload
-(add-to-list 'auto-mode-alist '("\\.slim$" . slim-mode))
-
-;; Setup/Activation
-(provide 'slim-mode)
-;;; slim-mode.el ends here
View
2  gitconfig
@@ -45,3 +45,5 @@
grep = auto
[format]
pretty = %C(yellow)%h%Creset %s %C(red)(%cr)%Creset
+[credential]
+ helper = osxkeychain
View
40 ruco.rb
@@ -0,0 +1,40 @@
+Ruco.configure do
+ # set options
+ options.window_line_scroll_offset = 5 # default 1
+ options.history_entries = 10 # default 100
+ options.editor_remove_trailing_whitespace_on_save = true # default false
+ options.editor_blank_line_before_eof_on_save = true # default false
+ options.editor_line_numbers = true # default false
+
+ # Use any Textmate theme e.g. from http://wiki.macromates.com/Themes/UserSubmittedThemes
+ # use a url that points directly to the theme, e.g. github 'raw' urls
+ options.color_theme = "https://raw.github.com/deplorableword/textmate-solarized/master/Solarized%20%28dark%29.tmTheme"
+
+ # bind a key
+ # - you can use Integers and Symbols
+ # - use "ruco --debug-keys foo" to see which keys are possible
+ # - have a look at lib/ruco/keyboard.rb
+ bind(:"Ctrl+e") do
+ ask('foo') do |response|
+ if response == 'bar'
+ editor.insert('baz')
+ else
+ editor.move(:to, 0,0)
+ editor.delete(99999)
+ editor.insert('FAIL!')
+ end
+ end
+ end
+
+ # bind an existing action
+ puts @actions.keys
+
+ bind :"Ctrl+x", :quit
+ bind :"Ctrl+o", :save
+ bind :"Ctrl+k", :delete_line
+ bind :"Ctrl+a", :move_to_bol
+
+ # create reusable actions
+ action(:first_line){ editor.move(:to_column, 0) }
+ bind :"Ctrl+u", :first_line
+end
View
9 tmux.conf
@@ -14,4 +14,11 @@ set -sg escape-time 1
set -g mode-mouse on
-set-option -g status off
+set-option -g status on
+set-option -g status-interval 2
+set-option -g status-utf8 on
+set-option -g status-justify "centre"
+set-option -g status-left-length 60
+set-option -g status-right-length 90
+set-option -g status-left "#(~/.tmux/tmux-powerline/status-left.sh)"
+set-option -g status-right "#(~/.tmux/tmux-powerline/status-right.sh)"
View
3  tmux/tmux-powerline/.gitignore
@@ -0,0 +1,3 @@
+segments/np_mpd
+segments/xkb_layout
+*.swp
View
19 tmux/tmux-powerline/AUTHORS
@@ -0,0 +1,19 @@
+Please append you name/nick here when you have contributed with something!
+
+Erik Westrup <erik.westrup@gmail.com>
+Suvash Thapaliya <suvash@gmail.com>
+Erik Jansson <erikjansson90@gmail.com>
+Yuku Takahashi <taka84u9@gmail.com>
+Oscar Olsson <osse.olsson@gmail.com>
+Ryo Katsuma
+negipo
+Sina Siadat
+Vivien Leroy <fantattitude@me.com>
+Gino Lucero
+Derek Ashley Thomas <derekathomas@gmail.com>
+LuRsT
+Tomokazu Hirai <tomokazu.hirai@gmail.com>
+Matt Black
+krieiter
+Viktor Jackson
+flytreeleft <flytreeleft@126.com>
View
14 tmux/tmux-powerline/LICENSE
@@ -0,0 +1,14 @@
+tmux-powerline - Statusbar configuration for tmux that looks like vim-powerline and consist of dynamic segments.
+
+Copyright (c) 2012, see AUTHORS
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+ * Neither the name of the <ORGANIZATION> nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+http://opensource.org/licenses/BSD-3-Clause
View
167 tmux/tmux-powerline/README.md
@@ -0,0 +1,167 @@
+# tmux-powerline
+This is a set of scripts (segments) for making a nice and dynamic tmux statusbar where elements can come and disappears depending on events. I really like the look of [Lokaltog/vim-powerline](https://github.com/Lokaltog/vim-powerline) and I decided I wanted the same for tmux.
+
+The following segments exists for now:
+* LAN & WAN IP addresses.
+* Now Playing for MPD, Spotify (GNU/Linux native or wine, OS X), iTunes (OS X), Rhythmbox, Banshee, MOC, and Audacious.
+* New mail count for GMail, Maildir and Apple Mail.
+* GNU/Linux and Macintosh OS X battery status (uses [richo/dotfiles/bin/battery](https://github.com/richoH/dotfiles/blob/master/bin/battery)).
+* Weather in Celsius, Fahrenheit and Kelvin using Yahoo Weather.
+* System load, cpu usage and uptime.
+* Git, SVN and Mercurial branch in CWD.
+* Date and time.
+* Hostname.
+* tmux info.
+* CWD in pane.
+* Current X keyboard layout.
+
+Check [segments/](https://github.com/erikw/tmux-powerline/tree/master/segments) for more undocumented segments and details.
+
+# Screenshots
+**Full screenshot**
+
+![Full screenshot](https://github.com/erikw/tmux-powerline/raw/master/img/full.png)
+
+**left-status**
+
+Current tmux session, window and pane, hostname and LAN & WAN IP address.
+
+![left-status](https://github.com/erikw/tmux-powerline/raw/master/img/left-status.png)
+
+**right-status**
+
+New mails, now playing, average load, weather, date and time.
+
+![right-status](https://github.com/erikw/tmux-powerline/raw/master/img/right-status.png)
+
+Now I've read my inbox so the mail segment disappears!
+
+![right-status, no mail](https://github.com/erikw/tmux-powerline/raw/master/img/right-status_no_mail.png)
+
+After pausing the music there's no need for showing NP anymore. Also the weather has become much nicer!
+
+![right-status, no mpd](https://github.com/erikw/tmux-powerline/raw/master/img/right-status_no_mpd.png)
+
+Remaining battery.
+
+![right-status, weather and battery](https://github.com/erikw/tmux-powerline/raw/master/img/right-status_weather_battery.png)
+
+# Requirements
+Requirements for the lib to work are:
+
+* Recent tmux version
+* `bash --version` >= 4.0
+* A patched font. Follow instructions at [Lokaltog/vim-powerline/fontpatcher](https://github.com/Lokaltog/vim-powerline/tree/develop/fontpatcher) or [download](https://github.com/Lokaltog/vim-powerline/wiki/Patched-fonts) a new one.
+
+## Segment Requirements
+Requirements for some segments. You only need to fullfill the requirements for those segments you want to use.
+
+* WAN IP: curl, bc
+* MPD now playing: [libmpdclient](http://sourceforge.net/projects/musicpd/files/libmpdclient/)
+* xkb_layout: X11, XKB
+* GMail count: wget.
+
+## OS X specific requirements
+
+**You still need to follow the first part of these instructions even if you are running zsh or something else as your default shell!**
+
+tmux-powerline uses associative arrays in bash, which were added in bash version 4.0. OS X Lion ships with an antiquated version of bash ( run
+`bash --version` to see your version). In order to use tmux-powerline, you need to install a newer version of bash, fortunately,
+[brew](http://mxcl.github.com/homebrew/) makes this very easy. If you don't have brew, [install it](https://github.com/mxcl/homebrew/wiki/installation).
+Then follow these steps:
+
+```bash
+$ brew install bash
+```
+
+**If you're using something other than bash (or if you don't want this newer version of bash as your default shell) you should be done now**. If something
+seems broken, try following the last two steps and see if it helps:
+
+```bash
+$ sudo bash -c "echo /usr/local/Cellar/bash/%INSTALLED_VERSION%/bin/bash >> /private/etc/shells"
+$ chsh -s /usr/local/Cellar/bash/%INSTALLED_VERSION%/bin/bash
+```
+
+The first command installs bash through brew, the second registers the new shell with the system and the third changes to the new shell for your user.
+If you later upgrade bash through brew, don't forget to do the last two steps again with the new version number. After doing the above and restarting your
+terminal, running `echo $SHELL` should result in the following:
+
+```bash
+$ echo $SHELL
+/usr/local/Cellar/bash/%INSTALLED_VERSION%/bin/bash
+```
+
+# Installation
+Just check out the repository with:
+
+```console
+$ cd ~/some/path/
+$ git clone git://github.com/erikw/tmux-powerline.git
+```
+
+Now edit your `~/.tmux.conf` to use the scripts:
+
+<!-- Close syntax enought. -->
+```vim
+set-option -g status on
+set-option -g status-interval 2
+set-option -g status-utf8 on
+set-option -g status-justify "centre"
+set-option -g status-left-length 60
+set-option -g status-right-length 90
+set-option -g status-left "#(~/path/to/tmux-powerline/status-left.sh)"
+set-option -g status-right "#(~/path/to/tmux-powerline/status-right.sh)"
+```
+
+Set the maximum lengths to something that suits your configuration of segments and size of terminal (the maximum segments length will be handled better in the future). Don't forget to change the PLATFORM variable in `config.sh` or your `~/.bashrc` to reflect your operating system of choice.
+
+Also I recommend you to use the [tmux-colors-solarized](https://github.com/seebi/tmux-colors-solarized) theme (as well as solarized for [everything else](http://ethanschoonover.com/solarized) :)):
+
+```bash
+source ~/path/to/tmux-colors-solarized/tmuxcolors.conf
+```
+Some segments e.g. cwd and cvs_branch needs to find the current working directory of the active pane. To achive this we let tmux save the path each time the bash prompt is displayed. Put this in your `~/.bashrc` or where you define you PS1 variable (I use and source `~/.bash_ps1`):
+
+```bash
+PS1="$PS1"'$([ -n "$TMUX" ] && tmux setenv TMUXPWD_$(tmux display -p "#I_#P") "$PWD")'
+```
+
+You can toggle the visibility of the statusbars by adding the following to your `~/.tmux.conf`:
+
+```vim
+bind C-[ run '~/path/to/tmux-powerline/mute_statusbar.sh left' # Mute left statusbar.
+bind C-] run '~/path/to/tmux-powerline/mute_statusbar.sh right' # Mute right statusbar.
+```
+
+# Configuration
+
+Edit the two status scripts to suit you needs. A number of common segments are included that covers some general functions like time, date, battery etc. The segments can be moved around and does not needs to be in the order (or same file) as they are now. It should be quite easy to add you own segments.
+
+```console
+$ $EDITOR ~/path/to/tmux-powerline/status-left.sh
+$ $EDITOR ~/path/to/tmux-powerline/status-right.sh
+```
+
+
+Here is one segment configuration explained so you'll know how to make you own.
+
+```bash
+declare -A time # The name of the array.
+time+=(["script"]="${segments_path}/time.sh") # mandatory, the shell script producing the output text to be shown.
+time+=(["foreground"]="colour136") # mandatory, the text foreground color.
+time+=(["background"]="colour235") # mandatory, the text background color.
+time+=(["separator"]="${separator_left_thin}") # mandatory, the separator to use. Can be (as described in `lib.sh`) any of separator_(left|right)_(bold|thin)
+time+=(["separator_fg"]="default") # optional, overrides the default blending coloring of the separator with a custom colored foreground.
+register_segment "time" # Registers the name of the array declared above.
+```
+# Debugging
+
+Some segments might not work on your system for various reasons such as missing programs or different versions not having the same options. If a segment fails the printing should be aborted. To investigate further why a segment fails you can run
+
+```bash
+$ bash -x ~/path/to/failing/segment.sh
+```
+
+# Hacking
+
+This project can only gain positively from contributions. Fork today and make your own enhancments and segments to share back!
View
12 tmux/tmux-powerline/config.sh
@@ -0,0 +1,12 @@
+#!/bin/sh
+# Cofigurations for tmux-powerline.
+
+if [ -z "$PLATFORM" ]; then
+ # You platform \in {linux,bsd,mac}.
+ export PLATFORM="linux"
+fi
+
+if [ -z "$USE_PATCHED_FONT" ]; then
+ # Useage of patched font for symbols. true or false.
+ export USE_PATCHED_FONT="true"
+fi
View
BIN  tmux/tmux-powerline/img/full.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  tmux/tmux-powerline/img/left-status.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  tmux/tmux-powerline/img/right-status.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  tmux/tmux-powerline/img/right-status_no_mail.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  tmux/tmux-powerline/img/right-status_no_mpd.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  tmux/tmux-powerline/img/right-status_weather_battery.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
219 tmux/tmux-powerline/lib.sh
@@ -0,0 +1,219 @@
+# Library functions.
+
+segments_dir="segments"
+declare entries
+
+if [ -n "$USE_PATCHED_FONT" -a "$USE_PATCHED_FONT" == "true" ]; then
+ # Separators (patched font required)
+ separator_left_bold=""
+ separator_left_thin=""
+ separator_right_bold=""
+ separator_right_thin=""
+else
+ # Alternative separators in the normal Unicode table.
+ separator_left_bold=""
+ separator_left_thin=""
+ separator_right_bold=""
+ separator_right_thin=""
+fi
+
+# Make sure that grep does not emit colors.
+export GREP_OPTIONS="--color=never"
+
+# Create temp directory for segments to use.
+export tp_tmpdir="/tmp/tmux-powerline"
+if [ ! -d "$tp_tmpdir" ]; then
+ mkdir "$tp_tmpdir"
+fi
+
+# Register a segment.
+register_segment() {
+ segment_name="$1"
+ entries[${#entries[*]}]="$segment_name"
+
+}
+
+print_status_line_right() {
+ local prev_bg="colour235"
+ for entry in ${entries[*]}; do
+ local script=$(eval echo \${${entry}["script"]})
+ local foreground=$(eval echo \${${entry}["foreground"]})
+ local background=$(eval echo \${${entry}["background"]})
+ local separator=$(eval echo \${${entry}["separator"]})
+ local separator_fg=""
+ if [ $(eval echo \${${entry}["separator_fg"]+_}) ];then
+ separator_fg=$(eval echo \${${entry}["separator_fg"]})
+ fi
+
+ # Can't be declared local if we want the exit code.
+ output=$(${script})
+ local exit_code="$?"
+ if [ "$exit_code" -ne 0 ]; then
+ echo "Segment ${script} exited with code ${exit_code}. Aborting."
+ exit 1
+ elif [ -z "$output" ]; then
+ continue
+ fi
+ __ui_right "$prev_bg" "$background" "$foreground" "$separator" "$separator_fg"
+ echo -n "$output"
+ unset output
+ prev_bg="$background"
+ done
+ # End in a clean state.
+ echo "#[default]"
+}
+
+first_segment_left=1
+print_status_line_left() {
+ prev_bg="colour148"
+ for entry in ${entries[*]}; do
+ local script=$(eval echo \${${entry}["script"]})
+ local foreground=$(eval echo \${${entry}["foreground"]})
+ local background=$(eval echo \${${entry}["background"]})
+ local separator=$(eval echo \${${entry}["separator"]})
+ local separator_fg=""
+ if [ $(eval echo \${${entry}["separator_fg"]+_}) ];then
+ separator_fg=$(eval echo \${${entry}["separator_fg"]})
+ fi
+
+ local output=$(${script})
+ if [ -n "$output" ]; then
+ __ui_left "$prev_bg" "$background" "$foreground" "$separator" "$separator_fg"
+ echo -n "$output"
+ prev_bg="$background"
+ if [ "$first_segment_left" -eq "1" ]; then
+ first_segment_left=0
+ fi
+ fi
+ done
+ __ui_left "colour235" "colour235" "red" "$separator_right_bold" "$prev_bg"
+
+ # End in a clean state.
+ echo "#[default]"
+}
+
+#Internal printer for right.
+__ui_right() {
+ local bg_left="$1"
+ local bg_right="$2"
+ local fg_right="$3"
+ local separator="$4"
+ local separator_fg
+ if [ -n "$5" ]; then
+ separator_fg="$5"
+ else
+ separator_fg="$bg_right"
+ fi
+ echo -n " #[fg=${separator_fg}, bg=${bg_left}]${separator}#[fg=${fg_right},bg=${bg_right}] "
+}
+
+# Internal printer for left.
+__ui_left() {
+ local bg_left="$1"
+ local bg_right="$2"
+ local fg_right="$3"
+ local separator
+ if [ "$first_segment_left" -eq "1" ]; then
+ separator=""
+ else
+ separator="$4"
+ fi
+
+ local separator_bg
+ if [ -n "$5" ]; then
+ bg_left="$5"
+ separator_bg="$bg_right"
+ else
+ separator_bg="$bg_right"
+ fi
+
+ if [ "$first_segment_left" -eq "1" ]; then
+ echo -n "#[bg=${bg_right}]"
+ fi
+
+ echo -n " #[fg=${bg_left}, bg=${separator_bg}]${separator}#[fg=${fg_right},bg=${bg_right}]"
+
+ if [ "$first_segment_left" -ne "1" ]; then
+ echo -n " "
+ fi
+}
+
+# Get the current path in the segment.
+get_tmux_cwd() {
+ local env_name=$(tmux display -p "TMUXPWD_#I_#P")
+ local env_val=$(tmux show-environment | grep "$env_name")
+ # The version below is still quite new for tmux. Uncommented this in the future :-)
+ #local env_val=$(tmux show-environment "$env_name" 2>&1)
+
+ if [[ ! $env_val =~ "unknown variable" ]]; then
+ local tmux_pwd=$(echo "$env_val" | sed 's/^.*=//')
+ echo "$tmux_pwd"
+ fi
+}
+
+# Exit this script if a mute file exists.
+mute_status_check() {
+ local side="$1"
+ local tmux_session=$(tmux display -p "#S")
+ local mute_file="${tp_tmpdir}/mute_${tmux_session}_${side}"
+ if [ -e "$mute_file" ]; then
+ exit
+ fi
+}
+
+# Toggles the visibility of a statusbar side.
+mute_status() {
+ local side="$1"
+ local tmux_session=$(tmux display -p "#S")
+ local mute_file="${tp_tmpdir}/mute_${tmux_session}_${side}"
+ if [ -e "$mute_file" ]; then
+ rm "$mute_file"
+ else
+ touch "$mute_file"
+ fi
+}
+
+# Rolling anything what you want.
+# arg1: text to roll.
+# arg2: max length to display.
+# arg3: roll speed in characters per second.
+roll_stuff() {
+ local stuff="$1" # Text to print
+ if [ -z "$stuff" ]; then
+ return;
+ fi
+ local max_len="10" # Default max length.
+ if [ -n "$2" ]; then
+ max_len="$2"
+ fi
+ local speed="1" # Default roll speed in chars per second.
+ if [ -n "$3" ]; then
+ speed="$3"
+ fi
+ # Anything starting with 0 is an Octal number in Shell,C or Perl,
+ # so we must explicityly state the base of a number using base#number
+ local offset=$((10#$(date +%s) * ${speed} % ${#stuff}))
+ # Truncate stuff.
+ stuff=${stuff:offset}
+ local char # Character.
+ local bytes # The bytes of one character.
+ local index
+ for ((index=0; index < max_len; index++)); do
+ char=${stuff:index:1}
+ bytes=$(echo -n $char | wc -c)
+ # The character will takes twice space
+ # of an alphabet if (bytes > 1).
+ if ((bytes > 1)); then
+ max_len=$((max_len - 1))
+ fi
+ done
+ stuff=${stuff:0:max_len}
+ #echo "index=${index} max=${max_len} len=${#stuff}"
+ # How many spaces we need to fill to keep
+ # the length of stuff that will be shown?
+ local fill_count=$((${index} - ${#stuff}))
+ for ((index=0; index < fill_count; index++)); do
+ stuff="${stuff} "
+ done
+ echo "${stuff}"
+}
View
11 tmux/tmux-powerline/mute_statusbar.sh
@@ -0,0 +1,11 @@
+#!/usr/bin/env bash
+# Toggles the visibility of a statusbar side.
+
+# The powerline root directory.
+cwd=$(dirname $0)
+
+# Source lib functions.
+source "${cwd}/lib.sh"
+
+side="$1"
+mute_status "$side"
View
18 tmux/tmux-powerline/segments/Makefile
@@ -0,0 +1,18 @@
+# Build the small MPD NP program.
+# Enable debug printing with $ make -e DEBUG=1
+DEBUG=0
+CC = $(shell hash clang 2>/dev/null && echo clang || echo gcc)
+CFLAGS = -O3 -Wall -std=c99 -I /usr/include/ -D DEBUG=${DEBUG}
+LDLIBS = -lmpdclient
+XKB_LAYOUT_LDLIBS= -lX11
+
+.PHONY: all clean
+
+all: np_mpd xkb_layout
+
+xkb_layout: xkb_layout.c
+ $(CC) $(CFLAGS) $(LDFLAGS) $< $(XKB_LAYOUT_LDLIBS) -o $@
+
+clean:
+ $(RM) np_mpd
+ $(RM) xkb_layout
View
130 tmux/tmux-powerline/segments/battery.sh
</
@@ -0,0 +1,130 @@
+#!/usr/bin/env bash
+# LICENSE This code is not under the same license as the rest of the project as it's "stolen". It's cloned from https://github.com/richoH/dotfiles/blob/master/bin/battery and just some modifications are done so it works for my laptop. Check that URL for more recent versions.
+
+#CUTE_BATTERY_INDICATOR="true"
+
+HEART_FULL=♥
+HEART_EMPTY=♡
+[ -z "$NUM_HEARTS" ] &&
+ NUM_HEARTS=5
+
+cutinate()
+{
+ perc=$1
+ inc=$(( 100 / $NUM_HEARTS))
+
+
+ for i in `seq $NUM_HEARTS`; do
+ if [ $perc -lt 100 ]; then
+ echo $HEART_EMPTY
+ else
+ echo $HEART_FULL
+ fi
+ perc=$(( $perc + $inc ))
+ done
+}
+
+linux_get_bat ()
+{
+ bf=$(cat $BAT_FULL)
+ bn=$(cat $BAT_NOW)
+ echo $(( 100 * $bn / $bf ))
+}
+
+freebsd_get_bat ()
+{
+ echo "$(sysctl -n hw.acpi.battery.life)"
+
+}
+
+# Do with grep and awk unless too hard
+
+# TODO Identify which machine we're on from teh script.
+
+battery_status()
+{
+case $(uname -s) in
+ "Linux")
+ BATPATH=/sys/class/power_supply/BAT0
+ if [ ! -d $BATPATH ]; then
+ BATPATH=/sys/class/power_supply/BAT1
+ fi
+ STATUS=$BATPATH/status
+ BAT_FULL=$BATPATH/charge_full
+ if [ ! -r $BAT_FULL ]; then
+ BAT_FULL=$BATPATH/energy_full
+ fi
+ BAT_NOW=$BATPATH/charge_now
+ if [ ! -r $BAT_NOW ]; then
+ BAT_NOW=$BATPATH/energy_now
+ fi
+
+ if [ "$1" = `cat $STATUS` -o "$1" = "" ]; then
+ linux_get_bat
+ fi
+ ;;
+ "FreeBSD")
+ STATUS=`sysctl -n hw.acpi.battery.state`
+ case $1 in
+ "Discharging")
+ if [ $STATUS -eq 1 ]; then
+ freebsd_get_bat
+ fi
+ ;;
+ "Charging")
+ if [ $STATUS -eq 2 ]; then
+ freebsd_get_bat
+ fi
+ ;;
+ "")
+ freebsd_get_bat
+ ;;
+ esac
+ ;;
+ "Darwin")
+ case $1 in
+ "Discharging")
+ ext="No";;
+ "Charging")
+ ext="Yes";;
+ esac
+
+ ioreg -c AppleSmartBattery -w0 | \
+ grep -o '"[^"]*" = [^ ]*' | \
+ sed -e 's/= //g' -e 's/"//g' | \
+ sort | \
+ while read key value; do
+ case $key in
+ "MaxCapacity")
+ export maxcap=$value;;
+ "CurrentCapacity")
+ export curcap=$value;;
+ "ExternalConnected")
+ if [ "$ext" != "$value" ]; then
+ exit
+ fi
+ ;;
+ "FullyCharged")
+ if [ "$value" = "Yes" ]; then
+ exit
+ fi
+ ;;
+ esac
+ if [[ -n "$maxcap" && -n $curcap ]]; then
+ echo $(( 100 * $curcap / $maxcap ))
+ break
+ fi
+ done
+esac
+}
+
+BATTERY_STATUS=`battery_status $1`
+[ -z "$BATTERY_STATUS" ] && exit
+
+if [ -n "$CUTE_BATTERY_INDICATOR" ]; then
+ echo `cutinate $BATTERY_STATUS`
+else
+ echo "${HEART_FULL} ${BATTERY_STATUS}%"
+ #echo "⛁ ${BATTERY_STATUS}%"
+fi
+