-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathtermux.sh
243 lines (218 loc) · 6.5 KB
/
termux.sh
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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
#! /bin/bash
if [[ "$*" =~ help ]]; then
echo all = INSTALLS EVERYTHING
echo bash = SETUP .bashrc
echo zsh = INSTALLS ZSH AND SETUP .zshrc. TO CHANGE DEFAULT SHELL USE chsh AND TYPE zsh
echo ohmyzsh = INSTALLS OH-MY-ZSH
echo vim = INSTALLS vim-python AND SETUP .vimrc
echo fasd = INSTALL AND SETUP FASD
echo fzf = INSTALL FZF AND ADD COMMON ALIASES LIKE fcd AND fv
echo neovim = INSTALL NEOVIM AND SETUP init.vim
echo stoage = ENABLES ACCESS TO PHONE STORAGE
fi
if [[ "$*" =~ all ]]; then
pkg upgrade
pkg install -y man
pkg install -y curl
fi
#BASH
if [[ "$*" =~ bash || "$*" =~ all ]]; then
touch ~/.bashrc
{
echo "set -o vi"
echo "alias la='ls -a'"
echo "alias ll='ls -l'"
echo "alias lal='ls -al'"
echo "alias src='source ~/.bashrc'"
echo "alias pi='pkg install'"
echo "alias pla='pkg list-all'"
echo "alias pii='pkg list-installed'"
echo "alias pu='pkg uninstall'"
echo "alias psh='pkg show'"
echo "alias pse='pkg search'"
} >> ~/.bashrc
fi
#ZSH
if [[ "$*" =~ zsh || "$*" =~ all ]]; then
pkg install -y zsh
touch ~/.zshrc
{
echo "bindkey -v"
echo "alias la='ls -a'"
echo "alias ll='ls -l'"
echo "alias lal='ls -al'"
echo "alias src='source ~/.zshrc'"
echo "alias pi='pkg install'"
echo "alias pla='pkg list-all'"
echo "alias pii='pkg list-installed'"
echo "alias pu='pkg uninstall'"
echo "alias psh='pkg show'"
echo "alias pse='pkg search'"
} >> ~/.zshrc
fi
#VIM
if [[ "$*" =~ vim || "$*" =~ all ]]; then
pkg install -y vim
touch ~/.vimrc
{
echo '"PREFERENCES'
echo 'set tabstop=4'
echo 'set shiftwidth=4'
echo 'set autoindent'
echo 'set ignorecase'
echo 'set smartcase'
echo 'set nobackup'
echo 'set noswapfile'
echo 'set number'
echo 'set relativenumber'
echo 'set incsearch'
echo 'set hlsearch'
echo 'set nowrap'
echo ''
echo '"LEADER MAPPINGS'
echo 'let mapleader=" "'
echo 'let maplocalleader=","'
echo 'nnoremap <LEADER><LEADER> :'
echo ''
echo '"BUFFER MAPPINGS'
echo 'nnoremap <Leader>ba :badd '
echo 'nnoremap <Leader>be :edit '
echo 'nnoremap <Leader>bd :bdelete<CR>'
echo 'nnoremap <Leader>bw :w<CR>'
echo 'nnoremap <Leader>bfw :w!<CR>'
echo 'nnoremap <Leader>bn :bnext<CR>'
echo 'nnoremap <Leader>bp :bprevious<CR>'
echo ""
echo '"WINDOWS MAPPINGS'
echo 'nnoremap <Leader>wo :only<CR>'
echo 'nnoremap <Leader>ws :split '
echo 'nnoremap <Leader>wv :vsplit '
echo 'nnoremap <Leader>wj <C-W><C-J>'
echo 'nnoremap <Leader>wk <C-W><C-K>'
echo 'nnoremap <Leader>wl <C-W><C-L>'
echo 'nnoremap <Leader>wh <C-W><C-H>'
echo ""
echo '"TAB MAPPINGS'
echo 'nnoremap <LEADER>ta :tabnew<CR> '
echo 'nnoremap <LEADER>tc :tabclose<CR> '
echo 'nnoremap <LEADER>tn :tabnext<CR> '
echo 'nnoremap <LEADER>tp :tabprevious<CR>'
echo 'nnoremap <LEADER>th :tabmove -<CR> '
echo 'nnoremap <LEADER>tl :tabmove +<CR> '
echo ""
echo '"VIM MAPPINGS'
echo 'nnoremap <Leader>vrc :edit ~/.vimrc<CR>'
echo 'nnoremap <Leader>vs :source ~/.vimrc<CR>'
echo 'nnoremap <Leader>vq :q<CR>'
echo 'nnoremap <Leader>vfq :q!<CR>'
echo 'nnoremap <Leader>vc :normal! 0i"<Esc>'
echo 'nnoremap <Leader>vu :normal! 0x'
} >> ~/.vimrc
fi
#NEOVIM
if [[ "$*" =~ neovim ]]; then
pkg install -y neovim
mkdir ~/.config
mkdir ~/.config/nvim
touch ~/.config/nvim/init.vim
{
echo '"PREFERENCES'
echo 'set tabstop=4'
echo 'set shiftwidth=4'
echo 'set autoindent'
echo 'set ignorecase'
echo 'set smartcase'
echo 'set nobackup'
echo 'set noswapfile'
echo 'set number'
echo 'set relativenumber'
echo 'set incsearch'
echo 'set hlsearch'
echo 'set nowrap'
echo ''
echo '"LEADER MAPPINGS'
echo 'let mapleader=" "'
echo 'let maplocalleader=","'
echo 'nnoremap <LEADER><LEADER> :'
echo ''
echo '"BUFFER MAPPINGS'
echo 'nnoremap <Leader>ba :badd '
echo 'nnoremap <Leader>be :edit '
echo 'nnoremap <Leader>bd :bdelete<CR>'
echo 'nnoremap <Leader>bw :w<CR>'
echo 'nnoremap <Leader>bfw :w!<CR>'
echo 'nnoremap <Leader>bn :bnext<CR>'
echo 'nnoremap <Leader>bp :bprevious<CR>'
echo ""
echo '"WINDOWS MAPPINGS'
echo 'nnoremap <Leader>wo :only<CR>'
echo 'nnoremap <Leader>ws :split '
echo 'nnoremap <Leader>wv :vsplit '
echo 'nnoremap <Leader>wj <C-W><C-J>'
echo 'nnoremap <Leader>wk <C-W><C-K>'
echo 'nnoremap <Leader>wl <C-W><C-L>'
echo 'nnoremap <Leader>wh <C-W><C-H>'
echo ""
echo '"TAB MAPPINGS'
echo 'nnoremap <LEADER>ta :tabnew<CR> '
echo 'nnoremap <LEADER>tc :tabclose<CR> '
echo 'nnoremap <LEADER>tn :tabnext<CR> '
echo 'nnoremap <LEADER>tp :tabprevious<CR>'
echo 'nnoremap <LEADER>th :tabmove -<CR> '
echo 'nnoremap <LEADER>tl :tabmove +<CR> '
echo ""
echo '"VIM MAPPINGS'
echo 'nnoremap <Leader>vrc :edit ~/.vimrc<CR>'
echo 'nnoremap <Leader>vs :source ~/.vimrc<CR>'
echo 'nnoremap <Leader>vq :q<CR>'
echo 'nnoremap <Leader>vfq :q!<CR>'
echo 'nnoremap <Leader>vc :normal! 0i"<Esc>'
echo 'nnoremap <Leader>vu :normal! 0x'
} >> ~/.config/nvim/init.vim
fi
#FASD
if [[ "$*" =~ fasd ]]; then
pkg install -y git
pkg install -y make
git clone https://github.com/clvv/fasd ~/fasd
cd ~/fasd
make install
if [[ -f ~/.zshrc && -x /usr/bin/fasd ]]; then
echo 'eval "$(fasd --init auto)"' >> ~/.zshrc
echo "alias v='f -e vim'" >> ~/.zshrc
fi
if [[ -f ~/.bashrc && -x /usr/bin/fasd ]]; then
echo 'eval "$(fasd --init auto)"' >> ~/.bashrc
echo "alias v='f -e vim'" >> ~/.bashrc
fi
fi
#FZF
if [[ "$*" =~ 'fzf' || "$*" =~ all ]]; then
pkg install -y fzf
touch ~/.bashrc
touch ~/.zshrc
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
[ -f ~/.fzf.bash ] && source ~/.fzf.bash
{
echo "export FZF_DEFAULT_COMMAND='find'"
echo "export FZF_DEFAULT_OPTS='--height 50% --reverse --margin 0,0,0,2 --color fg:-1,bg:-1,hl:33,fg+:254,bg+:235,hl+:33 --color info:136,prompt:136,pointer:230,marker:230,spinner:136'"
echo $'alias fcd=\'cd "$(find -L -type d | fzf)"\''
echo $'alias fv=\'vim "$(find -L -type f | fzf)"\''
} >> ~/.zshrc
{
echo "export FZF_DEFAULT_COMMAND='find'"
echo "export FZF_DEFAULT_OPTS='--height 50% --reverse --margin 0,0,0,2 --color fg:-1,bg:-1,hl:33,fg+:254,bg+:235,hl+:33 --color info:136,prompt:136,pointer:230,marker:230,spinner:136'"
echo $'alias fcd=\'cd "$(find -L -type d | fzf)"\''
echo $'alias fv=\'vim "$(find -L -type f | fzf)"\''
} >> ~/.bashrc
fi
#OH-MY-ZSH
if [[ "$*" =~ ohmyzsh || "$*" =~ all ]]; then
pkg install -y curl
pkg install -y git
bash -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
fi
#STORAGE
if [[ "$*" =~ storage || "$*" =~ all ]]; then
termux-setup-storage
fi