You are not logged in.
i would like to map F11 and F12 to do previous-window and next-window, how do i do that?
bind-key -n F11 prev
bind-key -n F12 next
Offline
How do we predefine loading a certain vim file, or any string, or a vncviewer command using the code below or something else, in .tumx.conf?
neww -d -nvim 'vim sometextfile'
setw -t0:8 aggressive-resize on
neww -d -nvnc 'vncviewer 192.168.0.104'
setw -t0:9 aggressive-resize on
Right now everything's loading when PC is booted using .xinitrc which is fabulous.
Haven't deduced how to do the above type of thing yet.
UPDATE: this works. I took a better look at the example files. Specifically NicM's.
http://tmux.cvs.sourceforge.net/viewvc/ … iew=markup
neww -d -nvim 'exec vim ~/sometextfile'
Note: don't know if the 'exec' to run specific files.
Last edited by yvonney (2010-04-20 23:41:14)
Offline
rent0n wrote:So what key combination do I have to enter to scroll back/forward? Maybe I need to enter a 'scroll mode' before?
Yes. you've to enter the 'copy mode' which is triggered by default by pressing <Prefix-key> + [
See section 'Windows and Panes' in the man page.
Yep, that's it! I knew I was missing something...
rent0n@deviantART | rent0n@bitbucket | rent0n@identi.ca | LRU #337812
aspire: Acer Aspire 5920 Arch Linux x86_64 | beetle: Gericom Beetle G733 Arch Linux i686
Offline
OBJECTIVE: have my currently nicely autoloading .tmux.conf auto-add a window
with 2 panes instead of the usual single pane in one window. ie. one split.
tmux now loads up bunches of apps beautifully via .xinitrc on boot.
urxvt -e bash -c "tmux attach -d -t 0" & ## where '0' is the session name I think, so could be anything there
yet it relates to the -s0 in my conf below so they'd have to be the same, I think, probably.
Then the conf load all this up. (plus it can do linked loads to other sessions)
.tmux.conf ## taken from NicM the dev's great example file. See my post above for where original is.
# First session
new -d -s0 -nranger 'ranger'
# setw -t0:0 monitor-activity on
setw -t0:0 aggressive-resize on
neww -d -nmutt 'mutt'
setw -t0:1 aggressive-resize on
neww -d -nirssi 'irssi'
setw -t0:2 aggressive-resize on
neww -d -nncmpcpp 'ncmpcpp'
setw -t0:3 aggressive-resize on
neww -d -nnewsbeuter 'newsbeuter'
setw -t0:4 aggressive-resize on
Anyone know how to have, say, the mutt window open with mutt on the left 3/4's of the window
and another pane in the same mutt window that has, say, a bash prompt, taking up the right 1/4 of the window?
Have been advised generally that an addition to the .tmux.conf should likely make this happen.
Anyone know how? I've read the manual though not well enough I think.
Hope it's not already been cover. I did have a search for 'pane' in all 5 pages though not that thoroughly.
Last edited by yvonney (2010-04-29 02:12:15)
Offline
Anyone know how to have, say, the mutt window open with mutt on the left 3/4's of the window
and another pane in the same mutt window that has, say, a bash prompt, taking up the right 1/4 of the window?
With your config, I think something like this might do what you want:
tmux splitw -h -d -p 25 -t 0:1;
Offline
Happy about that! So, where would I put some of that or similar in my .tmux.conf from my above conf as posted.
Confused about why it as the semi-colon and starts with tmux.
Was about to give it a try and will do in morning.
Is a semi-colon OK I wonder for the .tmux.conf and can any line in it start with tmux.
I'll attempt though though to ask.
looking forward to trying. Must be possible then. great!
UPDATE: WORK! had to try it. just left of semi-colon (coulda worked with it of course - didn't try)
And, just had my conf like this (part of it from above with your FANTASTIC line added):
neww -d -nmutt 'mutt'
setw -t0:1 aggressive-resize on
splitw -h -d -p 25 -t 0:1
UPDATE 2: In your 'splitw' line I changed the 25 to 10 and then 5 and then 2. The right side pane does get more narrow.
And it is fine enough taking up about 25 percent of windows whether I put 2, 5, or 10 it seems. Is there something I'm missing as to
why change 25 to smaller numbers doesn't narror the right pane in a linear way?
I'm guessing I've missed something or the 25 relates in some other way.
UPDATE 3: ah! maybe it's the aggresive-resize that affecting it?
UPDATE 4: well, so far even turning off aggressive-resize doesn't give small right pane for lower numbers.
I just set the aggressive-resize on to off.
NOTE: oh yeah, for anyone trying all this restarting X won't update your tmux session by re-reading the conf.
I do a 'killall tmux' which does restart the session anew based on the .xinitrc line i used of course. (above post)
There may be a better way to do this quite possibly.
So, I do a cntl-alt-delete to crash out of xmonad and X, then a killall tmux at prompt, then startx.
Slight aside: tmux is just so so so 'the best'
http://old.nabble.com/Colors-and-layout … 51045.html ## almost a year old.
I think it's improved the split features yet interesting bits.
Last edited by yvonney (2010-04-29 10:31:51)
Offline
Confused about why it as the semi-colon and starts with tmux.
Sorry I just copy/paste what I wrote on the command line and forgot to edit it correctly.
UPDATE 2: In your 'splitw' line I changed the 25 to 10 and then 5 and then 2. The right side pane does get more narrow.
And it is fine enough taking up about 25 percent of windows whether I put 2, 5, or 10 it seems. Is there something I'm missing as to
why change 25 to smaller numbers doesn't narror the right pane in a linear way?
I'm guessing I've missed something or the 25 relates in some other way.UPDATE 3: ah! maybe it's the aggresive-resize that affecting it?
Must be as you say because it works fine for me.
NOTE: oh yeah, for anyone trying all this restarting X won't update your tmux session by re-reading the conf.
I do a 'killall tmux' which does restart the session anew based on the .xinitrc line i used of course. (above post)
There may be a better way to do this quite possibly.
Or you could use
tmux kill-server
Last edited by jiyuu (2010-04-29 10:35:09)
Offline
nice jiyuu... this is a big one i like!
um, so you're saying that the 25 is 25 percent of your 2nd right side pane, then 15 is 15 percent, then, 10 is 10 percent?
And so, it IS set to create pane on right side I guess.
And maybe it's 'cause i use .xinitrc to start, or that my conf has other stuff in it that holding back the width from decreasing as
I decrease the numbers.
Or, maybe a restart and deleting the session will change it like yours.
You have a different conf, and you're not using an .xinitrc to start tmux.
The above's all just a quick few thoughts as questions, guesses, or ponderings.
i'm almost there. This one is great. thank you.
Offline
um, so you're saying that the 25 is 25 percent of your 2nd right side pane, then 15 is 15 percent, then, 10 is 10 percent?
And so, it IS set to create pane on right side I guess.
Yes. When splitting horizontaly (-h), the new pane always appears at the right of the current pane (at bottom when splitting vertically (-v)) and the percentage given with the option -s is the percentage of the newly created pane.
And maybe it's 'cause i use .xinitrc to start, or that my conf has other stuff in it that holding back the width from decreasing as
I decrease the numbers.
I haven't tested but like you said, maybe the 'aggresive-resize' option mess with the resizing of the pane. Or maybe you have set one of these two options: 'force-height' and 'force-width'
You have a different conf, and you're not using an .xinitrc to start tmux.
The above's all just a quick few thoughts as questions, guesses, or ponderings.
You guess it right. I start tmux manually and my config is only used for key binding and aesthetic.
Offline
Hey, what about yaourt background color? There's something wrong with it. I attach a screenshot showing the difference between yaourt output in both tmux and pure urxvt.
edit: I tried different colors with no difference.
Last edited by vi3dr0 (2010-05-16 23:09:58)
Thinkpad T61p : T7700 | 4GB RAM | nVidia FX 570M | Intel 4965
Arch64 @ Openbox
Offline
Not trying to necro-bump or anything but I just noticed my tmux.conf was being used as partial template on Arch wiki and also being discussed here (not that I think it's anything terribly amazing) but I wanted to let anyone know that I changed my tmux.conf location so any links anyone's posted on here will not work. Here's current tmux.conf address: http://github.com/milomouse/dotfiles/bl … /tmux.conf Glad someone else likes it. I added a few things like resizing and better window direction since last update. Still thinking about adding stuff but don't like to clutter conf's when I can just commence commands.
Last edited by milomouse (2010-07-28 16:30:01)
Offline
How do you sync clipboard?
I have used this with screen (add on .screenrc): bindkey -m > eval "stuff ' '" writebuf "exec sh -c 'xsel -n < /tmp/screen-exchange'"
I've found this on something on this blog:
http://codehunk.wordpress.com/2010/04/1 … y-toolset/
Which use this function on .zshrc: x() { echo $1 | xclip -selection c. }
But nothing is copied to clipboard when I press 'x'. (I have xclip installed)
Last edited by vae77 (2010-08-12 17:46:42)
Offline
I just put that here....
https://wiki.archlinux.org/index.php/Tmux
ktr
Offline
Offline
Hey guys, after spending a frustrating hour or so looking for a complete tmux.conf that explained everything in place (rather than having to flip back and forth to the manpages), I decided to make my own (pulling all info from the wonderful fully documented manpages for tmux-1.3):
Everything is commented out by default & it's only missing some stuff to do with 'Environment' (setenv) and the set -au options, which I don't plan on adding. I am pretty sure it is error free, but no guarantees of course.. I figured y'all might find it useful at any rate
Edit - sorry had to update it since I forgot about a few of the commands probably not applying from .tmux.conf (but haven't tried them so don't know)
Last edited by voighta (2010-09-11 05:14:13)
Offline
very much appreciated. that is most helpful! really nice work.
maybe let us know if you update it or anything. Another look and yeah, that's gonna be really useful.
great!!
Last edited by yvonney (2010-09-11 04:47:24)
Offline
Ok, so I got this problem...
As seen in this screenshot, running tmux in urxvt with <fullscreen>true</fullscreen> in openbox.rc places my statusbar a bit off. I would want it to be in the extreme bottom, not some pixels above it. Is it possible?
I also wonder if the pane-setup I got going can be made when i start tmux.
Oh, and another thing, the statusbar only shows 'multivac' when using urxvt -e tmux and 'username@multivac' when starting urxvt and launching tmux. How come?
Been googleing and reading man tmux for hours without figuring anything out, really.
.tmux.conf
# command prefix (like screen)
set -g prefix F12
bind F12 send-prefix
# basic settings
set-window-option -g mode-keys vi # vi key
set-option -g status-keys vi
set-window-option -g utf8 on # utf8 support
set-window-option -g mode-mouse off # disable mouse
# copy mode to escape key
unbind [
bind Escape copy-mode
# splitting and cycling
set-option -g mouse-select-pane on
unbind %
bind + split-window -h # horizontal split
unbind '"'
bind - split-window -v # vertical split
bind C-j previous-window
bind C-k next-window
# window title
set-option -g set-titles on
set-option -g set-titles-string '#S:#I.#P #W' # window number,program name,active (or not)
set-window-option -g automatic-rename on # auto name
bind v select-layout main-vertical
# messages
#set-window-option -g mode-bg magenta
#set-window-option -g mode-fg black
#set-option -g message-bg magenta
#set-option -g message-fg black
# No visual activity
set -g visual-activity off
set -g visual-bell off
#next tab
bind-key -n C-right next
#previous tab
bind-key -n C-left prev
# status bar
set-option -g status-utf8 on
set-option -g status-justify right
set-option -g status-bg black
set-option -g status-fg cyan
set-option -g status-interval 5
set-option -g status-left-length 30
set-option -g status-left '#[fg=green]» #[fg=green,bold]#T#[default]'
set-option -g status-right '#[fg=cyan]»» #[fg=green,bold]###S #[fg=green]%R %m-%d#(acpi | cut -d ',' -f 2)#[default]'
set-option -g visual-activity on
set-window-option -g monitor-activity on
set-window-option -g window-status-current-fg white
# clock
set-window-option -g clock-mode-colour green
set-window-option -g clock-mode-style 24
Screenshot: http://ompldr.org/vNWxmMg
Would really appreciate some help here...
Offline
As seen in this screenshot, running tmux in urxvt with <fullscreen>true</fullscreen> in openbox.rc places my statusbar a bit off. I would want it to be in the extreme bottom, not some pixels above it. Is it possible?
This might be because while you can (almost) fluently change the size of a X window, a terminal emulator cannot fluently adapt to that, it adapts only in line-height intervals.
(No idea about the other things)
ogion
(my-dotfiles)
"People willing to trade their freedom for temporary security deserve neither and will lose both." - Benjamin Franklin
"Enlightenment is man's leaving his self-caused immaturity." - Immanuel Kant
Offline
Some guys in the irc liked a trick I use with tmux and urlview to grab/browse url's from terminal applications run in tmux (most use it with mutt), so I post it here too for reference (I might add it to the wiki as well if you like it):
bind-key u capture-pane \; save-buffer /tmp/tmux-buffer \; run-shell "$TERMINAL -e 'cat /tmp/tmux-buffer | urlview'"
Last edited by tzervo (2010-09-30 07:20:59)
Offline
@Möller -- -- --
I also wonder if the pane-setup I got going can be made when i start tmux.
Wish I coulda replied a few days ago. Yes, the panes can happen when you start tmux.
Notice this bit below:
splitw -v -d -p 40 -t 0:9
splitw -v -d -p 10 -t 0:9
splitw -v -d -p 20 -t 0:9
splitw -h -d -p 30 -t 0:9
Never really spilt exactly as expected though that's 'cause of my skill-level.
I used a combination of:
.xinitrc
# urxvt -e bash -c "tmux attach -d -t 0" &
and .tmux.conf (this was used and changed from the author's wiki)
it's a mess, just gives you an idea, though first session worked yet I'm not understanding
but the basics.
# First session
new -d -s0 -nranger '~/ranger /usr/bin/ranger'
# setw -t0:0 monitor-activity on
setw -t0:0 aggressive-resize on
neww -d -nmutt 'mutt'
setw -t0:1 aggressive-resize on
# splitw -h -d -p 10 -t 0:1 # resize above was off in tests
neww -d -nirssi 'irssi'
setw -t0:2 aggressive-resize on
neww -d -nncmpcpp 'ncmpcpp'
setw -t0:3 aggressive-resize on
neww -d -nnewsbeuter 'newsbeuter'
setw -t0:4 aggressive-resize on
neww -d -nmcabber 'mcabber'
setw -t0:5 aggressive-resize on
neww -d -nfilestuff 'exec vim -p /file_name'
setw -t0:6 aggressive-resize on
neww -d -njournal 'exec vim -p ~/journal'
setw -t0:7 aggressive-resize on
neww -d -ntext 'vim'
setw -t0:8 aggressive-resize on
neww -d -nvnc 'vnc'
setw -t0:9 aggressive-resize off
splitw -v -d -p 40 -t 0:9
splitw -v -d -p 10 -t 0:9
splitw -v -d -p 20 -t 0:9
splitw -h -d -p 30 -t 0:9
# neww -d -ntest1 'exec vim ~/test1.txt'
# setw -t0:11 aggressive-resize on
# neww -d -ntest2 'exec vim ~/test2.txt'
# setw -t0:12 aggressive-resize on
### Second session.
# new -d -s1 -nappointments 'exec vim ~/file_name'
# setw -t1:0 aggressive-resize on
# neww -d -nranger 'ranger'
# setw -t1:1 aggressive-resize on
# neww -d -ntest3 'exec vim ~/test3.txt'
# setw -t1:2 aggressive-resize on
# neww -d -ntest4 'exec vim ~/test4.txt'
# setw -t1:3 aggressive-resize on
# # Third session.
# neww -d -n 'exec vim ~/text/'
# setw -t2:4 aggressive-resize on
# neww -d -n 'exec vim ~/text/'
# setw -t2:5 aggressive-resize on
# neww -d -n 'exec vim ~/text/'
# setw -t2:6 aggressive-resize on
# neww -d -n 'exec vim ~/text/'
# setw -t2:7 aggressive-resize on
# neww -d -n 'exec vim ~/text/'
# setw -t2:8 aggressive-resize on
# neww -d -n 'exec vim ~/text/'
# setw -t2:9 aggressive-resize on
NOTE: there may well be cooler ways to do/tweak the idea and going to the IRC channel is very useful for asking.
I've now archived most all of that and am using pbrisbin.com (brisbin33)'s amazing Xmonad scratchpads to call whatever with a key command.
Though I do set tmux to always load whenever I start a term.
Last edited by yvonney (2010-10-02 21:19:51)
Offline
I set up windows and panes like this (commenting added for clarity):
# session initialization
new -n TTYtter /home/jason/Scripts/ttytter.pl
neww -n ncmpcpp/vifm ncmpcpp # ncmpcpp/vifm is the window name
splitw -v -p 50 -t 0 vifm # two panes: ncmpcpp on top of vifm
neww -n bash bash
neww -n irssi /home/jason/Scripts/startirssi.sh
selectw -t 1 # opens on TTYtter
Offline
NICE tip/implimentation! very helpful.
yeah, sorry about the mess above.
It was either throw that up or nothing at all due to busy busy schedule
and my skill level/understanding of tmux.
many thanks!
Last edited by yvonney (2010-10-03 03:33:19)
Offline
Hi,
I have strange problem. I bound keys as follows to switch tabs with alt-1, alt-2, etc.
bind-key -n M-0 select-window -t 0
bind-key -n M-1 select-window -t 1
bind-key -n M-2 select-window -t 2
bind-key -n M-3 select-window -t 3
...
However I have to press "2" twice (Alt-2-2) to switch to second window. Other shortcuts are working just fine, only window #2 has this issue. I can't understand it.
EDIT: for no apparent reason I have this issue only with urxvt. Therefore I just replaced it with xterm. It rocks
Last edited by vi3dr0 (2010-11-24 01:53:47)
Thinkpad T61p : T7700 | 4GB RAM | nVidia FX 570M | Intel 4965
Arch64 @ Openbox
Offline
Been using tmux for about a week now and I've already found ways to do everything I had set up in my .screenrc (and more). This includes things that took hours/days to figure out in screen. The configuration syntax makes way more sense.
I'm not trying to knock screen, because I've used it for years, and it's been immensely useful. tmux is just... better. Like vim is better than vi.
Offline
Has anyone figured out how to move a window to a brand new session? I tried running
tmux movew -s 2 -t newsession
to move window 2 from the current session to a new session named "newsession". But I get an error that "newsession" does not exist. I had to detach, start a new session, reattach, then move the window to the new session. This also results in an unwanted first window in the new session, with the recently-moved window taking the 2nd window position.
Offline