Browse code
Improve .emacs, .zshrc, ad lispworks conf
Showing 16 changed files
- emacs
- lispworks/editor-color-theme.lisp
- lispworks/lispworks
- zsh_plugins/.gitignore
- zsh_plugins/00-iterm-control.zsh
- zsh_plugins/00-iterm.zsh
- zsh_plugins/00-pip-paths.zsh
- zsh_plugins/00-utils.zsh
- zsh_plugins/00_dummy.zsh
- zsh_plugins/01-help.zsh
- zsh_plugins/01-java.zsh
- zsh_plugins/01-pfff.zsh
- zsh_plugins/01-python.zsh
- zsh_plugins/01_git.zsh
- zsh_plugins/99-completion.zsh
- zshrc_work
... | ... |
@@ -26,6 +26,18 @@ |
26 | 26 |
(define-key evil-normal-state-map " o" 'slime-selector) |
27 | 27 |
(define-key evil-insert-state-map (kbd "TAB") 'company-complete)) |
28 | 28 |
|
29 |
+;;;;; INDENTATION SETUP {{{ |
|
30 |
+(progn |
|
31 |
+ (setq-default indent-tabs-mode nil |
|
32 |
+ tab-width 2) |
|
33 |
+ (defvaralias 'c-basic-offset 'tab-width) |
|
34 |
+ (defvaralias 'sh-basic-offset 'tab-width) |
|
35 |
+ (defvaralias 'js2-basic-offset 'tab-width) |
|
36 |
+ (defvaralias 'sgml-basic-offset 'tab-width) |
|
37 |
+ (defvaralias 'cperl-indent-level 'tab-width)) |
|
38 |
+ |
|
39 |
+;;;;; }}} |
|
40 |
+ |
|
29 | 41 |
;;;;; SLIME SETUP {{{ |
30 | 42 |
(progn ;slime isn't loaded via use-package because quicklisp-helper keeps it uptodate |
31 | 43 |
(load (expand-file-name "~/quicklisp/slime-helper.el")) |
... | ... |
@@ -273,7 +285,7 @@ |
273 | 285 |
(use-package evil-nerd-commenter |
274 | 286 |
:ensure t |
275 | 287 |
:config |
276 |
- (evilnc-default-hotkeys)) |
|
288 |
+ (evilnc-default-hotkeys t)) |
|
277 | 289 |
|
278 | 290 |
(use-package evil-leader |
279 | 291 |
:ensure t) |
... | ... |
@@ -523,7 +535,7 @@ |
523 | 535 |
'(global-linum-mode t) |
524 | 536 |
'(haskell-mode-hook |
525 | 537 |
(quote |
526 |
- (capitalized-words-mode haskell-decl-scan-mode haskell-indentation-mode highlight-uses-mode imenu-add-menubar-index interactive-haskell-mode)) t) |
|
538 |
+ (capitalized-words-mode haskell-decl-scan-mode haskell-indentation-mode highlight-uses-mode imenu-add-menubar-index interactive-haskell-mode))) |
|
527 | 539 |
'(helm-ls-git-fuzzy-match t) |
528 | 540 |
'(jdee-server-dir "~/.emacs.d/jdee-server/") |
529 | 541 |
'(jira-url "https://atomampd.atlassian.net/rpc/xmlrpc") |
... | ... |
@@ -536,7 +548,7 @@ |
536 | 548 |
("#CC9393" "#DFAF8F" "#F0DFAF" "#7F9F7F" "#BFEBBF" "#93E0E3" "#94BFF3" "#DC8CC3"))) |
537 | 549 |
'(package-selected-packages |
538 | 550 |
(quote |
539 |
- (geiser pollen-mode js2-refactor npm-mode helm-dash aggressive-indent company-tern tern srefactor ac-slime znc helm-ag ag helm-projectile notmuch zenburn-theme zeal-at-point use-package tabbar slime-company rainbow-delimiters projectile mvn jdee intero helm evil-visual-mark-mode evil-vimish-fold evil-paredit evil-numbers ensime eldoc-eval editorconfig color-theme ansible alect-themes ac-js2))) |
|
551 |
+ (deft geiser pollen-mode js2-refactor npm-mode helm-dash aggressive-indent company-tern tern srefactor ac-slime znc helm-ag ag helm-projectile notmuch zenburn-theme zeal-at-point use-package tabbar slime-company rainbow-delimiters projectile mvn jdee intero helm evil-visual-mark-mode evil-vimish-fold evil-paredit evil-numbers ensime eldoc-eval editorconfig color-theme ansible alect-themes ac-js2))) |
|
540 | 552 |
'(pe/omit-gitignore t) |
541 | 553 |
'(safe-local-variable-values |
542 | 554 |
(quote |
543 | 555 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,526 @@ |
1 |
+;;;; Copyright (C) 2013 Paulo Madeira |
|
2 |
+;;;; |
|
3 |
+;;;; This Source Code Form is subject to the terms of the Mozilla Public |
|
4 |
+;;;; License, v. 2.0. If a copy of the MPL was not distributed with this |
|
5 |
+;;;; file, You can obtain one at http://mozilla.org/MPL/2.0/. |
|
6 |
+ |
|
7 |
+;;; Interface |
|
8 |
+ |
|
9 |
+(cl:in-package #:cl-user) |
|
10 |
+ |
|
11 |
+ |
|
12 |
+(defpackage #:editor-color-theme |
|
13 |
+ (:use #:cl) |
|
14 |
+ (:export #:*current-colors* |
|
15 |
+ #:all-color-themes |
|
16 |
+ #:color-theme-args |
|
17 |
+ #:color-theme |
|
18 |
+ #:define-color-theme |
|
19 |
+ #:remove-color-theme |
|
20 |
+ )) |
|
21 |
+ |
|
22 |
+(in-package #:editor-color-theme) |
|
23 |
+ |
|
24 |
+ |
|
25 |
+;;; Configuration |
|
26 |
+ |
|
27 |
+;; Default foreground and background colors |
|
28 |
+(defconstant +default-foreground-color+ :black) |
|
29 |
+(defconstant +default-background-color+ :white) |
|
30 |
+ |
|
31 |
+(defvar *current-colors* (make-hash-table)) |
|
32 |
+ |
|
33 |
+;;; Implementation |
|
34 |
+ |
|
35 |
+(defvar *all-color-themes* (make-hash-table :test 'string=)) |
|
36 |
+ |
|
37 |
+(defvar *editor-face-names* |
|
38 |
+ '(:region |
|
39 |
+ :show-point-face |
|
40 |
+ :interactive-input-face |
|
41 |
+ :highlight |
|
42 |
+ :non-focus-complete-face |
|
43 |
+ :font-lock-function-name-face |
|
44 |
+ :font-lock-comment-face |
|
45 |
+ :font-lock-type-face |
|
46 |
+ :font-lock-variable-name-face |
|
47 |
+ :font-lock-string-face |
|
48 |
+ :font-lock-keyword-face |
|
49 |
+ :font-lock-builtin-face |
|
50 |
+ :compiler-note-highlight |
|
51 |
+ :compiler-warning-highlight |
|
52 |
+ :compiler-error-highlight |
|
53 |
+ :incremental-search-face |
|
54 |
+ :incremental-search-other-matches-face |
|
55 |
+ )) |
|
56 |
+ |
|
57 |
+ |
|
58 |
+ |
|
59 |
+(defclass editor-panes-theme () |
|
60 |
+ ((editor-panes :initform nil :accessor editor-panes) |
|
61 |
+ (buffers-panes :initform nil :accessor buffers-panes) |
|
62 |
+ (editor-background :initform +default-background-color+ :accessor bg) |
|
63 |
+ (editor-foreground :initform +default-foreground-color+ :accessor fg) |
|
64 |
+ (buffers-background :initform +default-background-color+ :accessor buffers-bg) |
|
65 |
+ (buffers-foreground :initform +default-foreground-color+ :accessor buffers-fg) |
|
66 |
+ (buffers-selected-foreground :initform +default-foreground-color+ :accessor buffers-selected-fg))) |
|
67 |
+ |
|
68 |
+(defclass listener-panes-theme () |
|
69 |
+ ((listener-panes :initform nil :accessor listener-panes) |
|
70 |
+ (listener-foreground :initform +default-foreground-color+ :accessor bg) |
|
71 |
+ (listener-background :initform +default-background-color+ :accessor fg))) |
|
72 |
+ |
|
73 |
+ |
|
74 |
+(defclass general-panes-theme () |
|
75 |
+ ((output-panes :initform nil :accessor output-panes) |
|
76 |
+ (output-foreground :initform +default-foreground-color+ :accessor output-fg) |
|
77 |
+ (output-background :initform +default-background-color+ :accessor output-bg))) |
|
78 |
+ |
|
79 |
+(defvar *editor-tool* (make-instance 'editor-panes-theme)) |
|
80 |
+(defvar *listener-tool* (make-instance 'listener-panes-theme)) |
|
81 |
+(defvar *all-tools* (make-instance 'general-panes-theme)) |
|
82 |
+ |
|
83 |
+(defun all-color-themes () |
|
84 |
+ (maphash #'(lambda (key value) |
|
85 |
+ (declare (ignore value)) |
|
86 |
+ key) |
|
87 |
+ *all-color-themes*)) |
|
88 |
+ |
|
89 |
+(defun color-theme-data (theme-name) |
|
90 |
+ (multiple-value-bind (data found?) |
|
91 |
+ (gethash theme-name *all-color-themes*) |
|
92 |
+ (if found? |
|
93 |
+ data |
|
94 |
+ (error "No color theme named ~s found." theme-name)))) |
|
95 |
+ |
|
96 |
+(defun color-theme-super-theme-names (theme-name) |
|
97 |
+ (first (color-theme-data theme-name))) |
|
98 |
+ |
|
99 |
+(defun color-theme-args (theme-name) |
|
100 |
+ (rest (color-theme-data theme-name))) |
|
101 |
+ |
|
102 |
+ |
|
103 |
+(defun buffers-color-function (lp symbol state) |
|
104 |
+ (declare (ignore lp)) |
|
105 |
+ (cond ((eq state :normal) |
|
106 |
+ (buffers-fg *editor-tool*)) |
|
107 |
+ ((eq state :selected) |
|
108 |
+ (buffers-selected-fg *editor-tool*)))) |
|
109 |
+ |
|
110 |
+(defun update-pane-colors (pane foreground background) |
|
111 |
+ (setf (capi:simple-pane-foreground pane) foreground) |
|
112 |
+ (setf (capi:simple-pane-background pane) background) |
|
113 |
+ |
|
114 |
+ (when (and (typep pane 'capi:editor-pane) |
|
115 |
+ (editor::buffer-font-lock-mode-p (capi:editor-pane-buffer pane))) |
|
116 |
+ (gp:invalidate-rectangle pane))) |
|
117 |
+ |
|
118 |
+ |
|
119 |
+(defgeneric clear-colors (tool) |
|
120 |
+ (:documentation "Clear colors for tool keeping other data untouched")) |
|
121 |
+ |
|
122 |
+(defgeneric update (tool) |
|
123 |
+ (:documentation "Update tool's colors")) |
|
124 |
+ |
|
125 |
+ |
|
126 |
+(defmethod clear-colors ((self editor-panes-theme)) |
|
127 |
+ (with-slots (editor-background editor-foreground) self |
|
128 |
+ (setf editor-background +default-background-color+) |
|
129 |
+ (setf editor-foreground +default-foreground-color+))) |
|
130 |
+ |
|
131 |
+(defmethod clear-colors ((self listener-panes-theme)) |
|
132 |
+ (with-slots (listener-background listener-foreground) self |
|
133 |
+ (setf listener-background +default-background-color+) |
|
134 |
+ (setf listener-foreground +default-foreground-color+))) |
|
135 |
+ |
|
136 |
+(defmethod clear-colors ((self general-panes-theme)) |
|
137 |
+ (with-slots (output-background output-foreground) self |
|
138 |
+ (setf output-background +default-background-color+) |
|
139 |
+ (setf output-foreground +default-foreground-color+))) |
|
140 |
+ |
|
141 |
+ |
|
142 |
+(defmethod update ((self editor-panes-theme)) |
|
143 |
+ (mapcar #'(lambda (pane) |
|
144 |
+ (update-pane-colors pane (fg self) (bg self))) |
|
145 |
+ (editor-panes self)) |
|
146 |
+ (mapcar #'(lambda (pane) |
|
147 |
+ (update-pane-colors pane (buffers-fg self) (buffers-bg self))) |
|
148 |
+ (buffers-panes self))) |
|
149 |
+ |
|
150 |
+(defmethod update ((self listener-panes-theme)) |
|
151 |
+ (mapcar #'(lambda (pane) |
|
152 |
+ (update-pane-colors pane (fg self) (bg self))) |
|
153 |
+ (listener-panes self))) |
|
154 |
+ |
|
155 |
+(defmethod update ((self general-panes-theme)) |
|
156 |
+ (mapcar #'(lambda (pane) |
|
157 |
+ (update-pane-colors pane (output-fg self) (output-bg self))) |
|
158 |
+ (output-panes self))) |
|
159 |
+ |
|
160 |
+ |
|
161 |
+(defun set-color-theme (theme-name) |
|
162 |
+ (destructuring-bind (&rest color-theme-args |
|
163 |
+ &key foreground background |
|
164 |
+ listener-foreground |
|
165 |
+ listener-background |
|
166 |
+ output-foreground |
|
167 |
+ output-background |
|
168 |
+ buffers-foreground |
|
169 |
+ buffers-selected-foreground |
|
170 |
+ buffers-background |
|
171 |
+ &allow-other-keys) |
|
172 |
+ (color-theme-args theme-name) |
|
173 |
+ |
|
174 |
+ ;; new instances of tools wrappers |
|
175 |
+ (clear-colors *editor-tool*) |
|
176 |
+ (clear-colors *listener-tool*) |
|
177 |
+ (clear-colors *all-tools*) |
|
178 |
+ |
|
179 |
+ ;; editor foreground and background |
|
180 |
+ (when foreground |
|
181 |
+ (setf (fg *editor-tool*) foreground)) |
|
182 |
+ (when background |
|
183 |
+ (setf (bg *editor-tool*) background)) |
|
184 |
+ ;; listener foreground and background, uses |
|
185 |
+ ;; the :background and :foreground if not specified |
|
186 |
+ (setf (fg *listener-tool*) |
|
187 |
+ (or listener-foreground |
|
188 |
+ (fg *editor-tool*)) |
|
189 |
+ (bg *listener-tool*) |
|
190 |
+ (or listener-background |
|
191 |
+ (bg *editor-tool*))) |
|
192 |
+ |
|
193 |
+ ;; output foreground and background, uses :background and |
|
194 |
+ ;; :foreground if not specified |
|
195 |
+ (setf (output-fg *all-tools*) |
|
196 |
+ (or output-foreground |
|
197 |
+ (fg *editor-tool*)) |
|
198 |
+ (output-bg *all-tools*) |
|
199 |
+ (or output-background |
|
200 |
+ (bg *editor-tool*))) |
|
201 |
+ |
|
202 |
+ ;; buffers list colors |
|
203 |
+ (setf (buffers-fg *editor-tool*) |
|
204 |
+ (or buffers-foreground |
|
205 |
+ (fg *editor-tool*)) |
|
206 |
+ (buffers-selected-fg *editor-tool*) |
|
207 |
+ (or buffers-selected-foreground |
|
208 |
+ (buffers-fg *editor-tool*)) |
|
209 |
+ (buffers-bg *editor-tool*) |
|
210 |
+ (or buffers-background |
|
211 |
+ (bg *editor-tool*))) |
|
212 |
+ |
|
213 |
+ |
|
214 |
+ (dolist (name *editor-face-names*) |
|
215 |
+ (let* ((color-theme-args-for-face (getf color-theme-args name)) |
|
216 |
+ (face-name (intern (string name) '#:editor)) |
|
217 |
+ (face (editor:make-face face-name :if-exists t))) |
|
218 |
+ (apply 'editor:make-face face-name :if-exists :overwrite |
|
219 |
+ :documentation (or (getf color-theme-args-for-face :documentation) |
|
220 |
+ (slot-value face 'documentation)) |
|
221 |
+ color-theme-args-for-face)))) |
|
222 |
+ |
|
223 |
+ theme-name) |
|
224 |
+ |
|
225 |
+(defun color-theme (theme-name) |
|
226 |
+ (mapc 'set-color-theme (color-theme-super-theme-names theme-name)) |
|
227 |
+ (set-color-theme theme-name) |
|
228 |
+ |
|
229 |
+ (update *editor-tool*) |
|
230 |
+ (update *listener-tool*) |
|
231 |
+ (update *all-tools*) |
|
232 |
+ |
|
233 |
+ theme-name) |
|
234 |
+ |
|
235 |
+(defun define-color-theme (theme-name super-theme-names |
|
236 |
+ &rest color-theme-args &key &allow-other-keys) |
|
237 |
+ (unless super-theme-names |
|
238 |
+ (setf super-theme-names '("default"))) |
|
239 |
+ (dolist (super-theme-name super-theme-names) |
|
240 |
+ (multiple-value-bind (color-theme-data found?) |
|
241 |
+ (gethash super-theme-name *all-color-themes*) |
|
242 |
+ (declare (ignore color-theme-data)) |
|
243 |
+ (unless found? |
|
244 |
+ (warn "Inherited color theme ~s not defined." super-theme-name)))) |
|
245 |
+ |
|
246 |
+ (setf (gethash theme-name *all-color-themes*) (list* super-theme-names color-theme-args)) |
|
247 |
+ |
|
248 |
+ theme-name) |
|
249 |
+ |
|
250 |
+(defun remove-color-theme (theme-name) |
|
251 |
+ (remhash theme-name *all-color-themes*)) |
|
252 |
+ |
|
253 |
+(defun set-editor-pane-colors (pane) |
|
254 |
+ (typecase pane |
|
255 |
+ (capi:editor-pane |
|
256 |
+ (progn |
|
257 |
+ (pushnew pane (editor-panes *editor-tool*)) |
|
258 |
+ (let ((bg-color (bg *editor-tool*)) |
|
259 |
+ (fg-color (fg *editor-tool*))) |
|
260 |
+ (setf (capi:simple-pane-foreground pane) fg-color) |
|
261 |
+ (setf (capi:simple-pane-background pane) bg-color)))))) |
|
262 |
+ |
|
263 |
+ |
|
264 |
+(defun set-listener-pane-colors (pane) |
|
265 |
+ (typecase pane |
|
266 |
+ (capi:editor-pane |
|
267 |
+ (progn |
|
268 |
+ (pushnew pane (listener-panes *listener-tool*)) |
|
269 |
+ (let ((bg-color (bg *listener-tool*)) |
|
270 |
+ (fg-color (fg *listener-tool*))) |
|
271 |
+ (setf (capi:simple-pane-foreground pane) fg-color) |
|
272 |
+ (setf (capi:simple-pane-background pane) bg-color)))))) |
|
273 |
+ |
|
274 |
+ |
|
275 |
+(defun set-collector-pane-colors (pane) |
|
276 |
+ ;;(when (typep (capi:top-level-interface pane) 'lw-tools:listener) |
|
277 |
+ (pushnew pane (output-panes *all-tools*)) |
|
278 |
+ (let ((bg-color (output-bg *all-tools*)) |
|
279 |
+ (fg-color (output-fg *all-tools*))) |
|
280 |
+ (setf (capi:simple-pane-foreground pane) fg-color) |
|
281 |
+ (setf (capi:simple-pane-background pane) bg-color))) |
|
282 |
+ |
|
283 |
+(defun set-mulitcolumn-list-panel-colors (pane) |
|
284 |
+ (when (or (eq (capi:capi-object-name pane) 'lw-tools::buffers-list) |
|
285 |
+ (eq (capi:capi-object-name pane) 'lispworks-tools::narrow-buffers-list)) |
|
286 |
+ (pushnew pane (buffers-panes *editor-tool*)) |
|
287 |
+ (when (eq (capi:capi-object-name pane) 'lispworks-tools::narrow-buffers-list) |
|
288 |
+ (setf (slot-value pane 'capi::color-function) #'buffers-color-function)) |
|
289 |
+ (update-pane-colors pane (buffers-fg *editor-tool*) (buffers-bg *editor-tool*)))) |
|
290 |
+ |
|
291 |
+ |
|
292 |
+(lispworks:defadvice ((method capi:interface-display :before (lw-tools:editor)) |
|
293 |
+ change-editor-colors |
|
294 |
+ :before |
|
295 |
+ :documentation "Change editor colors.") |
|
296 |
+ (interface) |
|
297 |
+ (capi:map-pane-descendant-children interface 'set-editor-pane-colors)) |
|
298 |
+ |
|
299 |
+ |
|
300 |
+;; we don't have defined capi:interface-display for lw-tools::listener, |
|
301 |
+;; so nothing to advice. Instead we need to define our own |
|
302 |
+(sys::without-warning-on-redefinition |
|
303 |
+ (defmethod capi:interface-display :before ((self lw-tools::listener)) |
|
304 |
+ (capi:map-pane-descendant-children |
|
305 |
+ self 'set-listener-pane-colors))) |
|
306 |
+ |
|
307 |
+;; capi:collector-pane does'nt have interface-display method called, |
|
308 |
+;; so we adding the :after constuctor instead |
|
309 |
+(sys::without-warning-on-redefinition |
|
310 |
+ (defmethod initialize-instance :after ((self capi:collector-pane) &rest |
|
311 |
+ clos::initargs &key &allow-other-keys) |
|
312 |
+ (set-collector-pane-colors self))) |
|
313 |
+ |
|
314 |
+(lispworks:defadvice ((method initialize-instance :after (capi:multi-column-list-panel)) |
|
315 |
+ change-multicolumn-colors |
|
316 |
+ :after |
|
317 |
+ :documentation "Change capi:multi-column-list-panel colors") |
|
318 |
+ (self &rest initargs &key &allow-other-keys) |
|
319 |
+ (declare (ignore initargs)) |
|
320 |
+ (set-mulitcolumn-list-panel-colors self)) |
|
321 |
+ |
|
322 |
+ |
|
323 |
+ |
|
324 |
+;; This makes it "work" after the podium is launched |
|
325 |
+(defun is-editor-pane-p (obj) |
|
326 |
+ (and (typep obj 'capi:editor-pane) |
|
327 |
+ (not (eq obj (hcl:class-prototype (class-of obj)))))) |
|
328 |
+ |
|
329 |
+(defun cache-existing-pane (pane) |
|
330 |
+ (pushnew pane (editor-panes *editor-tool*))) |
|
331 |
+ |
|
332 |
+(defun cache-if-pane (obj) |
|
333 |
+ (when (is-editor-pane-p obj) |
|
334 |
+ (cache-existing-pane obj))) |
|
335 |
+ |
|
336 |
+#+:lispworks-personal-edition |
|
337 |
+(hcl:sweep-all-objects #'cache-if-pane) |
|
338 |
+ |
|
339 |
+ |
|
340 |
+;;; Initial color themes |
|
341 |
+ |
|
342 |
+(define-color-theme "default" () |
|
343 |
+ :foreground nil |
|
344 |
+ :background nil |
|
345 |
+ :region '(:foreground :color_highlighttext |
|
346 |
+ :background :color_highlight) |
|
347 |
+ :show-point-face '(:background :green) |
|
348 |
+ :interactive-input-face '(:foreground :red3) |
|
349 |
+ :highlight '(:bold-p t) |
|
350 |
+ :non-focus-complete-face '(:background :tweak_background) |
|
351 |
+ :font-lock-function-name-face '(:foreground :blue) |
|
352 |
+ :font-lock-comment-face '(:foreground :firebrick) |
|
353 |
+ :font-lock-type-face '(:foreground :forestgreen) |
|
354 |
+ :font-lock-variable-name-face '(:foreground :darkgoldenrod) |
|
355 |
+ :font-lock-string-face '(:foreground :rosybrown) |
|
356 |
+ :font-lock-keyword-face '(:foreground :purple) |
|
357 |
+ :font-lock-builtin-face '(:foreground :orchid) |
|
358 |
+ :compiler-note-highlight '(:foreground :magenta) |
|
359 |
+ :compiler-warning-highlight '(:foreground :orange3) |
|
360 |
+ :compiler-error-highlight '(:foreground :red) |
|
361 |
+ :incremental-search-face '(:background :tweak_background) |
|
362 |
+ :incremental-search-other-matches-face '(:underline-p t)) |
|
363 |
+ |
|
364 |
+(define-color-theme "plain" () |
|
365 |
+ :foreground nil :background nil |
|
366 |
+ :region '(:foreground :color_highlighttext |
|
367 |
+ :background :color_highlight) |
|
368 |
+ :show-point-face '() |
|
369 |
+ :interactive-input-face '() |
|
370 |
+ :highlight '(:bold-p t) |
|
371 |
+ :non-focus-complete-face '(:background :tweak_background) |
|
372 |
+ :font-lock-function-name-face '() |
|
373 |
+ :font-lock-comment-face '() |
|
374 |
+ :font-lock-type-face '() |
|
375 |
+ :font-lock-variable-name-face '() |
|
376 |
+ :font-lock-string-face '() |
|
377 |
+ :font-lock-keyword-face '() |
|
378 |
+ :font-lock-builtin-face '() |
|
379 |
+ :compiler-note-highlight '() |
|
380 |
+ :compiler-warning-highlight '() |
|
381 |
+ :compiler-error-highlight '() |
|
382 |
+ :incremental-search-face '(:background :tweak_background) |
|
383 |
+ :incremental-search-other-matches-face '(:underline-p t)) |
|
384 |
+ |
|
385 |
+ |
|
386 |
+(define-color-theme "emacs" () |
|
387 |
+ ;; :foreground nil :background nil |
|
388 |
+ :region '(:foreground :color_highlighttext |
|
389 |
+ :background :color_highlight) |
|
390 |
+ :show-point-face '(:background :green) |
|
391 |
+ :interactive-input-face '(:foreground :red3) |
|
392 |
+ :highlight '(:bold-p t) |
|
393 |
+ :non-focus-complete-face '(:background :tweak_background) |
|
394 |
+ :font-lock-function-name-face '(:foreground :blue) |
|
395 |
+ :font-lock-comment-face '(:foreground :gray40) |
|
396 |
+ :font-lock-type-face '(:foreground :forestgreen) |
|
397 |
+ :font-lock-variable-name-face '(:foreground :darkgoldenrod) |
|
398 |
+ :font-lock-string-face '(:foreground :rosybrown) |
|
399 |
+ :font-lock-keyword-face '(:foreground :purple) |
|
400 |
+ :font-lock-builtin-face '(:foreground :orchid) |
|
401 |
+ :compiler-note-highlight '(:foreground :magenta) |
|
402 |
+ :compiler-warning-highlight '(:foreground :orange3) |
|
403 |
+ :compiler-error-highlight '(:foreground :red) |
|
404 |
+ :incremental-search-face '(:background :tweak_background) |
|
405 |
+ :incremental-search-other-matches-face '(:underline-p t)) |
|
406 |
+ |
|
407 |
+ |
|
408 |
+(define-color-theme "torte" () |
|
409 |
+ :foreground (color:make-rgb 0.8s0 0.8s0 0.8s0) |
|
410 |
+ :background (color:make-rgb 0.0s0 0.0s0 0.0s0) |
|
411 |
+ :region '(:foreground :color_highlighttext |
|
412 |
+ :background :color_highlight) |
|
413 |
+ :show-point-face `(:background ,(color:make-rgb 0.6275s0 0.1255s0 0.9412s0)) |
|
414 |
+ :interactive-input-face '(:foreground :pink) |
|
415 |
+ :highlight '(:bold-p t) |
|
416 |
+ :non-focus-complete-face '(:background :tweak_background) |
|
417 |
+ :font-lock-function-name-face `(:foreground ,(color:make-rgb 0.0s0 1.0s0 1.0s0)) |
|
418 |
+ :font-lock-comment-face `(:foreground ,(color:make-rgb 0.5s0 0.6275s0 1.0s0)) |
|
419 |
+ :font-lock-type-face `(:foreground ,(color:make-rgb 0.5s0 1.0s0 0.5s0)) |
|
420 |
+ :font-lock-variable-name-face `(:foreground ,(color:make-rgb 1.0s0 1.0s0 1.0s0)) |
|
421 |
+ :font-lock-string-face `(:foreground ,(color:make-rgb 1.0s0 0.6275s0 0.6275s0)) |
|
422 |
+ :font-lock-keyword-face `(:foreground ,(color:make-rgb 1.0s0 1.0s0 0.0s0)) |
|
423 |
+ :font-lock-builtin-face `(:foreground ,(color:make-rgb 1.0s0 1.0s0 0.0s0)) |
|
424 |
+ :compiler-note-highlight '(:foreground :magenta) |
|
425 |
+ :compiler-warning-highlight '(:foreground :orange) |
|
426 |
+ :compiler-error-highlight '(:foreground :red) |
|
427 |
+ :incremental-search-face '(:background :tweak_background) |
|
428 |
+ :incremental-search-other-matches-face '(:underline-p t)) |
|
429 |
+ |
|
430 |
+ |
|
431 |
+(defun make-rgb (red green blue &optional alpha) |
|
432 |
+ (color:make-rgb (/ red 255s0) |
|
433 |
+ (/ green 255s0) |
|
434 |
+ (/ blue 255s0) |
|
435 |
+ (and alpha (/ alpha 255s0)))) |
|
436 |
+ |
|
437 |
+(defvar *solarized-color-table* |
|
438 |
+ '(:solarized-base03 (#x00 #x2b #x36) |
|
439 |
+ :solarized-base02 (#x07 #x36 #x42) |
|
440 |
+ :solarized-base01 (#x58 #x6e #x75) |
|
441 |
+ :solarized-base00 (#x65 #x7b #x83) |
|
442 |
+ :solarized-base0 (#x83 #x94 #x96) |
|
443 |
+ :solarized-base1 (#x93 #xa1 #xa1) |
|
444 |
+ :solarized-base2 (#xee #xe8 #xd5) |
|
445 |
+ :solarized-base3 (#xfd #xf6 #xe3) |
|
446 |
+ :solarized-yellow (#xb5 #x89 #x00) |
|
447 |
+ :solarized-orange (#xcb #x4b #x16) |
|
448 |
+ :solarized-red (#xdc #x32 #x2f) |
|
449 |
+ :solarized-magenta (#xd3 #x36 #x82) |
|
450 |
+ :solarized-violet (#x6c #x71 #xc4) |
|
451 |
+ :solarized-blue (#x26 #x8b #xd2) |
|
452 |
+ :solarized-cyan (#x2a #xa1 #x98) |
|
453 |
+ :solarized-green (#x85 #x99 #x00))) |
|
454 |
+ |
|
455 |
+(loop for list on *solarized-color-table* by #'cddr |
|
456 |
+ for name = (first list) |
|
457 |
+ for rgb = (second list) |
|
458 |
+ do |
|
459 |
+ (color:define-color-alias |
|
460 |
+ name |
|
461 |
+ (apply #'make-rgb rgb))) |
|
462 |
+ |
|
463 |
+(define-color-theme "solarized-light" () |
|
464 |
+ :foreground :solarized-base00 |
|
465 |
+ :background :solarized-base3 |
|
466 |
+ :region '(:foreground :solarized-base1 |
|
467 |
+ :background :solarized-base3 |
|
468 |
+ :inverse-p t) |
|
469 |
+ :highlight '(:background :solarized-base2) |
|
470 |
+ :font-lock-function-name-face '(:foreground :solarized-blue) |
|
471 |
+ :font-lock-comment-face '(:foreground :solarized-base1 :italic-p t) |
|
472 |
+ :font-lock-type-face '(:foreground :solarized-yellow) |
|
473 |
+ :font-lock-variable-name-face '(:foreground :solarized-blue) |
|
474 |
+ :font-lock-string-face '(:foreground :solarized-cyan) |
|
475 |
+ :font-lock-keyword-face '(:foreground :solarized-green) |
|
476 |
+ :font-lock-builtin-face '(:foreground :solarized-green) |
|
477 |
+ :compiler-note-highlight '(:foreground :solarized-green |
|
478 |
+ :bold-p t) |
|
479 |
+ :compiler-warning-highlight '(:foreground :solarized-orange |
|
480 |
+ :bold-p t) |
|
481 |
+ :compiler-error-highlight '(:foreground :solarized-red |
|
482 |
+ :inverse-p t) |
|
483 |
+ :show-point-face '(:foreground :solarized-cyan |
|
484 |
+ :bold-p t :inverse-p t) |
|
485 |
+ :interactive-input-face '(:foreground :solarized-red) |
|
486 |
+ :non-focus-complete-face '(:background :solarized-base3) |
|
487 |
+ :parenthesis-font-face-colours '(:solarized-red |
|
488 |
+ :solarized-base01 |
|
489 |
+ :solarized-green |
|
490 |
+ :solarized-orange |
|
491 |
+ :solarized-blue |
|
492 |
+ :solarized-magenta)) |
|
493 |
+ |
|
494 |
+(define-color-theme "solarized-dark" () |
|
495 |
+ :foreground :solarized-base0 |
|
496 |
+ :background :solarized-base03 |
|
497 |
+ :region '(:foreground :solarized-base01 |
|
498 |
+ :background :solarized-base03 |
|
499 |
+ :inverse-p t) |
|
500 |
+ :highlight '(:background :solarized-base02) |
|
501 |
+ :font-lock-function-name-face '(:foreground :solarized-blue) |
|
502 |
+ :font-lock-comment-face '(:foreground :solarized-base01 :italic-p t) |
|
503 |
+ :font-lock-type-face '(:foreground :solarized-yellow) |
|
504 |
+ :font-lock-variable-name-face '(:foreground :solarized-blue) |
|
505 |
+ :font-lock-string-face '(:foreground :solarized-cyan) |
|
506 |
+ :font-lock-keyword-face '(:foreground :solarized-green) |
|
507 |
+ :font-lock-builtin-face '(:foreground :solarized-green) |
|
508 |
+ :compiler-note-highlight '(:foreground :solarized-green |
|
509 |
+ :bold-p t) |
|
510 |
+ :compiler-warning-highlight '(:foreground :solarized-orange |
|
511 |
+ :bold-p t) |
|
512 |
+ :compiler-error-highlight '(:foreground :solarized-red |
|
513 |
+ :inverse-p t) |
|
514 |
+ :show-point-face '(:foreground :solarized-cyan |
|
515 |
+ :bold-p t :inverse-p t) |
|
516 |
+ :interactive-input-face '(:foreground :solarized-red) |
|
517 |
+ :non-focus-complete-face '(:background :solarized-base03) |
|
518 |
+ :parenthesis-font-face-colours '(:solarized-red |
|
519 |
+ :solarized-base1 |
|
520 |
+ :solarized-green |
|
521 |
+ :solarized-orange |
|
522 |
+ :solarized-blue |
|
523 |
+ :solarized-magenta)) |
|
524 |
+ |
|
525 |
+;;; Show presence when loaded |
|
526 |
+(pushnew :editor-color-theme *features*) |
0 | 527 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,18 @@ |
1 |
+(defun load-init-file (filename &optional (conf-dir ".lispworks.d")) |
|
2 |
+ (load (merge-pathnames |
|
3 |
+ (make-pathname :directory `(:relative ,conf-dir) |
|
4 |
+ :name filename) |
|
5 |
+ (user-homedir-pathname)))) |
|
6 |
+ |
|
7 |
+(change-directory (user-homedir-pathname)) |
|
8 |
+ |
|
9 |
+(load-init-file "editor-color-theme") |
|
10 |
+ |
|
11 |
+(editor-color-theme:color-theme "solarized-dark") |
|
12 |
+ |
|
13 |
+(setf (editor:variable-value "Input Format Default") |
|
14 |
+ :default) |
|
15 |
+(setf (editor:variable-value "Output Format Default") |
|
16 |
+ '(:utf-8 :eol-style :lf)) |
|
17 |
+ |
|
18 |
+(load "~/quicklisp/setup.lisp") |
0 | 8 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,134 @@ |
1 |
+if [[ -o interactive ]]; then |
|
2 |
+ if [ "$TERM" != "screen" -a "$ITERM_SHELL_INTEGRATION_INSTALLED" = "" ]; then |
|
3 |
+ ITERM_SHELL_INTEGRATION_INSTALLED=Yes |
|
4 |
+ ITERM2_SHOULD_DECORATE_PROMPT="1" |
|
5 |
+ # Indicates start of command output. Runs just before command executes. |
|
6 |
+ iterm2_before_cmd_executes() { |
|
7 |
+ printf "\033]133;C;\007" |
|
8 |
+ } |
|
9 |
+ |
|
10 |
+ iterm2_set_user_var() { |
|
11 |
+ printf "\033]1337;SetUserVar=%s=%s\007" "$1" $(printf "%s" "$2" | base64 | tr -d '\n') |
|
12 |
+ } |
|
13 |
+ |
|
14 |
+ # Users can write their own version of this method. It should call |
|
15 |
+ # iterm2_set_user_var but not produce any other output. |
|
16 |
+ # e.g., iterm2_set_user_var currentDirectory $PWD |
|
17 |
+ # Accessible in iTerm2 (in a badge now, elsewhere in the future) as |
|
18 |
+ # \(user.currentDirectory). |
|
19 |
+ whence -v iterm2_print_user_vars > /dev/null 2>&1 |
|
20 |
+ if [ $? -ne 0 ]; then |
|
21 |
+ iterm2_print_user_vars() { |
|
22 |
+ } |
|
23 |
+ fi |
|
24 |
+ |
|
25 |
+ iterm2_print_state_data() { |
|
26 |
+ printf "\033]1337;RemoteHost=%s@%s\007" "$USER" "$iterm2_hostname" |
|
27 |
+ printf "\033]1337;CurrentDir=%s\007" "$PWD" |
|
28 |
+ iterm2_print_user_vars |
|
29 |
+ } |
|
30 |
+ |
|
31 |
+ # Report return code of command; runs after command finishes but before prompt |
|
32 |
+ iterm2_after_cmd_executes() { |
|
33 |
+ printf "\033]133;D;%s\007" "$STATUS" |
|
34 |
+ iterm2_print_state_data |
|
35 |
+ } |
|
36 |
+ |
|
37 |
+ # Mark start of prompt |
|
38 |
+ iterm2_prompt_mark() { |
|
39 |
+ printf "\033]133;A\007" |
|
40 |
+ } |
|
41 |
+ |
|
42 |
+ # Mark end of prompt |
|
43 |
+ iterm2_prompt_end() { |
|
44 |
+ printf "\033]133;B\007" |
|
45 |
+ } |
|
46 |
+ |
|
47 |
+ # There are three possible paths in life. |
|
48 |
+ # |
|
49 |
+ # 1) A command is entered at the prompt and you press return. |
|
50 |
+ # The following steps happen: |
|
51 |
+ # * iterm2_preexec is invoked |
|
52 |
+ # * PS1 is set to ITERM2_PRECMD_PS1 |
|
53 |
+ # * ITERM2_SHOULD_DECORATE_PROMPT is set to 1 |
|
54 |
+ # * The command executes (possibly reading or modifying PS1) |
|
55 |
+ # * iterm2_precmd is invoked |
|
56 |
+ # * ITERM2_PRECMD_PS1 is set to PS1 (as modified by command execution) |
|
57 |
+ # * PS1 gets our escape sequences added to it |
|
58 |
+ # * zsh displays your prompt |
|
59 |
+ # * You start entering a command |
|
60 |
+ # |
|
61 |
+ # 2) You press ^C while entering a command at the prompt. |
|
62 |
+ # The following steps happen: |
|
63 |
+ # * (iterm2_preexec is NOT invoked) |
|
64 |
+ # * iterm2_precmd is invoked |
|
65 |
+ # * iterm2_before_cmd_executes is called since we detected that iterm2_preexec was not run |
|
66 |
+ # * (ITERM2_PRECMD_PS1 and PS1 are not messed with, since PS1 already has our escape |
|
67 |
+ # sequences and ITERM2_PRECMD_PS1 already has PS1's original value) |
|
68 |
+ # * zsh displays your prompt |
|
69 |
+ # * You start entering a command |
|
70 |
+ # |
|
71 |
+ # 3) A new shell is born. |
|
72 |
+ # * PS1 has some initial value, either zsh's default or a value set before this script is sourced. |
|
73 |
+ # * iterm2_precmd is invoked |
|
74 |
+ # * ITERM2_SHOULD_DECORATE_PROMPT is initialized to 1 |
|
75 |
+ # * ITERM2_PRECMD_PS1 is set to the initial value of PS1 |
|
76 |
+ # * PS1 gets our escape sequences added to it |
|
77 |
+ # * Your prompt is shown and you may begin entering a command. |
|
78 |
+ # |
|
79 |
+ # Invariants: |
|
80 |
+ # * ITERM2_SHOULD_DECORATE_PROMPT is 1 during and just after command execution, and "" while the prompt is |
|
81 |
+ # shown and until you enter a command and press return. |
|
82 |
+ # * PS1 does not have our escape sequences during command execution |
|
83 |
+ # * After the command executes but before a new one begins, PS1 has escape sequences and |
|
84 |
+ # ITERM2_PRECMD_PS1 has PS1's original value. |
|
85 |
+ iterm2_decorate_prompt() { |
|
86 |
+ # This should be a raw PS1 without iTerm2's stuff. It could be changed during command |
|
87 |
+ # execution. |
|
88 |
+ ITERM2_PRECMD_PS1="$PS1" |
|
89 |
+ ITERM2_SHOULD_DECORATE_PROMPT="" |
|
90 |
+ |
|
91 |
+ # Add our escape sequences just before the prompt is shown. |
|
92 |
+ if [[ $PS1 == *'$(iterm2_prompt_mark)'* ]] |
|
93 |
+ then |
|
94 |
+ PS1="$PS1%{$(iterm2_prompt_end)%}" |
|
95 |
+ else |
|
96 |
+ PS1="%{$(iterm2_prompt_mark)%}$PS1%{$(iterm2_prompt_end)%}" |
|
97 |
+ fi |
|
98 |
+ } |
|
99 |
+ |
|
100 |
+ iterm2_precmd() { |
|
101 |
+ local STATUS="$?" |
|
102 |
+ if [ -z "$ITERM2_SHOULD_DECORATE_PROMPT" ]; then |
|
103 |
+ # You pressed ^C while entering a command (iterm2_preexec did not run) |
|
104 |
+ iterm2_before_cmd_executes |
|
105 |
+ fi |
|
106 |
+ |
|
107 |
+ iterm2_after_cmd_executes "$STATUS" |
|
108 |
+ |
|
109 |
+ if [ -n "$ITERM2_SHOULD_DECORATE_PROMPT" ]; then |
|
110 |
+ iterm2_decorate_prompt |
|
111 |
+ fi |
|
112 |
+ } |
|
113 |
+ |
|
114 |
+ # This is not run if you press ^C while entering a command. |
|
115 |
+ iterm2_preexec() { |
|
116 |
+ # Set PS1 back to its raw value prior to executing the command. |
|
117 |
+ PS1="$ITERM2_PRECMD_PS1" |
|
118 |
+ ITERM2_SHOULD_DECORATE_PROMPT="1" |
|
119 |
+ iterm2_before_cmd_executes |
|
120 |
+ } |
|
121 |
+ |
|
122 |
+ # If hostname -f is slow on your system, set iterm2_hostname prior to sourcing this script. |
|
123 |
+ [[ -z "$iterm2_hostname" ]] && iterm2_hostname=`hostname -f` |
|
124 |
+ |
|
125 |
+ [[ -z $precmd_functions ]] && precmd_functions=() |
|
126 |
+ precmd_functions=($precmd_functions iterm2_precmd) |
|
127 |
+ |
|
128 |
+ [[ -z $preexec_functions ]] && preexec_functions=() |
|
129 |
+ preexec_functions=($preexec_functions iterm2_preexec) |
|
130 |
+ |
|
131 |
+ iterm2_print_state_data |
|
132 |
+ printf "\033]1337;ShellIntegrationVersion=5;shell=zsh\007" |
|
133 |
+ fi |
|
134 |
+fi |
0 | 2 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,50 @@ |
1 |
+add_exe_path() { |
|
2 |
+ export PATH="$PATH:$1" |
|
3 |
+} |
|
4 |
+ |
|
5 |
+push_exe_path() { |
|
6 |
+ export PATH="$PATH:$1" |
|
7 |
+} |
|
8 |
+ |
|
9 |
+prepend_exe_path() { |
|
10 |
+ export PATH="$1:$PATH" |
|
11 |
+} |
|
12 |
+ |
|
13 |
+mkcd() { |
|
14 |
+ mkdir "$@" |
|
15 |
+ cd "$1" |
|
16 |
+} |
|
17 |
+ |
|
18 |
+dupfind() { |
|
19 |
+ local parallel |
|
20 |
+ parallel="$(command -v parallel)" |
|
21 |
+ parallel="${parallel:-$(command -v xargs)}" |
|
22 |
+ |
|
23 |
+ local dir |
|
24 |
+ dir="${1:-.}" |
|
25 |
+ find "$dir" \( \( -name .git -o -name CVS \) -prune \) -o \( -type f \) -print0 | |
|
26 |
+ $parallel -0 shasum | |
|
27 |
+ sort | |
|
28 |
+ ${GNU_PREFIX}uniq -w 20 -c | |
|
29 |
+ sort -nr |
|
30 |
+} |
|
31 |
+ |
|
32 |
+is-function () { |
|
33 |
+ whence -w $1 | grep -I function > /dev/null |
|
34 |
+} |
|
35 |
+ |
|
36 |
+is-alias () { |
|
37 |
+ whence -w $1 | grep -I alias > /dev/null |
|
38 |
+} |
|
39 |
+ |
|
40 |
+expand-alias () { |
|
41 |
+ local POSSIBLE_ALIAS |
|
42 |
+ if [[ ! -z "$1" ]]; then |
|
43 |
+ POSSIBLE_ALIAS="$(alias $1)" |
|
44 |
+ if [[ ! -z "$POSSIBLE_ALIAS" ]]; then |
|
45 |
+ echo "${POSSIBLE_ALIAS#*=}" |
|
46 |
+ else |
|
47 |
+ echo "$1" |
|
48 |
+ fi |
|
49 |
+ fi |
|
50 |
+} |
0 | 2 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,53 @@ |
1 |
+alias ..python="PYTHONPATH=.. python" |
|
2 |
+alias .python="PYTHONPATH=. python" |
|
3 |
+ |
|
4 |
+activate_env() { |
|
5 |
+ venv=. |
|
6 |
+ if [[ -e bin/activate ]]; then |
|
7 |
+ echo "sourcing local env: `pwd`/bin/activate" |
|
8 |
+ elif [[ -e venv/bin/activate ]]; then |
|
9 |
+ echo "sourcing local env: `pwd`/venv/bin/activate" |
|
10 |
+ venv=venv |
|
11 |
+ else |
|
12 |
+ env=$1 |
|
13 |
+ pushd $HOME/python_envs/ > /dev/null |
|
14 |
+ venv="$PWD/$env" |
|
15 |
+ popd |
|
16 |
+ |
|
17 |
+ if [[ $env == "" ]]; then |
|
18 |
+ counter=1 |
|
19 |
+ typeset -A choices |
|
20 |
+ unset choice |
|
21 |
+ for x in `ls "$venv"`; do |
|
22 |
+ echo $counter\) `basename $x` |
|
23 |
+ choices[$counter]=$x |
|
24 |
+ (( counter++ )) |
|
25 |
+ done |
|
26 |
+ echo -n "your choice? " |
|
27 |
+ choice=-1 |
|
28 |
+ read choice |
|
29 |
+ if [[ $choice == "" ]]; then |
|
30 |
+ return |
|
31 |
+ fi |
|
32 |
+ venv="$venv/$choices[$choice]" |
|
33 |
+ echo "you chose $venv" |
|
34 |
+ fi |
|
35 |
+ fi |
|
36 |
+ source "$venv/bin/activate" |
|
37 |
+ unset venv env; |
|
38 |
+} |
|
39 |
+alias ae=activate_env |
|
40 |
+ |
|
41 |
+psc() { |
|
42 |
+ python -u -c "from __future__ import print_function; import sys;$1" |
|
43 |
+} |
|
44 |
+ |
|
45 |
+new_virtual_env() { |
|
46 |
+ virtualenv -p "python$2" --no-site-packages "$HOME/python_envs/$1" |
|
47 |
+ pushd "$HOME/python_envs/$1" |
|
48 |
+} |
|
49 |
+alias ne=new_virtual_env |
|
50 |
+ |
|
51 |
+ge() { |
|
52 |
+ cd "$VIRTUAL_ENV" |
|
53 |
+} |
... | ... |
@@ -1,5 +1,11 @@ |
1 | 1 |
GIT_DEBUG=0 |
2 | 2 |
|
3 |
+git-ub() { |
|
4 |
+ git stash || exit 1 |
|
5 |
+ git pull --rebase |
|
6 |
+ git stash pop |
|
7 |
+} |
|
8 |
+ |
|
3 | 9 |
git-ufgrep() { |
4 | 10 |
PATTERN="$1" |
5 | 11 |
if [[ ${PATTERN}x == ""x ]]; then |
... | ... |
@@ -28,6 +34,10 @@ git-back() { |
28 | 34 |
} |
29 | 35 |
|
30 | 36 |
git-ff() { |
37 |
+ git merge --ff-only |
|
38 |
+} |
|
39 |
+ |
|
40 |
+git-pff() { |
|
31 | 41 |
git pull --ff-only |
32 | 42 |
} |
33 | 43 |
|
... | ... |
@@ -36,7 +46,7 @@ git-root() { |
36 | 46 |
} |
37 | 47 |
|
38 | 48 |
git-ag() { |
39 |
- ag "$@" -- $(git-root) |
|
49 |
+ ag "$@" -- "$(git-root)" |
|
40 | 50 |
} |
41 | 51 |
|
42 | 52 |
git-cd() { |
... | ... |
@@ -48,25 +58,40 @@ git-graph() { |
48 | 58 |
git log --graph --format=oneline --decorate "$@" |
49 | 59 |
} |
50 | 60 |
alias gl=git-graph |
61 |
+alias git-l=git-graph |
|
62 |
+alias git-hist=git-graph |
|
63 |
+alias g=git |
|
64 |
+ |
|
65 |
+git-messages() { |
|
66 |
+ if [[ -d .git ]]; then |
|
67 |
+ echo "Git log messages:" |
|
68 |
+ git log -n 5 | egrep --color=yes -Io '(TODO|NOTE|FIXME|BUG|DONE):.*$' |
|
69 |
+ fi |
|
51 | 70 |
|
52 |
-is-function () { |
|
53 |
- whence -w $1 | grep --color=auto -I function > /dev/null |
|
71 |
+ echo "Messages from files:" |
|
72 |
+ egrep --color=yes -IHnro '(TODO|NOTE|FIXME|BUG):.*$' . | |
|
73 |
+ psc ' |
|
74 |
+for line in sys.stdin: |
|
75 |
+ line = line.strip().split(":", 2) |
|
76 |
+ print("%s\n\t%s" % (":".join(line[2:]), ":".join(line[:2])))' |
|
54 | 77 |
} |
55 | 78 |
|
79 |
+alias git-msg=git-messages |
|
56 | 80 |
|
57 | 81 |
GIT_CMD="`which -p git 2>/dev/null`" |
82 |
+GTI_CMD="`which -p gti 2>/dev/null`" |
|
58 | 83 |
|
59 |
-if [[ "$GIT_CMD"x != ""x ]]; then |
|
84 |
+if [[ ! -z "$GIT_CMD" ]]; then |
|
60 | 85 |
# git wrapper that mimics the functionality of git for commandlets but also |
61 | 86 |
# searches shell functions. |
62 | 87 |
git() { |
63 |
- POSSIBLE_CMD="git-$1" |
|
64 |
- if is-function $POSSIBLE_CMD; then |
|
88 |
+ local POSSIBLE_CMD |
|
89 |
+ POSSIBLE_CMD="$(expand-alias git-$1)" |
|
90 |
+ |
|
91 |
+ if is-function "$POSSIBLE_CMD"; then |
|
65 | 92 |
$POSSIBLE_CMD "${@[2,-1]}" |
66 | 93 |
else |
67 |
- $GIT_CMD "$@" |
|
94 |
+ "$GIT_CMD" "$@" |
|
68 | 95 |
fi |
69 | 96 |
} |
70 | 97 |
fi |
71 |
- |
|
72 |
- |
73 | 98 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,48 @@ |
1 |
+# # zstyle ':completion:*' add-space true |
|
2 |
+# # zstyle ':completion:*' insert-unambiguous true |
|
3 |
+# zstyle ':completion:*' completer _list _oldlist _expand _complete _match _correct _prefix |
|
4 |
+# zstyle ':completion:*' completions 1 |
|
5 |
+# zstyle ':completion:*' expand prefix suffix |
|
6 |
+# zstyle ':completion:*' file-sort name |
|
7 |
+# zstyle ':completion:*' format 'Completing %D %d' |
|
8 |
+# zstyle ':completion:*' glob 1 |
|
9 |
+# zstyle ':completion:*' group-name '' |
|
10 |
+# zstyle ':completion:*' matcher-list 'm:{[:lower:]}={[:upper:]} r:|[-._\ ]=** r:|=**' '+m:{[:lower:]}={[:upper:]} r:|[-._\ ]=** r:|=**' '+m:{[:lower:]}={[:upper:]} r:|[-._\ ]=** r:|=** l:|=*' '+m:{[:lower:]}={[:upper:]} r:|[-._\ ]=** r:|=** l:|=*' |
|
11 |
+# zstyle ':completion:*' max-errors 1 |
|
12 |
+# zstyle ':completion:*' prompt '%e errors:' |
|
13 |
+# zstyle ':completion:*' substitute 1 |
|
14 |
+# zstyle :compinstall filename '/Users/elangley/.zshrc' |
|
15 |
+# export fpath=($HOME/.zsh.d/completion $fpath) |
|
16 |
+ |
|
17 |
+# The following lines were added by compinstall |
|
18 |
+ |
|
19 |
+ |
|
20 |
+# zstyle ':completion:*' completer _expand _complete #_match _prefix |
|
21 |
+zstyle ':completion:*' completer _list _oldlist _expand _complete _match _prefix #_correct _prefix |
|
22 |
+zstyle ':completion:*' keep-prefix true |
|
23 |
+zstyle ':completion:*' format 'Completing %D %d' |
|
24 |
+zstyle ':completion:*' group-name '' |
|
25 |
+zstyle ':completion:*' ignore-parents parent pwd |
|
26 |
+zstyle ':completion:*' insert-unambiguous true |
|
27 |
+zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS} |
|
28 |
+zstyle ':completion:*' list-prompt %SAt %p: Hit TAB for more, or the character to insert%s |
|
29 |
+zstyle ':completion:*' matcher-list 'm:{[:lower:][:upper:]}={[:upper:][:lower:]} r:|[-._\ ]=** r:|=**' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]} r:|[-._\ ]=** r:|=**' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]} r:|[-._\ ]=** r:|=**' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]} r:|[-._\ ]=** r:|=**' |
|
30 |
+# zstyle ':completion:*' match-original both |
|
31 |
+zstyle ':completion:*' menu select=2 |
|
32 |
+# zstyle ':completion:*' original true |
|
33 |
+zstyle ':completion:*' original false |
|
34 |
+zstyle ':completion:*' prompt '%e errors:' |
|
35 |
+zstyle ':completion:*' select-prompt '%SScrolling active: current selection at %p%s' |
|
36 |
+zstyle ':completion:*' show-ambiguity true |
|
37 |
+zstyle ':completion:*' use-compctl false |
|
38 |
+zstyle ':completion::complete:cd::' group-order directory-stack local-directories named-directories users |
|
39 |
+zstyle :compinstall filename '/Users/elangley/.zsh.d/99-completion.zsh' |
|
40 |
+ |
|
41 |
+ |
|
42 |
+source $HOME/.zsh.d/completion/nix.plugin.zsh |
|
43 |
+fpath=($HOME/.zsh.d/completion $fpath) |
|
44 |
+autoload -U compinit && compinit |
|
45 |
+ |
|
46 |
+compinit |
|
47 |
+ |
|
48 |
+# # End of lines added by compinstall |
0 | 49 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,556 @@ |
1 |
+#zmodload zsh/zprof |
|
2 |
+ |
|
3 |
+cat <<'EOP' |
|
4 |
+ : |
|
5 |
+ `. ; .' |
|
6 |
+ `. .-'''-. .' |
|
7 |
+ ;' __ _;' |
|
8 |
+ / '_ _`\ |
|
9 |
+ | _( a ( a | |
|
10 |
+ '''''| (_) > |`````` |
|
11 |
+ \ \ / / |
|
12 |
+ `. `--'.' |
|
13 |
+ .' `-,,,-' `. |
|
14 |
+ .' : `. hjw |
|
15 |
+ : |
|
16 |
+EOP |
|
17 |
+ |
|
18 |
+echo "begin zshrc" |
|
19 |
+echo "shell session started for $USER on $TTY at `date`" | tee /dev/stderr | logger |
|
20 |
+source $HOME/.localzshrc.sh |
|
21 |
+autoload -U colors && colors |
|
22 |
+autoload zsh/parameter |
|
23 |
+ |
|
24 |
+export PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin:/usr/texbin:/usr/X11/bin:/opt/local/bin:/sbin/usr/sbin:$PATH |
|
25 |
+ |
|
26 |
+export GNU_PREFIX='' |
|
27 |
+platform="$(uname -s)" |
|
28 |
+echo the platform is "$platform" |
|
29 |
+if [[ $platform == 'Darwin' ]]; then |
|
30 |
+ GNU_PREFIX='g' |
|
31 |
+ else |
|
32 |
+ echo not osx |
|
33 |
+fi |
|
34 |
+ |
|
35 |
+if [[ -e /etc/sysconfig/zsh-prompt-$TERM ]]; then |
|
36 |
+ . /etc/sysconfig/zsh-prompt-$TERM |
|
37 |
+elif [[ -e $HOME/.zsh-prompt-$TERM ]]; then |
|
38 |
+ . $HOME/.zsh-prompt-$TERM |
|
39 |
+fi |
|
40 |
+ |
|
41 |
+for p in $PATH; do |
|
42 |
+ _FORTUNE="$PATH/fortune" |
|
43 |
+ if [[ -x "$_FORTUNE" ]]; then |
|
44 |
+ FORTUNE="$_FORTUNE" |
|
45 |
+ break |
|
46 |
+ fi |
|
47 |
+done |
|
48 |
+ |
|
49 |
+if [ -x "$FORTUNE" ]; then |
|
50 |
+ $FORTUNE |
|
51 |
+fi |
|
52 |
+ |
|
53 |
+function battery_charge() { |
|
54 |
+ if [[ $LAPTOP[1] == 'y' && $TERM != "xterm" ]]; then |
|
55 |
+ python "$HOME/bin/batcharge.py" 2>/dev/null |
|
56 |
+ fi |
|
57 |
+} |
|
58 |
+ |
|
59 |
+autoload -Uz vcs_info |
|
60 |
+zstyle ':vcs_info:*' actionformats \ |
|
61 |
+ '%F{5}%f%s%F{5}%F{3}->%F{5}%F{2}%b%F{3}|%F{1}%a%F{5}%f' |
|
62 |
+zstyle ':vcs_info:*' formats \ |
|
63 |
+ '%F{5}%f%s%F{5}%F{3}->%F{5}%F{2}%b%F{5}%f' |
|
64 |
+zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b%F{1}:%F{3}%r' |
|
65 |
+ |
|
66 |
+zstyle ':vcs_info:*' enable git cvs svn |
|
67 |
+ |
|
68 |
+vcs_info_wrapper() { |
|
69 |
+ vcs_info |
|
70 |
+ if [ -n "$vcs_info_msg_0_" ]; then |
|
71 |
+ echo "%{$fg[grey]%}${vcs_info_msg_0_}%{$reset_color%}$del" |
|
72 |
+ fi |
|
73 |
+} |
|
74 |
+ |
|
75 |
+function zle-line-init zle-keymap-select { |
|
76 |
+ RPS1="${${KEYMAP/vicmd/-- NORMAL --}/(main|viins)/-- INSERT --}" |
|
77 |
+ RPS2=$RPS1 |
|
78 |
+ zle reset-prompt |
|
79 |
+} |
|
80 |
+ |
|
81 |
+zle -N zle-line-init |
|
82 |
+zle -N zle-keymap-select |
|
83 |
+ |
|
84 |
+ |
|
85 |
+export PYTHONSTARTUP=$HOME/Library/Python/2.7/site-packages/sitecustomize.py |
|
86 |
+setopt promptsubst |
|
87 |
+ |
|
88 |
+PROMPT='--- |
|
89 |
+(%?) %m:%n--%l ${PWD/$HOME/~} `vcs_info_wrapper` `battery_charge` |
|
90 |
+%!:%# ' |
|
91 |
+export PROMPT |
|
92 |
+#RPROMPT='[%T]' |
|
93 |
+ |
|
94 |
+HOSTNAME=`hostname -f` |
|
95 |
+PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD}\007"' |
|
96 |
+ |
|
97 |
+cmdtermtitle() { |
|
98 |
+ cmd_name="${(V)1}" |
|
99 |
+ if [ 'fg' = "${${(z)@}[1]}" ]; then |
|
100 |
+ cmd_name="${(vV)jobtexts}" |
|
101 |
+ fi |
|
102 |
+ |
|
103 |
+ if [[ "${TERM%%-*}"x == "screen"x ]]; then |
|
104 |
+ echo -ne "\033]0;${cmd_name}\007" |
|
105 |
+ else |
|
106 |
+ echo -ne "\033]0; ${cmd_name} : ${USER}@$HOSTNAME\007" |
|
107 |
+ fi |
|
108 |
+} |
|
109 |
+ |
|
110 |
+autoload -U add-zsh-hook |
|
111 |
+if [[ $TERM != "linux" && ${TERM%-color} != "eterm" ]]; then |
|
112 |
+ add-zsh-hook preexec cmdtermtitle |
|
113 |
+fi |
|
114 |
+ |
|
115 |
+termtitle() { |
|
116 |
+ npwd=${PWD/#$HOME/\~} |
|
117 |
+ if [[ "${TERM%%-*}"x == "screen"x ]]; then |
|
118 |
+ echo -ne "\033]0;${npwd}\007" |
|
119 |
+ else |
|
120 |
+ echo -ne "\033]0;${USER}@$HOSTNAME: ${npwd}\007" |
|
121 |
+ fi |
|
122 |
+} |
|
123 |
+ |
|
124 |
+if [[ $TERM != "linux" && ${TERM%-color} != "eterm" ]]; then |
|
125 |
+ add-zsh-hook precmd termtitle |
|
126 |
+fi |
|
127 |
+ |
|
128 |
+PATH=$HOME/bin:/usr/local/bin:$PATH |
|
129 |
+export PATH="/opt/local/bin:/usr/sbin:/sbin/usr/sbin:/sbin:$HOME/.cabal/bin:$HOME/.local/bin:$HOME/bin:/Developer/usr/bin:$PATH" |
|
130 |
+export VIMCLOJURE_SERVER_JAR="$HOME/bin/jars/server-2.3.6.jar" |
|
131 |
+export SAVEHIST=10000000 |
|
132 |
+export HISTSIZE=10000000 |
|
133 |
+export HISTFILE=$HOME/.zshistory |
|
134 |
+ |
|
135 |
+export PKG_CONFIG_PATH="$PKG_CONFIG_PATH" |
|
136 |
+ |
|
137 |
+export MANPATH="$HOME/.nix-profile/share/man:/opt/local/share/man:/usr/local/share/man:/Applications/Xcode.app/Contents/Developer/usr/share/man:$MANPATH" |
|
138 |
+export INFOPATH="$HOME/.nix-profile/share/info:/usr/local/share/info:/usr/local/texlive/2009/texmf/doc/info:$INFOPATH" |
|
139 |
+ |
|
140 |
+export PAGER="less -SiemX" |
|
141 |
+ |
|
142 |
+export RGBDEF='/opt/X11/share/X11/rgb.txt' |
|
143 |
+export GREP_COLORS='ms=01;31:mc=01;31:sl=:cx=:fn=35:ln=32:bn=32:se=36' |
|
144 |
+ |
|
145 |
+if command -v emacsclient 2>&1 >/dev/null; then |
|
146 |
+ export VISUAL="emacsclient -c" |
|
147 |
+elif [ -x /usr/local/bin/vim ]; then |
|
148 |
+ export VISUAL="/usr/local/bin/vim" |
|
149 |
+else |
|
150 |
+ export VISUAL="/usr/bin/vim" |
|
151 |
+fi |
|
152 |
+export EDITOR=$VISUAL |
|
153 |
+ |
|
154 |
+autoload run-help |
|
155 |
+autoload -U zfinit |
|
156 |
+autoload -U tcp_proxy |
|
157 |
+autoload -U tcp_open |
|
158 |
+autoload -U tcp_point |
|
159 |
+autoload -U tcp_shoot |
|
160 |
+#------------------ |
|
161 |
+zfinit |
|
162 |
+ |
|
163 |
+if [[ $TERM != 'dumb' ]]; then |
|
164 |
+ # Solarized dircolors: |
|
165 |
+ LS_COLORS='no=00;38;5;244:rs=0:di=00;38;5;33:ln=00;38;5;37:mh=00:pi=48;5;230;38;5;136;01:so=48;5;230;38;5;136;01:do=48;5;230;38;5;136;01:bd=48;5;230;38;5;244;01:cd=48;5;230;38;5;244;01:or=48;5;235;38;5;160:su=48;5;160;38;5;230:sg=48;5;136;38;5;230:ca=30;41:tw=48;5;64;38;5;230:ow=48;5;235;38;5;33:st=48;5;33;38;5;230:ex=00;38;5;64:*.tar=00;38;5;61:*.tgz=00;38;5;61:*.arj=00;38;5;61:*.taz=00;38;5;61:*.lzh=00;38;5;61:*.lzma=00;38;5;61:*.tlz=00;38;5;61:*.txz=00;38;5;61:*.zip=00;38;5;61:*.z=00;38;5;61:*.Z=00;38;5;61:*.dz=00;38;5;61:*.gz=00;38;5;61:*.lz=00;38;5;61:*.xz=00;38;5;61:*.bz2=00;38;5;61:*.bz=00;38;5;61:*.tbz=00;38;5;61:*.tbz2=00;38;5;61:*.tz=00;38;5;61:*.deb=00;38;5;61:*.rpm=00;38;5;61:*.jar=00;38;5;61:*.rar=00;38;5;61:*.ace=00;38;5;61:*.zoo=00;38;5;61:*.cpio=00;38;5;61:*.7z=00;38;5;61:*.rz=00;38;5;61:*.apk=00;38;5;61:*.gem=00;38;5;61:*.jpg=00;38;5;136:*.JPG=00;38;5;136:*.jpeg=00;38;5;136:*.gif=00;38;5;136:*.bmp=00;38;5;136:*.pbm=00;38;5;136:*.pgm=00;38;5;136:*.ppm=00;38;5;136:*.tga=00;38;5;136:*.xbm=00;38;5;136:*.xpm=00;38;5;136:*.tif=00;38;5;136:*.tiff=00;38;5;136:*.png=00;38;5;136:*.PNG=00;38;5;136:*.svg=00;38;5;136:*.svgz=00;38;5;136:*.mng=00;38;5;136:*.pcx=00;38;5;136:*.dl=00;38;5;136:*.xcf=00;38;5;136:*.xwd=00;38;5;136:*.yuv=00;38;5;136:*.cgm=00;38;5;136:*.emf=00;38;5;136:*.eps=00;38;5;136:*.CR2=00;38;5;136:*.ico=00;38;5;136:*.tex=00;38;5;245:*.rdf=00;38;5;245:*.owl=00;38;5;245:*.n3=00;38;5;245:*.ttl=00;38;5;245:*.nt=00;38;5;245:*.torrent=00;38;5;245:*.xml=00;38;5;245:*Makefile=00;38;5;245:*Rakefile=00;38;5;245:*Dockerfile=00;38;5;245:*build.xml=00;38;5;245:*rc=00;38;5;245:*1=00;38;5;245:*.nfo=00;38;5;245:*README=00;38;5;245:*README.txt=00;38;5;245:*readme.txt=00;38;5;245:*.md=00;38;5;245:*README.markdown=00;38;5;245:*.ini=00;38;5;245:*.yml=00;38;5;245:*.cfg=00;38;5;245:*.conf=00;38;5;245:*.c=00;38;5;245:*.cpp=00;38;5;245:*.cc=00;38;5;245:*.sqlite=00;38;5;245:*.go=00;38;5;245:*.log=00;38;5;240:*.bak=00;38;5;240:*.aux=00;38;5;240:*.lof=00;38;5;240:*.lol=00;38;5;240:*.lot=00;38;5;240:*.out=00;38;5;240:*.toc=00;38;5;240:*.bbl=00;38;5;240:*.blg=00;38;5;240:*~=00;38;5;240:*#=00;38;5;240:*.part=00;38;5;240:*.incomplete=00;38;5;240:*.swp=00;38;5;240:*.tmp=00;38;5;240:*.temp=00;38;5;240:*.o=00;38;5;240:*.pyc=00;38;5;240:*.class=00;38;5;240:*.cache=00;38;5;240:*.aac=00;38;5;166:*.au=00;38;5;166:*.flac=00;38;5;166:*.mid=00;38;5;166:*.midi=00;38;5;166:*.mka=00;38;5;166:*.mp3=00;38;5;166:*.mpc=00;38;5;166:*.ogg=00;38;5;166:*.ra=00;38;5;166:*.wav=00;38;5;166:*.m4a=00;38;5;166:*.axa=00;38;5;166:*.oga=00;38;5;166:*.spx=00;38;5;166:*.xspf=00;38;5;166:*.mov=00;38;5;166:*.MOV=00;38;5;166:*.mpg=00;38;5;166:*.mpeg=00;38;5;166:*.m2v=00;38;5;166:*.mkv=00;38;5;166:*.ogm=00;38;5;166:*.mp4=00;38;5;166:*.m4v=00;38;5;166:*.mp4v=00;38;5;166:*.vob=00;38;5;166:*.qt=00;38;5;166:*.nuv=00;38;5;166:*.wmv=00;38;5;166:*.asf=00;38;5;166:*.rm=00;38;5;166:*.rmvb=00;38;5;166:*.flc=00;38;5;166:*.avi=00;38;5;166:*.fli=00;38;5;166:*.flv=00;38;5;166:*.gl=00;38;5;166:*.m2ts=00;38;5;166:*.divx=00;38;5;166:*.webm=00;38;5;166:*.axv=00;38;5;166:*.anx=00;38;5;166:*.ogv=00;38;5;166:*.ogx=00;38;5;166:'; |
|
166 |
+ export LS_COLORS |
|
167 |
+fi |
|
168 |
+ |
|
169 |
+setopt autopushd |
|
170 |
+setopt cdablevars |
|
171 |
+setopt AUTO_LIST |
|
172 |
+setopt LIST_PACKED |
|
173 |
+setopt SHARE_HISTORY |
|
174 |
+setopt HIST_IGNORE_ALL_DUPS |
|
175 |
+setopt HIST_EXPIRE_DUPS_FIRST |
|
176 |
+setopt HIST_VERIFY |
|
177 |
+setopt noBG_NICE |
|
178 |
+setopt PUSHD_IGNORE_DUPS |
|
179 |
+setopt autocd |
|
180 |
+setopt chaselinks |
|
181 |
+setopt markdirs |
|
182 |
+ |
|
183 |
+source $HOME/git_repos/3dp/nix-zsh-completions/nix.plugin.zsh |
|
184 |
+fpath=($HOME/git_repos/3dp/nix-zsh-completions $fpath) |
|
185 |
+ |
|
186 |
+# The following lines were added by compinstall |
|
187 |
+zstyle ':completion:*' completer _expand _complete #_match _prefix |
|
188 |
+zstyle ':completion:*' format 'Completing %D %d' |
|
189 |
+zstyle ':completion:*' group-name '' |
|
190 |
+zstyle ':completion:*' insert-unambiguous true |
|
191 |
+zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS} |
|
192 |
+zstyle ':completion:*' list-prompt %SAt %p: Hit TAB for more, or the character to insert%s |
|
193 |
+zstyle ':completion:*' matcher-list 'm:{[:lower:][:upper:]}={[:upper:][:lower:]} r:|[-._\ ]=** r:|=**' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]} r:|[-._\ ]=** r:|=**' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]} r:|[-._\ ]=** r:|=**' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]} r:|[-._\ ]=** r:|=**' |
|
194 |
+zstyle ':completion:*' menu select=0 |
|
195 |
+zstyle ':completion:*' original false |
|
196 |
+zstyle ':completion:*' prompt '%e errors:' |
|
197 |
+zstyle ':completion:*' select-prompt %SScrolling active: current selection at %p%s |
|
198 |
+zstyle ':completion:*' use-compctl false |
|
199 |
+ |
|
200 |
+export fpath=($HOME/.zsh.d/completion $fpath) |
|
201 |
+autoload -Uz compinit |
|
202 |
+ |
|
203 |
+compinit |
|
204 |
+# End of lines added by compinstall |
|
205 |
+ |
|
206 |
+[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function |
|
207 |
+ |
|
208 |
+alias vi='vim' |
|
209 |
+vim() { |
|
210 |
+ stty -ixon |
|
211 |
+ env vim $* |
|
212 |
+ stty ixany |
|
213 |
+} |
|
214 |
+alias :e='vim' |
|
215 |
+alias :w='cat >' |
|
216 |
+ |
|
217 |
+alias "cd-"="cd -" |
|
218 |
+alias jmp=pushd |
|
219 |
+alias ret=popd |
|
220 |
+alias ..python="PYTHONPATH=.. python" |
|
221 |
+alias .python="PYTHONPATH=. python" |
|
222 |
+alias grep="grep --color=auto -I" |
|
223 |
+alias la="ls -AF" |
|
224 |
+alias ,=pydit |
|
225 |
+alias tw=twitter_tool |
|
226 |
+alias v=$VISUAL |
|
227 |
+alias e=$EDITOR |
|
228 |
+alias cvsdiff='cvs diff -wbB | colordiff' |
|
229 |
+alias cp.='gcp --target-directory=.' |
|
230 |
+alias bower='noglob bower' |
|
231 |
+alias node='nodejs' |
|
232 |
+alias find='noglob find' |
|
233 |
+ |
|
234 |
+echo "done variables and options" |
|
235 |
+ |
|
236 |
+showspaces() { |
|
237 |
+ python -c'import sys;print sys.stdin.read().replace(" ","_").replace("\t", "----")' |
|
238 |
+} |
|
239 |
+ |
|
240 |
+cvsc() { |
|
241 |
+ FN=$1 |
|
242 |
+ shift |
|
243 |
+ cvs -q commit -m "'$*'" $FN |
|
244 |
+} |
|
245 |
+alias cvsc.="cvsc ." |
|
246 |
+ |
|
247 |
+truncfile() { |
|
248 |
+ echo $1 |
|
249 |
+ (( number = $1 - 1 )) |
|
250 |
+ ${GNU_PREFIX}sed -i "${number}q" $2 |
|
251 |
+} |
|
252 |
+gtde() { cd $HOME/Desktop/$1 } |
|
253 |
+gtdo() { cd $HOME/Downloads/$1 } |
|
254 |
+gtp() {cd $HOME/Programming/$1 } |
|
255 |
+gt() { cd $HOME/$1 } |
|
256 |
+if [[ ! -e $HHOME/.gtaliases ]]; then touch $HOME/.gtaliases; fi |
|
257 |
+ |
|
258 |
+savedir() { |
|
259 |
+ cmd="export "`basename $PWD`"=$PWD" |
|
260 |
+ eval $cmd |
|
261 |
+ truncfile 50 $HOME/.gtaliases |
|
262 |
+ echo $cmd >> $HOME/.gtaliases |
|
263 |
+} |
|
264 |
+ |
|
265 |
+gtpa() { |
|
266 |
+ gtp $1 |
|
267 |
+ cmd="alias \"gt_$1\"=\"gtp $1\"" |
|
268 |
+ eval $cmd |
|
269 |
+ truncfile 50 $HOME/.gtaliases |
|
270 |
+ echo $cmd >> $HOME/.gtaliases |
|
271 |
+} |
|
272 |
+gta() { |
|
273 |
+ gt $1 |
|
274 |
+ cmd="alias \"gt_$1\"=\"gt $1\"" |
|
275 |
+ eval $cmd |
|
276 |
+ truncfile 50 $HOME/.gtaliases |
|
277 |
+ echo $cmd >> $HOME/.gtaliases |
|
278 |
+} |
|
279 |
+source $HOME/.gtaliases |
|
280 |
+gthaskell() { gtp haskell } |
|
281 |
+gtprolog() { gtp prolog } |
|
282 |
+gtpython() { gtp python } |
|
283 |
+despace() { echo ${1// /} } |
|
284 |
+escape() { echo ${(j<\\ >)*} } |
|
285 |
+archive() { |
|
286 |
+ if [ ! -d .bak ]; then |
|
287 |
+ mkdir .bak |
|
288 |
+ fi |
|
289 |
+ FN=.bak/`despace $1`-`date +"%Y%m%d.%H%M%S"`.tbz |
|
290 |
+ echo -n archiving $FN... |
|
291 |
+ tar jhcf $FN $1 |
|
292 |
+ echo done. |
|
293 |
+} |
|
294 |
+ |
|
295 |
+editrc() { |
|
296 |
+ hash=`md5 $HOME/.zshrc` |
|
297 |
+ $VISUAL $HOME/.zshrc |
|
298 |
+ newhash=`md5 $HOME/.zshrc` |
|
299 |
+ if [[ $hash != $newhash ]]; then |
|
300 |
+ source $HOME/.zshrc |
|
301 |
+ fi |
|
302 |
+} |
|
303 |
+ |
|
304 |
+rl() { source $HOME/.zshrc } |
|
305 |
+ |
|
306 |
+getlink() { #gtdo |
|
307 |
+ curl "`pbpaste`" > $(basename `pbpaste`) |
|
308 |
+} |
|
309 |
+ |
|
310 |
+copypwd() { echo -n `pwd` | pbcopy } |
|
311 |
+alias sdir='copypwd' |
|
312 |
+ |
|
313 |
+sshto() { |
|
314 |
+ TARGET=`egrep "^$1:" ~/.ssh_dests | cut -d: -f2` |
|
315 |
+ USER=`grep $TARGET ~/.ssh_dests | cut -d: -f3` |
|
316 |
+ ssh $USER@$TARGET |
|
317 |
+} |
|
318 |
+ |
|
319 |
+dirsave() { |
|
320 |
+ pwd | ctext |
|
321 |
+} |
|
322 |
+dirgo() { |
|
323 |
+ cd `ptext` |
|
324 |
+} |
|
325 |
+ |
|
326 |
+ccwd() { |
|
327 |
+ pwd | ucopy |
|
328 |
+} |
|
329 |
+ |
|
330 |
+gdir() { |
|
331 |
+ cd `upaste` |
|
332 |
+} |
|
333 |
+ |
|
334 |
+ulimit -c unlimited |
|
335 |
+autoload edit-command-line |
|
336 |
+zle -N edit-command-line |
|
337 |
+bindkey '^X^e' edit-command-line |
|
338 |
+ |
|
339 |
+# pip zsh completion start |
|
340 |
+function _pip_completion { |
|
341 |
+ local words cword |
|
342 |
+ read -Ac words |
|
343 |
+ read -cn cword |
|
344 |
+ reply=( $( COMP_WORDS="$words[*]" \ |
|
345 |
+ COMP_CWORD=$(( cword-1 )) \ |
|
346 |
+ PIP_AUTO_COMPLETE=1 $words[1] ) ) |
|
347 |
+} |
|
348 |
+compctl -K _pip_completion pip |
|
349 |
+# pip zsh completion end |
|
350 |
+ |
|
351 |
+add_to_sandbox() { |
|
352 |
+ echo adding $1 to sandbox |
|
353 |
+ cp $1 $HOME/sandbox |
|
354 |
+ cd $HOME/sandbox |
|
355 |
+ git add `basename $1` |
|
356 |
+ git commit -a -m "added snippet $1" |
|
357 |
+ cd - |
|
358 |
+} |
|
359 |
+ |
|
360 |
+psc() { |
|
361 |
+ python -u -c "from __future__ import print_function; import sys;$1" |
|
362 |
+} |
|
363 |
+ |
|
364 |
+activate_env() { |
|
365 |
+ venv=. |
|
366 |
+ if [[ -e bin/activate ]]; then |
|
367 |
+ echo "sourcing local env: `pwd`/bin/activate" |
|
368 |
+ elif [[ -e venv/bin/activate ]]; then |
|
369 |
+ echo "sourcing local env: `pwd`/venv/bin/activate" |
|
370 |
+ venv=venv |
|
371 |
+ else |
|
372 |
+ env=$1 |
|
373 |
+ pushd $HOME/python_envs/ > /dev/null |
|
374 |
+ venv="$PWD/$env" |
|
375 |
+ popd |
|
376 |
+ |
|
377 |
+ if [[ $env == "" ]]; then |
|
378 |
+ counter=1 |
|
379 |
+ typeset -A choices |
|
380 |
+ unset choice |
|
381 |
+ for x in `ls "$venv"`; do |
|
382 |
+ echo $counter\) `basename $x` |
|
383 |
+ choices[$counter]=$x |
|
384 |
+ (( counter++ )) |
|
385 |
+ done |
|
386 |
+ echo -n "your choice? " |
|
387 |
+ choice=-1 |
|
388 |
+ read choice |
|
389 |
+ if [[ $choice == "" ]]; then |
|
390 |
+ return |
|
391 |
+ fi |
|
392 |
+ venv="$venv/$choices[$choice]" |
|
393 |
+ echo "you chose $venv" |
|
394 |
+ fi |
|
395 |
+ fi |
|
396 |
+ source $venv/bin/activate |
|
397 |
+ unset venv env; |
|
398 |
+} |
|
399 |
+alias ae=activate_env |
|
400 |
+ |
|
401 |
+new_virtual_env() { |
|
402 |
+ virtualenv -p python$2 --no-site-packages --distribute $HOME/python_envs/$1 |
|
403 |
+ pushd $HOME/python_envs/$1 |
|
404 |
+} |
|
405 |
+alias ne=new_virtual_env |
|
406 |
+ |
|
407 |
+ge() { |
|
408 |
+ cd $VIRTUAL_ENV |
|
409 |
+} |
|
410 |
+ |
|
411 |
+messages() { |
|
412 |
+ if [[ -d .git ]]; then |
|
413 |
+ echo "Git log messages:" |
|
414 |
+ git log -n 5 | egrep --color=yes -Io '(TODO|NOTE|FIXME|BUG|DONE):.*$' |
|
415 |
+ fi |
|
416 |
+ |
|
417 |
+ echo "Messages from files:" |
|
418 |
+ egrep --color=yes -IHnro '(TODO|NOTE|FIXME|BUG):.*$' . | |
|
419 |
+ psc ' |
|
420 |
+for line in sys.stdin: |
|
421 |
+ line = line.strip().split(":", 2) |
|
422 |
+ print("%s\n\t%s" % (":".join(line[2:]), ":".join(line[:2])))' |
|
423 |
+} |
|
424 |
+ |
|
425 |
+wiki() { |
|
426 |
+ pushd $HOME/mywiki > /dev/null |
|
427 |
+ soywiki |
|
428 |
+ popd > /dev/null |
|
429 |
+} |
|
430 |
+ |
|
431 |
+dupfind() { |
|
432 |
+ find \( \( -name .git -o -name CVS \) -prune \) -o \( -type f \) -print0 | xargs -0 shasum | sort | uniq -w 20 -c | sort -nr |
|
433 |
+} |
|
434 |
+ |
|
435 |
+es() { |
|
436 |
+ python2.7 -c "e('$1')" |
|
437 |
+} |
|
438 |
+ |
|
439 |
+load_snippet() { |
|
440 |
+ python -ic "import sitecustomize;ls('$1')" |
|
441 |
+} |
|
442 |
+ |
|
443 |
+alias page=$PAGER |
|
444 |
+export VIRTUALENV=/usr |
|
445 |
+ |
|
446 |
+setopt allexport |
|
447 |
+ |
|
448 |
+export PYTHONPATH=$PYTHONPATH:$HOME/pythonlibs |
|
449 |
+ |
|
450 |
+PASSWD_RIGHT=True |
|
451 |
+cuauth() { |
|
452 |
+ if [ $PASSWD_RIGHT ]; then |
|
453 |
+ passwd=`security find-internet-password -l "ntsrva.cua.edu" -w` |
|
454 |
+ else |
|
455 |
+ passwd=`prompt_password 69langley` |
|
456 |
+ fi |
|
457 |
+ |
|
458 |
+ postdata="buttonClicked=4&err_flag=0&err_msg=&info_flag=0&info_msg=&redirect_url=&username=69langley&password=$passwd" |
|
459 |
+ curl https://wirelessauth.cua.edu/login.html -d $postdata 2>&1 | html2ps | ps2ascii && return |
|
460 |
+ unset PASSWD_RIGHT |
|
461 |
+} |
|
462 |
+ |
|
463 |
+getshelljobtrees() { |
|
464 |
+ pstree `pgrep '^login$'` |
|
465 |
+} |
|
466 |
+ |
|
467 |
+ |
|
468 |
+psgrep() { |
|
469 |
+ ps auxw | grep --color=yes $* | grep -v grep --color=no |
|
470 |
+} |
|
471 |
+ |
|
472 |
+dis() { |
|
473 |
+ jobs |
|
474 |
+ echo -n 'disown which? ' |
|
475 |
+ n=-1 |
|
476 |
+ read n |
|
477 |
+ if [[ $n != "" ]]; then |
|
478 |
+ disown %$n |
|
479 |
+ fi |
|
480 |
+} |
|
481 |
+ |
|
482 |
+getcommands() { |
|
483 |
+ compgen -acbk -A function | grep -v '^_' |
|
484 |
+} |
|
485 |
+ |
|
486 |
+alias dq=dmenu_queue_mpd |
|
487 |
+alias dqp=dmenu_queueplay_mpd |
|
488 |
+ |
|
489 |
+if [[ $BINDKEYS == "" ]]; then |
|
490 |
+ echo 'defining bindkeys in zshrc' |
|
491 |
+ BINDKEYS=${TERM%-256color} |
|
492 |
+ BINDKEYS=${BINDKEYS%-noit} |
|
493 |
+fi |
|
494 |
+ |
|
495 |
+bindkey -e |
|
496 |
+if [[ $BINDKEYS == "screen" ]]; then |
|
497 |
+ bindkey '[D' backward-word |
|
498 |
+ bindkey '[C' forward-word |
|
499 |
+ bindkey '[1~' beginning-of-line |
|
500 |
+ bindkey '[4~' end-of-line |
|
501 |
+else |
|
502 |
+ bindkey '[1;5D' backward-word |
|
503 |
+ bindkey '[5D' backward-word |
|
504 |
+ bindkey '[1;5C' forward-word |
|
505 |
+ bindkey '[5C' forward-word |
|
506 |
+ bindkey 'OH' beginning-of-line |
|
507 |
+ bindkey 'OF' end-of-line |
|
508 |
+fi |
|
509 |
+bindkey '[3~' delete-char |
|
510 |
+ |
|
511 |
+ |
|
512 |
+PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting |
|
513 |
+rvm use system &>/dev/null |
|
514 |
+ |
|
515 |
+export GOPATH=$HOME/go |
|
516 |
+export PATH=$PATH:$GOPATH/bin |
|
517 |
+export PATH=$HOME/vim8/bin:$PATH |
|
518 |
+ |
|
519 |
+export CPATH=$CPATH:$HOME/include |
|
520 |
+export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/lib |
|
521 |
+export VIMCLOJURE_SERVER_JAR="$HOME/lib/vimclojure/server-2.3.6.jar" |
|
522 |
+export CLON_THEME=el |
|
523 |
+ |
|
524 |
+pmkdir() { |
|
525 |
+ mkdir $1 |
|
526 |
+ touch $1/__init__.py |
|
527 |
+ cd $1 |
|
528 |
+} |
|
529 |
+ |
|
530 |
+mkcd() { |
|
531 |
+ mkdir "$1" |
|
532 |
+ cd "$1" |
|
533 |
+} |
|
534 |
+ |
|
535 |
+for x in `ls $HOME/.zsh.d/*.zsh`; do |
|
536 |
+ source "$x" |
|
537 |
+done |
|
538 |
+alias cn=current_news |
|
539 |
+ |
|
540 |
+PROMPT='--- |
|
541 |
+(%?) %m:%n--%l ${PWD/$HOME/~} `vcs_info_wrapper` `battery_charge 2>/dev/null` |
|
542 |
+%!:%# ' |
|
543 |
+export PROMPT |
|
544 |
+ |
|
545 |
+set -o vi |
|
546 |
+bindkey -M vicmd '?' history-incremental-search-backward |
|
547 |
+ |
|
548 |
+#zprof |
|
549 |
+ |
|
550 |
+export NVM_DIR="/home/edwlan/.nvm" |
|
551 |
+[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm |
|
552 |
+ |
|
553 |
+echo 'zshrc done' |
|
554 |
+ |
|
555 |
+#THIS MUST BE AT THE END OF THE FILE FOR GVM TO WORK!!! |
|
556 |
+[[ -s "/Users/edwlan/.gvm/bin/gvm-init.sh" ]] && source "/Users/edwlan/.gvm/bin/gvm-init.sh" |