mirror of https://github.com/bjeanes/dotfiles.git
Improve the 'm' function so that it sets the current working directly correctly (e.g. when using mvim) and uses the current $VISUAL editor.
parent
394f7e588c
commit
d0384efad4
|
@ -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
|
||||||
else
|
cd_to=$1
|
||||||
files=.
|
file=.
|
||||||
|
else
|
||||||
|
file=$*
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
mate -l1 $files 2>/dev/null
|
|
||||||
|
bash -l -c "cd $cd_to && $VISUAL $file"
|
||||||
}
|
}
|
||||||
|
|
||||||
function extract() {
|
function extract() {
|
||||||
|
|
Loading…
Reference in New Issue