Merge branch 'master' of gitorious.org:hunner/hunners-dotfiles
Conflicts: .zshrc
This commit is contained in:
commit
2b63e41a3b
14 changed files with 669 additions and 101 deletions
14
.emacs
14
.emacs
|
|
@ -1,15 +1,15 @@
|
||||||
(defconst dot-emacs (concat (getenv "HOME") "/" ".emacs.hunner.el")
|
(defconst dot-emacs (concat (getenv "HOME") "/" ".emacs.hunner.el")
|
||||||
"My dot emacs file")
|
"My dot emacs file")
|
||||||
|
|
||||||
(require 'bytecomp)
|
(require 'bytecomp)
|
||||||
(setq compiled-dot-emacs (byte-compile-dest-file dot-emacs))
|
(setq compiled-dot-emacs (byte-compile-dest-file dot-emacs))
|
||||||
|
|
||||||
(if (or (not (file-exists-p compiled-dot-emacs))
|
(if (or (not (file-exists-p compiled-dot-emacs))
|
||||||
(file-newer-than-file-p dot-emacs compiled-dot-emacs)
|
(file-newer-than-file-p dot-emacs compiled-dot-emacs)
|
||||||
(equal (nth 4 (file-attributes dot-emacs)) (list 0 0)))
|
(equal (nth 4 (file-attributes dot-emacs)) (list 0 0)))
|
||||||
(load dot-emacs)
|
(load dot-emacs)
|
||||||
(load compiled-dot-emacs))
|
(load compiled-dot-emacs))
|
||||||
|
|
||||||
(add-hook 'kill-emacs-hook
|
(add-hook 'kill-emacs-hook
|
||||||
'(lambda () (and (file-newer-than-file-p dot-emacs compiled-dot-emacs)
|
'(lambda () (and (file-newer-than-file-p dot-emacs compiled-dot-emacs)
|
||||||
(byte-compile-file dot-emacs))))
|
(byte-compile-file dot-emacs))))
|
||||||
|
|
|
||||||
|
|
@ -22,8 +22,8 @@
|
||||||
(interactive)
|
(interactive)
|
||||||
(color-theme-install
|
(color-theme-install
|
||||||
'(color-theme-irblack
|
'(color-theme-irblack
|
||||||
(;; (background-color . "black")
|
((background-color . "black")
|
||||||
;; (background-mode . dark)
|
(background-mode . dark)
|
||||||
(border-color . "gray10")
|
(border-color . "gray10")
|
||||||
(cursor-color . "DarkOliveGreen2")
|
(cursor-color . "DarkOliveGreen2")
|
||||||
(foreground-color . "#F6F3E8")
|
(foreground-color . "#F6F3E8")
|
||||||
|
|
@ -57,8 +57,10 @@
|
||||||
(font-lock-variable-name-face ((t (:foreground "steel blue"))))
|
(font-lock-variable-name-face ((t (:foreground "steel blue"))))
|
||||||
(font-lock-warning-face ((t (:background "#CC1503" :foreground "#FFFFFF"))))
|
(font-lock-warning-face ((t (:background "#CC1503" :foreground "#FFFFFF"))))
|
||||||
(gui-element ((t (:background "#D4D0C8" :foreground "black"))))
|
(gui-element ((t (:background "#D4D0C8" :foreground "black"))))
|
||||||
|
(fringe ((t (:background "grey10"))))
|
||||||
(region ((t (:background "dark red"))))
|
(region ((t (:background "dark red"))))
|
||||||
(mode-line ((t (:background "dim gray" :foreground "dark gray"))))
|
(mode-line ((t (:background "dim gray" :foreground "dark gray"))))
|
||||||
|
(mode-line-buffer-id ((t (:bold t :background "dim gray" : foreground "dark gray" :weight bold))))
|
||||||
(highlight ((t (:background "#111111"))))
|
(highlight ((t (:background "#111111"))))
|
||||||
(highline-face ((t (:background "SeaGreen"))))
|
(highline-face ((t (:background "SeaGreen"))))
|
||||||
(left-margin ((t (nil))))
|
(left-margin ((t (nil))))
|
||||||
|
|
@ -67,6 +69,8 @@
|
||||||
(show-paren-mismatch ((t (:background "#FF1100"))))
|
(show-paren-mismatch ((t (:background "#FF1100"))))
|
||||||
(underline ((nil (:underline nil))))
|
(underline ((nil (:underline nil))))
|
||||||
|
|
||||||
|
;; whitespace
|
||||||
|
(trailing-whitespace ((t (:background "gray22"))))
|
||||||
;; mumamo
|
;; mumamo
|
||||||
;(mumamo-background-chunk-major ((t (:background "#000000"))))
|
;(mumamo-background-chunk-major ((t (:background "#000000"))))
|
||||||
;(mumamo-background-chunk-submode ((t (:background "#222222"))))
|
;(mumamo-background-chunk-submode ((t (:background "#222222"))))
|
||||||
|
|
|
||||||
110
.emacs.hunner.el
110
.emacs.hunner.el
|
|
@ -1,6 +1,6 @@
|
||||||
(require 'cl)
|
;; (require 'cl)
|
||||||
|
|
||||||
(mapcar (lambda (x) (add-to-list 'load-path (expand-file-name x)))
|
(mapc (lambda (x) (add-to-list 'load-path (expand-file-name x)))
|
||||||
'("~/.emacs.d"
|
'("~/.emacs.d"
|
||||||
))
|
))
|
||||||
|
|
||||||
|
|
@ -12,15 +12,17 @@
|
||||||
irblack
|
irblack
|
||||||
parenface
|
parenface
|
||||||
bar-cursor
|
bar-cursor
|
||||||
|
tls
|
||||||
|
erc
|
||||||
))
|
))
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
;; GLOBAL
|
;; GLOBAL
|
||||||
(color-theme-initialize)
|
(color-theme-initialize)
|
||||||
|
|
||||||
(if window-system
|
;; (if window-system
|
||||||
(set-background-color "black")
|
;; (set-background-color "black")
|
||||||
())
|
;; ())
|
||||||
(color-theme-irblack)
|
(color-theme-irblack)
|
||||||
;(if window-system
|
;(if window-system
|
||||||
; (color-theme-gentooish)
|
; (color-theme-gentooish)
|
||||||
|
|
@ -30,8 +32,15 @@
|
||||||
;(load-file "~/.emacs.d/color-theme-inkpot.el")
|
;(load-file "~/.emacs.d/color-theme-inkpot.el")
|
||||||
;(color-theme-inkpot)
|
;(color-theme-inkpot)
|
||||||
|
|
||||||
|
;; OS X settings
|
||||||
|
;; (setq mac-option-key-is-meta nil)
|
||||||
|
;; (setq mac-command-key-is-meta t)
|
||||||
|
;; (setq mac-command-modifier 'meta)
|
||||||
|
;; (setq mac-option-modifier nil)
|
||||||
|
|
||||||
(bar-cursor-mode 1)
|
(bar-cursor-mode 1)
|
||||||
(menu-bar-mode 0)
|
(menu-bar-mode 0)
|
||||||
|
(scroll-bar-mode -1)
|
||||||
(tool-bar-mode 0)
|
(tool-bar-mode 0)
|
||||||
(setq linum-format "%3d ")
|
(setq linum-format "%3d ")
|
||||||
(setq-default indent-tabs-mode nil)
|
(setq-default indent-tabs-mode nil)
|
||||||
|
|
@ -80,8 +89,9 @@
|
||||||
;; (setq url-proxy-services '(("no_proxy" . "localhost")
|
;; (setq url-proxy-services '(("no_proxy" . "localhost")
|
||||||
;; ("http" . "localhost:8118")))
|
;; ("http" . "localhost:8118")))
|
||||||
|
|
||||||
(setq-default save-place t) ;; activate it for all buffers
|
|
||||||
(setq save-place-file "~/.emacs.d/saveplace") ;; keep my ~/ clean
|
(setq save-place-file "~/.emacs.d/saveplace") ;; keep my ~/ clean
|
||||||
|
(setq-default save-place t) ;; activate it for all buffers
|
||||||
|
(require 'saveplace) ;; Need to require after setq
|
||||||
|
|
||||||
(setq backup-directory-alist
|
(setq backup-directory-alist
|
||||||
`((".*" . "~/.emacs.d/backups/")))
|
`((".*" . "~/.emacs.d/backups/")))
|
||||||
|
|
@ -96,6 +106,7 @@
|
||||||
;; Highlight bad whitespace
|
;; Highlight bad whitespace
|
||||||
(global-whitespace-mode t)
|
(global-whitespace-mode t)
|
||||||
(setq whitespace-style (quote (tabs tab-mark)))
|
(setq whitespace-style (quote (tabs tab-mark)))
|
||||||
|
(setq-default show-trailing-whitespace t)
|
||||||
|
|
||||||
;; Make % work like vi
|
;; Make % work like vi
|
||||||
(global-set-key "%" 'match-paren)
|
(global-set-key "%" 'match-paren)
|
||||||
|
|
@ -107,12 +118,12 @@
|
||||||
(t (self-insert-command (or arg 1)))))
|
(t (self-insert-command (or arg 1)))))
|
||||||
|
|
||||||
;; Prevent Emacs from stupidly auto-changing my working directory
|
;; Prevent Emacs from stupidly auto-changing my working directory
|
||||||
(defun find-file-save-default-directory ()
|
;; (defun find-file-save-default-directory ()
|
||||||
(interactive)
|
;; (interactive)
|
||||||
(setq saved-default-directory default-directory)
|
;; (setq saved-default-directory default-directory)
|
||||||
(ido-find-file)
|
;; (ido-find-file)
|
||||||
(setq default-directory saved-default-directory))
|
;; (setq default-directory saved-default-directory))
|
||||||
(global-set-key "\C-x\C-f" 'find-file-save-default-directory)
|
;; (global-set-key "\C-x\C-f" 'find-file-save-default-directory)
|
||||||
|
|
||||||
;; Give killing lines advice
|
;; Give killing lines advice
|
||||||
(defadvice kill-ring-save (before slick-copy activate compile)
|
(defadvice kill-ring-save (before slick-copy activate compile)
|
||||||
|
|
@ -164,6 +175,7 @@
|
||||||
commands))
|
commands))
|
||||||
(set-keys '(
|
(set-keys '(
|
||||||
("C-c t" totd)
|
("C-c t" totd)
|
||||||
|
("C-c n" global-linum-mode)
|
||||||
("C-c s p" (lambda () (interactive)
|
("C-c s p" (lambda () (interactive)
|
||||||
(if (shellfm-running-p)
|
(if (shellfm-running-p)
|
||||||
(shellfm-pause)
|
(shellfm-pause)
|
||||||
|
|
@ -176,8 +188,14 @@
|
||||||
("C-c s a" shellfm-add-to-playlist)
|
("C-c s a" shellfm-add-to-playlist)
|
||||||
("C-c s q" shellfm 0)
|
("C-c s q" shellfm 0)
|
||||||
("C-c s i" shellfm-track-info)
|
("C-c s i" shellfm-track-info)
|
||||||
|
("C-c e" ido-erc-buffer)
|
||||||
|
("C-S-<left>" shrink-window-horizontally)
|
||||||
|
("C-S-<right>" enlarge-window-horizontally)
|
||||||
|
("C-S-<down>" shrink-window)
|
||||||
|
("C-S-<up>" enlarge-window)
|
||||||
("M-s" save-buffer)
|
("M-s" save-buffer)
|
||||||
("M-n" global-linum-mode)
|
("M-p" ctrl-y-in-vi)
|
||||||
|
("M-n" ctrl-e-in-vi)
|
||||||
("M-N" make-frame)
|
("M-N" make-frame)
|
||||||
("M-W" delete-frame)
|
("M-W" delete-frame)
|
||||||
("M-w" ido-kill-buffer)
|
("M-w" ido-kill-buffer)
|
||||||
|
|
@ -190,21 +208,44 @@
|
||||||
("M-O" other-window)
|
("M-O" other-window)
|
||||||
("M-`" switch-to-next-frame)
|
("M-`" switch-to-next-frame)
|
||||||
("M-~" switch-to-previous-frame)
|
("M-~" switch-to-previous-frame)
|
||||||
|
("M-RET" ns-toggle-fullscreen)
|
||||||
))
|
))
|
||||||
|
|
||||||
|
;;toggle full-screen
|
||||||
|
;; (defun toggle-fullscreen ()
|
||||||
|
;; (interactive)
|
||||||
|
;; (set-frame-parameter
|
||||||
|
;; nil
|
||||||
|
;; 'fullscreen
|
||||||
|
;; (if (frame-parameter nil 'fullscreen)
|
||||||
|
;; nil
|
||||||
|
;; 'fullboth)))
|
||||||
|
|
||||||
|
;; (global-set-key [(meta return)] 'toggle-fullscreen)
|
||||||
|
|
||||||
;; Transparency
|
;; Transparency
|
||||||
(set-frame-parameter (selected-frame) 'alpha '(85 85))
|
(set-frame-parameter (selected-frame) 'alpha '(85 85))
|
||||||
(add-to-list 'default-frame-alist '(alpha 85 85))
|
(add-to-list 'default-frame-alist '(alpha 85 85))
|
||||||
|
;; (set-frame-font "Droid Sans Mono Dotted-12")
|
||||||
(eval-when-compile (require 'cl))
|
(eval-when-compile (require 'cl))
|
||||||
(defun toggle-transparency ()
|
(defun toggle-transparency ()
|
||||||
(interactive)
|
(interactive)
|
||||||
(if (/=
|
(if (/=
|
||||||
(cadr (find 'alpha (frame-parameters nil) :key #'car))
|
(cadr (find 'alpha (frame-parameters nil) :key #'car))
|
||||||
10)
|
40)
|
||||||
(set-frame-parameter nil 'alpha '(10 10))
|
(set-frame-parameter nil 'alpha '(40 40))
|
||||||
(set-frame-parameter nil 'alpha '(85 85))))
|
(set-frame-parameter nil 'alpha '(85 85))))
|
||||||
(global-set-key (kbd "C-c T") 'toggle-transparency)
|
(global-set-key (kbd "C-c T") 'toggle-transparency)
|
||||||
|
|
||||||
|
;; Vim-like scrolling
|
||||||
|
(defun ctrl-e-in-vi (n)
|
||||||
|
(interactive "p")
|
||||||
|
(scroll-up n))
|
||||||
|
|
||||||
|
(defun ctrl-y-in-vi (n)
|
||||||
|
(interactive "p")
|
||||||
|
(scroll-down n))
|
||||||
|
|
||||||
;; (global-set-key (kbd "<XF86AudioPlay>")
|
;; (global-set-key (kbd "<XF86AudioPlay>")
|
||||||
;; (lambda () (interactive)
|
;; (lambda () (interactive)
|
||||||
;; (if (shellfm-running-p)
|
;; (if (shellfm-running-p)
|
||||||
|
|
@ -213,8 +254,29 @@
|
||||||
|
|
||||||
;; ERC stuff
|
;; ERC stuff
|
||||||
;; (setq erc-encoding-coding-alist (quote (("#lisp" . utf-8)
|
;; (setq erc-encoding-coding-alist (quote (("#lisp" . utf-8)
|
||||||
;; ("#nihongo" . iso-2022-jp) ("#truelambda" . iso-latin-1)
|
;; ("#nihongo" . iso-2022-jp)
|
||||||
;; ("#bitlbee" . iso-latin-1))))
|
;; ("#" . iso-latin-1)
|
||||||
|
;; ("#" . iso-latin-1))))
|
||||||
|
(autoload 'erc "erc")
|
||||||
|
(add-hook 'erc-mode-hook
|
||||||
|
'(lambda ()
|
||||||
|
(setq scroll-margin 0)
|
||||||
|
(setq erc-scrolltobottom-mode 1)))
|
||||||
|
(load "~/.emacs.d/erc-bip") ;; Passwords here
|
||||||
|
(defun ido-erc-buffer()
|
||||||
|
(interactive)
|
||||||
|
(switch-to-buffer
|
||||||
|
(ido-completing-read "Channel:"
|
||||||
|
(save-excursion
|
||||||
|
(delq
|
||||||
|
nil
|
||||||
|
(mapcar (lambda (buf)
|
||||||
|
(when (buffer-live-p buf)
|
||||||
|
(with-current-buffer buf
|
||||||
|
(and (eq major-mode 'erc-mode)
|
||||||
|
(buffer-name buf)))))
|
||||||
|
(buffer-list)))))))
|
||||||
|
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
;; Haskell mode
|
;; Haskell mode
|
||||||
|
|
@ -282,6 +344,13 @@
|
||||||
'(scroll-step 1)
|
'(scroll-step 1)
|
||||||
'(scroll-up-aggressively 0.0)
|
'(scroll-up-aggressively 0.0)
|
||||||
'(show-paren-mode t nil (paren)))
|
'(show-paren-mode t nil (paren)))
|
||||||
|
(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.
|
||||||
|
'(mumamo-border-face-in ((t nil)))
|
||||||
|
'(mumamo-border-face-out ((t nil))))
|
||||||
|
|
||||||
|
|
||||||
;;; This was installed by package-install.el.
|
;;; This was installed by package-install.el.
|
||||||
|
|
@ -294,10 +363,3 @@
|
||||||
(expand-file-name "~/.emacs.d/elpa/package.el"))
|
(expand-file-name "~/.emacs.d/elpa/package.el"))
|
||||||
(package-initialize)
|
(package-initialize)
|
||||||
(require 'starter-kit-elpa))
|
(require 'starter-kit-elpa))
|
||||||
(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.
|
|
||||||
'(mumamo-border-face-in ((t nil)))
|
|
||||||
'(mumamo-border-face-out ((t nil))))
|
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,7 @@
|
||||||
[user]
|
[user]
|
||||||
name = Hunter Haugen
|
name = Hunter Haugen
|
||||||
email = h.haugen@gmail.com
|
email = h.haugen@gmail.com
|
||||||
|
[color]
|
||||||
|
ui = true
|
||||||
|
[alias]
|
||||||
|
lg = "log --pretty=format:'%C(yellow)%h%C(reset) %C(blue)%an%C(reset) %C(cyan)%cr%C(reset) %s %C(green)%d%C(reset)' --graph"
|
||||||
|
|
|
||||||
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -1,2 +1,3 @@
|
||||||
.emacs.d/auto-save-list/*
|
.emacs.d/auto-save-list/*
|
||||||
.emacs.d/history
|
.emacs.d/history
|
||||||
|
*
|
||||||
|
|
|
||||||
19
.muttrc
19
.muttrc
|
|
@ -1,20 +1,5 @@
|
||||||
# Gmail stuff
|
# Accound information
|
||||||
#set imap_user="hunter.haugen@gmail.com"
|
source '~/.muttrc.sh|'
|
||||||
set imap_user="hunner"
|
|
||||||
#set imap_pass="password"
|
|
||||||
|
|
||||||
#set smtp_url="smtp://hunter.haugen@smtp.gmail.com:587/"
|
|
||||||
set smtp_url="smtp://mailhost.cecs.pdx.edu:587/"
|
|
||||||
#set ssl_min_dh_prime_bits=512
|
|
||||||
#set smtp_pass="password"
|
|
||||||
set from="hunner@cat.pdx.edu"
|
|
||||||
set realname="Hunter Haugen"
|
|
||||||
|
|
||||||
#set folder="imaps://imap.gmail.com:993"
|
|
||||||
set folder="imaps://mailhost.cecs.pdx.edu:993"
|
|
||||||
set spoolfile="+INBOX"
|
|
||||||
#set postponed="+[Gmail]/Drafts"
|
|
||||||
#set record="+[Gmail]/Sent Mail"
|
|
||||||
|
|
||||||
# Cache message headers for quick retrieval
|
# Cache message headers for quick retrieval
|
||||||
set header_cache=~/.mutt/cache/headers
|
set header_cache=~/.mutt/cache/headers
|
||||||
|
|
|
||||||
28
.muttrc.sh
Executable file
28
.muttrc.sh
Executable file
|
|
@ -0,0 +1,28 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
if [ x$HOST = xcz ] ; then
|
||||||
|
echo 'set imap_user="hunter@puppetlabs.com"'
|
||||||
|
#set imap_pass="password"
|
||||||
|
|
||||||
|
#set smtp_url="smtp://hunter.haugen@smtp.gmail.com:587/"
|
||||||
|
|
||||||
|
echo 'set folder="imaps://imap.gmail.com:993"'
|
||||||
|
echo 'set spoolfile="+INBOX"'
|
||||||
|
#set postponed="+[Gmail]/Drafts"
|
||||||
|
#set record="+[Gmail]/Sent Mail"
|
||||||
|
else
|
||||||
|
# IMAP
|
||||||
|
echo 'set imap_user="hunner"'
|
||||||
|
#set imap_pass="password"
|
||||||
|
|
||||||
|
# SMTP
|
||||||
|
echo 'set smtp_url="smtp://mailhost.cecs.pdx.edu:587/"'
|
||||||
|
#set ssl_min_dh_prime_bits=512
|
||||||
|
#set smtp_pass="password"
|
||||||
|
echo 'set from="hunner@cat.pdx.edu"'
|
||||||
|
echo 'set realname="Hunter Haugen"'
|
||||||
|
|
||||||
|
# Folders
|
||||||
|
echo 'set folder="imaps://mailhost.cecs.pdx.edu:993"'
|
||||||
|
echo 'set spoolfile="+INBOX"'
|
||||||
|
fi
|
||||||
|
|
@ -8,8 +8,10 @@ augroup filetypedetect
|
||||||
"au! BufNewFile,BufRead *.rhtml set syn=eruby
|
"au! BufNewFile,BufRead *.rhtml set syn=eruby
|
||||||
"au! BufNewFile,BufRead *.haml setfiletype haml
|
"au! BufNewFile,BufRead *.haml setfiletype haml
|
||||||
"au! BufNewFile,BufRead *.rhtml setfiletype rhtml
|
"au! BufNewFile,BufRead *.rhtml setfiletype rhtml
|
||||||
|
au! BufNewFile,BufRead Vagrantfile setfiletype ruby
|
||||||
au! BufNewFile,BufRead *.rhtml setfiletype eruby
|
au! BufNewFile,BufRead *.rhtml setfiletype eruby
|
||||||
au! BufNewFile,BufRead *.s setfiletype asmx86
|
au! BufNewFile,BufRead *.s setfiletype asmx86
|
||||||
|
au! BufNewFile,BufRead *.rl setfiletype ragel
|
||||||
au! BufRead,BufNewFile *.ijs,*.ijt,*.ijp,*.ijx setfiletype j
|
au! BufRead,BufNewFile *.ijs,*.ijt,*.ijp,*.ijx setfiletype j
|
||||||
|
|
||||||
augroup END
|
augroup END
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
" puppet syntax file
|
" puppet syntax file
|
||||||
" Filename: puppet.vim
|
" Filename: puppet.vim
|
||||||
" Language: puppet configuration file
|
" Language: puppet configuration file
|
||||||
" Maintainer: Luke Kanies <luke@madstop.com>
|
" Maintainer: Luke Kanies <luke@madstop.com>
|
||||||
" URL:
|
" URL:
|
||||||
" Last Change:
|
" Last Change:
|
||||||
" Version:
|
" Version:
|
||||||
"
|
"
|
||||||
|
|
||||||
" Copied from the cfengine, ruby, and perl syntax files
|
" Copied from the cfengine, ruby, and perl syntax files
|
||||||
|
|
@ -16,37 +16,66 @@ elseif exists("b:current_syntax")
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
|
|
||||||
syn region puppetDefine start="^\s*\(class\|define\|site\|node\)" end="{" contains=puppetDefType,puppetDefName,puppetDefArguments
|
" match class/definition/node declarations
|
||||||
syn keyword puppetDefType class define site node inherits contained
|
syn region puppetDefine start="^\s*\(class\|define\|node\)\s" end="{" contains=puppetDefType,puppetDefName,puppetDefArguments,puppetNodeRe
|
||||||
syn keyword puppetInherits inherits contained
|
syn keyword puppetDefType class define node inherits contained
|
||||||
syn region puppetDefArguments start="(" end=")" contains=puppetArgument
|
syn region puppetDefArguments start="(" end=")" contained contains=puppetArgument,puppetString
|
||||||
syn match puppetArgument "\w\+" contained
|
syn match puppetArgument "\w\+" contained
|
||||||
syn match puppetDefName "\w\+" contained
|
syn match puppetArgument "\$\w\+" contained
|
||||||
|
syn match puppetArgument "'[^']+'" contained
|
||||||
|
syn match puppetArgument '"[^"]+"' contained
|
||||||
|
syn match puppetDefName "\w\+" contained
|
||||||
|
syn match puppetNodeRe "/.*/" contained
|
||||||
|
|
||||||
syn match puppetInstance "\w\+\s*{" contains=puppetTypeBrace,puppetTypeName,puppetTypeDefault
|
" match 'foo' in 'class foo { ...'
|
||||||
syn match puppetTypeBrace "{" contained
|
" match 'foo::bar' in 'class foo::bar { ...'
|
||||||
syn match puppetTypeName "[a-z]\w*" contained
|
" match 'Foo::Bar' in 'Foo::Bar["..."]
|
||||||
syn match puppetTypeDefault "[A-Z]\w*" contained
|
"FIXME: "Foo-bar" doesn't get highlighted as expected, although "foo-bar" does.
|
||||||
|
syn match puppetInstance "[A-Za-z0-9_-]\+\(::[A-Za-z0-9_-]\+\)*\s*{" contains=puppetTypeName,puppetTypeDefault
|
||||||
|
syn match puppetInstance "[A-Z][a-z_-]\+\(::[A-Z][a-z_-]\+\)*\s*[[{]" contains=puppetTypeName,puppetTypeDefault
|
||||||
|
syn match puppetInstance "[A-Z][a-z_-]\+\(::[A-Z][a-z_-]\+\)*\s*<\?<|" contains=puppetTypeName,puppetTypeDefault
|
||||||
|
syn match puppetTypeName "[a-z]\w*" contained
|
||||||
|
syn match puppetTypeDefault "[A-Z]\w*" contained
|
||||||
|
|
||||||
syn match puppetParam "\w\+\s*=>" contains=puppetTypeRArrow,puppetParamName
|
" match 'foo' in 'foo => "bar"'
|
||||||
syn match puppetParamRArrow "=>" contained
|
syn match puppetParam "\w\+\s*[=+]>" contains=puppetParamName
|
||||||
syn match puppetParamName "\w\+" contained
|
syn match puppetParamName "\w\+" contained
|
||||||
syn match puppetVariable "$\w\+"
|
|
||||||
syn match puppetVariable "${\w\+}"
|
|
||||||
syn match puppetParen "("
|
|
||||||
syn match puppetParen ")"
|
|
||||||
syn match puppetBrace "{"
|
|
||||||
syn match puppetBrace "}"
|
|
||||||
|
|
||||||
syn region puppetString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=puppetVariable
|
" match 'present' in 'ensure => present'
|
||||||
|
" match '2755' in 'mode => 2755'
|
||||||
|
" don't match 'bar' in 'foo => bar'
|
||||||
|
syn match puppetParam "\w\+\s*[=+]>\s*[a-z0-9]\+" contains=puppetParamString,puppetParamName
|
||||||
|
syn match puppetParamString "[=+]>\s*\w\+" contains=puppetParamKeyword,puppetParamSpecial,puppetParamDigits contained
|
||||||
|
syn keyword puppetParamKeyword present absent purged latest installed running stopped mounted unmounted role configured file directory link contained
|
||||||
|
syn keyword puppetParamSpecial true false undef contained
|
||||||
|
syn match puppetParamDigits "[0-9]\+"
|
||||||
|
|
||||||
syn keyword puppetBoolean true false
|
" match 'template' in 'content => template("...")'
|
||||||
syn keyword puppetKeyword import inherits include
|
syn match puppetParam "\w\+\s*[=+]>\s*\w\+\s*(" contains=puppetFunction,puppetParamName
|
||||||
syn keyword puppetControl case default
|
" statements
|
||||||
|
syn region puppetFunction start="^\s*\(alert\|crit\|debug\|emerg\|err\|fail\|include\|info\|notice\|realize\|require\|search\|tag\|warning\)\s*(" end=")" contained contains=puppetString
|
||||||
|
" rvalues
|
||||||
|
syn region puppetFunction start="^\s*\(defined\|file\|fqdn_rand\|generate\|inline_template\|regsubst\|sha1\|shellquote\|split\|sprintf\|tagged\|template\|versioncmp\)\s*(" end=")" contained contains=puppetString
|
||||||
|
|
||||||
|
syn match puppetVariable "$[a-zA-Z0-9_:]\+"
|
||||||
|
syn match puppetVariable "${[a-zA-Z0-9_:]\+}"
|
||||||
|
|
||||||
|
" match anything between simple/double quotes.
|
||||||
|
" don't match variables if preceded by a backslash.
|
||||||
|
syn region puppetString start=+'+ skip=+\\\\\|\\'+ end=+'+
|
||||||
|
syn region puppetString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=puppetVariable,puppetNotVariable
|
||||||
|
syn match puppetString "/[^/]*/"
|
||||||
|
syn match puppetNotVariable "\\$\w\+" contained
|
||||||
|
syn match puppetNotVariable "\\${\w\+}" contained
|
||||||
|
|
||||||
|
syn keyword puppetKeyword import inherits include
|
||||||
|
syn keyword puppetControl case default if else elsif
|
||||||
|
syn keyword puppetSpecial true false undef
|
||||||
|
|
||||||
" comments last overriding everything else
|
" comments last overriding everything else
|
||||||
syn match puppetComment "\s*#.*$" contains=puppetTodo
|
syn match puppetComment "\s*#.*$" contains=puppetTodo
|
||||||
syn keyword puppetTodo TODO NOTE FIXME XXX contained
|
syn region puppetComment start="/\*" end="\*/" contains=puppetTodo extend
|
||||||
|
syn keyword puppetTodo TODO NOTE FIXME XXX BUG HACK contained
|
||||||
|
|
||||||
" Define the default highlighting.
|
" Define the default highlighting.
|
||||||
" For version 5.7 and earlier: only when not done already
|
" For version 5.7 and earlier: only when not done already
|
||||||
|
|
@ -60,25 +89,25 @@ if version >= 508 || !exists("did_puppet_syn_inits")
|
||||||
endif
|
endif
|
||||||
|
|
||||||
HiLink puppetVariable Identifier
|
HiLink puppetVariable Identifier
|
||||||
HiLink puppetBoolean Boolean
|
|
||||||
HiLink puppetType Identifier
|
HiLink puppetType Identifier
|
||||||
HiLink puppetDefault Identifier
|
|
||||||
HiLink puppetKeyword Define
|
HiLink puppetKeyword Define
|
||||||
HiLink puppetTypeDefs Define
|
|
||||||
HiLink puppetComment Comment
|
HiLink puppetComment Comment
|
||||||
HiLink puppetString String
|
HiLink puppetString String
|
||||||
|
HiLink puppetParamKeyword String
|
||||||
|
HiLink puppetParamDigits String
|
||||||
|
HiLink puppetNotVariable String
|
||||||
|
HiLink puppetParamSpecial Special
|
||||||
|
HiLink puppetSpecial Special
|
||||||
HiLink puppetTodo Todo
|
HiLink puppetTodo Todo
|
||||||
" HiLink puppetBrace Delimiter
|
|
||||||
" HiLink puppetTypeBrace Delimiter
|
|
||||||
" HiLink puppetParen Delimiter
|
|
||||||
HiLink puppetDelimiter Delimiter
|
|
||||||
HiLink puppetControl Statement
|
HiLink puppetControl Statement
|
||||||
HiLink puppetDefType Define
|
HiLink puppetDefType Define
|
||||||
HiLink puppetDefName Type
|
HiLink puppetDefName Type
|
||||||
|
HiLink puppetNodeRe Type
|
||||||
HiLink puppetTypeName Statement
|
HiLink puppetTypeName Statement
|
||||||
HiLink puppetTypeDefault Type
|
HiLink puppetTypeDefault Type
|
||||||
HiLink puppetParamName Identifier
|
HiLink puppetParamName Identifier
|
||||||
HiLink puppetArgument Identifier
|
HiLink puppetArgument Identifier
|
||||||
|
HiLink puppetFunction Function
|
||||||
|
|
||||||
delcommand HiLink
|
delcommand HiLink
|
||||||
endif
|
endif
|
||||||
|
|
|
||||||
149
.vim/syntax/ragel.vim
Normal file
149
.vim/syntax/ragel.vim
Normal file
|
|
@ -0,0 +1,149 @@
|
||||||
|
" Vim syntax file
|
||||||
|
"
|
||||||
|
" Language: Ragel
|
||||||
|
" Author: Adrian Thurston
|
||||||
|
|
||||||
|
syntax clear
|
||||||
|
|
||||||
|
"
|
||||||
|
" Outside code
|
||||||
|
"
|
||||||
|
|
||||||
|
" Comments
|
||||||
|
syntax region ocComment start="\/\*" end="\*\/"
|
||||||
|
syntax match ocComment "\/\/.*$"
|
||||||
|
|
||||||
|
" Anything preprocessor
|
||||||
|
syntax match ocPreproc "#\(.\|\\\n\)*$"
|
||||||
|
syntax region ocPreproc start="#" end="[^\\]$"
|
||||||
|
|
||||||
|
" Strings
|
||||||
|
syntax match ocLiteral "'\(\\.\|[^'\\]\)*'"
|
||||||
|
syntax match ocLiteral "\"\(\\.\|[^\"\\]\)*\""
|
||||||
|
|
||||||
|
" C/C++ Keywords
|
||||||
|
syntax keyword ocType unsigned signed void char short int long float double bool
|
||||||
|
syntax keyword ocType inline static extern register const volatile auto
|
||||||
|
syntax keyword ocType union enum struct class typedef
|
||||||
|
syntax keyword ocType namespace template typename mutable
|
||||||
|
syntax keyword ocKeyword break continue default do else for
|
||||||
|
syntax keyword ocKeyword goto if return switch while
|
||||||
|
syntax keyword ocKeyword new delete this using friend public private protected sizeof
|
||||||
|
syntax keyword ocKeyword throw try catch operator typeid
|
||||||
|
syntax keyword ocKeyword and bitor xor compl bitand and_eq or_eq xor_eq not not_eq
|
||||||
|
syntax keyword ocKeyword static_cast dynamic_cast
|
||||||
|
|
||||||
|
" Numbers
|
||||||
|
syntax match ocNumber "[0-9][0-9]*"
|
||||||
|
syntax match ocNumber "0x[0-9a-fA-F][0-9a-fA-F]*"
|
||||||
|
|
||||||
|
" Booleans
|
||||||
|
syntax keyword ocBoolean true false
|
||||||
|
|
||||||
|
" Identifiers
|
||||||
|
syntax match anyId "[a-zA-Z_][a-zA-Z_0-9]*"
|
||||||
|
|
||||||
|
" Inline code only
|
||||||
|
syntax keyword fsmType fpc fc fcurs fbuf fblen ftargs fstack
|
||||||
|
syntax keyword fsmKeyword fhold fgoto fcall fret fentry fnext fexec fbreak
|
||||||
|
|
||||||
|
syntax cluster rlItems contains=rlComment,rlLiteral,rlAugmentOps,rlOtherOps,rlKeywords,rlWrite,rlCodeCurly,rlCodeSemi,rlNumber,anyId,rlLabelColon,rlExprKeywords
|
||||||
|
|
||||||
|
syntax region machineSpec1 matchgroup=beginRL start="%%{" end="}%%" contains=@rlItems
|
||||||
|
syntax region machineSpec2 matchgroup=beginRL start="%%[^{]"rs=e-1 end="$" keepend contains=@rlItems
|
||||||
|
syntax region machineSpec2 matchgroup=beginRL start="%%$" end="$" keepend contains=@rlItems
|
||||||
|
|
||||||
|
" Comments
|
||||||
|
syntax match rlComment "#.*$" contained
|
||||||
|
|
||||||
|
" Literals
|
||||||
|
syntax match rlLiteral "'\(\\.\|[^'\\]\)*'[i]*" contained
|
||||||
|
syntax match rlLiteral "\"\(\\.\|[^\"\\]\)*\"[i]*" contained
|
||||||
|
syntax match rlLiteral /\/\(\\.\|[^\/\\]\)*\/[i]*/ contained
|
||||||
|
syntax match rlLiteral "\[\(\\.\|[^\]\\]\)*\]" contained
|
||||||
|
|
||||||
|
" Numbers
|
||||||
|
syntax match rlNumber "[0-9][0-9]*" contained
|
||||||
|
syntax match rlNumber "0x[0-9a-fA-F][0-9a-fA-F]*" contained
|
||||||
|
|
||||||
|
" Operators
|
||||||
|
syntax match rlAugmentOps "[>$%@]" contained
|
||||||
|
syntax match rlAugmentOps "<>\|<" contained
|
||||||
|
syntax match rlAugmentOps "[>\<$%@][!\^/*~]" contained
|
||||||
|
syntax match rlAugmentOps "[>$%]?" contained
|
||||||
|
syntax match rlAugmentOps "<>[!\^/*~]" contained
|
||||||
|
syntax match rlAugmentOps "=>" contained
|
||||||
|
syntax match rlOtherOps "->" contained
|
||||||
|
|
||||||
|
syntax match rlOtherOps ":>" contained
|
||||||
|
syntax match rlOtherOps ":>>" contained
|
||||||
|
syntax match rlOtherOps "<:" contained
|
||||||
|
|
||||||
|
" Keywords
|
||||||
|
" FIXME: Enable the range keyword post 5.17.
|
||||||
|
" syntax keyword rlKeywords machine action context include range contained
|
||||||
|
syntax keyword rlKeywords machine action context include import export prepush postpop contained
|
||||||
|
syntax keyword rlExprKeywords when inwhen outwhen err lerr eof from to contained
|
||||||
|
|
||||||
|
" Case Labels
|
||||||
|
syntax keyword caseLabelKeyword case contained
|
||||||
|
syntax cluster caseLabelItems contains=ocComment,ocPreproc,ocLiteral,ocType,ocKeyword,caseLabelKeyword,ocNumber,ocBoolean,anyId,fsmType,fsmKeyword
|
||||||
|
syntax match caseLabelColon "case" contains=@caseLabelItems
|
||||||
|
syntax match caseLabelColon "case[\t ]\+.*:$" contains=@caseLabelItems
|
||||||
|
syntax match caseLabelColon "case[\t ]\+.*:[^=:]"me=e-1 contains=@caseLabelItems
|
||||||
|
|
||||||
|
" Labels
|
||||||
|
syntax match ocLabelColon "^[\t ]*[a-zA-Z_][a-zA-Z_0-9]*[ \t]*:$" contains=anyLabel
|
||||||
|
syntax match ocLabelColon "^[\t ]*[a-zA-Z_][a-zA-Z_0-9]*[ \t]*:[^=:]"me=e-1 contains=anyLabel
|
||||||
|
|
||||||
|
syntax match rlLabelColon "[a-zA-Z_][a-zA-Z_0-9]*[ \t]*:$" contained contains=anyLabel
|
||||||
|
syntax match rlLabelColon "[a-zA-Z_][a-zA-Z_0-9]*[ \t]*:[^=:>]"me=e-1 contained contains=anyLabel
|
||||||
|
syntax match anyLabel "[a-zA-Z_][a-zA-Z_0-9]*" contained
|
||||||
|
|
||||||
|
" All items that can go in a code block.
|
||||||
|
|
||||||
|
syntax cluster inlineItems contains=rlCodeCurly,ocComment,ocPreproc,ocLiteral,ocType,ocKeyword,ocNumber,ocBoolean,ocLabelColon,anyId,fsmType,fsmKeyword,caseLabelColon
|
||||||
|
|
||||||
|
" Blocks of code. rlCodeCurly is recursive.
|
||||||
|
syntax region rlCodeCurly matchgroup=NONE start="{" end="}" contained contains=@inlineItems
|
||||||
|
syntax region rlCodeSemi matchgroup=Type start="\<alphtype\>" start="\<getkey\>" start="\<access\>" start="\<variable\>" matchgroup=NONE end=";" contained contains=@inlineItems
|
||||||
|
|
||||||
|
syntax region rlWrite matchgroup=Type start="\<write\>" matchgroup=NONE end="[;)]" contained contains=rlWriteKeywords,rlWriteOptions
|
||||||
|
|
||||||
|
syntax keyword rlWriteKeywords init data exec exports start error first_final contained
|
||||||
|
syntax keyword rlWriteOptions noerror nofinal noprefix noend nocs contained
|
||||||
|
|
||||||
|
"
|
||||||
|
" Sync at the start of machine specs.
|
||||||
|
"
|
||||||
|
" Match The ragel delimiters only if there quotes no ahead on the same line.
|
||||||
|
" On the open marker, use & to consume the leader.
|
||||||
|
syntax sync match ragelSyncPat grouphere NONE "^[^\'\"%]*%%{&^[^\'\"%]*"
|
||||||
|
syntax sync match ragelSyncPat grouphere NONE "^[^\'\"%]*%%[^{]&^[^\'\"%]*"
|
||||||
|
syntax sync match ragelSyncPat grouphere NONE "^[^\'\"]*}%%"
|
||||||
|
|
||||||
|
"
|
||||||
|
" Specifying Groups
|
||||||
|
"
|
||||||
|
hi link ocComment Comment
|
||||||
|
hi link ocPreproc Macro
|
||||||
|
hi link ocLiteral String
|
||||||
|
hi link ocType Type
|
||||||
|
hi link ocKeyword Keyword
|
||||||
|
hi link ocNumber Number
|
||||||
|
hi link ocBoolean Boolean
|
||||||
|
hi link rlComment Comment
|
||||||
|
hi link rlNumber Number
|
||||||
|
hi link rlLiteral String
|
||||||
|
hi link rlAugmentOps Keyword
|
||||||
|
hi link rlExprKeywords Keyword
|
||||||
|
hi link rlWriteKeywords Keyword
|
||||||
|
hi link rlWriteOptions Keyword
|
||||||
|
hi link rlKeywords Type
|
||||||
|
hi link fsmType Type
|
||||||
|
hi link fsmKeyword Keyword
|
||||||
|
hi link anyLabel Label
|
||||||
|
hi link caseLabelKeyword Keyword
|
||||||
|
hi link beginRL Type
|
||||||
|
|
||||||
|
let b:current_syntax = "ragel"
|
||||||
12
.vimrc
12
.vimrc
|
|
@ -305,6 +305,10 @@ endif
|
||||||
|
|
||||||
" content creation
|
" content creation
|
||||||
if has("autocmd")
|
if has("autocmd")
|
||||||
|
augroup puppet
|
||||||
|
autocmd BufRead,BufNewFile *.pp
|
||||||
|
\ set tabstop=2 shiftwidth=2 softtabstop=2
|
||||||
|
augroup END
|
||||||
augroup text
|
augroup text
|
||||||
autocmd BufRead,BufNewFile *.txt
|
autocmd BufRead,BufNewFile *.txt
|
||||||
\ set nonumber tw=80
|
\ set nonumber tw=80
|
||||||
|
|
@ -513,8 +517,10 @@ endif
|
||||||
" Go to buffers
|
" Go to buffers
|
||||||
nmap <silent> <S-Left> :bprev<CR>
|
nmap <silent> <S-Left> :bprev<CR>
|
||||||
nmap <silent> <S-Right> :bnext<CR>
|
nmap <silent> <S-Right> :bnext<CR>
|
||||||
nmap <C-w>, :bp<CR>
|
nmap <C-w>, :bprev<CR>
|
||||||
nmap <C-w>. :bn<CR>
|
nmap <C-w>. :bnext<CR>
|
||||||
|
nmap gT :bprev<CR>
|
||||||
|
nmap gt :bnext<CR>
|
||||||
|
|
||||||
" v_K is really really annoying
|
" v_K is really really annoying
|
||||||
vmap K k
|
vmap K k
|
||||||
|
|
@ -977,7 +983,7 @@ au Filetype html,xml,xsl,sgml ",docbook
|
||||||
" explorador vertical
|
" explorador vertical
|
||||||
let g:explVertical=1
|
let g:explVertical=1
|
||||||
" define leader como =
|
" define leader como =
|
||||||
let mapleader = "="
|
"let mapleader = "="
|
||||||
|
|
||||||
" Terminal companability
|
" Terminal companability
|
||||||
map <F15> <S-F3>
|
map <F15> <S-F3>
|
||||||
|
|
|
||||||
|
|
@ -71,10 +71,10 @@ mKeys = [ ("M-S-n", sendMessage MirrorShrink ) -- Expand current window
|
||||||
, ("M-S-g", warpToCentre >> goToSelected gsConfig )
|
, ("M-S-g", warpToCentre >> goToSelected gsConfig )
|
||||||
|
|
||||||
-- Multimedia
|
-- Multimedia
|
||||||
, ("<XF86AudioPlay>" , spawn "cmus-remote --pause" ) -- play/pause mpd
|
, ("<XF86AudioPlay>" , spawn "mpc toggle" ) -- play/pause mpd
|
||||||
, ("<XF86AudioStop>" , spawn "cmus-remote --stop" ) -- stop mpd
|
, ("<XF86AudioStop>" , spawn "mpc stop" ) -- stop mpd
|
||||||
, ("<XF86AudioPrev>" , spawn "cmus-remote --prev" ) -- prev song
|
, ("<XF86AudioPrev>" , spawn "mpc prev" ) -- prev song
|
||||||
, ("<XF86AudioNext>" , spawn "cmus-remote --next" ) -- next song
|
, ("<XF86AudioNext>" , spawn "mpc next" ) -- next song
|
||||||
, ("<XF86AudioLowerVolume>", spawn "amixer -q set PCM 1-") -- volume down
|
, ("<XF86AudioLowerVolume>", spawn "amixer -q set PCM 1-") -- volume down
|
||||||
, ("<XF86AudioRaiseVolume>", spawn "amixer -q set PCM 1+") -- volume up
|
, ("<XF86AudioRaiseVolume>", spawn "amixer -q set PCM 1+") -- volume up
|
||||||
, ("<XF86AudioMute>" , spawn "amixer -q set Headphone toggle") -- toggle mute
|
, ("<XF86AudioMute>" , spawn "amixer -q set Headphone toggle") -- toggle mute
|
||||||
|
|
|
||||||
246
.zsh/func/zgitinit
Normal file
246
.zsh/func/zgitinit
Normal file
|
|
@ -0,0 +1,246 @@
|
||||||
|
##
|
||||||
|
## Load with `autoload -U zgitinit; zgitinit'
|
||||||
|
##
|
||||||
|
|
||||||
|
typeset -gA zgit_info
|
||||||
|
zgit_info=()
|
||||||
|
|
||||||
|
zgit_chpwd_hook() {
|
||||||
|
zgit_info_update
|
||||||
|
}
|
||||||
|
|
||||||
|
zgit_preexec_hook() {
|
||||||
|
if [[ $2 == git\ * ]] || [[ $2 == *\ git\ * ]]; then
|
||||||
|
zgit_precmd_do_update=1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
zgit_precmd_hook() {
|
||||||
|
if [ $zgit_precmd_do_update ]; then
|
||||||
|
unset zgit_precmd_do_update
|
||||||
|
zgit_info_update
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
zgit_info_update() {
|
||||||
|
zgit_info=()
|
||||||
|
|
||||||
|
local gitdir="$(git rev-parse --git-dir 2>/dev/null)"
|
||||||
|
if [ $? -ne 0 ] || [ -z "$gitdir" ]; then
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
zgit_info[dir]=$gitdir
|
||||||
|
zgit_info[bare]=$(git rev-parse --is-bare-repository)
|
||||||
|
zgit_info[inwork]=$(git rev-parse --is-inside-work-tree)
|
||||||
|
}
|
||||||
|
|
||||||
|
zgit_isgit() {
|
||||||
|
if [ -z "$zgit_info[dir]" ]; then
|
||||||
|
return 1
|
||||||
|
else
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
zgit_inworktree() {
|
||||||
|
zgit_isgit || return
|
||||||
|
if [ "$zgit_info[inwork]" = "true" ]; then
|
||||||
|
return 0
|
||||||
|
else
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
zgit_isbare() {
|
||||||
|
zgit_isgit || return
|
||||||
|
if [ "$zgit_info[bare]" = "true" ]; then
|
||||||
|
return 0
|
||||||
|
else
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
zgit_head() {
|
||||||
|
zgit_isgit || return 1
|
||||||
|
|
||||||
|
if [ -z "$zgit_info[head]" ]; then
|
||||||
|
local name=''
|
||||||
|
name=$(git symbolic-ref -q HEAD)
|
||||||
|
if [ $? -eq 0 ]; then
|
||||||
|
if [[ $name == refs/(heads|tags)/* ]]; then
|
||||||
|
name=${name#refs/(heads|tags)/}
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
name=$(git name-rev --name-only --no-undefined --always HEAD)
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
return 1
|
||||||
|
elif [[ $name == remotes/* ]]; then
|
||||||
|
name=${name#remotes/}
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
zgit_info[head]=$name
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo $zgit_info[head]
|
||||||
|
}
|
||||||
|
|
||||||
|
zgit_branch() {
|
||||||
|
zgit_isgit || return 1
|
||||||
|
zgit_isbare && return 1
|
||||||
|
|
||||||
|
if [ -z "$zgit_info[branch]" ]; then
|
||||||
|
local branch=$(git symbolic-ref HEAD 2>/dev/null)
|
||||||
|
if [ $? -eq 0 ]; then
|
||||||
|
branch=${branch##*/}
|
||||||
|
else
|
||||||
|
branch=$(git name-rev --name-only --always HEAD)
|
||||||
|
fi
|
||||||
|
zgit_info[branch]=$branch
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo $zgit_info[branch]
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
zgit_tracking_remote() {
|
||||||
|
zgit_isgit || return 1
|
||||||
|
zgit_isbare && return 1
|
||||||
|
|
||||||
|
local branch
|
||||||
|
if [ -n "$1" ]; then
|
||||||
|
branch=$1
|
||||||
|
elif [ -z "$zgit_info[branch]" ]; then
|
||||||
|
branch=$(zgit_branch)
|
||||||
|
[ $? -ne 0 ] && return 1
|
||||||
|
else
|
||||||
|
branch=$zgit_info[branch]
|
||||||
|
fi
|
||||||
|
|
||||||
|
local k="tracking_$branch"
|
||||||
|
local remote
|
||||||
|
if [ -z "$zgit_info[$k]" ]; then
|
||||||
|
remote=$(git config branch.$branch.remote)
|
||||||
|
zgit_info[$k]=$remote
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo $zgit_info[$k]
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
zgit_tracking_merge() {
|
||||||
|
zgit_isgit || return 1
|
||||||
|
zgit_isbare && return 1
|
||||||
|
|
||||||
|
local branch
|
||||||
|
if [ -z "$zgit_info[branch]" ]; then
|
||||||
|
branch=$(zgit_branch)
|
||||||
|
[ $? -ne 0 ] && return 1
|
||||||
|
else
|
||||||
|
branch=$zgit_info[branch]
|
||||||
|
fi
|
||||||
|
|
||||||
|
local remote=$(zgit_tracking_remote $branch)
|
||||||
|
[ $? -ne 0 ] && return 1
|
||||||
|
if [ -n "$remote" ]; then # tracking branch
|
||||||
|
local merge=$(git config branch.$branch.merge)
|
||||||
|
if [ $remote != "." ]; then
|
||||||
|
merge=$remote/$(basename $merge)
|
||||||
|
fi
|
||||||
|
echo $merge
|
||||||
|
return 0
|
||||||
|
else
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
zgit_isindexclean() {
|
||||||
|
zgit_isgit || return 1
|
||||||
|
if git diff --quiet --cached 2>/dev/null; then
|
||||||
|
return 0
|
||||||
|
else
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
zgit_isworktreeclean() {
|
||||||
|
zgit_isgit || return 1
|
||||||
|
if git diff --quiet 2>/dev/null; then
|
||||||
|
return 0
|
||||||
|
else
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
zgit_hasuntracked() {
|
||||||
|
zgit_isgit || return 1
|
||||||
|
local -a flist
|
||||||
|
flist=($(git ls-files --others --exclude-standard))
|
||||||
|
if [ $#flist -gt 0 ]; then
|
||||||
|
return 0
|
||||||
|
else
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
zgit_hasunmerged() {
|
||||||
|
zgit_isgit || return 1
|
||||||
|
local -a flist
|
||||||
|
flist=($(git ls-files -u))
|
||||||
|
if [ $#flist -gt 0 ]; then
|
||||||
|
return 0
|
||||||
|
else
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
zgit_svnhead() {
|
||||||
|
zgit_isgit || return 1
|
||||||
|
|
||||||
|
local commit=$1
|
||||||
|
if [ -z "$commit" ]; then
|
||||||
|
commit='HEAD'
|
||||||
|
fi
|
||||||
|
|
||||||
|
git show --raw $commit | \
|
||||||
|
grep git-svn-id | \
|
||||||
|
sed -re 's/^\s*git-svn-id: .*@([0-9]+).*$/\1/'
|
||||||
|
}
|
||||||
|
|
||||||
|
zgit_rebaseinfo() {
|
||||||
|
zgit_isgit || return 1
|
||||||
|
if [ -d $zgit_info[dir]/rebase-merge ]; then
|
||||||
|
dotest=$zgit_info[dir]/rebase-merge
|
||||||
|
elif [ -d $zgit_info[dir]/.dotest-merge ]; then
|
||||||
|
dotest=$zgit_info[dir]/.dotest-merge
|
||||||
|
elif [ -d .dotest ]; then
|
||||||
|
dotest=.dotest
|
||||||
|
else
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
zgit_info[dotest]=$dotest
|
||||||
|
|
||||||
|
zgit_info[rb_onto]=$(cat "$dotest/onto")
|
||||||
|
if [ -f "$dotest/upstream" ]; then
|
||||||
|
zgit_info[rb_upstream]=$(cat "$dotest/upstream")
|
||||||
|
else
|
||||||
|
zgit_info[rb_upstream]=
|
||||||
|
fi
|
||||||
|
if [ -f "$dotest/orig-head" ]; then
|
||||||
|
zgit_info[rb_head]=$(cat "$dotest/orig-head")
|
||||||
|
elif [ -f "$dotest/head" ]; then
|
||||||
|
zgit_info[rb_head]=$(cat "$dotest/head")
|
||||||
|
fi
|
||||||
|
zgit_info[rb_head_name]=$(cat "$dotest/head-name")
|
||||||
|
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
chpwd_functions+=zgit_chpwd_hook
|
||||||
|
preexec_functions+=zgit_preexec_hook
|
||||||
|
precmd_functions+=zgit_precmd_hook
|
||||||
|
|
||||||
|
zgit_info_update
|
||||||
|
|
||||||
|
# vim:set ft=zsh:
|
||||||
70
.zshrc
70
.zshrc
|
|
@ -1,9 +1,16 @@
|
||||||
|
typeset -ga preexec_functions
|
||||||
|
typeset -ga precmd_functions
|
||||||
|
typeset -ga chpwd_functions
|
||||||
|
fpath=($fpath $HOME/.zsh/func)
|
||||||
|
#typeset -u fpath
|
||||||
|
|
||||||
# Options
|
# Options
|
||||||
setopt appendhistory hist_ignore_space hist_ignore_all_dups extendedglob nomatch notify dvorak # correct
|
setopt appendhistory hist_ignore_space hist_ignore_all_dups extendedglob nomatch notify dvorak # correct
|
||||||
unsetopt beep
|
unsetopt beep
|
||||||
bindkey -e
|
bindkey -e
|
||||||
|
|
||||||
zstyle :compinstall filename '~/.zshrc'
|
zstyle :compinstall filename '~/.zshrc'
|
||||||
autoload -Uz compinit
|
autoload -Uz compinit colors zgitinit && colors && zgitinit
|
||||||
compinit -u
|
compinit -u
|
||||||
#bindkey '^L' push-line
|
#bindkey '^L' push-line
|
||||||
bindkey "^I" expand-or-complete-prefix
|
bindkey "^I" expand-or-complete-prefix
|
||||||
|
|
@ -28,7 +35,8 @@ paths=(/cat/bin /cat/games/bin /opt/csw/sbin /opt/csw/bin
|
||||||
/opt/SUNWut/sbin /opt/SUNWut/bin /usr/ccs/bin /usr/local/bin /usr/openwin/bin
|
/opt/SUNWut/sbin /opt/SUNWut/bin /usr/ccs/bin /usr/local/bin /usr/openwin/bin
|
||||||
/usr/bin/X11 /usr/local/bin/X11 /usr/openwin/lib/X11/xkb /usr/openwin/bin/xview /opt/java/bin
|
/usr/bin/X11 /usr/local/bin/X11 /usr/openwin/lib/X11/xkb /usr/openwin/bin/xview /opt/java/bin
|
||||||
/opt/java5/bin /opt/java/jre/bin /opt/openoffice/program)
|
/opt/java5/bin /opt/java/jre/bin /opt/openoffice/program)
|
||||||
prepaths=(~/.cabal/bin ~/local/bin ~/local/sbin ~/local/share/bin)
|
prepaths=(/opt/local/sbin /opt/local/bin ~/.cabal/bin ~/local/bin ~/local/sbin
|
||||||
|
~/local/share/bin)
|
||||||
for dir in $paths ; do
|
for dir in $paths ; do
|
||||||
if [ -d $dir ] ; then
|
if [ -d $dir ] ; then
|
||||||
export PATH=$PATH:$dir
|
export PATH=$PATH:$dir
|
||||||
|
|
@ -56,20 +64,42 @@ fi
|
||||||
if [ -d ~/.gems/bin ] ; then
|
if [ -d ~/.gems/bin ] ; then
|
||||||
export PATH="$HOME/.gems/bin:$PATH"
|
export PATH="$HOME/.gems/bin:$PATH"
|
||||||
fi
|
fi
|
||||||
|
if [ -d ~/.gem/ruby/1.8/bin ] ; then
|
||||||
|
export PATH="$PATH:$HOME/.gem/ruby/1.8/bin"
|
||||||
|
fi
|
||||||
#for dir in `find /opt/*/bin|grep /bin$` `find /opt/csw/*/bin|grep /bin$` ; do
|
#for dir in `find /opt/*/bin|grep /bin$` `find /opt/csw/*/bin|grep /bin$` ; do
|
||||||
# export PATH=$PATH:$dir
|
# export PATH=$PATH:$dir
|
||||||
#done
|
#done
|
||||||
|
|
||||||
# Setting vars
|
# Setting vars
|
||||||
#TERM=rxvt
|
#TERM=rxvt
|
||||||
export GEM_HOME="$HOME/.gems"
|
#export GEM_HOME="$HOME/.gems"
|
||||||
export GEM_PATH="$GEM_HOME:/usr/lib/ruby/gems/1.8"
|
#export GEM_PATH="$GEM_HOME:/usr/lib/ruby/gems/1.8"
|
||||||
zshhosts=(serenity.cat.pdx.edu hunner@mint.cic.pdx.edu drkatz.cat.pdx.edu walt.ece.pdx.edu bunny.cat.pdx.edu spof.cat.pdx.edu fops.cat.pdx.edu narsil.cat.pdx.edu hunner@odin.pdx.edu hunnur@alcmaeonllc.com mir.cat.pdx.edu geppetto.cat.pdx.edu)
|
zshhosts=(serenity.cat.pdx.edu hunner@mint.cic.pdx.edu drkatz.cat.pdx.edu walt.ece.pdx.edu bunny.cat.pdx.edu spof.cat.pdx.edu fops.cat.pdx.edu narsil.cat.pdx.edu hunner@odin.pdx.edu hunnur@alcmaeonllc.com mir.cat.pdx.edu geppetto.cat.pdx.edu)
|
||||||
HISTSIZE=1000
|
HISTSIZE=1000
|
||||||
SAVEHIST=1000
|
SAVEHIST=1000
|
||||||
HISTFILE=~/.history
|
HISTFILE=~/.history
|
||||||
export GPGKEY="48C7AF0C"
|
export GPGKEY="48C7AF0C"
|
||||||
PS1="%m%# "
|
|
||||||
|
# Prompt
|
||||||
|
#PS1="%m%# "
|
||||||
|
prompt_precmd() {
|
||||||
|
gitcolor=""
|
||||||
|
if zgit_isgit ; then
|
||||||
|
if ! zgit_isindexclean ; then
|
||||||
|
#PROMPT="[%F{$usercolor}%n%F{white}@%F{$hostcolor}%m%F{white}:%F{blue}%~%f](%F{cyan}$(zgit_branch)%f)>"
|
||||||
|
gitcolor=$fg[blue]
|
||||||
|
elif ! zgit_isworktreeclean ; then
|
||||||
|
#PROMPT="[%F{$usercolor}%n%F{white}@%F{$hostcolor}%m%F{white}:%F{blue}%~%f]>"
|
||||||
|
gitcolor=$fg[green]
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
color="%(?.$gitcolor.$fg[red])"
|
||||||
|
PROMPT="%m$color%#%{$reset_color%} "
|
||||||
|
}
|
||||||
|
#precmd_functions+=prompt_precmd
|
||||||
|
PROMPT="%m%# "
|
||||||
|
|
||||||
if [ `uname -s` = "SunOS" ] ; then
|
if [ `uname -s` = "SunOS" ] ; then
|
||||||
export LANG="C"
|
export LANG="C"
|
||||||
else
|
else
|
||||||
|
|
@ -114,6 +144,9 @@ else
|
||||||
export VISUAL=vi
|
export VISUAL=vi
|
||||||
export EDITOR=vi
|
export EDITOR=vi
|
||||||
fi
|
fi
|
||||||
|
if [ -n "$SSH_AUTH_SOCK" ] ; then
|
||||||
|
ln -fs $SSH_AUTH_SOCK $HOME/.ssh-agent
|
||||||
|
fi
|
||||||
#xset fp+ /usr/APL2/fonts/X11
|
#xset fp+ /usr/APL2/fonts/X11
|
||||||
#xset fp rehash
|
#xset fp rehash
|
||||||
#if [ -d $HOME/.gems/gems ] ; then
|
#if [ -d $HOME/.gems/gems ] ; then
|
||||||
|
|
@ -132,6 +165,7 @@ alias ll="l -Fl"
|
||||||
alias la="l -Fa"
|
alias la="l -Fa"
|
||||||
alias lla="ll -Fa"
|
alias lla="ll -Fa"
|
||||||
alias c="cd"
|
alias c="cd"
|
||||||
|
cl() { cd $@ && ls }
|
||||||
alias e="TERM=rxvt-256color; emacs -nw"
|
alias e="TERM=rxvt-256color; emacs -nw"
|
||||||
alias et="TERM=rxvt-256color; emacsclient -t"
|
alias et="TERM=rxvt-256color; emacsclient -t"
|
||||||
alias ec="emacsclient -c --eval '(set-background-color \"black\")'"
|
alias ec="emacsclient -c --eval '(set-background-color \"black\")'"
|
||||||
|
|
@ -145,7 +179,7 @@ alias m="TERM=rxvt;ssh hunner@mint.cic.pdx.edu"
|
||||||
alias chandra="TERM=rxvt;ssh hunner@chandra.cs.pdx.edu"
|
alias chandra="TERM=rxvt;ssh hunner@chandra.cs.pdx.edu"
|
||||||
export CS=cs.pdx.edu
|
export CS=cs.pdx.edu
|
||||||
alias odin="TERM=xterm;ssh hunner@odin.pdx.edu"
|
alias odin="TERM=xterm;ssh hunner@odin.pdx.edu"
|
||||||
alias clancy="ssh hunnur@clancy.dreamhost.com"
|
alias budda="ssh hunnur@budda.dreamhost.com"
|
||||||
alias kvar="ssh hunner@131.252.134.134"
|
alias kvar="ssh hunner@131.252.134.134"
|
||||||
alias kvin="ssh hunner@131.252.135.22"
|
alias kvin="ssh hunner@131.252.135.22"
|
||||||
alias mutt="TERM=xterm-256color mutt"
|
alias mutt="TERM=xterm-256color mutt"
|
||||||
|
|
@ -154,13 +188,13 @@ alias gpg-add="/usr/libexec/gpg-preset-passphrase"
|
||||||
alias rsync="rsync -azPHe ssh" #-a equals -rlptgoD
|
alias rsync="rsync -azPHe ssh" #-a equals -rlptgoD
|
||||||
alias mang="cd ~/zips/mangband ; DISPLAY=\"\" ./mangclient"
|
alias mang="cd ~/zips/mangband ; DISPLAY=\"\" ./mangclient"
|
||||||
alias nh="export HISTFILE=/dev/null"
|
alias nh="export HISTFILE=/dev/null"
|
||||||
alias cl="co -l"
|
#alias cl="co -l"
|
||||||
alias cu="ci -u"
|
alias cu="ci -u"
|
||||||
alias sl="screen -ls"
|
alias sl="screen -ls"
|
||||||
alias sr="screen -r"
|
alias sr="screen -r"
|
||||||
alias sx="screen -x"
|
alias sx="screen -x"
|
||||||
alias srd="screen -rd"
|
alias srd="screen -rd"
|
||||||
alias t="SSH_AUTH_SOCK=$HOME/.tmux-ssh-agent TERM=xterm-256color tmux at"
|
alias t="SSH_AUTH_SOCK=$HOME/.ssh-agent TERM=xterm-256color tmux at"
|
||||||
alias tl="tmux ls"
|
alias tl="tmux ls"
|
||||||
alias bc="bc -q"
|
alias bc="bc -q"
|
||||||
alias fm="fmstatus.sh&;shell-fm"
|
alias fm="fmstatus.sh&;shell-fm"
|
||||||
|
|
@ -169,8 +203,26 @@ alias d="dtach -a /tmp/dtach"
|
||||||
alias eo="xmodmap ~/keymaps/eo_dv_hunner.pke"
|
alias eo="xmodmap ~/keymaps/eo_dv_hunner.pke"
|
||||||
alias vt="export TERM=vt220"
|
alias vt="export TERM=vt220"
|
||||||
alias rm=rm; unalias rm #hack
|
alias rm=rm; unalias rm #hack
|
||||||
alias gem="nice -n19 gem"
|
alias g="git"
|
||||||
|
alias gl="git lg"
|
||||||
|
alias gp="git push"
|
||||||
|
alias gu="git pull"
|
||||||
|
alias gs="git status"
|
||||||
|
alias gm="git mv"
|
||||||
|
alias gr="git r"
|
||||||
|
alias ga="git add"
|
||||||
|
alias gaf="git add --force"
|
||||||
|
alias gb="git branch"
|
||||||
|
alias gc="git commit"
|
||||||
|
alias gca="git commit --amend"
|
||||||
|
alias gd="git diff"
|
||||||
|
alias go="git checkout"
|
||||||
|
alias gob="git checkout -b"
|
||||||
|
alias gk="gitk --all&"
|
||||||
|
alias gx="gitx --all"
|
||||||
alias uzbl="uzbl-browser"
|
alias uzbl="uzbl-browser"
|
||||||
|
alias hide="SetFile -a V"
|
||||||
|
alias show="SetFile -a v"
|
||||||
#startup aliases
|
#startup aliases
|
||||||
alias -s pdf="zathura"
|
alias -s pdf="zathura"
|
||||||
alias -s txt="vi"
|
alias -s txt="vi"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue