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 cd $* && m
} }
function m() { function m() {
file=.
cd_to=.
if [ -n "$*" ]; then if [ -n "$*" ]; then
files=$* if [ -d "$1" ]; then
cd_to=$1
file=.
else else
files=. file=$*
fi fi
mate -l1 $files 2>/dev/null fi
bash -l -c "cd $cd_to && $VISUAL $file"
} }
function extract() { function extract() {