forked from cowboy/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path50_editor.sh
38 lines (34 loc) · 793 Bytes
/
50_editor.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
# Editing
# if [[ ! "$SSH_TTY" ]] && is_osx; then
# export EDITOR='mvim'
# export LESSEDIT='mvim ?lm+%lm -- %f'
# else
export EDITOR='vim'
# fi
function openInSublime() {
if [ -f *.sublime-project ]; then
subl --project *.sublime-project;
else
sublime_project_file_template="$(cat <<EOF
{
"folders":
[
{
"path": "."
}
]
}
EOF
)"
sublime_project_file_name="${PWD##*/}.sublime-project"
echo "No Sublime Project Found ... Creating $sublime_project_file_name";
echo "$sublime_project_file_template" >> $sublime_project_file_name
subl --project *.sublime-project;
fi
}
export VISUAL="$EDITOR"
alias q="$EDITOR"
alias qv="q $DOTFILES/link/.{,g}vimrc +'cd $DOTFILES'"
alias qs="q $DOTFILES"
alias subln="subl -n ."
alias sublp=openInSublime