Browse Source

Trying to improve zsh, git, and Emacs for new users:

  * Emacs: Update color theme, with improved colors for ERB,
    whitespace, and error messages (flymake).

  * Emacs: Change the frame title so it displays the full name of the
    file that is currently being edited.

  * Emacs: Add a message to the frame title when a buffer hasn't yet
    been saved to a file.

  * Emacs: Typing while text is selected (there is an active region)
    will now replace the selection with whatever you type.

  * Emacs: Add a major-mode for editing YAML files.

  * Git: Ignore Emacs temporary auto-save files so they don't get
    added when you do a `git add .'

  * ZSH: Auto-correction is now case-sensitive and won't try to help
    you pick the correct case.

  * ZSH: The `e' alias is now a function that tries really hard to
    make sure there's a running Emacs to connect to.

  * Linux Desktop: Automatically start an Emacs daemon when you
    log-in.
master
Peter J. Jones 7 years ago
parent
commit
f9bb17b620
12 changed files with 235 additions and 95 deletions
  1. 27
    0
      ChangeLog
  2. 1
    1
      GNUmakefile
  3. 26
    1
      emacs/emacsrc.el
  4. 6
    0
      emacs/lib/code.el
  5. 134
    89
      emacs/themes/devalot-theme.el
  6. 8
    0
      git/GNUmakefile
  7. 1
    0
      git/ignore
  8. 8
    1
      mk/install.mk
  9. 1
    0
      xorg/GNUmakefile
  10. 5
    0
      xorg/xsession
  11. 1
    0
      zsh/GNUmakefile
  12. 17
    3
      zsh/zshrc

+ 27
- 0
ChangeLog View File

@@ -0,0 +1,27 @@
1
+2012-07-05  Peter Jones  <pjones@pmade.com>
2
+
3
+	* Emacs: Update color theme, with improved colors for ERB,
4
+	whitespace, and error messages (flymake).
5
+
6
+	* Emacs: Change the frame title so it displays the full name of
7
+	the file that is currently being edited.
8
+
9
+	* Emacs: Add a message to the frame title when a buffer hasn't yet
10
+	been saved to a file.
11
+
12
+	* Emacs: Typing while text is selected (there is an active region)
13
+	will now replace the selection with whatever you type.
14
+
15
+	* Emacs: Add a major-mode for editing YAML files.
16
+
17
+	* Git: Ignore Emacs temporary auto-save files so they don't get
18
+	added when you do a `git add .'
19
+
20
+	* ZSH: Auto-correction is now case-sensitive and won't try to help
21
+	you pick the correct case.
22
+
23
+	* ZSH: The `e' alias is now a function that tries really hard to
24
+	make sure there's a running Emacs to connect to.
25
+
26
+	* Linux Desktop: Automatically start an Emacs daemon when you
27
+	log-in.

+ 1
- 1
GNUmakefile View File

@@ -3,5 +3,5 @@ include mk/install.mk
3 3
 include mk/dirs.mk
4 4
 
5 5
 ##############################################################################
6
-DIRS = emacs ruby xorg zsh
6
+DIRS = git emacs ruby xorg zsh
7 7
 $(eval $(call DESCEND_INTO_DIRECTORIES,$(DIRS)))

+ 26
- 1
emacs/emacsrc.el View File

@@ -10,6 +10,8 @@
10 10
 (require 'package)
11 11
 (add-to-list 'package-archives
12 12
              '("marmalade" . "http://marmalade-repo.org/packages/") t)
13
+(add-to-list 'package-archives
14
+             '("melpa" . "http://melpa.milkbox.net/packages/") t)
13 15
 
14 16
 (package-initialize)
15 17
 
@@ -17,7 +19,7 @@
17 19
   (package-refresh-contents))
18 20
 
19 21
 ;; Add in your own as you wish:
20
-(defvar my-packages '(magit flymake-ruby ruby-end inf-ruby)
22
+(defvar my-packages '(magit flymake-ruby ruby-end inf-ruby yaml-mode gist)
21 23
   "A list of packages to ensure are installed at launch.")
22 24
 
23 25
 (dolist (p my-packages)
@@ -41,11 +43,34 @@
41 43
 (setq-default indicate-buffer-boundaries 'left
42 44
               indicate-empty-lines t)
43 45
 
46
+;; Frame defaults
47
+(defun pjones:frame-title-file-name ()
48
+  (let* ((home (expand-file-name "~"))
49
+         (end (length home))
50
+         (start (and buffer-file-name (substring buffer-file-name 0 end)))
51
+         (under-home (and start (string= home start))))
52
+    (cond (under-home
53
+           (concat "~/" (file-relative-name buffer-file-name "~")))
54
+          (buffer-file-name buffer-file-name)
55
+          (dired-directory
56
+           (if (listp dired-directory) (car dired-directory) dired-directory))
57
+          (t (buffer-name)))))
58
+
59
+(defun pjones:frame-title-not-saved ()
60
+  (if (buffer-modified-p) " (NOT SAVED)"))
61
+
62
+(setq default-frame-alist '((cursor-type  . bar))
63
+      frame-title-format '((:eval (pjones:frame-title-file-name))
64
+                           (:eval (pjones:frame-title-not-saved))))
65
+
44 66
 ;; Turn off the menu bar in text mode, but leave it on in the GUI.
45 67
 (setq window-system-default-frame-alist
46 68
       '((x (menu-bar-lines . 1) (tool-bar-lines . 1))
47 69
         (nil (menu-bar-lines . 0) (tool-bar-lines . 0))))
48 70
 
71
+;; Delete the region when you start typing
72
+(delete-selection-mode)
73
+
49 74
 ;; Color theme
50 75
 (add-to-list 'custom-theme-load-path "~/.emacs.d/themes")
51 76
 (load-theme 'devalot t)

+ 6
- 0
emacs/lib/code.el View File

@@ -21,9 +21,15 @@
21 21
 (add-to-list 'auto-mode-alist '("Rakefile$"   . ruby-mode))
22 22
 (add-to-list 'auto-mode-alist '("Gemfile$"    . ruby-mode))
23 23
 (add-to-list 'auto-mode-alist '("Capfile$"    . ruby-mode))
24
+
25
+(add-to-list 'auto-mode-alist '("\\.yml$" . yaml-mode))
26
+(autoload 'yaml-mode "yaml-mode" "YAML Mode" t)
27
+
28
+
24 29
 (add-hook 'ruby-mode-hook 'inf-ruby-keys)
25 30
 (add-hook 'ruby-mode-hook 'flymake-ruby-load)
26 31
 (add-hook 'ruby-mode-hook 'ruby-end-mode)
32
+(add-hook 'yaml-mode-hook 'usk-programming-mode-hook)
27 33
 
28 34
 ;; Ruby embedded in HTML
29 35
 (add-to-list 'load-path (concat user-emacs-directory "rhtml"))

+ 134
- 89
emacs/themes/devalot-theme.el View File

@@ -1,113 +1,147 @@
1
-;;; devalot-theme.el --- Solarized-based custom theme for faces
2
-
3
-;; Copyright (C) 2012 Free Software Foundation, Inc.
4
-
5
-;; Authors: Peter Jones <pjones@pmade.com>
6
-
7
-;; This file is not part of GNU Emacs.
8
-
9
-;; GNU Emacs is free software: you can redistribute it and/or modify
10
-;; it under the terms of the GNU General Public License as published by
11
-;; the Free Software Foundation, either version 3 of the License, or
12
-;; (at your option) any later version.
13
-
14
-;; GNU Emacs is distributed in the hope that it will be useful,
15
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
16
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
-;; GNU General Public License for more details.
18
-
19
-;; You should have received a copy of the GNU General Public License
20
-;; along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
21
-
1
+;;; devalot-theme.el --- Solarized-based custom theme for faces.
2
+;;
3
+;; Copyright (C) 2007-2012 Peter Jones <pjones@pmade.com>
4
+;;
5
+;; Permission is hereby granted, free of charge, to any person obtaining
6
+;; a copy of this software and associated documentation files (the
7
+;; "Software"), to deal in the Software without restriction, including
8
+;; without limitation the rights to use, copy, modify, merge, publish,
9
+;; distribute, sublicense, and/or sell copies of the Software, and to
10
+;; permit persons to whom the Software is furnished to do so, subject to
11
+;; the following conditions:
12
+;;
13
+;; The above copyright notice and this permission notice shall be
14
+;; included in all copies or substantial portions of the Software.
15
+;;
16
+;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+;; EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+;; MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+;; NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+;; LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+;; OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+;; WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23
+;;
22 24
 ;;; Commentary
23
-
25
+;;
24 26
 ;; The majority of the colors in this theme come from the Solarized
25 27
 ;; palette, which is released under an MIT license:
26 28
 ;; https://github.com/altercation/solarized.
27
-
29
+;;
30
+;;
28 31
 ;;; Code:
32
+
29 33
 (deftheme devalot "A theme loosely based on solarized.")
30 34
 
31
-;; Create some faces
32
-(when (not (facep 'devalot-fixme-face))
33
-  (copy-face 'font-lock-warning-face 'devalot-fixme-face)
34
-  (setq devalot-fixme-face 'devalot-fixme-face))
35
+;; Create the faces if they don't already exist.
36
+(put 'devalot 'theme-immediate t)
35 37
 
36
-;; Notes
38
+;;; Notes
37 39
 ;; * To see all faces in effect: list-faces-display
38
-(let ((yellow     "#b58900")
39
-      (orange     "#cb4b16")
40
-      (red        "#dc322f")
41
-      (magenta    "#d33682")
42
-      (violet     "#6c71c4")
43
-      (blue       "#268bd2")
44
-      (cyan       "#2aa198")
45
-      (green      "#859900")
46
-      (bg-normal  "#222222")
47
-      (bg-off     "#003340")
48
-      (bg-high    "#083d4a")
49
-      (bg-low      "#2a2a2a")
50
-      (bg-inverse "#fdf6e3")
51
-      (fg-normal  "#839496")
52
-      (fg-low     "#586e75")
53
-      (fg-high    "#93a1a1")
54
-      (fg-inverse "#657b83"))
40
+;; * To see all colors: list-colors-display
41
+(let ((yellow       "#b58900")
42
+      (yellow-high  "#b5a924")
43
+      (orange       "#cb4b16")
44
+      (orange-high  "#cb683f")
45
+      (red          "#dc322f")
46
+      (red-high     "#dc5c5a")
47
+      (magenta      "#d33682")
48
+      (magenta-high "#d36198")
49
+      (violet       "#6c71c4")
50
+      (violet-high  "#9396c4")
51
+      (blue         "#268bd2")
52
+      (blue-high    "#509cd2")
53
+      (cyan         "#2aa198")
54
+      (cyan-high    "#4aa19a")
55
+      (green        "#859900")
56
+      (green-high   "#88b324")
57
+      (bg-normal    "#222222")
58
+      (bg-off       "#003340")
59
+      (bg-high      "#083d4a")
60
+      (bg-low       "#2a2a2a")
61
+      (bg-inverse   "#fdf6e3")
62
+      (fg-normal    "#839496")
63
+      (fg-low       "#586e75")
64
+      (fg-high      "#93a1a1")
65
+      (fg-inverse   "#657b83")
66
+      (class '((class color) (min-colors 89))))
55 67
   (custom-theme-set-faces
56 68
    'devalot
57 69
    `(default        ((((type graphic)) (:background ,bg-normal :foreground ,fg-normal))))
58
-   `(cursor         ((t (:background ,yellow :foreground ,bg-normal))))
59
-   `(link           ((t (:underline  ,cyan))))
70
+   `(cursor         ((t (:background ,magenta-high :foreground ,bg-normal))))
71
+   `(error          ((t (:foreground ,red-high))))
72
+   `(warning        ((t (:foreground ,yellow-high))))
73
+   `(success        ((t (:foreground ,green-high))))
60 74
    `(match          ((t (:background ,bg-high :foreground ,fg-normal))))
61 75
    `(fringe         ((t (:background ,bg-low :foreground ,fg-low))))
62
-   `(lazy-highlight ((t (:background ,bg-inverse :foreground ,fg-inverse))))
63
-   `(isearch        ((t (:background ,magenta :foreground ,bg-inverse))))
76
+   `(lazy-highlight ((t (:background ,bg-high :foreground ,magenta-high))))
77
+   `(isearch        ((t (:background ,magenta :foreground ,bg-inverse :bold t))))
64 78
    `(region         ((t (:background ,bg-high))))
65
-   `(highlight      ((t (:background ,green :foreground ,bg-inverse))))
66
-   `(hl-line        ((t (:background ,green :foreground ,bg-inverse))))
79
+   `(highlight      ((t (:background ,green-high :foreground ,bg-low))))
80
+   `(hl-line        ((t (:inherit 'highlight))))
81
+
82
+   `(link ((,class (:underline  ,blue-high :foreground ,fg-normal))
83
+           (t (:underline "blue" :foreground "blue"))))
84
+
67 85
 
68 86
    ;; Show paren
69
-   `(show-paren-match ((t (:background ,bg-inverse
70
-                                       :foreground ,blue
71
-                                       :bold t))))
87
+   `(show-paren-match ((t (:background ,bg-inverse :foreground ,blue :bold t))))
72 88
 
73 89
    ;; Font-lock
74 90
    `(font-lock-builtin-face           ((t (:foreground ,fg-low))))
75
-   `(font-lock-comment-delimiter-face ((t (:foreground ,fg-inverse :bold t))))
91
+   `(font-lock-comment-delimiter-face ((t (:foreground ,fg-low :bold t))))
76 92
    `(font-lock-comment-face           ((t (:foreground ,violet :italic t))))
77 93
    `(font-lock-constant-face          ((t (:foreground ,yellow))))
78 94
    `(font-lock-function-name-face     ((t (:foreground ,orange :bold t))))
79 95
    `(font-lock-keyword-face           ((t (:foreground ,green :bold t))))
80 96
    `(font-lock-preprocessor-face      ((t (:foreground ,red))))
81
-   `(font-lock-string-face            ((t (:foreground ,cyan))))
97
+   `(font-lock-string-face            ((t (:foreground ,violet-high))))
82 98
    `(font-lock-type-face              ((t (:foreground ,blue :bold t))))
83
-   `(font-lock-variable-name-face     ((t (:foreground ,magenta))))
84
-   `(font-lock-warning-face           ((t (:underline  ,red))))
99
+   `(font-lock-variable-name-face     ((t (:foreground ,magenta-high))))
100
+   `(font-lock-warning-face           ((t (:foreground ,magenta :background ,bg-off :bold t))))
85 101
 
86 102
    ;; Minibuffer
87
-   `(minibuffer-noticeable-prompt ((t (:inherit 'font-lock-builtin-face :bold t))))
103
+   `(minibuffer-noticeable-prompt ((t (:foreground ,red-high :bold t))))
104
+   `(minibuffer-prompt ((t (:foreground ,magenta :bold t))))
88 105
 
89 106
    ;; Modeline and Things in the Modeline
90
-   `(modeline ((t (:background ,yellow :foreground ,bg-normal :box (:line-width 1 :style released-button)))))
91
-   `(mode-line-inactive ((t (:background ,bg-high :foreground ,fg-normal :box (:line-width 1 :style released-button)))))
107
+   `(modeline ((,class (:background ,green :foreground ,bg-normal :box (:line-width 1 :style released-button)))
108
+               (t (:background "green" :foreground "black"))))
109
+   `(mode-line-inactive ((t (:background ,bg-low :foreground ,fg-low :box (:line-width 1 :style released-button)))))
92 110
    `(modeline-mousable ((t (:background ,bg-high :foreground ,fg-normal))))
93 111
    `(modeline-mousable-minor-mode ((t (:background ,bg-high :foreground ,bg-high))))
94 112
 
95 113
    ;; Flyspell
96
-   `(flyspell-duplicate ((t (:underline ,yellow))))
97
-   `(flyspell-incorrect ((t (:underline ,red))))
114
+   `(flyspell-duplicate ((t (:foreground ,yellow-high :underline ,yellow))))
115
+   `(flyspell-incorrect ((t (:foreground ,magenta-high :underline ,red))))
116
+
117
+   ;; Dired
118
+   `(dired-directory ((t (:foreground ,blue :bold t))))
119
+   `(dired-flagged ((t (:foreground ,magenta-high))))
120
+   `(dired-header ((t (:foreground ,orange))))
121
+   `(dired-ignored ((t (:foreground ,fg-low))))
122
+   `(dired-mark ((t (:foreground ,yellow))))
123
+   `(dired-marked ((t (:foreground ,yellow-high))))
124
+   `(dired-perm-write ((t (:foreground ,fg-high))))
125
+   `(dired-symlink ((t (:foreground ,cyan))))
126
+   `(dired-warning ((t (:underline ,yellow-high))))
98 127
 
99 128
    ;; Outline Mode
100
-   `(outline-1 ((t (:foreground ,blue    :bold t))))
101
-   `(outline-2 ((t (:foreground ,violet  :bold t))))
102
-   `(outline-3 ((t (:foreground ,magenta :bold nil))))
103
-   `(outline-4 ((t (:foreground ,yellow  :bold nil))))
104
-   `(outline-5 ((t (:foreground ,cyan    :bold nil))))
129
+   `(outline-1 ((,class (:foreground ,blue-high :bold t))
130
+                (t (:foreground "blue" :bold t))))
131
+   `(outline-2 ((,class (:foreground ,green-high :bold t))
132
+                (t (:foreground "green" :bold t))))
133
+   `(outline-3 ((,class (:foreground ,cyan-high :bold nil))
134
+                (t (:foreground "cyan" :bold t))))
135
+   `(outline-4 ((,class (:foreground ,orange :bold nil))
136
+                (t (:foreground "orange" :bold t))))
137
+   `(outline-5 ((,class (:foreground ,yellow-high :bold nil))
138
+                (t (:foreground "magenta"))))
105 139
 
106 140
    ;; Org-Mode
107 141
    `(org-level-1               ((t (:inherit 'outline-1))))
108 142
    `(org-level-2               ((t (:inherit 'outline-2))))
109 143
    `(org-level-3               ((t (:inherit 'outline-3))))
110
-   `(org-level-4               ((t (:inherit 'outline-4))))
144
+   `(org-level-4               ((t (:inherit 'outline-4 :italic t))))
111 145
    `(org-level-5               ((t (:inherit 'outline-5))))
112 146
    `(org-archived              ((t (:inherit 'font-lock-string-face))))
113 147
    `(org-document-title        ((t (:inherit 'font-lock-comment-delimiter-face))))
@@ -125,22 +159,33 @@
125 159
    `(org-date                  ((t (:foreground ,fg-low))))
126 160
    `(org-tag                   ((t (:foreground ,fg-low))))
127 161
    `(org-tag-default           ((t (:inherit 'org-tag))))
128
-   `(org-special-keyword       ((t (:inherit 'org-tag))))
129
-   `(org-code                  ((t (:inherit 'font-lock-function-name-face :bold nil))))
130
-   `(org-hide                  ((t (:foreground ,bg-off))))
131
-   `(org-column                ((t (:background ,bg-high))))
132
-   `(org-column-title          ((t (:inherit 'mode-line :background ,orange))))
162
+   `(org-column                ((t (:background ,bg-low))))
163
+   `(org-column-title          ((t (:inherit 'mode-line :background ,orange-high))))
133 164
    `(org-checkbox              ((t (:inherit 'mode-line :background ,green))))
134 165
    `(org-todo                  ((t (:inherit 'mode-line :background ,red))))
135 166
    `(org-done                  ((t (:inherit 'mode-line :background ,green))))
136 167
 
168
+   `(org-hide ((,class (:foreground ,bg-off))
169
+               (t (:foreground "black"))))
170
+
171
+   `(org-special-keyword ((,class (:foreground ,fg-low))
172
+                          (t (:foreground "gray"))))
173
+
174
+   `(org-code ((,class (:inherit 'font-lock-keyword-face :bold nil))
175
+               (nil (:foreground "green"))))
176
+
177
+   `(org-block ((t (:inherit 'org-code))))
178
+   `(org-block-begin-line ((t (:inherit 'org-special-keyword))))
179
+   `(org-block-end-line ((t (:inherit 'org-block-begin-line))))
180
+
181
+
137 182
    ;; ERB (Ruby Embedded in HTML)
138
-   `(erb-face               ((t (:inherit 'default))))
139
-   `(erb-delim-face         ((t (:foreground ,fg-low))))
140
-   `(erb-out-face           ((t (:inherit 'default))))
141
-   `(erb-out-delim-face     ((t (:foreground ,blue))))
142
-   `(erb-comment-delim-face ((t (:inherit 'font-lock-comment-delimiter-face))))
143
-   `(erb-comment-face       ((t (:inherit 'font-lock-comment-face))))
183
+   `(erb-face               ((t (:background ,bg-normal :foreground ,fg-normal))))
184
+   `(erb-delim-face         ((,class (:foreground ,fg-low)) (t (:foreground "magenta"))))
185
+   `(erb-out-face           ((t (:background ,bg-normal :foreground ,fg-normal))))
186
+   `(erb-out-delim-face     ((,class (:foreground ,blue :background ,bg-normal)) (t (:foreground "blue"))))
187
+   `(erb-comment-delim-face ((t (:foreground ,fg-low :bold t))))
188
+   `(erb-comment-face       ((t (:foreground ,violet :italic t))))
144 189
 
145 190
    ;; Diff Mode
146 191
    `(diff-added             ((t (:foreground ,green))))
@@ -165,8 +210,8 @@
165 210
    `(compilation-info ((t (:inherit 'font-lock-string-face :bold t))))
166 211
    `(compilation-error ((t (:underline ,red :bold t))))
167 212
    `(compilation-line-number ((t (:foreground ,orange :bold t))))
168
-   `(flymake-errline ((t :underline ,red)))
169
-   `(flymake-warnline ((t :underline ,yellow)))
213
+   `(flymake-errline ((t :underline ,magenta-high :background ,bg-off, :foreground ,magenta-high)))
214
+   `(flymake-warnline ((t :underline ,yellow ,bg-normal)))
170 215
 
171 216
    ;; nXML
172 217
    `(nxml-element-colon-face             ((t (:inherit 'font-lock-type-face))))
@@ -185,8 +230,10 @@
185 230
    `(nxml-comment-content-face           ((t (:inherit 'font-lock-comment-face))))
186 231
 
187 232
    ;; ido
188
-   `(ido-first-match ((t (:inherit 'font-lock-string-face))))
189
-   `(ido-subdir      ((t (:inherit 'font-lock-function-name-face))))
233
+   `(ido-first-match ((t (:foreground ,magenta-high))))
234
+   `(ido-only-match  ((t (:foreground ,green :bold t))))
235
+   `(ido-subdir      ((t (:foreground ,blue :bold t))))
236
+   `(ido-virtual     ((t (:foreground ,fg-low))))
190 237
 
191 238
    ;; rcIRC
192 239
    `(rcirc-track-nick    ((t (:foreground ,fg-low :bold t))))
@@ -209,11 +256,9 @@
209 256
 
210 257
    ;; Whitespace Mode
211 258
    `(whitespace-tab ((t (:background ,bg-low))))
212
-   `(whitespace-trailing ((t (:inherit 'default))))
213
-   `(whitespace-line ((t (:background ,bg-low))))
214
-
215
-   ;; Non-Standard Faces
216
-   `(devalot-fixme-face ((t (:background ,bg-inverse :foreground ,red :bold t :box (:line-width 1 :color ,bg-low)))))
259
+   `(whitespace-trailing ((t (:background ,bg-normal :foreground ,fg-normal))))
260
+   `(whitespace-empty ((t (:background ,bg-normal :foreground ,fg-normal))))
261
+   `(whitespace-line ((t (:background ,bg-normal :underline ,bg-off))))
217 262
 
218 263
    ;; Remaining Junk
219 264
    `(completion-dynamic-face ((t (:inherit 'match))))))

+ 8
- 0
git/GNUmakefile View File

@@ -0,0 +1,8 @@
1
+##############################################################################
2
+include ../mk/install.mk
3
+
4
+################################################################################
5
+install: ~/.gitignore
6
+~/.gitignore: ignore
7
+	$(INSTALL_PLAIN_FILE) $< $@
8
+	git config --global core.excludesfile '~/.gitignore'

+ 1
- 0
git/ignore View File

@@ -0,0 +1 @@
1
+.#*

+ 8
- 1
mk/install.mk View File

@@ -9,11 +9,12 @@ install:
9 9
 ##############################################################################
10 10
 # $1: The file to install
11 11
 # $2: The destination name
12
+# $3: File mode (default 0644)
12 13
 define INSTALL_FILE_AS
13 14
 install: $(2)
14 15
 $(2): $(1)
15 16
 	@ mkdir -p $(dir $2)
16
-	$(INSTALL_PLAIN_FILE) $$< $$@
17
+	install -m $(if $(3),$(3),0644) $$< $$@
17 18
 endef
18 19
 
19 20
 ##############################################################################
@@ -22,6 +23,12 @@ define INSTALL_DOT_FILE
22 23
 $(eval $(call INSTALL_FILE_AS,$(1),$(HOME)/.$(notdir $(1))))
23 24
 endef
24 25
 
26
+################################################################################
27
+# $1: file to install as ~/.$(1) with the exec bits set.
28
+define INSTALL_EXEC_DOT_FILE
29
+$(eval $(call INSTALL_FILE_AS,$(1),$(HOME)/.$(notdir $(1)),0755))
30
+endef
31
+
25 32
 ##############################################################################
26 33
 # $1: The file to install
27 34
 # $2: The directory to put it in

+ 1
- 0
xorg/GNUmakefile View File

@@ -3,3 +3,4 @@ include ../mk/install.mk
3 3
 
4 4
 ##############################################################################
5 5
 $(eval $(call INSTALL_DOT_FILE,Xdefaults))
6
+$(eval $(call INSTALL_EXEC_DOT_FILE,xsession))

+ 5
- 0
xorg/xsession View File

@@ -0,0 +1,5 @@
1
+#!/bin/sh
2
+x11vnc -bg -viewonly -forever
3
+killall emacs
4
+emacs --daemon
5
+exec gnome-session

+ 1
- 0
zsh/GNUmakefile View File

@@ -7,4 +7,5 @@ $(eval $(call INSTALL_DOT_FILE,zshrc))
7 7
 ##############################################################################
8 8
 install: $(HOME)/.oh-my-zsh
9 9
 $(HOME)/.oh-my-zsh: oh-my-zsh
10
+	rm -rf $@
10 11
 	cp -rp $< $@

+ 17
- 3
zsh/zshrc View File

@@ -8,7 +8,7 @@ ZSH=$HOME/.oh-my-zsh
8 8
 ZSH_THEME="kphoen"
9 9
 
10 10
 # Set to this to use case-sensitive completion
11
-# CASE_SENSITIVE="true"
11
+CASE_SENSITIVE="true"
12 12
 
13 13
 # Comment this out to disable weekly auto-update checks
14 14
 DISABLE_AUTO_UPDATE="true"
@@ -27,7 +27,21 @@ COMPLETION_WAITING_DOTS="true"
27 27
 # Example format: plugins=(rails git textmate ruby lighthouse)
28 28
 plugins=(git)
29 29
 
30
-alias e="emacsclient -nq -a emacs"
31
-export EDITOR="emacsclient -t -a emacs"
30
+################################################################################
31
+# A helper function to get a file loaded into a running Emacs.
32
+e () {
33
+  if ! pgrep emacs > /dev/null 2>&1; then
34
+    (cd && emacs --daemon > /dev/null 2>&1)
35
+  fi
36
+
37
+  frames=`emacsclient --eval '(length (frame-list))'`
32 38
 
39
+  if [ "$frames" -lt 2 ]; then
40
+    emacsclient -q --create-frame --no-wait "$@"
41
+  else
42
+    emacsclient -q --no-wait "$@"
43
+  fi
44
+}
45
+
46
+export EDITOR="emacsclient -t -a emacs"
33 47
 source $ZSH/oh-my-zsh.sh

Loading…
Cancel
Save