-
Notifications
You must be signed in to change notification settings - Fork 0
/
.zshaliases
77 lines (68 loc) · 1.98 KB
/
.zshaliases
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# Ryan's aliases for Zsh
# for managing config files
alias zshenv='code -n $ZDOTDIR/.zshenv'
alias zprofile='code -n $ZDOTDIR/.zprofile'
# alias zshlogin='' # not used
alias zshrc='code -n $ZDOTDIR/.zshrc'
alias zshaliases='code -n $ZDOTDIR/.zshaliases'
alias reload='source $ZDOTDIR/.zshrc'
zshconfig() {
# Open all config files (in order that they are loaded by system)
code -n \
$ZDOTDIR \
/etc/zshenv \
$ZDOTDIR/.zshenv \
/etc/zprofile \
$ZDOTDIR/.zprofile \
/etc/zshrc \
/etc/zshrc_Apple_Terminal \
$ZDOTDIR/.zshrc \
$ZDOTDIR/.zshaliases
}
# ls aliases
alias l='ls -lah'
alias la='ls -lAh'
alias ll='ls -lh'
alias ls='ls -G'
alias lsa='ls -lah'
# Would be nice to add column headings like this:
# (printf "PERM LINKS OWNER GROUP SIZE MONTH DAY HH:MM/YEAR NAME\n"; ls -l | sed 1d) | column -t
# searching for dir or file
alias fd='find . -type d -name'
alias ff='find . -type f -name'
# Check if you are in an interactive shell
check-if-interactive() {
[[ $- == *i* ]] && echo 'Interactive' || echo 'Not interactive'
}
# Check if you are in a login shell
check-if-login() {
[[ -o login ]] && echo 'Login shell' || echo 'Not login shell'
}
# Some good functions to copy in future
# https://github.com/VonHeikemen/dotfiles/blob/master/my-configs/shell/custom-functions.sh
# Create a new react app
# react-app() {
# npx create-react-app $1
# cd $1
# npm i -D eslint
# npm i -D eslint-config-prettier eslint-plugin-prettier
# npm i -D eslint-config-airbnb eslint-plugin-import eslint-plugin-jsx-a11y eslint-plugin-react eslint-plugin-react-hooks
# cp "${HOME}/.eslintrc.json" .
# cp "${HOME}/.prettierrc" .
# echo $1 > README.md
# rm -rf yarn.lock
# cd src
# rm -f App.css App.test.js index.css logo.svg serviceWorker.js
# mkdir components views
# git add -A
# git commit -m "Initial commit."
# cd ..
# clear
# code .
# }
# # Echo metadata
# echo-metadata() {
# echo 'default login shell: ' $SHELL
# echo 'working directory: ' $PWD
# ps -p $$
# }