-
Notifications
You must be signed in to change notification settings - Fork 0
/
.bash_aliases
147 lines (123 loc) · 4.64 KB
/
.bash_aliases
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
alias ls='ls --color=auto'
alias grep='grep --color=always'
alias dir='dir --color=auto'
alias vdir='vdir --color=auto'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
fi
# package manager alieases
if [ -f /etc/os-release ]; then
. /etc/os-release
OS=$NAME
VER=$VERSION_ID
if [ "$OS" = "Ubuntu" ]; then
alias i='sudo aptitude install'
alias s='apt search'
alias r='sudo apt remove'
elif [ "$OS" = "Fedora Linux" ]; then
alias i='sudo yum install'
alias s='yum search'
alias r='sudo yum remove'
fi
fi
# $ f
# $ F
alias f='sudo find . -name'
alias F='sudo find / -name'
alias ll='ls -la'
alias x='~/dotfiles/scripts/extract' # extract any kind of archive
alias make='bear -- make' # because of coc.vim
alias ..='cd ..'
alias ...='cd ..; cd ..'
alias ....='cd ..; cd ..; cd ..'
# Record screencast
alias record='simplescreenrecorder'
alias map='xmodmap dotfiles/.Xmodmap'
alias mapo='xmodmap dotfiles/xmodmap_original'
alias logout="gnome-session-quit --logout"
# Swap $man <-> $Vim as a PAGER without changing $PAGER var ;)
# also you could use just q for quit.
#alias man='bash -c '\''vim +Man\ $0 +wincmd\ o'\'''
alias vim="nvim"
# How can I copy the output of a command directly into my clipboard?
# https://stackoverflow.com/a/5130969/5688267
# ls | cc
# vv
alias "cc=xclip -selection clipboard"
alias "vv=xclip -o -selection clipboard"
# {{{ copy vimspector.json to current dir
alias vimspector="cp ~/dotfiles/vimspector/.vimspector.json ."
# }}} FIXME: Bad idea. make this automatic, you don't have to type this thing
# everytime.
# Power aliases
alias R='yes | rm -r'
alias cp='cp -r'
alias n='ranger'
alias mutt='neomutt'
alias strc='xrdb ~/.strc' # Update strc
alias t='date +"%n%w) %A%n%d/%m/%Y%n%X%n"'
# {{{ Linux Kernel
# $ send_patch_next 0001-your-patch-name.patch # that's it ;)
send_patch_next() {
git send-email --cc [email protected] --cc-cmd='/home/smalinux/linux-next/scripts/get_maintainer.pl -norolestats' "$1"
}
alias checkpatch='/home/smalinux/linux-next/scripts/checkpatch.pl'
# }}}
# $ aptfile btf.h
aptfile() {
apt-file search "$1" | grep "$1"
}
# To search for a specific tag and open Vim to its definition, run the following
# command in your shell:
# Run Ctags recursively over the entire kernel to generate the tags file. For
# Linux 2.6.13, this should only take a minute or so:
alias ctags='ctags -R *'
# copy any line (ex: link) into any file
# $ fc dotfiles
fc() {
cat "$1" | fzf --reverse | xclip -selection clipboard
}
# https://github.com/jgreco/mpv-youtube-quality
alias music="mpv --no-video --loop"
# {{{ git aliases
alias statpatch='git apply --stat'
alias checkpatch='git apply --check'
alias applypatch='patch -p1 < '
# f = format p = patch
alias git-fp='git format-patch --base=auto --cover-letter' # ex$ git format-patch -1 HEAD # where 1 == number of commit
# DONT USE THIS, this just a reference, The canonical git-send-email(1) args
alias git-se='git send-email --base=auto --cover-letter'
# }}}
ss() {
brave-browser https://www.linkedin.com/in/smalinux/
#brave-browser https://www.instagram.com/smalinux/
#brave-browser https://soundcloud.com/smalinux
#brave-browser https://github.com/smalinux
#brave-browser https://web.whatsapp.com
#brave-browser https://twitter.com
#brave-browser https://facebook.com
}
# $ b google.com
function b() {
brave-browser --app="https://$1"
}
alias linkedin='brave-browser --app=https://www.linkedin.com/in/smalinux/'
alias insta='brave-browser --app=https://www.instagram.com/smalinux/'
alias soundcloud='brave-browser --app=https://soundcloud.com/smalinux'
alias github='brave-browser --app=https://github.com/smalinux'
alias whatsapp='brave-browser --app=https://web.whatsapp.com'
alias twitter='brave-browser --app=https://twitter.com'
alias facebook='brave-browser --app=https://facebook.com'
alias gmail='brave-browser --app=https://gmail.com'
alias cal='brave-browser --app=https://calendar.google.com/calendar/u/0/r/week' # Calendar
alias keep='brave-browser --app=https://keep.google.com/u/0/?pli=1#home' # Google Keep
alias c='calc' # sudo apt install calc
# I got this error when I invoked gnome-control-center:
# Running gnome-control-center is only supported under GNOME and Unity, exiting
# And here is the solution:
# https://discourse.gnome.org/t/gnome-control-center-outside-of-gnome/15771
alias gnome-control-center='env XDG_CURRENT_DESKTOP=GNOME gnome-control-center'