Skip to content

Commit 6c4048a

Browse files
authored
chore/profile-dynamic-shortcuts (#209)
1 parent 3e5b1e5 commit 6c4048a

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

base/roles/base/files/profile.sh

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ alias .....='cd ../../../..'
77

88
# General
99

10-
alias c='cd'
1110
alias l='ls -lhA --group-directories-first'
1211
alias s='systemctl'
1312
alias grep='grep --color=auto'
@@ -56,8 +55,6 @@ backport() {
5655

5756
# Functions
5857

59-
cdir() { mkdir "$1" && cd "$1"; }
60-
6158
extract () {
6259
if [ -f "$1" ] ; then
6360
case "$1" in
@@ -79,10 +76,21 @@ exe() {
7976
docker exec -it "$(docker ps -qf name=$1)" /bin/bash
8077
}
8178

79+
c() {
80+
[ -z "$1" ] && { cd; return; }
81+
[ -d "$1" ] && { cd "$1"; return; } ||
82+
[ -f "$1" ] && file -b "$1" | grep -q -e "text" -e "empty" && { cat "$1"; return; } ||
83+
file "$1"
84+
}
85+
8286
j() {
8387
journalctl -xe --no-pager -u "$1" || journalctl -xe --no-pager
8488
}
8589

90+
m() {
91+
mkdir "$1" && cd "$1";
92+
}
93+
8694
package() {
8795
local project
8896
project=$(basename "$PWD")

0 commit comments

Comments
 (0)