mirror of
https://codeberg.org/vlw/dotfiles.git
synced 2025-09-14 03:03:42 +02:00
Compare commits
2 commits
c6f7cbad09
...
7c9edd6334
Author | SHA1 | Date | |
---|---|---|---|
7c9edd6334 | |||
943927567f |
1 changed files with 36 additions and 11 deletions
|
@ -1,23 +1,48 @@
|
||||||
# Make dir and cd into it
|
# Make dir and cd into it
|
||||||
mkcdir () {
|
mkcdir () {
|
||||||
mkdir -p -- "$1" &&
|
mkdir -p -- "$1" && cd -P -- "$1"
|
||||||
cd -P -- "$1"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# ls -la
|
# Preview contents of a file or list the contents of a directory
|
||||||
alias l="ls -lh"
|
l () {
|
||||||
alias ll="ls -lah"
|
if [ -f "$1" ] ; then
|
||||||
alias lll="ls -lah | less"
|
less $1
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
ls -lh $1 || l $(dirname "$1")
|
||||||
|
}
|
||||||
|
|
||||||
|
# Preview the contents of a file or list the contents of a directory with hidden files shown
|
||||||
|
ll () {
|
||||||
|
if [ -f "$1" ] ; then
|
||||||
|
less $1
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
ls -lah $1 || ll $(dirname "$1")
|
||||||
|
}
|
||||||
|
|
||||||
|
# Edit the contents of a file or list the contents of a directory (with hidden files shown) if that file is not found
|
||||||
|
lll () {
|
||||||
|
if [ -f "$1" ] ; then
|
||||||
|
nano $1
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
ls -lah $1 || lll $(dirname "$1")
|
||||||
|
}
|
||||||
|
|
||||||
|
.. () {
|
||||||
|
cd .. && l
|
||||||
|
}
|
||||||
|
|
||||||
# cd +
|
|
||||||
cdl () {
|
cdl () {
|
||||||
cd -P -- "$1" &&
|
cd -P -- "$1" && l
|
||||||
l
|
|
||||||
}
|
}
|
||||||
|
|
||||||
cdll () {
|
cdll () {
|
||||||
cp -P -- "$1" &&
|
cp -P -- "$1" && ll
|
||||||
ll
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Create standard git WIP commit with timestamps
|
# Create standard git WIP commit with timestamps
|
||||||
|
|
Loading…
Add table
Reference in a new issue