Tmux iterm panes11/27/2023 Set -g pane-border-indicators both # Displays arrows pointing to the current pane. # More explicit options that I find a bit excessive Since tmux 3.3 (released Jun 1, 2022, so it may not have propagated to all distributions yet), there are new options to help disambiguate which pane is active (though these don't change the background color specifically): # I find this together with default coloring of the active pane border sufficient You can, of course, use a different window-style (e.g. The lack of -g inside the hook is important (the subtle bug that prevents is left as an exercise to a reader interested in tmux arcana). ![]() I am not sure if set focus-events on is necessary. The last three lines may require a recent version of tmux (I use tmux 3.3),Īnd mark all panes inactive when the terminal window is not focused. Set-hook -g client-focus-out "set window-active-style 'fg=terminal,bg=black'" 1 Answer Sorted by: 1 Agree this is annoying behaviour. ![]() Set-hook -g client-focus-in "set window-active-style 'fg=terminal,bg=terminal'" Set -g window-style 'fg=terminal,bg=black' Set -g window-active-style 'fg=terminal,bg=terminal' # Use `white` instead of `black` for light themes. # "Nord" or "Tango dark" themes do this out of the box. # different colors for `background` vs `black` (AKA `color0`). I like this variation of : # Make sure your 16-color terminal theme uses slightly Hi LineNr guifg=#e6e1de ctermfg=none gui=none What I use in my vim colourscheme is the following (you need to find and edit the colourscheme file): hi Normal guifg=#e6e1de ctermfg=none gui=none However, changing this line to: hi Normal ctermfg=lightgreen guifg=lightgreenĮDIT July 2019 Augusto provided a good suggestion for also changing the background colour for the line numbers. nf and map tmux actions to those keybindings. As an example, the "inactive colouring" does not work with the murphy colourscheme, because in murphy.vim there is the line: hi Normal ctermbg=Black ctermfg=lightgreen guibg=Black guifg=lightgreen The idea is to map keystrokes in iTerm to trigger tmux actions. To make it work with your own custom Vim colourscheme, make sure that the setting for Normal highlighting does not have ctermbg or guibg specified. You will probably find that (e.g.) Up and Control - Up both generate the same sequence. Try running cat and typing the keys into it (Control-C to quit). I hadn't seen the window-style and window-active-style commands before, but maybe they were available in previous tmux versions.Īlso, these two lines are pretty useful for splitting panes easily: bind | split-window -hĮDIT: as Jamie Schembri mentions in the comments, tmux version 2.1 (at least) will now be installed with: brew install tmuxĮDIT (Oct 2017): brew now installs tmux 2.6, and the above still works.ĮDIT Vim panes: If you find that the "inactive colouring" does not work with a Vim pane, it might be due to the colourscheme you are using. 54 Probably your terminal is not sending a (distinct) sequence when you hold Control and press an arrow key. Set -g pane-active-border-style 'fg=colour51,bg=colour236' Set -g pane-border-style 'fg=colour235,bg=colour238' Set -g window-active-style 'fg=colour250,bg=black' Set -g window-style 'fg=colour247,bg=colour236' ![]() To answer the original question, I use the following lines in my ~/.nf for setting the background/foreground colours to mimic the behaviour in iTerm: #set inactive/active window styles to change pane 1's foreground (text) to blue and background to red use: select-pane -t.1 -P 'fg=blue,bg=red' From the changelog: * 'select-pane' now understands '-P' to set window/pane background colours.Į.g. You can access this from within a tmux session with : list-panes -aįor example, if you need to pass a command to all panes that have vim running, you can do something like: tmux list-panes -aF "# C-[ ":so ~/.vimrc" C-m takes the pane IDs output by awk and for each pane ID, it sends the keys (to ensure we're in normal mode), :so ~/.vimrc (the command to reload the vimrc file), and (to execute the command) to that pane.It seems that tmux-2.1 (released 18 October 2015) now allows the colours of individual panes to be specified.
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |