-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.tcshrc
154 lines (122 loc) · 4.4 KB
/
.tcshrc
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
# .tcshrc
# Lloyd Dilley
# https://github.com/ldilley/dotfiles
# Various colors
# Note: "1;" appears as bold when using xterm. If you want the font thinner, use 0 (zero) instead.
set plain="%{\033[0m%}"
set blue="%{\033[0;34m%}"
set cyan="%{\033[0;36m%}"
set green="%{\033[0;32m%}"
set magenta="%{\033[0;35m%}"
set red="%{\033[0;31m%}"
set white="%{\033[0;37m%}"
set yellow="%{\033[0;33m%}"
# Face to signify return code of last command
set smile="${green}:)${plain}"
set frown="${red}:(${plain}"
set face="${smile}"
# Prompt appearance
set prompt="${white}<${yellow}%P${white}> (${magenta}%c${white})\n${white}[${cyan}%n${white}@${cyan}%m${white}] ${face} ${white}{${yellow}%h${white}}%# ${plain}"
# First character indicates a regular user prompt and second indicates a root prompt
set promptchars = "%#"
# Set the Java home below if you have one
#setenv JAVA_HOME "/opt/jdk"
# Path
if (! $?JAVA_HOME) then # JAVA_HOME is undefined
set path = ($path)
else
if ("$JAVA_HOME" == "") then # JAVA_HOME is empty
set path = ($path)
else # JAVA_HOME is defined
set path = (${JAVA_HOME}/bin $path)
endif
endif
# Terminal type
setenv TERM xterm-256color
# Set DISPLAY appropriately if using an X server
#setenv DISPLAY localhost:0.0
# Set default editor
setenv EDITOR vi
setenv VISUAL vi
# Use less instead of more to navigate pages of data on the screen
setenv PAGER less
# Uncomment the line below to disable terminal messaging from other users
#mesg n
# A reasonable umask (use 027 or 077 for increased security)
umask 027
# Check input before completion attempts
set autocorrect
# Check for previous matches in the history for auto-completion
set autoexpand
# Enable tab completion
set autolist
# Detect and attempt to correct erroneous input
set correct=cmd
# Set location and name of the history file
# The default is: ~/.history
#set histfile = ~/.tcsh_history
# Store up to this many lines in the history file and merge with existing
set savehist=(1000 merge)
# Store up to this many lines in memory for the history of the current session
# The date and time format is also specified.
set history=(1500 "%h %W/%D/%Y (%d) %P - %R\n")
# If previous command is the same as the current one, do not add it to the history
# Set this to "all" or "erase" to eliminate duplicate entries.
set histdup=prev
# Print and save the literal form of the history
set histlit
# List all jobs when backgrounding a job
set listjobs
# Disable the bell
#set nobeep
# Disallow > operator on a file that already exists
# This is an additional layer of protection against accidental overwrites.
set noclobber
# Notify of job status changes
set notify
# Verify "rm *" command use
set rmstar
# Dynamically update prompt by checking the exit code of the previous command
# Git status support (optional)
# To obtain: git clone https://github.com/olemb/git-prompt
# After building (go build git-prompt.go), copy the resulting binary to somewhere in your path such as /usr/local/bin or ~/bin.
if ( `where git-prompt` == "" ) then
alias precmd 'test $? -gt 0 && set face="${frown}" || set face="${smile}"' \
'; set prompt="${white}<${yellow}%P${white}> (${magenta}%c${white})\n${white}[${cyan}%n${white}@${cyan}%m${white}] ${face} ${white}{${yellow}%h${white}}%# ${plain}"'
else
alias precmd 'test $? -gt 0 && set face="${frown}" || set face="${smile}"' \
'; set prompt="${white}<${yellow}%P${white}> (${magenta}%c${white}) %{`git-prompt`%} \n${white}[${cyan}%n${white}@${cyan}%m${white}] ${face} ${white}{${yellow}%h${white}}%# ${plain}"'
endif
# Save each command to the history file after it is entered (this also increments the history number +1)
#alias postcmd 'history -M'
# Set backspace as erase key
stty erase '^?'
# Enable ls-F, ls, and NLS color
set color
set colorcat
# Enable color support for BSD and macOS if TERM supports it (for --color=auto)
setenv CLICOLOR 1
# Uncomment the line below to remove all existing aliases and start fresh
#unalias *
# Aliases
alias cd.. 'cd ..'
alias cls 'clear'
alias cp 'cp -i'
alias cwd 'pwd'
alias df 'df -h'
alias ducks 'du -cks * | sort -nr | less'
alias egrep 'egrep --color=auto'
alias fgrep 'fgrep --color=auto'
alias free 'free -h'
alias grep 'grep --color=auto'
alias la 'ls -laF --color=auto'
alias ll 'ls -lF --color=auto'
alias ln 'ln -i'
alias ls 'ls -F --color=auto'
alias md 'mkdir'
alias more 'less'
alias mv 'mv -i'
alias rd 'rmdir'
alias rm 'rm -i'
alias tree 'tree -C'
alias vi 'vim'