forked from bryanl/zshkit
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path05_editor
More file actions
35 lines (30 loc) · 725 Bytes
/
Copy path05_editor
File metadata and controls
35 lines (30 loc) · 725 Bytes
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
export EDITOR
# Abuse the "open" command on OS X
if [[ $OSTYPE[1,6] == "darwin" ]]; then
for s in mp3 wav aac \
avi mp4 m4v mov qt mpg mpeg \
jpg png psd bmp gif tif tiff \
ps pdf html dmg; do
alias -s $s=open
done
# define vim with MacVIM
if [[ -x /Applications/MacVim.app/Contents/MacOS/Vim ]]; then
alias vim="/Applications/MacVim.app/Contents/MacOS/Vim"
EDITOR=vim
fi
fi
function not_run_from_ssh () {
ps x|grep "${PPID}.*sshd"|grep -v grep
echo $?
}
if [[ -x `which vim` ]]; then
EDITOR="vim"
elif [[ -x `which nano` ]]; then
EDITOR=nano
elif [[ -x `which pico` ]]; then
EDITOR=pico
fi
# Set EDITOR as default for plaintext stuff
for s in txt c cc cxx cpp; do
alias -s $s=$EDITOR
done