文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>打开emacs

打开emacs

时间:2010-09-13  来源:checl1987_EE

chechunli@chechunli-desktop:~ $ type edit edit is aliased to `edit_1' edit_1 is a function edit_1 ()      local file=$1;     if test -e "$file"; then         emacsclient -n "$file";     else         [[ "$file" =~ :$ ]] && file=${file:0:${#file}-1};         local line=${file##*:};         file=${file%:*};         local x=0;         while test ! -f "$file" && ((x++ < 10)); do             file=../"$file";         done;         if test -e "$file"; then             emacsclient -n +"${line:-1}" "$file";         else             emacsclient -n $1;         fi;     fi }

把这些内容加在.chechunli@chechunli-desktop:~ $ type edit edit is aliased to `edit_1' edit_1 is a function edit_1 ()      local file=$1;     if test -e "$file"; then         emacsclient -n "$file";     else         [[ "$file" =~ :$ ]] && file=${file:0:${#file}-1};         local line=${file##*:};         file=${file%:*};         local x=0;         while test ! -f "$file" && ((x++ < 10)); do             file=../"$file";         done;         if test -e "$file"; then             emacsclient -n +"${line:-1}" "$file";         else             emacsclient -n $1;         fi;     fi }

把这些内容加在.bashrc中就可以了 chechunli@chechunli-desktop:~ $ vi .bashrc  ... #edit_1 is a function edit_1 ()      local file=$1;     if test -e "$file"; then         emacsclient -n "$file";     else         [[ "$file" =~ :$ ]] && file=${file:0:${#file}-1};         local line=${file##*:};         file=${file%:*};         local x=0;         while test ! -f "$file" && ((x++ < 10)); do             file=../"$file";         done;         if             test -e "$file"; then             emacsclient -n +"${line:-1}" "$file";         else             emacsclient -n $1;         fi;     fi } ... alias edit='edit_1'bashrc中就可以了 chechunli@chechunli-desktop:~ $ vi .bashrc  ... #edit_1 is a function edit_1 ()      local file=$1;     if test -e "$file"; then         emacsclient -n "$file";     else         [[ "$file" =~ :$ ]] && file=${file:0:${#file}-1};         local line=${file##*:};         file=${file%:*};         local x=0;         while test ! -f "$file" && ((x++ < 10)); do             file=../"$file";         done;         if             test -e "$file"; then             emacsclient -n +"${line:-1}" "$file";         else             emacsclient -n $1;         fi;chechunli@chechunli-desktop:~ $ type edit edit is aliased to `edit_1' edit_1 is a function edit_1 ()      local file=$1;     if test -e "$file"; then         emacsclient -n "$file";     else         [[ "$file" =~ :$ ]] && file=${file:0:${#file}-1};         local line=${file##*:};         file=${file%:*};         local x=0;         while test ! -f "$file" && ((x++ < 10)); do             file=../"$file";         done;         if test -e "$file"; then             emacsclient -n +"${line:-1}" "$file";         else             emacsclient -n $1;         fi;     fi }

把这些内容加在.bashrc中就可以了 chechunli@chechunli-desktop:~ $ vi .bashrc  ... #edit_1 is a function edit_1 ()      local file=$1;     if test -e "$file"; then         emacsclient -n "$file";     else         [[ "$file" =~ :$ ]] && file=${file:0:${#file}-1};         local line=${file##*:};         file=${file%:*};         local x=0;         while test ! -f "$file" && ((x++ < 10)); do             file=../"$file";         done;         if             test -e "$file"; then             emacsclient -n +"${line:-1}" "$file";         else             emacsclient -n $1;         fi;     fi } ... alias edit='edit_1'     fi } ...
alias edit='edit_1' #我是把edit改成打开emacs 的方法了。可以用别的名字
相关阅读 更多 +
排行榜 更多 +
辰域智控app

辰域智控app

系统工具 下载
网医联盟app

网医联盟app

运动健身 下载
汇丰汇选App

汇丰汇选App

金融理财 下载