Hacker News new | ask | show | jobs
by hyyypr 3867 days ago
Love tmux, fail to see how desk and tmux are related. I think you missed the point.

Wheb i boot up, i still have to ^R to cd to the right location, and then ^R again to "compile" etc.

I'm looking forward to trying this out, direnv (mentionned above) seems like an even better idea.

2 comments

I have four directories which I frequently use. For one of them, I commit as let's say me@example.com and in the other three as me@example.edu.

So first of all, I have a bash function declared in my bashrc which takes one argument -- the domain -- and sets a few evironment variables such as GIT_AUTHOR_EMAIL and GIT_COMMITER_EMAIL.

Next I have one two-letter alias and three three-letter aliases which all cd to their respective paths and call the function to set the env vars.

Finally, I have two-letter aliases to git add, git diff, git commit, git push and so on.

Dead simple and works great. All I need is my bashrc.

You can actually save tmux sessions on disk, and you can script tmux, too. I have a tmux session that creates a directory if it doesn't exist yet, then it clones git repos there, then it creates a window for each of them, cds into it, loads the corresponding virtualenv (Python stuff), installs the required packages from a .txt file (also Python stuff) then prints me a tree of the last 10 commits and the current status of the repo (if it's not new I want to see if I forgot to commit something before I checked out the day before). All tmux. I only have to write "work<Enter>" into any shell and that's what I get.

Hope you could learn something, because that's the reason I'm writing here.