Live data from Hacker News

Using tmux properly

danielallendeutsch.com

61–70 of 218 posts

Re: Using tmux properly

#61
post #17

Earlier quoted context omitted.

You do one better - tmux's mouse mode allows you to scroll with your mouse wheel. Just add 'set -g mouse on' to your ~/.tmux.conf. You can configure the history size limit by setting 'set-option -g history-limit '. When you scroll the mouse wheel, tmux will enter copy mode and scroll.

That is absolutely not 'better', sorry. Taking your hands off the keyboard to do something basic is never better.

I disagree. I want to select with the mouse and touch type with the keyboard.

And "doing it faster" is never a concern. As a programmer I write about 5% of what I could type in the same time as a secretary or accountant. Most of the work is thinking.

Plus, the occasional chance to get your hands off of the rigid (and carpal tunnel inducing) pose on the keyboard and move them to the mouse, or vice versa, is welcome.

I don't want to replicate things the mouse does better with keyboard shortcuts, or suffer "modal" input-modes in my programs.

Re: Using tmux properly

#62
post #57

Earlier quoted context omitted.

Terminator is an alternative to something like iTerm. Tmux is server based so the sessions persist after disconnecting from ssh for example and allow multiple users to connect to the same terminal

Out of curiosity, would you still use terminator/iterm if you used tmux in every shell? I understand term* provides some additional functions, but would you still consider it worthwhile?

I personally would, because learning less tools is great.

I've had some problem applying this principle when using tmux locally on a system with i3. You kinda need to be consistent in which of the 2 you use to create new shell windows.

Re: Using tmux properly

#63
post #62
post #57

Earlier quoted context omitted.

Out of curiosity, would you still use terminator/iterm if you used tmux in every shell? I understand term* provides some additional functions, but would you still consider it worthwhile?

I personally would, because learning less tools is great. I've had some problem applying this principle when using tmux locally on a system with i3. You kinda need to be consistent in which of the 2 you use to create new shell windows.

Funny you mention that. I tried i3 last year but quickly realized I already have the good parts in tmux.

I am now trying to simplify my workflow by only using tmux and emacs. It's minimal and works on almost any system I log into.

Re: Using tmux properly

#64
post #44
post #42

Earlier quoted context omitted.

The thing about tmux bindings is that, as far as I know, very few people like the defaults. I've taken the approach of 'learn the defaults' for vim, but on tmux that simply won't stand because the defaults have so much room for improvement. Pretty much everything I've read on tmux suggests the - and | bindings for window splits, same goes for hjkl bindings for movement. Adding these bindings would go a long way towar…

Yeah, I learned screen defaults, so ^A is far too strong of a habit to change.

I use screen, and in my book the choice of ^A for the default escape is a giant WTF, and remapping that is the first thing I do on a new account before starting to use screen (I use ^o, for no particular reason I suppose except it's not used by anything else I use). Don't the screen developers ever need to go to the beginning of a line in the shell or editor?

Re: Using tmux properly

#65
post #46
post #33

Yesterday I was helping a friend setting a box with no graphical session: I fired up tmux in the linux virtual terminal and then proceeded to realize without my tmux.conf I couldn't do a thing because I have always been using entirely different keybindings from the default. This is the problem with too much customization. Learning to use the default configuration may be difficult but it's probably worth the effort, f…

I 120% agree. I once lost my emacs dotfile and suddenly i was almost unable to use Emacs on my own pc. Since then, i've decided to apply as little customisation as possible to software I use, and read the documentation and learn the standard configuration instead. For some reasons nowadays it's trendy to add colors, bells and whistles to things but I've found out that learning the standard/default configuration lets…

That's why I have public dotfiles. Also this situation happens rarely. The whole beauty of software is that you can customize it and make it your own.

The only downside I see with customization is that it can be huge timesink.

I guess to each his own, but I think you're really missing out.

P. S. Backups.

Re: Using tmux properly

#66
post #61
post #17

Earlier quoted context omitted.

That is absolutely not 'better', sorry. Taking your hands off the keyboard to do something basic is never better.

I disagree. I want to select with the mouse and touch type with the keyboard. And "doing it faster" is never a concern. As a programmer I write about 5% of what I could type in the same time as a secretary or accountant. Most of the work is thinking. Plus, the occasional chance to get your hands off of the rigid (and carpal tunnel inducing) pose on the keyboard and move them to the mouse, or vice versa, is welcome. I…

k

I still prefer not using the mouse for a basic operation like scrolling, thank you.

Re: Using tmux properly

#67
post #64
post #44

Earlier quoted context omitted.

Yeah, I learned screen defaults, so ^A is far too strong of a habit to change.

I use screen, and in my book the choice of ^A for the default escape is a giant WTF, and remapping that is the first thing I do on a new account before starting to use screen (I use ^o, for no particular reason I suppose except it's not used by anything else I use). Don't the screen developers ever need to go to the beginning of a line in the shell or editor?

At this point it's muscle memory for me to use C-a a to get to the beginning of a line, to the point that when I'm not in screen there will be extra "a"s at the beginning of my commands.

As for editors, I use vim. (With almost no customization, as others have advocated.)

Re: Using tmux properly

#68
post #64
post #44

Earlier quoted context omitted.

Yeah, I learned screen defaults, so ^A is far too strong of a habit to change.

I use screen, and in my book the choice of ^A for the default escape is a giant WTF, and remapping that is the first thing I do on a new account before starting to use screen (I use ^o, for no particular reason I suppose except it's not used by anything else I use). Don't the screen developers ever need to go to the beginning of a line in the shell or editor?

> Don't the screen developers ever need to go to the beginning of a line in the shell or editor?

C-a a. Using emacs with screen for many years, this is almost automatic for me.

Re: Using tmux properly

#69
post #33

Yesterday I was helping a friend setting a box with no graphical session: I fired up tmux in the linux virtual terminal and then proceeded to realize without my tmux.conf I couldn't do a thing because I have always been using entirely different keybindings from the default. This is the problem with too much customization. Learning to use the default configuration may be difficult but it's probably worth the effort, f…

Considering it takes one command to recover a tmux config file, I don't see the value in optimizing for the rare occasion where I won't have the config file already in the environment I'm working in. In fact, if I'm not able to use my config file, chances are, tmux is not available for me to use anyways.

Re: Using tmux properly

#70
post #33

Yesterday I was helping a friend setting a box with no graphical session: I fired up tmux in the linux virtual terminal and then proceeded to realize without my tmux.conf I couldn't do a thing because I have always been using entirely different keybindings from the default. This is the problem with too much customization. Learning to use the default configuration may be difficult but it's probably worth the effort, f…

It gets worse when you work in ops and are constantly needing to remote into servers and you regularly have tmux within a tmux within a tmux... Littering config files across the datacenter just isn't an option.

For this reason I started using tmux exclusively on my local workstation and screen remotely.
Post reply on HN