more bsd attempts
This commit is contained in:
10
qcd_function
10
qcd_function
@@ -11,7 +11,10 @@ esac
|
|||||||
function gcd() {
|
function gcd() {
|
||||||
# guess cd, find first match in folder, or ask if multiple hits
|
# guess cd, find first match in folder, or ask if multiple hits
|
||||||
local cdto QCDPATH
|
local cdto QCDPATH
|
||||||
QCDPATH=$( dirname $( realpath ${BASH_SOURCE[0]} ) )
|
case $OSTYPE in
|
||||||
|
darwin*) QCDPATH=$( dirname $( realpath ${BASH_SOURCE[0]} ) ) ;;
|
||||||
|
*) QCDPATH=$( dirname $( readlink -f ${BASH_SOURCE[0]} ) ) ;;
|
||||||
|
esac
|
||||||
cdto=$( python "$QCDPATH"/files/gcd-findmatch.py "$@" )
|
cdto=$( python "$QCDPATH"/files/gcd-findmatch.py "$@" )
|
||||||
[[ -z "$cdto" ]] && return
|
[[ -z "$cdto" ]] && return
|
||||||
\cd "$cdto"
|
\cd "$cdto"
|
||||||
@@ -384,7 +387,10 @@ function path_add_current {
|
|||||||
}
|
}
|
||||||
local p=$(pwd)
|
local p=$(pwd)
|
||||||
[[ -z "$1" ]] || {
|
[[ -z "$1" ]] || {
|
||||||
p=$( realpath "$1" )
|
case $OSTYPE in
|
||||||
|
darwin*) p=$( realpath "$1" ) ;;
|
||||||
|
*) p=$( realpath "$1" ) ;;
|
||||||
|
esac
|
||||||
}
|
}
|
||||||
[[ -z "$p" ]] && {
|
[[ -z "$p" ]] && {
|
||||||
echo Path "$1" not found >&2
|
echo Path "$1" not found >&2
|
||||||
|
|||||||
@@ -8,5 +8,8 @@ function helpexit() {
|
|||||||
[[ -z "$1" ]] && helpexit
|
[[ -z "$1" ]] && helpexit
|
||||||
[[ "$1" = "-h" ]] && helpexit
|
[[ "$1" = "-h" ]] && helpexit
|
||||||
|
|
||||||
LIB=$( dirname $( readlink -f $0 ) )/ansi.vim
|
case $OSTYPE in
|
||||||
|
darwin*) LIB=$( dirname $( realpath $0 ) )/ansi.vim ;;
|
||||||
|
*) LIB=$( dirname $( readlink -f $0 ) )/ansi.vim ;;
|
||||||
|
esac`
|
||||||
vim -S "$LIB" "$@"
|
vim -S "$LIB" "$@"
|
||||||
|
|||||||
@@ -44,7 +44,10 @@ if [ ! -e "$1" ]; then
|
|||||||
else
|
else
|
||||||
gpg --decrypt "$1" > "$unc"
|
gpg --decrypt "$1" > "$unc"
|
||||||
fi
|
fi
|
||||||
LIB=$( dirname $( readlink -f $0 ) )/crypted.vim
|
case $OSTYPE in
|
||||||
|
darwin*) LIB=$( dirname $( realpath $0 ) )/crypted.vim ;;
|
||||||
|
*) LIB=$( dirname $( readlink -f $0 ) )/crypted.vim ;;
|
||||||
|
esac
|
||||||
edit=`date +%s -r $unc`
|
edit=`date +%s -r $unc`
|
||||||
if [ -s "$unc" ]; then
|
if [ -s "$unc" ]; then
|
||||||
vim -i NONE -S "$LIB" -n -c "call Hide()" "$unc"
|
vim -i NONE -S "$LIB" -n -c "call Hide()" "$unc"
|
||||||
|
|||||||
5
vim/vimd
5
vim/vimd
@@ -9,5 +9,8 @@ function helpexit() {
|
|||||||
[[ -z "$1" ]] && helpexit
|
[[ -z "$1" ]] && helpexit
|
||||||
[[ "$1" = "-h" ]] && helpexit
|
[[ "$1" = "-h" ]] && helpexit
|
||||||
|
|
||||||
LIB=$( dirname $( realpath $0 ) )/markdown.vim
|
case $OSTYPE in
|
||||||
|
darwin*) LIB=$( dirname $( realpath $0 ) )/markdown.vim ;;
|
||||||
|
*) LIB=$( dirname $( readlink -f $0 ) )/markdown.vim ;;
|
||||||
|
esac
|
||||||
vim -S "$LIB" "$@"
|
vim -S "$LIB" "$@"
|
||||||
|
|||||||
Reference in New Issue
Block a user