@@ -21,7 +21,7 @@ a shell-slut, and dabble between Zshell and Fish.
21
21
if [ ! -d /usr/local/Cellar -a -n "$ON_A_MAC" ]
22
22
then
23
23
echo "ZOMG! No Homebrew installed! Installing now..."
24
- ruby -e "`curl -fsSL https://raw.github.com/mxcl/homebrew/go/install`"
24
+ echo ' ruby -e "`curl -fsSL https://raw.github.com/mxcl/homebrew/go/install`"'
25
25
fi
26
26
#+END_SRC
27
27
@@ -57,11 +57,21 @@ a shell-slut, and dabble between Zshell and Fish.
57
57
58
58
* Global Aliases
59
59
60
- I dislike =more=, especially since =less= is now really sweet.
60
+ Just standard things that I keep typing:
61
61
62
- #+BEGIN_SRC shell
63
- alias more=less
64
- #+END_SRC
62
+ #+BEGIN_SRC shell
63
+ alias e='emacsclient -nw'
64
+ alias ee='emacsclient'
65
+ alias gst='git status'
66
+
67
+ if type gls >/dev/null 2>&1
68
+ then
69
+ alias ls='gls --color'
70
+ alias ll='gls -al --color'
71
+ else
72
+ alias ll='ls -al'
73
+ fi
74
+ #+END_SRC
65
75
66
76
* Python
67
77
@@ -203,6 +213,19 @@ a shell-slut, and dabble between Zshell and Fish.
203
213
[[ -r $rvm_path/scripts/completion ]] && . $rvm_path/scripts/completion
204
214
#+END_SRC
205
215
216
+ * Completions
217
+
218
+ Assuming the location of all the Bash completions:
219
+
220
+ #+BEGIN_SRC shell
221
+ source /usr/local/etc/bash_completion.d/brew
222
+ # source /usr/local/etc/bash_completion.d/coreutils
223
+ # source /usr/local/etc/bash_completion.d/findutils
224
+ source /usr/local/etc/bash_completion.d/git-prompt.sh
225
+ source /usr/local/etc/bash_completion.d/git-completion.bash
226
+ # source /usr/local/etc/bash_completion.d/ssh
227
+ #+END_SRC
228
+
206
229
* Prompt
207
230
208
231
A helper function to help trim down lengthy directories:
@@ -223,6 +246,7 @@ a shell-slut, and dabble between Zshell and Fish.
223
246
__git_ps1 " :%s" | sed 's|^ :review/.*/\([0-9]*\)$| :review-\1|'
224
247
}
225
248
#+END_SRC
249
+
226
250
Better approach to displaying the current path, is to only display
227
251
the first or second directory name ... any maybe the name of the Git
228
252
project. Holy hell, so many exceptions and so few patterns...
@@ -250,12 +274,12 @@ a shell-slut, and dabble between Zshell and Fish.
250
274
then
251
275
name=$(sed -E "s|$HOME/Work/([[:alnum:]_-]+).*|\1|; s/ / /g" <<< $PWD)
252
276
base=$(basename $PWD)
253
- intr=$(basename `dirname $PWD` )
277
+ intr=$(basename " `dirname \" $PWD\"`" )
254
278
255
- if [[ $name == $base ]]
279
+ if [[ " $name" == " $base" ]]
256
280
then
257
281
echo -n "Ⓦ/$name"
258
- elif [[ $intr == $name ]]
282
+ elif [[ " $intr" == " $name" ]]
259
283
then
260
284
echo -n "Ⓦ/$name/$base"
261
285
else
@@ -265,9 +289,11 @@ a shell-slut, and dabble between Zshell and Fish.
265
289
# In a home directory
266
290
elif [[ $PWD == $HOME/* ]]
267
291
then
268
- if [[ $(basename `dirname $PWD`) == $(basename $HOME) ]]
292
+ base=$(basename $PWD)
293
+ intr=$(basename "`dirname \"$PWD\"`")
294
+ if [[ "$intr" == $(basename $HOME) ]]
269
295
then
270
- echo -n "~/$(basename $PWD) "
296
+ echo -n "~/$base "
271
297
else
272
298
echo -n "~/$(_trim_dir $PWD)"
273
299
fi
0 commit comments