Skip to content

Instantly share code, notes, and snippets.

@natevw
Last active April 8, 2019 06:35
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save natevw/0324311ae115ca8d1a9e to your computer and use it in GitHub Desktop.
Save natevw/0324311ae115ca8d1a9e to your computer and use it in GitHub Desktop.
Better `xed` — the CLI tool for Xcode is handy, but has a few issues that get in the way. For starters, if the file doesn't exist, the builtin `x\ed` won't create a new one. I also noticed that Xcode will open a symlink and let you edit, but then gets really angry when it tries to save. So…this.
alias xed='function _xed() { [ ! -f $1 ] && touch $1; xed `python -c "import os,sys;print os.path.realpath(sys.argv[1])" $1`; };_xed'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment