2009-10-09 36 views

回答

4

如果您em添加一個別名到您.bashrc你可以跳過Tab補齊一起:

alias em=emacs 

有了這個,你可以通過簡單地鍵入命令em啓動Emacs。

+0

我認爲這是最佳方案。它沒有完成emacs的名字,但沒關係:) – Natim 2009-10-09 02:10:59

2

我用另一種方法 - 簡單è命令:

 
#!/bin/sh 

# Written by Oleksandr Gavenko , 2008. 
# File placed by author in public domain. 

# View file in emacs buffer using emacsclient. 
# If emacs not already running, run it. 
# Put this file 'e' in your PATH. 
# Name `e' because `edit'. 

case "$1" in 
    -h|-help|--help) 
    echo "Emacsclient run script." 
    echo "Usage:" 
    echo " e [-h|--help] file..." 
    exit 0 
    ;; 
    "") 
    echo "What file you want to open?" 
    exit 0 
    ;; 
esac 

if [ -n "$COMSPEC" ]; then 
    # We probably under Windows like OS. I like native Emacs over Cygwin. 
    for arg; do 
    emacsclientw -a emacs -n "$arg" 
    done 
else 
    # We under UNIX like OS. 
    for arg; do 
    emacsclient -a emacs -n "$arg" 
    done 
fi 

而且我寫在批處理文件(.bat)語言類似的腳本用於MS Windows:

 
@echo off 

REM Written by Oleksandr Gavenko , 2008. 
REM File placed by author in public domain. 

REM View files in emacs buffer using emacsclientw. 
REM If emacs not already running, run it. 
REM Put this file (e.bat) in your PATH. 
REM Name `e' because `edit'. 

REM If path to file contain spaces it must be inclosed into quotes. 

if x%1 == x-h  goto usage 
if x%1 == x-help goto usage 
if x%1 == x--help goto usage 

:loop 
emacsclientw -a runemacs -n %1 
shift 
if not x%1 == x goto loop 
goto :eof 

:usage 
@echo Alias for emacsclient without waiting for editing ending. 
@echo Usage: 
@echo e [-h^|--help] file... 
+1

emacsclientw的使用很好 – Natim 2011-07-19 07:30:31