The difference here is that I’m using parentheses to tell tmux to execute a bash command. Set -g status-right '##(tmux-mem-cpu-load -g 5 -interval 2) ' Then to display the name of the window I’m using #I, which is a short-hand for the window_index variable and #W, which is short for window_nameĪlmost done! status-right should look pretty familiar now. In order to get the style to work I have to toggle the foreground and background colours before and after the . I wanted to have triangular shapes delineating my windows similar to what Vim Powerline does. This looks similar to what we have above, but there’s some style tricks we need to do. set -g window-status-current-format "##I #W #" window-status-format is where things get more interesting. Here I’ve set the default window status to blend in to the rest of the status bar and the active window to be purple with white text. Set-window-option -g window-status-current-style fg='#ff79c6',bg='#282a36' Set-window-option -g window-status-style fg='#bd93f9',bg=default This time, I’m displaying an arrow if I’ve zoomed one of my panes to take up the whole window. # are we controlling tmux or the content of the panes? It tells tmux to refresh the status line every second.Īll right, now for status-left. The next line is important for what we’re going to do with status-right later. Although, the purple will get overwritten later. Here we set the background to a dark grey and the foreground to purple. All of the window-status directives style these tabs. You can think of these like tabs in iTerm. Remember how I said that tmux has multiple windows. status-left, window-status and status-right. The status line is comprised of three parts. I kept this similar to the status bar, with a grey background and blue text. But this gets covered up by the tmux command line and any messages from tmux. Message StyleĪt the bottom of a tmux window, you’ll see the status bar. These two styles tell tmux to make all the boarders dark purple, but if my cursor is in a window, make that pane’s borders pink. The attributes is either none or a comma-delimited list of one or more of: bright (or bold), dim, underscore, blink, reverse, hidden, italics, or strikethrough to turn an attribute on, or an attribute prefixed with no to turn one off. The tmux docs gives a list of all the attributes you can use: tumx style directives are a comma-separated list of styles for foreground, fg, and background bg.įg and bg each accept a colour and a list of attributes. The default border colour is Dracula’s dark purple comment colour. Set -g pane-active-border-style fg='#ff79c6' If you’re familiar with iTerm, think of panes like a horizontal or vertical split. Each pane is a separate terminal session and each window can have one or more terminal sessions. Set -g default-terminal "screen-256color"Ī tmux session can have windows and windows have panes. tmux supports passing hex codes in to the configs, but it will convert the hex code to the closest 256color. You’ll notice that I’m using the hex codes for these colours. Then, lets tell tmux to use a terminal that supports colours. But first, this is what it looks like! □įirst, I wanted all the hex codes for Dracula colours right in front of me so I didn’t have to keep switching to a browser window. Here’s how I approached writing a theme in my tmux config. When I switched Vim over to Dracula, I immediately realized that I needed to change my tmux colours too! I dove head first into this environment and got used to it pretty quickly, but I never spent much time configuring it. Love it or hate it, I’ve been working with Vim and tmux for the past two years and I inherited my Vim and tmux configurations from someone else. I recently decided to use the Dracula in my coding environment.
0 Comments
Leave a Reply. |