summaryrefslogtreecommitdiff
path: root/zsh/functions.zsh
blob: 6bd9482abcea0f4b7ce65d7036e5acdc4f862725 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
function mpod {
    mcpan pod $1 | $PAGER -c 'set ft=perldoc'
}

function msrc {
    mcpan src $1 | $PAGER -c 'set ft=perl'
}

function scratch {
    local tmp
    tmp=$(mktemp --suffix=.$1)
    vim -c 'set ft='$1 $tmp
    rm $tmp
}

function note {
    local note
    pushd
    cd ~/notes
    note=(${(@f)$(fzf --print-query)})
    if [[ -f $note[2] ]]; then
        $VISUAL $note[2]
    else
        $VISUAL $note[1]
    fi
    popd
}