Improve the 'm' function so that it sets the current working directly correctly (e.g. when using mvim) and uses the current $VISUAL editor.

pull/2/head
Bodaniel Jeanes 2010-11-22 21:31:42 +10:00
parent 394f7e588c
commit d0384efad4
1 changed files with 11 additions and 4 deletions

View File

@ -20,12 +20,19 @@ function p() {
cd $* && m
}
function m() {
file=.
cd_to=.
if [ -n "$*" ]; then
files=$*
else
files=.
if [ -d "$1" ]; then
cd_to=$1
file=.
else
file=$*
fi
fi
mate -l1 $files 2>/dev/null
bash -l -c "cd $cd_to && $VISUAL $file"
}
function extract() {