0

如何从fishshell 启动当前配置的编辑器?那是与关联的编辑器$EDITOR

从管道获取输入并在由$EDITOR.

$EDITOR从参数列表中打开路径的函数会是什么样子?

4

1 回答 1

1

怎么样:

function edit -d "Open a file using $EDITOR"
    for file in $argv
        if test -e $file
            eval $EDITOR $file
            echo "Opening file $file"
        else
            echo "Create file? (y/n)"
            read createFile
            if test $createFile = "y"
                eval $EDITOR -n $file
                echo "Creating file $file"
            end
        end
    end
end
于 2012-07-11T20:44:00.800 回答