Skip to content

Instantly share code, notes, and snippets.

@redacted
Created May 6, 2011 19:06
Show Gist options
  • Save redacted/959571 to your computer and use it in GitHub Desktop.
Save redacted/959571 to your computer and use it in GitHub Desktop.
Autojump proposal
import os
import os.path as path
CLONE_DIR = os.getcwd()
SHELL = os.environ['SHELL'].split("/")[-1]
if SHELL == 'zsh':
with open("custom_install.zsh", "w") as fz:
fz.write("# edit path to include autojump\n")
fz.write("export PATH=({0} $PATH)\n\n".format(CLONE_DIR))
fz.write("source {0}/autojump.{1}\n".format(CLONE_DIR, SHELL))
with open(path.expandvars("$HOME/.zshrc"), "a") as zshrc:
zshrc.write("# source autojump\n")
zshrc.write("\nsource {0}\n".format(path.join(CLONE_DIR, "custom_install.zsh")))
else:
## bash code here
pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment