bbedit.plugin.zsh 420 Bytes
Newer Older
Chris Smith's avatar
Chris Smith committed
1
2
3
4
5
6
7
8
9
10
alias bbpb='pbpaste | bbedit --clean --view-top'

alias bbd=bbdiff

#
# If the bb command is called without an argument, launch BBEdit
# If bb is passed a directory, cd to it and open it in BBEdit
# If bb is passed a file, open it in BBEdit
#
function bb() {
Chris Smith's avatar
Chris Smith committed
11
    if [[ -z "$1" ]]
Chris Smith's avatar
Chris Smith committed
12
13
14
    then
        bbedit --launch
    else
Chris Smith's avatar
Chris Smith committed
15
16
        bbedit "$1"
        if [[ -d "$1" ]]
Chris Smith's avatar
Chris Smith committed
17
        then
Chris Smith's avatar
Chris Smith committed
18
            cd "$1"
Chris Smith's avatar
Chris Smith committed
19
20
21
        fi
    fi
}