forked from violapterin/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.bashrc
More file actions
84 lines (63 loc) · 2.74 KB
/
Copy path.bashrc
File metadata and controls
84 lines (63 loc) · 2.74 KB
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
# Filename: .bashrc
# Author: Tzu-Yu Jeng
# Date: mostly late 2016
# Description: An interactive non-login shell loads this file.
# Requirement: That it be saved in user's home, and included in `.bash_profile`.
# # # # # # # # Settings, exportation, sourcing # # # # # # # #
# To define environment variables.
export DOC="/Users/amino/Documents"
export PATH="${PATH}:${DOC}/code_repos/scripts/bash"
export PYTHONPATH="${PYTHONPATH}:${DOC}/code_repos/scripts/python"
# To set MacVim as the default editor, such as Git commit logs.
export VISUAL="mvim -v"
export EDITOR="${VISUAL}"
# To compile LilyPond `.ly` file.
export LilyPond="/Applications/LilyPond.app/Contents/Resources/bin/lilypond"
# Command-line completion resp. using up and down arrow keys.
bind "\"\e[A\": history-search-backward"
bind "\"\e[B\": history-search-forward"
# To ignore case in completing commands.
bind "set completion-ignore-case On"
# Initialize the `bash-completion` package.
# (Install with `brew install bash-completion`.)
source /usr/local/etc/bash_completion
# # # # # # # # Display of color # # # # # # # #
# To prompt current username, time in minutes,
# and current directory (not full path).
export PS1="\[\033[1;32m\]\u\[\033[1;34m\][\A]\[\033[1;31m\]@\W\[\033[1;37m\]$ \[\033[0;37m\]"
# To enable color in command line interface.
export CLICOLOR=1
# To specify color settings used by `ls` ("list") display.
export LSCOLORS="gxBxhxDxfxhxhxhxhxcxcx"
# # # # # # # # File management # # # # # # # #
# When changing directory, always expand a symlink.
alias cd="cd -P"
# `ls` for hidden & short form; `Ls` unhidden & long form;
# `-G`: to enable colorized output;
# `-F`: to display a slash;
# `-h`: to use human readable format, e.g. KB, MB, GB,...;
# `-l`: to use long format, including permissions and date modified;
# `-a`: to display hidden files, say `.DS_Store`
alias ls="ls -GFh"
alias Ls="ls -alGFh"
# Disk usage
alias Du="du -shc * | gsort -hr"
# To show hidden files in Mac `Finder.app`.
alias ShowFiles="defaults write com.apple.finder AppleShowAllFiles YES"
# To show hidden files in Mac `Finder.app`.
alias HideFiles="defaults write com.apple.finder AppleShowAllFiles NO"
# # # # # # # # Other aliases for applications # # # # # # # #
# `cd` (change directory) shortcuts.
# Double quotes ensures they are passed as a single token.
alias ToEssays="cd \"${DOC}/essays_vol_8\""
alias ToAllFairCopies="cd \"${DOC}/all_fair_copies\""
alias ToLilypondWork="cd \"${DOC}/LilyPond_work\""
alias ToLatexWork="cd \"${DOC}/LaTeX_work\""
alias ToPrograms="cd \"${DOC}/code_repos\""
alias ToBooks="cd \"${DOC}/books\""
# To open with MacVim embedded in the terminal.
alias Vim="mvim -v"
# To browse PTT.
alias BrowsePtt="ssh bbsu@ptt.cc"
# To browse PTT2.
alias BrowsePtt2="ssh bbsu@ptt2.cc"