I really love Xeno, but one of my biggest gripes is that even if I configure it to use Sublime Text as my editor, it opens the entire directory and not the project file. For most maybe that’s not an issue, but for me that means a loss of indentions, spacing styles, clang options, and lots more.

So I wrote this script called “subl-project.sh”:

echo Looking in $1
for s in `find $1 -name \*.sublime-project -maxdepth 1 `; do
    echo "Opening a sublime project: $s"
    subl -p $s

if [ $found = 0 ]; then
    echo "No project found, opening $1"
    subl $1

And then executed this from the command line:

xeno config core.editor ~/bin/subl-project.sh

And tada! Now when I begin or resume an editing session with xeno, it defaults to opening any Sublime Project files it finds first! If none are found, then it just does the usual.