浏览代码

Fix vi aliases and EDITOR environments

pull/15/head
10sr 8 年前
父节点
当前提交
e88f291929
共有 2 个文件被更改,包括 19 次插入16 次删除
  1. +16
    -7
      profile
  2. +3
    -9
      shrc

+ 16
- 7
profile 查看文件

@@ -68,17 +68,26 @@ do
done
test -n "$_src_hilite_lp_path" && export LESSOPEN="| $_src_hilite_lp_path %s"

if which vim >/dev/null
if which nvim >/dev/null
then
export EDITOR=vim
else
export EDITOR=vi
_VI_ALT=nvim
elif which vim >/dev/null
then
_VI_ALT=vim
elif which vi >/dev/null
then
_VI_ALT=vi
fi
# export CDPATH=".:~"
export VISUAL="$EDITOR"

if test -n "$_VI_ALT"
then
export EDITOR="$_VI_ALT"
export GIT_EDITOR="$EDITOR"
export VISUAL="$EDITOR"
fi

# export CDPATH=".:~"
export GIT_PAGER="less -F"
export GIT_EDITOR="$EDITOR"
export GIT_MERGE_AUTOEDIT=no

if test -n "$TMUX" && \


+ 3
- 9
shrc 查看文件

@@ -275,17 +275,11 @@ _timeformat_rfc2822="%a, %d %b %Y %T %z"
_timeformat_num="%Y%m%d%H%M%S"
alias datenum="date +$_timeformat_num"

if null type nvim
if test -n "$_VI_ALT"
then
export EDITOR=nvim
elif null type vim
then
export EDITOR=vim
elif null type vi
then
export EDITOR=vi
alias vi=$_VI_ALT
export EDITOR=$_VI_ALT
fi
test -n "$EDITOR" && alias vi=$EDITOR

# export GREP_OPTIONS=""
alias gr="grep -n --color=always"


正在加载...
取消
保存