如何从fish
shell 启动当前配置的编辑器?那是与关联的编辑器$EDITOR
。
从管道获取输入并在由$EDITOR
.
$EDITOR
从参数列表中打开路径的函数会是什么样子?
怎么样:
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