cd /var/log # run multiple commands in this pane cd ~/ # run as a first command in all panes And then tmuxp load path/to/dirĪ sample YAML configuration with 4 panes: tmuxp.yaml in a project or directory (so you can store configs in a VCS per-project / folder. So $HOME/.tmuxp/ myconfig.yaml would be loadable via tmuxp load myconfig. Files inside can be loaded via filename, e.g. tmuxp checks for files in $XDG_CONFIG_HOME/tmuxp (usually $HOME/.config/tmuxp), and $TMUXP_CONFIGDIR path (default $HOME/.tmuxp).Via absolute or relative file path tmuxp load file, tmuxp load.You can put configurations in any directory to access them via 3 ways: The YAML markup is similar to tmuxinator's. Tmuxp accepts both JSON and YAML configurations. If you have any questions about my set up, or would like me to detail any of the other aspects of my workflow, you can find me on Twitter or email.Tmuxp is a session manager for the tmux terminal multiplexer. I keep these in a privately hosted repository because they disclose some internals about projects that I'm not permitted to disclose. My own config files are available in my dotfiles repo, with the exception of my tmuxinator project definitions. If you're interested in exploring this further, the tmuxinator README is comprehensive. Hopefully this gives you a taste of a modern terminal-based workflow. In practice I've found that most of the projects I work on have too many nuances for this to be useful though. For example, you might define a tmuxinator project called "laravel" and use that one definition for any Laravel project you work on. It is also possible to define a project as a template and start multiple tmux sessions from that one definition. Alternatively, you can configure your own custom window layout. If you like splitting your windows into panes, tmuxinator comes with a decent set of preset layouts you might like to explore. If I run the above command and the project is already running, it will simply attach to the existing session. I can close my terminal window at any time and it will automatically detach. If the project isn't already running, it will first make sure Homestead is up, and then it will start a new tmux session with my chosen name and the windows and processes I have configured. It allows me to type that quick command and have everything ready to go.Īfter installing Tmuxinator, you can define a project using: Tmuxinator bills itself by saying "Create and manage tmux sessions easily". I just want to think about the project I want to work on, type a quick command, and have everything ready to go. I don't want to have to think about that or start anything manually, especially when I'm ready to dive right into the code. Starting a session and opening windows in tmux is easy, but it's a pain remembering which specific processes I need to start for each project, especially for those I only work on sporadically. I don't often divide windows into panes but there are times when it can be useful. Within that session I will typically have one window (tab) for each process. I like to start a separate tmux session for each project that I work on. Switching between sessions shows you a preview of each window in the session. You can "detach" from tmux and it will keep everything running in the background for you to reattach to later (perhaps from a different terminal!). These programs can be divided into different sessions, windows (tabs), and panes. Tmux is a "terminal multiplexer" which basically means that it allows you run multiple programs within a single terminal and switch between them all. To manage all of these different projects and their respective CLI programs, I like to use tmux, with the assistance of tmuxinator. In fact, the only desktop apps I often have open are a terminal and a web browser. Personally I like a lot of terminal or CLI (command line interface) programs. Other projects might be using Docker or Homestead, Gulp instead of Webpack. My static website, for example, requires the Jigsaw server, Webpack, a text editor, and a shell. Not every project requires the same set of tools either. Development server such a Vagrant, Docker, or perhaps simply artisan serve.A modern web development workflow has quite a few moving parts and might require a combination of: Often I need to be able to quickly start and switch between projects. Like many developers, I work on quite a few different code bases between my job and my side projects. Just a heads up this this article is over 12 months old and might be out of date!
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |