Quickly open projects in tmux with split window configuration

When I work on a coding project, I often have a window for it in tmux. The window is split horizontally into two panes. On the left there's vim, on the right there's just shell for running commands. This is a bit tedious to set up everytime I want to work on a project, so I created a little helper script for it.
The first script is called tmuxide.
#!/bin/sh
dir=${1:-$PWD}
name=${2:-$dir}
session="$USER-ide"
window="$session:$name"
# Create a new session if there isn't one
tmux has-session -t $session 2> /dev/null || tmux new-session -d -s $session
# Select the project's window if it exists, else create it
tmux select-window -t $window 2> /dev/null || {
tmux new-window -c $dir -t $session -n $name 'vim .'
tmux setw -t $window allow-rename off > /dev/null
tmux split-window -t $window -d -c $dir -h -p 45
tmux -2 attach -d -t $session
The project directory and name are given as parameters. This looks for a session called $USER-ide and creates it if it's not found. Then, it tries to select the window with the project name. If it doesn't find it, a new window with the previously described split configuration is opened. Last, it attaches to the IDE session. So I can open a project view for instance in my dotfiles folder: `tmuxide $HOME/.dotfiles dotfiles`, where the second "dotfiles" is the name given to the project window.
To complement this, I created a convenience script called project. It's inspired by a feature called "Project Quick Open" found in some text editors.
#!/bin/sh
root=${PROJECT_ROOT:-"$HOME/projects"}
prj=$1
[ -z $prj ] && {
ls -d $root/*/ | awk -F'/' '{print $(NF-1)}' | column
printf "\n"
read -e -p "Open project: " prj
dir="$root/$prj"
[ ! -d $dir ] && exit 0
tmuxide $dir $prj
This looks for the environment variable $PROJECT_ROOT. I can now supply the name of any folder under $PROJECT_ROOT: eg. if I run now `project metaballs`, it looks for the folder $PROJECT_ROOT/metaballs and opens a tmuxide window in that folder with the name "metaballs". If no project name is given as a parameter, the script shows a directory listing and prompts the user for a project.
The scripts become especially powerful when bound to a hotkey. For example, I'm binding the project script with sxhkd in my bspwm environment like this:
super + shift + p
bspc rule -a URxvt -o desktop=code && urxvtc -e project
Now the powerful environment is just a keypress away.
I'm sure you all have your own workflows with vim, tmux etc. This is mine, and I just thought I'd share it in case someone finds it useful. Especially, the detection of existing windows and directing the commands to the right session in the tmuxide script was somewhat non-trivial (well, for me at least).
I'll appreciate any thoughts and ideas for improvement.
Edit: more descriptive title.
Last edited by flannelhead (2015-01-29 21:04:35)

You might try a third-party utility such as Witch to create window sets that can be configured and restored. Look for it and others at VersionTracker or MacUpdate.

Similar Messages

  • My iTunes, whenever I try to open it, come up with a window that says iTunes has encountered a problem and now has to close sorry for the inconvienence.

    My iTunes, whenever I try to open it, come up with a window that saysiTunes has encountered a problem and now has to close sorry for theinconvienence.

    Generate another of those errors, and click the "Click here" link in the error message box.
    What modname and modver do you see for the error? (Precise spelling, please.)
    If the error is a BEX and you thus aren't seeing a modname or modver, let us know what P1 through P9 items are being listed for the error.

  • HT2506 Hello I'm unable to open any pdf's with preview window opens up with message file couldn't be opened because you don't have permission to view it (none of the pdf's have any security thanks if you can assist

    Hello this week I'm unable to open any pdf's with preview, when I select to open a window opens up with message "file couldn't be opened because you don't have permission to view it" none of the pdf's have any security thanks if you can assist

    Back up all data. Don't continue unless you're sure you can restore from a backup, even if you're unable to log in.
    This procedure will unlock all your user files (not system files) and reset their ownership and access-control lists to the default. If you've set special values for those attributes on any of your files, they will be reverted. In that case, either stop here, or be prepared to recreate the settings if necessary. Do so only after verifying that those settings didn't cause the problem. If none of this is meaningful to you, you don't need to worry about it.
    Step 1
    If you have more than one user account, and the one in question is not an administrator account, then temporarily promote it to administrator status in the Users & Groups preference pane. To do that, unlock the preference pane using the credentials of an administrator, check the box marked Allow user to administer this computer, then reboot. You can demote the problem account back to standard status when this step has been completed.
    Triple-click the following line to select it. Copy the selected text to the Clipboard (command-C):
    { sudo chflags -R nouchg,nouappnd ~ $TMPDIR.. ; sudo chown -R $UID:staff ~ $_ ; sudo chmod -R u+rwX ~ $_ ; chmod -R -N ~ $_ ; } 2> /dev/null
    Launch the Terminal application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad. Click Utilities, then Terminal in the icon grid.
    Paste into the Terminal window (command-V). You'll be prompted for your login password. Nothing will be displayed when you type it. You may get a one-time warning to be careful. If you don’t have a login password, you’ll need to set one before you can run the command. If you see a message that your username "is not in the sudoers file," then you're not logged in as an administrator.
    The command will take a noticeable amount of time to run. Wait for a new line ending in a dollar sign (“$”) to appear, then quit Terminal.
    Step 2 (optional)
    Take this step only if you have trouble with Step 1 or if it doesn't solve the problem.
    Boot into Recovery. When the OS X Utilities screen appears, select
    Utilities ▹ Terminal
    from the menu bar. A Terminal window will open.
    In the Terminal window, type this:
    res
    Press the tab key. The partial command you typed will automatically be completed to this:
    resetpassword
    Press return. A Reset Password window will open. You’re not  going to reset a password.
    Select your boot volume ("Macintosh HD," unless you gave it a different name) if not already selected.
    Select your username from the menu labeled Select the user account if not already selected.
    Under Reset Home Directory Permissions and ACLs, click the Reset button.
    Select
     ▹ Restart
    from the menu bar.

  • P6.2.1 after opening project, some activites with non-zero dur. now show 0d

    Hi,
    I was wondering if anyone experienced this issue.
    After opening project, some activities that were previously non-zero durations are now showing zero durations.
    Can not seem to find the reason for this. We are not importing from Excel spreadsheets.
    Anyone had similar experiences?

    Hi
    Please check if the original duration or the remaining duration has turned zero.
    To avoid this in future, Go to the Projects Window, Select your project. Go to the Settings tab in the details window. Put the tick ON for 'Link Budget & At completion values'
    Hope this solves.
    Edited by: Rikesh on Mar 18, 2010 3:34 PM

  • When I open some PDF files with my Windows 7 PC I just see garbled font instead of the actual text. I have installed the latest version of Reader and restarted my PC. Any help?

    I received some PDFs from a vendor and when I open them the font it garbled. If I go to a different PC it is fine. I use Windows 7 and have updated my version of Reader and restarted the PC. Any ideas on how to fix it?

    Are you sure that your PDF opens in Adobe Reader, and not some other application like Microsoft Word?
    Can you post a screenshot of what you see: https://forums.adobe.com/thread/1070933

  • View with split window

    Hi,
    is there a way to create a view where the top side of the screen in a pre-defined view and the bottom is another pre-defined view?
    what I noticed in my work is that when I change the bottom view (e.g. Task form view) it stays when I change the top one.
    thanks,
    Yuval

    Hello,
    Yes you can, you need to create a combination view in Project. See an example here:
    http://ntrajkovski.com/2012/02/02/customizing-views-in-ms-project-2010-part-2/
    Paul
    Paul Mather | Twitter |
    http://pwmather.wordpress.com | CPS

  • Excel Split Window function

    Have imported an Excel speadsheet and am trying to freeze column titles so that they remain as you scroll down what is a large spreadsheet.
    Could do in Excel with "split window", but can't see any way of doing this in numbers.
    Any ideas gratefully received

    THIS IS NOT A "TRUE" SOLUTION TO THIS PROBLEM....but,
    I am a teacher and I use my computer to take care of my attendance. I had been using NeoOffice and it has the split-window feature...Numbers doesn't. Normally, I have had the dates string along from left to right from say Aug---Dec. This meant that i had to use the split window to keep track of whose name I was using. I decided to try and turn my spreadsheet around. Each week I add 5 more days to the left side of the table, nest to the names. Thus, I can keep track of the name and not lose the date. It is not the best solution, but it is an easy workaround. Provided your spreadsheet isn't huge already. The school year for me has just started so I only had two weeks of data to cut-and-paste to the "backwards" spreadsheet.
    Grades posed a similar problem. The grading template provided by Apple didn't cut it for my system. Besides, if you use their templates, as provided, the split-window problem quickly rears its ugly head. I had created a NeoOffice spreadsheet that contained Homework, Quizes, and Test information. This was not really workable in Numbers. So, I created a "sheet" with three tables each. One for homework, quizes, and tests respectively. This is working out quite well. I am also adding the new assignements to the left, not on the right as was my custom, next to the names of the students. This seems to be working quite well. Check with me towads the end of the semester to see if Numbers is still working for me....hahaha. Until Apple resolves this split-window problem I will continue to be cautious using Numbers. But, to their credit the multiple tables on one sheet works much better here than anything else I have tried. Plus, I really like the simplicity of Numbers.
    Good Luck.

  • Launching VB6 Editor after installing Visual Studio 2013 results in "Please wait while Windows configures Microsoft Visual Studio..."

    I have had various versions of Visual Studio installed beside Visual Basic 6.0 Enterprise for some time with no problems, most recently Visual Studio 2012 Premium.
    I recently installed Visual Studio 2013 Premium, and now every time I open VB6 I get a dialog that says "Please wait while Windows configures Microsoft Visual Studio Professional 2013" that shows a progress bar. After it finishes (30 seconds or
    so), it launches again and again and finally VB6 will open. This happens with each instance of VB6, regardless if I've already done it once and never run VS2013 in between.
    If I cancel the dialog, I get this error message in a dialog: "Error 1712. One or more of the files required to restore your computer to its previous state could not be found. Restoration will not be possible." Several more "Please wait"...
    dialogs will appear and if I continue to cancel, eventually I'll get the VB6 editor. It appear to work fine despite the error messages.
    It seems to me that the VS2013 installer flagged some dll's or other files to be rolled back whenever starting VB6. It doesn't appear to be necessary, and I'd like to avoid playing the "Please wait" wack-a-cancel-button game before launching each
    instance of VB6 (or waiting several minutes for no reason). So how do I fix this?
    Note: I've seen something similar happen in Outlook on a different PC when upgrading from 2010 to 2013. The same sort of "Please wait"... dialog would appear each time I opened Outlook. Judging by the "similar" questions that popped up when
    entering this forum post, I'd say this is a general problem with upgrading older versions or installing newer versions of major Microsoft software side-by-side.
    /* Don Reynolds */

    I found the answer!
    I was having the exact same issue, and I was search for a solution and I happened across the following thread: http://social.msdn.microsoft.com/Forums/en-US/f4b0fd38-f4f9-41ea-bd8d-834203a175d2/building-visual-studio-2010-project-triggers-please-wait-while-windows-configures-visual-studio?forum=vssetup&prof=required
    Scroll a small bit down, and there is a post by Barry Wang explaining that you need to use event viewer to find out what is missing. Anyway, I opened event viewer, then open VS 6, then hit refresh in the event viewer (under Windows Logs -> Application)
    and saw a warning message from MsiInstaller. It gave me the following message:
    Detection of product '{9C593464-7F2F-37B3-89F8-7E894E3B09EA}', feature 'Visual_Studio_Professional_x86_enu', component '{E3FF99AA-78B9-4A06-8A74-869E9F65E1FE}' failed.  The resource 'C:\WINDOWS\Microsoft.NET\Framework\URTInstallPath_GAC\' does
    not exist.
    I opened an elevated command prompt, I navigated to the C:\WINDOWS\Microsoft.NET\Framework folder and verified that 'URTInstallPath_GAC' didn't exist, and then I did "md URTInstallPath_GAC".
    Closed and reopened VS 6, and it instantly opened - no "Please wait" message.
    Now this may or may not be the same problem you are having (problem is - I have had it happen on two separate computers now with VS 6 and VS 2013 installed), but it should point you in the right direction. In fact, you should be able to use the Event Viewer
    for anytime the "Please wait" message shows up for any application, and then once there find out what is really missing.

  • T61p - Please wait while Windows configures Client Security Password - Manager

    My T61p system is fully updated, however I continue to get "Please with while windows configures Client Security Password - Manager." and then the computer trys to install
    css_manager_vista_tpm.exe
    over and over again.
    What is the problem here and how can I solve?
    How can I contact Lenovo-Thinkpad to assist?
    The problem has reoccured even after I did a system restore to an earlier date.
    It seems to initiate when I first boot up and then open up "Pictures"
    Please help.
    Thanks

    Well, I take everything back. After removing all password entries and re-installing/rebooting, it worked for a while. But now it is doing it all over again. I tried to call techincal support, but they then said I would have to pay for software support and they only support hardware, and to re-install the OS. Great, jeez, I couldn't have tried that myself, and that is so simple and takes no time at all (detecing sarcasm yet?)
    I do a lot of work for large corporations that are watching the IBM=>Lenovo takeover very closely to see if they are going to drop Thinkpads altogether and go with another laptop vendor. This type of weak support does not bode well. The person I was on the phone with was rude, hard to understand, and even told me there was no place to escalate the call to.
    There is no replacement for customer support. It is sad to see no Lenovo involvement in this forum, and don't make the mistake of thinking this is an isolated problem at this time. It is growing.
    Though Thinkpads are great Laptops, Toshiba used to have the market, but their support or should I say lack of it led to their downfall and position of leadership loss.
    It will be no different if Lenovo continues to act like a machine churner.

  • My project is finish with final cut 4 when i  export on quick time a window open and says (error 34 ) is anyone knows what is the problem tanks DENIS

    my project is finish with final cut 4 when i export via quick time a window open and says (error  34 ) what is the problem .
    i've made many transfers before and every time it was excellent thanks   denis

    Is the external formatted tmac OS Extended?
    It should be.
    Al

  • Going back and forth with open projects

    Using Motion 4, is there a quick way to toggle quickly between open projects?
    (aside from going to window menu, and switching there)

    Kinda works? I use Command-~ all the time, does it not work for you? The only thing you need to be aware of is that it also changes focus between the Utility pane and the Canvas of the current project (which is itself quite handy) so you have to press it two times to get to another open project.

  • Unable to Open Project with RoboHelp 9

    I've been working on a project using RoboHelp 9. Last night when I attempted to save RoboHelp froze. Looking at the CPU usage in task manager I saw it was still hovering between 45 and 50% CPU usage. Seeing as it was the end of the day anyway, I decided to leave the program running overnight in the hopes that it would eventually unfreeze.
    When I came in this morning it was in the same frozen state, still using between 45 and 50% of the CPU. So I used end task to stop the program from running and tried to re-open the project. The project tried to open but froze during loading.
    After consulting the forums I made a back-up of my project directory and deleted the CPD file. The project hung again on open (though it created a new CPD file was slightly smaller than the original CPD file).
    I restored from backup and tried to open from the XPJ file but had no luck.
    Restoring from backup again, I deleted the CPD and XPJ files and tried to open the HHP file with similar results.
    Other projects are working fine so I created a new project and attempted to import the HTML file (a file which opens fine in Firefox) and it also causes the project to hang.
    A bit of additional info:
    I'm running the project on a local drive on Windows 7 32 bit edition.
    Does anyone have any ideas for next steps I should try? I really don't want to have to restart the project from scratch.

    Hello Peter.
    Thanks for the speedy reply.
    I have rebooted my system to no effect. I also am able to work on sample projects (adding and removing content, modifying topics, saving, generating output, etc) without any issue.
    I tried the items you talked about on your Opening Projects page that I hadn't already tried. I even tried deleting the HHP file and using the HHP file to generate a new one in the hopes I might luck out but it also hung. It did create a new XPJ file that would open but all the content was missing (I could see the table of contents but the links were all x'd out because the page they were pointing to wasn't being loaded).
    One thing I have noticed is that most (though not all) of the times I try to load the project and it hangs it hangs out "Loading topic files" (other times it hangs without any text indicating what it is doing).

  • Problem opening PrE 9 project created on Mac in Windows

    Hi, I recently migrated from a Mac to Windows 7, and am having problems opening my project files on the Windows computer. I created several PrE9 projects on my Mac, but now I need to open some of these files on a PC with Windows 7. I get the error message "The project is not compatible with current version of Premiere Elements." I have successfully opened other CS5 project files (AI, PS) on both platforms. This is the first I've seen Adobe files open on Mac but not PC.
    So, assuming this is going to be impossible, can I export from the Mac version of PrE to Windows? Is cross-platform collaboration impossible with PrE 9? That doesn't seem likely. What am I missing?
    I have some title animations that I created on the Mac that I would really like to reuse in new Windows projects moving forward. I hope I don't have to recreate them from scratch!
    Thanks for any help.

    Unfortunately, project files created on the Mac platform are not compatible with the Windows version of the product and vice versa.
    You can't work on the same project file on both a Mac and a PC. Sorry.

  • How do I open projects created using Premier Elements 8 with Premier Elements 13

    how do I open projects created using Premier Elements 8 with Premier Elements 13

    ATR
    The DVD Creator.dll file was in the proper location but I could not find a Run As Administrator Option.
    I did delete Prefs file and try again to open the app then the project and received the same problem.  And the scratch disks were all directed to the Elements 13 path
    Yesterday I did try additional solutions
    Removed the Elements 13 App vis the Control Panel, copy the original downloaded .zip File to the Desktop and reload the entire application with no success solving the problem
    In addition to that I contacted a site called Rescue.com? and the guy told me that he was a representative of Adobe, which I was not sure was the truth.  He looked at my system and told me that Premier 13 was not compatible with Windows 7.  I called BS on him told him that Adobe site said it was compatible and he told me I had a Trojan on my system and he would refund my money for Elements 13 and sell me version 12, which would be compatible, along with a better security system than the Norton 360 I told him I had.  At that point I immediately terminated our communications and called Norton to have additional checks performed to ensure no additions were added to my system.  They had me download and run Power Eraser from them and it found nothing wrong. 
    I also temporarily turned off the firewall and tried to use the Elements 13 but had no success.
    I also went to Microsoft Windows site and searched for the Exception code: 0xc0000005 that was displayed in the event viewer and they indicated there was a hotfix available and they would email me that fix.  ave not received the email yet.
    I’m getting very frustrated but thank you for your help.  I will update you with and additional results or actions I get or perform.
    GDBMB

  • Problems with opening Project Bin

    I'm a new user of Photoshop Elements 6 for Mac.   I do not use it with the organizer but keep my photos in iPhoto or elsewhere on the hard drive of my MacBook Pro. 
    When I open two images to to work on them at the same time the project bin does not open.   I can see the arrow on the left hand bottom with Project bin next to it but I cannot get it to open when I click on it.  Similarly when I click on Project Bin in the drop down menu, nothing happens.  I did have it working once so assume I have done something idiotic.  Consulation with my "fat book" yields no solution.  I have not changed the preferences at all.
    Any suggestions or even a solution would be gratefully received.

    Hi.  I had given up on anyone replying to this query so thank you.
    Yes the project bin works in the Window drop down menu, toggling back and forth, but that is not very satisfactory,  unless the labels for the photos are very descriptive and not much use if you have three or four images, labelled image 1734 etc.  To see each image is almost essential.
    Version 6 has only the reset palette locations and not the reset panel options.
    I can see the show project bin with the arrow in the lower left hand corner of the screen, but it does not toggle with the hide the project bin as it should.   I can't see anything relevant in the preferences to change,  but I know I have worked with it open before.  I am assuming I have done something "bad" to cause this but have no idea what.
    Thanks for trying to help.

Maybe you are looking for

  • How to create adf component dynamically from backing bean

    Hi i,am using dev 11g ver2.. my requirement is to create a popup like an lov , i need to create adf controls at the run time based on datatype of the table field Edited by: [email protected] on Jul 9, 2009 3:56 AM

  • I didn't sync my iphone and I lost my passcode

    I didn't syinc my iPhone to my computer and lost my passcode. My iPhone is now disabled and it says to connect to iTunes. I can not connect to iTunes because it is locked and not synced with my computer. Please help!

  • PDF Links within Internet Explorer

    None of my "external" PDF links work when I view PDFs within Internet Explorer. I am running Acrobat 9.3 and IE 8, any ideas why this could be occuring? The links work fine when viewing the PDF within Acrobat. Thanks! R. Sloan

  • ITunes Library is not organized

    My itunes library seems to have suddenly been unorganized. It used to be in alphabetical order, but it seems to have broken up the library. Some are still grouped in order, but most of my songs are all out of order. How could this of happened and how

  • Is it really true that EA CC 2014 does NOT support multiple animations on a single page?

    My page has multiple animations that I have spent days designing, and now my developer is telling me we can only use one.  Is this seriously true?  A lack of detail on this issue will surely drive me to use another product like Hype or Google... http