-
Notifications
You must be signed in to change notification settings - Fork 0
/
.shell
747 lines (592 loc) · 28.1 KB
/
.shell
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
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
#!/usr/bin/env sh
# Vivek Menon - vvkmnn.xyz
##################################################
##################################################
###################### ####################
################ ##############
############# ####### ###########
########### ######### #########
######### ######## #######
######## ###### ######
####### ###### #####
###### ####### ###### ####
##### ######### ###### ###
##### ####### ###### ###
##### ###### ##### ###
##### ###### #### ###
##### ###### ### ###
##### ###### # ###
###### ###### ####
####### ##### #####
######## ##### ######
########## ##### ########
############ ##### ##########
############## ##### ############
################## ################
##################################################
##################################################
#
# case "$(uname -s)" in
#
# Linux | Darwin)
# Bash
if [ -n "$BASH_VERSION" ]; then
# [ -f ~/.fzf.bash ] && source ~/.fzf.bash
# no audio bell
# https://superuser.com/questions/163994/how-can-i-get-the-mac-terminal-to-not-beep
set bell-style visible
# adaptive width
export COLUMNS=200
shopt -s checkwinsize
# starship
# https://starship.rs/guide/#🚀-installation
# eval "$(starship init bash)"
om="ॐ"
morbidtime=$(date '+%-j/365 %-g/61 %a %d-%m-%y %T')
# cols=$(tput cols)
# PS1=$(printf "%*s\r%s\n$om " "$(tput cols)" 'righty tighty' 'lefty loosey')
# PS1=$(printf "%*s\r%s " "$(($cols - 25))" '$morbidtime' '$om')
# PS1=$(printf "%*s\r%s " "$(($(tput cols) - 35))" '$(date '+%-j/365 %-g/61 %a %d-%m-%y %T')' '$om')
PS1="\$(printf '%*s\r%s ' \$((\$(tput cols) - 35)) \"\$(date '+%-j/365 %-g/61 %a %d-%m-%y %T')\" \"\$om\")"
# PS1="\$(printf \"%*s\r%s \" \"\$(($(tput cols) - $(echo '$(date '+%-j/365 %-g/61 %a %d-%m-%y %T')' | wc -c)))\" \"\$(date '+%-j/365 %-g/61 %a %d-%m-%y %T')\" \"\$om\")"
# PS1="\$(printf \"%*s\r%s \" \"\$(($(tput cols) - 20)))\" \"\$(date '+%-j/365 %-g/61 %a %d-%m-%y %T')\" \"\$om\")"
true
# ZSH
elif [ -n "$ZSH_VERSION" ]; then
# NOTE Marginal change in performance, but less buggy when below zcomet
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
# if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
# source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
# fi
# zmodload zsh/zprof
# run `time zsh -i -c exit | nvim` to profile into nvim
# Save in case
# typeset -g POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(
# ...
# om # TODO fix, custom prompt
# )
#
# function prompt_om() {
# # 214 is saffron
# # 7 is grey
# p10k segment -b 2 -f 214 -t 'ॐ '
# }
## Zcomet {{{
# Clone zcomet if necessary
if [[ ! -f ${ZDOTDIR:-${HOME}}/.zcomet/bin/zcomet.zsh ]]; then
command git clone https://github.com/agkozak/zcomet.git ${ZDOTDIR:-${HOME}}/.zcomet/bin
fi
source ${ZDOTDIR:-${HOME}}/.zcomet/bin/zcomet.zsh
# Load a prompt
# zcomet load agkozak/agkozak-zsh-prompt
zcomet load romkatv/powerlevel10k
# Load some plugins
zcomet load agkozak/zsh-z
zcomet load ohmyzsh plugins/gitfast
zcomet load lukechilds/zsh-nvm
# zcomet load jeffreytse/zsh-vi-mode
# Load a code snippet - no need to download an entire repo
zcomet snippet https://github.com/jreese/zsh-titles/blob/master/titles.plugin.zsh
# Lazy-load some plugins
zcomet trigger zhooks agkozak/zhooks
zcomet trigger zsh-prompt-benchmark romkatv/zsh-prompt-benchmark
# Lazy-load Prezto's archive module without downloading all of Prezto's
# submodules
zcomet trigger --no-submodules archive unarchive lsarchive \
sorin-ionescu/prezto modules/archive
# It is good to load these popular plugins last, and in this order:
zcomet load zsh-users/zsh-syntax-highlighting
zcomet load zsh-users/zsh-autosuggestions
# tmux
zcomet load ohmyzsh plugins/tmux
# QOL
zcomet load paulirish/git-open
# Custom
zcomet load Tarrasch/zsh-autoenv
zcomet load zsh-users/zsh-completions
# Run compinit and compile its cache
zcomet compinit
##}}}
# Powerlevel 10k {{{
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi
# Vi Mode
bindkey -v
# p10k {{{
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
# }}}
# zsh-nvm {{{
export NVM_LAZY_LOAD=true
export NVM_COMPLETION=true
export NVM_AUTO_USE=true
export NVM_LAZY_LOAD_EXTRA_COMMANDS=('vim','nvim')
# }}}
# open-ai
# NOTE 1password prompts everytime...
# export oi_api_key=$(op read "op://Personal/mhgs4auyjijxtrytbsqw3hucty/Other Fields/credential")
# export oi_api_key="op://Personal/mhgs4auyjijxtrytbsqw3hucty/Other Fields/credential"
# }}}
# if [ -z "$TMUX" ]; then
# exec tmux new-session -A -s workspace
# fi
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
# if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
# source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
# fi
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
# [[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
## Antigen {{{
# # If no file, curl
# # if [[ ! -f ~/.antigen.zsh ]]; then
# # echo "curling antigen"
# # curl -L git.io/antigen > ~/.antigen.zsh
# # fi
# # now, simply add these two lines in your ~/.zshrc
# # # source antidote
# # source ${ZDOTDIR:-~}/.antidote/antidote.zsh
# # # initialize plugins statically with ${ZDOTDIR:-~}/.zsh_plugins.txt
# # antidote load
# # You can change the names/locations of these if you prefer.
# antidote_dir=${ZDOTDIR:-~}/.antidote
# plugins_txt=${ZDOTDIR:-~}/.zsh_plugins.txt
# static_file=${ZDOTDIR:-~}/.zsh_plugins.zsh
# # Clone antidote if necessary and generate a static plugin file.
# if [[ ! $static_file -nt $plugins_txt ]]; then
# [[ -e $antidote_dir ]] ||
# git clone --depth=1 https://github.com/mattmc3/antidote.git $antidote_dir
# (
# source $antidote_dir/antidote.zsh
# [[ -e $plugins_txt ]] || touch $plugins_txt
# antidote bundle <$plugins_txt >$static_file
# )
# fi
# # Uncomment this if you want antidote commands like `antidote update` available
# # in your interactive shell session:
# autoload -Uz $antidote_dir/functions/antidote
# # source the static plugins file
# source $static_file
# # cleanup
# unset antidote_dir plugins_txt static_file
# # antidote bundle <~/.zsh_plugins.txt >~/.zsh_plugins.zsh
# # source ~/.zsh_plugins.zsh
# # Powerlevel 10k
# # If not in tmux, start tmux: reads and writes the TTY.
# # if [[ -z ${TMUX+X}${ZSH_SCRIPT+X}${ZSH_EXECUTION_STRING+X} ]]; then
# # exec tmux
# # fi
# # Clone git repos that don't exist: prints and may take unpredictably long time to execute.
# # if [[ ! -e ~/zsh-autosuggestions ]]; then
# # print -r -- 'installing zsh-autosuggestions ...'
# # git clone --depth=1 https://github.com/zsh-users/zsh-autosuggestions.git ~/zsh-autosuggestions
# # fi
# Prints.
# print -Pr -- 'Hello, %n. Today is %D{%A}.'
# ... and so on
# Print the first prompt and redirect standard file descriptors.
# if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
# source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
# fi
# TODO Fix this, instant prompt from Powerlevel10k
# autoload -Uz compinit && compinit
# source ~/zsh-autosuggestions/zsh-autosuggestions.zsh
# ... and so on
# https://github.com/romkatv/zsh-bench#instant-prompt
# Essential
# [ -f .antigen.zsh ] && . .antigen.zsh
# source ~/.antigen.zsh
# # Load the oh-my-zsh's library.
# # antigen use oh-my-zsh
# # Bundles from the default repo (robbyrussell's oh-my-zsh).
# # antigen bundle git
# # antigen bundle heroku
# # antigen bundle pip
# # antigen bundle lein
# # antigen bundle command-not-found
# # Use nvm from zsh
# # Syntax highlighting bundle.
# # antigen bundle zsh-users/zsh-syntax-highlighting
# antigen bundle agkozak/zsh-z
# # Load the theme.
# # antigen theme robbyrussell
# antigen theme romkatv/powerlevel10k
# # Tell Antigen that you're done.
# antigen apply
# # }}}
# p10k
# NOTE Instant Prompt used above - unrelated to this config
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
# export POWERLEVEL9K_DISABLE_CONFIGURATION_WIZARD=true
# }}}
# TODO
# bounjourr safari
# NVM_LAZY_LOAD=true
# export ZSH_TMUX_AUTOQUIT=false
# /* * #analogClock { margin-bottom: 1em } */
# /* * #time #time-container { font-size: 1.1em } */
# /* * #interface #time #date { font-size: 0.8em } */
# /* * #interface #weather { font-size: 0.6em } */
# /* * #widgets #quotes_container { font-size: 0.6em } */
#
# /* * #clock { */
# /* line-height: 1.1em */
# /* } */
#
# /* #interface { height: 80vh; padding-top: 10vh } */
# /* #interface #time {justify-content: flex-end} */
# /* #interface #main {justify-content: flex-start} */
# /* #interface #widgets {justify-content: flex-start} */
# ohmyzsh/tmux {{{
# NOTE conflicts with instant prompt, turn that off for tmux to have time
ZSH_TMUX_AUTOSTART=true
ZSH_TMUX_AUTOCONNECT=false
ZSH_TMUX_AUTOQUIT=true
# }}}
# conda {{{
# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/Users/v/.miniconda3/bin/conda' 'shell.zsh' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
eval "$__conda_setup"
else
if [ -f "/Users/v/.miniconda3/etc/profile.d/conda.sh" ]; then
. "/Users/v/.miniconda3/etc/profile.d/conda.sh"
else
export PATH="/Users/v/.miniconda3/bin:$PATH"
fi
fi
unset __conda_setup
# <<< conda initialize <<<
# rust {{{
# . "$HOME/.cargo/env"
[ -d "$HOME/.cargo" ] && . "$HOME/.cargo/env"
# }}}
## nvm
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
# z {{{
# ZSHZ_DATA=" $HOME/.vz "
# }}}
# Zim {{{
# Define Zim location
# : ${ZIM_HOME=${ZDOTDIR:-${HOME}}/.zim}
# }}} End configuration added by Zim install
# }}}
# zinit {{{
# ### Preload
# source ~/.zinit/bin/zinit.zsh
# ### Packages
# # regular plugins loaded without investigating.
# zinit light zsh-users/zsh-autosuggestions
# zinit light zdharma/fast-syntax-highlighting
# # Completions
# zinit ice blockf
# zinit light zsh-users/zsh-completions
# # Fun
# zinit light paulirish/git-open # TODO Fix; not working
# zinit load knu/z
# # zinit light denysdovhan/spaceship-prompt
# # Plugin history-search-multi-word loaded with investigating.
# zinit load zdharma/history-search-multi-word
# # After automatic unpacking it provides program "fzf".
# zinit ice from"gh-r" as"program"
# zinit load junegunn/fzf-bin
# # fast async ++ spaceship?
# zinit load agkozak/agkozak-zsh-prompt
# # Load the pure theme, with zsh-async library that's bundled with it.
# # zinit ice pick"async.zsh" src"pure.zsh"
# # zinit light sindresorhus/pure
# # TODO https://zdharma.org/zinit/wiki/GALLERY/
# # zinit ice wait'!' lucid nocompletions \
# # compile"{zinc_functions/*,segments/*,zinc.zsh}" \
# # atload'!prompt_zinc_setup; prompt_zinc_precmd'
# # zinit load robobenklein/zinc
# # coreutils package from Homebrew; you can also use
# # https://github.com/ogham/exa)
# zinit ice atclone"dircolors -b LS_COLORS > c.zsh" atpull'%atclone' pick"c.zsh" nocompile'!'
# zinit light trapd00r/LS_COLORS
# # make'!...' -> run make before atclone & atpull
# # zinit ice as"program" make'!' atclone'./direnv hook zsh > zhook.zsh' atpull'%atclone' src"zhook.zsh"
# # zinit light direnv/direnv
# ### post load
# autoload -Uz _zinit
# (( ${+_comps} )) && _comps[zinit]=_zinit
# ### variables
# # TODO not working? https://github.com/marlonrichert/zsh-autocomplete
# zstyle ':autocomplete:tab:*' fzf yes
# zstyle ':completion:*' verbose no
# zstyle ':autocomplete:list-choices:*' max-lines 1
# bindkey $key[Up] up-line-or-history
# bindkey $key[Down] down-line-or-history
# # Exit status
# # AGKOZAK_CUSTOM_PROMPT='%(!!?@?..%B%F{red}(%?%)%f%b )'
# # Command execution time
# # AGKOZAK_CUSTOM_PROMPT+='%(9V.%9v .)'
# # Username and hostname
# AGKOZAK_CUSTOM_PROMPT+='%(!.%S%B.%B%F{green})%n%1v%(!.%b%s.%f%b) '
# # Path
# AGKOZAK_CUSTOM_PROMPT+=$'%B%F{blue}%2v%f%b\n'
# # Prompt character
# AGKOZAK_CUSTOM_PROMPT+=' ॐ ' #'%(4V.:.%#) '
# # Git status
# AGKOZAK_CUSTOM_RPROMPT+='%(3V.%F{yellow}%3v%f.) '
# # Bot face status
# AGKOZAK_CUSTOM_RPROMPT+='v@%M %(?,%F{green}[-_-]%f,%F{red}[ಠ_ಠ]%f) '
# }}}
# # zplug {{{
# Check if zplug is installed
# if [[ ! -d ~/.zplug ]]; then
# git clone https://github.com/zplug/zplug ~/.zplug
# source ~/.zplug/init.zsh && zplug update --self
# fi
# Essential
# source ~/.zplug/init.zsh
# zplug "plugins/git", from:oh-my-zsh
# zplug "paulirish/git-open", as:plugin
# zplug "zsh-users/zsh-syntax-highlighting"
# zplug "zsh-users/zsh-history-substring-search"
# zplug "zsh-users/zsh-completions"
# # zplug "zpm-zsh/autoenv"
# # zplug "zpm-zsh/colors"
# zplug "knu/z", use:z.sh
# zplug "denysdovhan/spaceship-prompt", use:spaceship.zsh, from:github, as:theme
# # Install packages that have not been installed yet
# if ! zplug check --verbose; then
# printf "Install? [y/N]: "
# if read -q; then
# echo; zplug install
# else
# echo
# fi
# fi
# zplug load
# }}}
## ngrok
if command -v ngrok &>/dev/null; then
eval "$(ngrok completion)"
fi
## fzf
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
## nvm
# export NVM_DIR="$HOME/.nvm"
# [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
# export NVM_DIR="$HOME/.nvm"
#
[ -s "/opt/homebrew/opt/nvm/nvm.sh" ] && \. "/opt/homebrew/opt/nvm/nvm.sh" # This loads nvm
[ -s "/opt/homebrew/opt/nvm/etc/bash_completion.d/nvm" ] && \. "/opt/homebrew/opt/nvm/etc/bash_completion.d/nvm" # This loads nvm bash_completion
# if [ -z "$TMUX" ]; then
# exec tmux new-session -A -s workspace
# fi
# tmux
# if [ -z "$TMUX" ]; then
# exec tmux new-session -A -s workspace
# fi
case "$(uname -s)" in
Linux )
## lazygit
if ! command -v lazygit &> /dev/null; then
LAZYGIT_VERSION=$(curl -s "https://api.github.com/repos/jesseduffield/lazygit/releases/latest" | grep -Po '"tag_name": "v\K[^"]*')
curl -Lo lazygit.tar.gz "https://github.com/jesseduffield/lazygit/releases/latest/download/lazygit_${LAZYGIT_VERSION}_Linux_x86_64.tar.gz"
tar xf lazygit.tar.gz lazygit
# Check if /usr/local/bin is writable
if [ -w /usr/local/bin ]; then
install lazygit /usr/local/bin
else
echo "/usr/local/bin is not writable. Attempting to use sudo..."
sudo install lazygit /usr/local/bin
fi
rm lazygit.tar.gz && rm -rf lazygit
fi
## pipx
# To activate completions for zsh you need to have bashcompinit enabled in zsh:
# autoload -U bashcompinit
# bashcompinit
autoload -Uz compinit
zstyle ':completion:*' menu select
fpath+=~/.zfunc
# Afterwards you can enable completion for pipx:
eval "$(register-python-argcomplete pipx)"
## brew
[ -d /home/linuxbrew/.linuxbrew ] && eval $(/home/linuxbrew/.linuxbrew/bin/brew shellenv)
;;
Darwin )
# Brew
eval "$(/opt/homebrew/bin/brew shellenv)"
## nvm
# [ -s "/opt/homebrew/opt/nvm/nvm.sh" ] && \. "/opt/homebrew/opt/nvm/nvm.sh" # This loads nvm
# [ -s "/opt/homebrew/opt/nvm/etc/bash_completion.d/nvm" ] && \. "/opt/homebrew/opt/nvm/etc/bash_completion.d/nvm" # This loads nvm bash_completion
;;
esac
# zprof
# Bash
elif [ -n "$BASH_VERSION" ]; then
# ~/.bashrc: executed by bash(1) for non-login shells.
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return ;;
esac
# don't put duplicate lines or lines starting with space in the history.
# See bash(1) for more options
HISTCONTROL=ignoreboth
# append to the history file, don't overwrite it
shopt -s histappend
# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTSIZE=1000
HISTFILESIZE=2000
# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize
# If set, the pattern "**" used in a pathname expansion context will
# match all files and zero or more directories and subdirectories.
#shopt -s globstar
# make less more friendly for non-text input files, see lesspipe(1)
#[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
# set variable identifying the chroot you work in (used in the prompt below)
if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then
debian_chroot=$(cat /etc/debian_chroot)
fi
# set a fancy prompt (non-color, unless we know we "want" color)
case "$TERM" in
xterm-color | *-256color) color_prompt=yes ;;
esac
# uncomment for a colored prompt, if the terminal has the capability; turned
# off by default to not distract the user: the focus in a terminal window
# should be on the output of commands, not on the prompt
#force_color_prompt=yes
if [ -n "$force_color_prompt" ]; then
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
# We have color support; assume it's compliant with Ecma-48
# (ISO/IEC-6429). (Lack of such support is extremely rare, and such
# a case would tend to support setf rather than setaf.)
color_prompt=yes
else
color_prompt=
fi
fi
if [ "$color_prompt" = yes ]; then
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
else
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
fi
unset color_prompt force_color_prompt
# If this is an xterm set the title to user@host:dir
# case "$TERM" in
# xterm* | rxvt*)
# PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
# ;;
# *) ;;
# esac
# 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 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
# colored GCC warnings and errors
#export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'
# some more ls aliases
#alias ll='ls -l'
#alias la='ls -A'
#alias l='ls -CF'
# Alias definitions.
# You may want to put all your additions into a separate file like
# ~/.bash_aliases, instead of adding them here directly.
# See /usr/share/doc/bash-doc/examples in the bash-doc package.
# if [ -f ~/.bash_aliases ]; then
# . ~/.bash_aliases
# fi
# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
# if ! shopt -oq posix; then
# if [ -f /usr/share/bash-completion/bash_completion ]; then
# . /usr/share/bash-completion/bash_completion
# elif [ -f /etc/bash_completion ]; then
# . /etc/bash_completion
# fi
# fi
# FiSH
elif [ -n "$FISH_VERSION" ]; then
echo "TODO fish"
# set fish_greeting
else
echo "TODO .shell"
# # asume something else
fi
# Darwin)
# echo '[¬_¬] Loading Darwin shell...'
# autoenv
# source $(brew --prefix autoenv)/activate.sh
## gcloud
# if [ -f "${HOME}/.google/path.zsh.inc" ]; then source "${HOME}/.google/path.zsh.inc"; fi
# if [ -f "${HOME}/.google/completion.zsh.inc" ]; then source "${HOME}/.google/completion.zsh.inc"; fi
## z
# . /usr/local/etc/profile.d/z.sh
## nvm
# export NVM_DIR="$HOME/.nvm"
# [ -s "/usr/local/opt/nvm/nvm.sh" ] && . "/usr/local/opt/nvm/nvm.sh" # This loads nvm
# conda
# !! Contents within this block are managed by 'conda init' !!
# __conda_setup="$('/usr/local/anaconda3/bin/conda' 'shell.zsh' 'hook' 2>/dev/null)"
# if [ $? -eq 0 ]; then
# eval "$__conda_setup"
# else
# if [ -f "/usr/local/anaconda3/etc/profile.d/conda.sh" ]; then
# . "/usr/local/anaconda3/etc/profile.d/conda.sh"
# else
# export PATH="/usr/local/anaconda3/bin:$PATH"
# fi
# fi
# unset __conda_setup
# Zim (Framework)
# export ZIM_HOME=${ZDOTDIR:-${HOME}}/.zim # Define zim location
# [[ -s ${ZIM_HOME}/init.zsh ]] && source ${ZIM_HOME}/init.zsh # Start zim
# elif [ -n "$BASH_VERSION" ]; then
# # assume Bash
# echo "fuckbash"
# FiSH
# elif [ -n "$FISH_VERSION" ]; then
# set fish_greeting
# else
# echo "fuckthis"
# # asume something else
# fi
# conda
# !! Contents within this block are managed by 'conda init' !!
# __conda_setup="$('/usr/local/anaconda3/bin/conda' 'shell.zsh' 'hook' 2> /dev/null)"
# if [ $? -eq 0 ]; then
# eval "$__conda_setup"
# else
# if [ -f "/usr/local/anaconda3/etc/profile.d/conda.sh" ]; then
# . "/usr/local/anaconda3/etc/profile.d/conda.sh"
# else
# export PATH="/usr/local/anaconda3/bin:$PATH"
# fi
# fi
# unset __conda_setup
# # Zim (Framework)
# export ZIM_HOME=${ZDOTDIR:-${HOME}}/.zim # Define zim location
# [[ -s ${ZIM_HOME}/init.zsh ]] && source ${ZIM_HOME}/init.zsh # Start zim
# ;;
# Linux)
# echo '[¬_¬] Loading Linux shell...'
# ;;
#
# CYGWIN* | MINGW32* | MSYS* | MINGW*)
# echo '[¬_¬] TODO DOS shell'
# ;;
#
# esac