![]() I can even yank it from another session using the : syntax. For this, I would use join-pane -t 1 (assuming it's number is 1, I could also use it's name). One example I use occasionally is pulling in the window containing the rails server into my dev window so I can access the binding.pry session for debugging. Once again using that cryptic -t/-s syntax, you can do some useful things with it. One neat trick you can do, is pulling a window into your current setup as a pane using join-pane. Of course, moving between panes is usually tmux-, but in my polka config I've set it to the vim keybindings, naturally. I tend to keep things fairly simple w/ only one or two splits, so I haven't dived heavily into this yet. More useful is the select layout options available by using tmux- options, letting you select a variety of layouts. You can rotate your splits around using tmux-space, though I've never found a good use for it. Horizontal splits are tmux-", and vertical are tmux-%. Splits are usually the reason people find tmux in the first place, as the version of GNU screen that OSX ships with doesn't do vertical splits for some unknown reason. No more juggling the irc window, I can simply have it everywhere. That means I can have the same shell, or the same program shared between multiple sessions. If you invoke the tmux console, type in link-window, and you can share a window between two sessions, using the same target/source syntax as move. So I've been juggling my irc channel around for a couple of months, before I stumbled on link-window. By default, tmux accepts your current window as the argument, but you can move a window you are not currently on by using the -t -s arguments to specify the target and source of the move. to get the same thing, then pass the argument bar:irssi. If I want to move a window containing my irc session (named irssi) from my current session foo to the new context session I've created ( bar), I can either invoke the console and type out :move-window or type tmux. I used to think that move window only let you set a new order number for your window, but I have since learned that you can pass windows between sessions fairly easily using the : syntax. is move window, and tmux- lets you jump around your first ten windows. By default, tmux-, is rename window, tmux. You can refer to them in tmux by name or number, which is kind of handy. ![]() They live in the bar at the bottom of the screen, ordered by their sort number. Windows in tmux have a name, and a sort number. Super simple, every time I need a new session now I simply tmux-: to get the tmux console, type :new, then cd to the folder I need, and run tspace to name it after the project and set the folder defaults. I got tired of doing this every time I made a context switch, so I wrote a little script to do this for me. ![]() This last command means that any split or new window inside that session opens in your current folder, which is handy for making a split so you can run a rake task or a script console for your rails project. You can switch between sessions using tmux-s, rename them using tmux-$, and set their default folder by running tmux set default-folder $(pwd) inside the session. sessionsīecause I tend to isolate projects to a single session, allowing me to have a complete context switch when needed, I tend to name them the project I am working on, and force their default folder to the project folder. Never forget that you always have access to your current shortcuts by typing tmux-?. When I refer to starting the tmux console, I mean keying in tmux. My tmux config can be found here, and there are some other theme settings here. For the course of this article, I will use tmux+ to avoid confusion when describing tmux shortcuts. I recently have been digging into some of the neater features in tmux's layout system, and here's what I've come up with to help me work harder better faster stronger.Ī couple notes: I have set the tmux key to be ctrl-g, but you can use whatever you want. Windows and panes I use as is convenient. I use sessions to separate workspaces, almost like the spaces in osx. Windows and panes are to a certain degree interchangeable as we will see, but sessions are fairly immutable. Sessions are groups of windows, and a window is a layout of panes. Tmux has three levels of hierarchy when it comes to organizing views: Sessions, windows, and panes.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |