DEV Community

Discussion on: Jaime's Guide to Tmux: The Most Awesome Tool You Didn't know you needed

Collapse
 
cristoamh profile image
Cristo Alberto Medina Henríquez

Hello! Nice post.

I just have 2 questions:

1) You recommended yo remap caps-lock to control key so we can use the shortcut on tmux ctrl+a easily, but me as a vim user, I have been using cap Lock as scape since I started with vim. On mac is awesome because I can have both, scape if cap lock is pressed alone and control if it was pressed with another key. How do you scape from insert mode por example? I just see scape key too far away.

2)I don't know If I misunderstood but, can I go to work use a tmux session then turn off the computer and still working on the day after, attacking myself to the last session? Or I have to leave the computer on?

Thanks!

Collapse
 
vintharas profile image
Jaime González García • Edited

Thank you Cristo!

1)

Cool!! I didn't know you could use it both as Escape and CTRL. I must look into how to do that :D. My mapping to exit insert mode is 'jk', so I type j followed by k, it's very convenient because my fingers are already on top of j and k so it flows very naturally. Alternatively I use CTRL-C or CTRL-[ (for instance, when leaving visual mode).

Anyhow, if I had to choose between having ESC or CTRL in the caps lock position I rather have CTRL because it opens more possibilities than just having ESC. (And ESC can be reproduced with other mappings like jk or CTRL-C, CTRL-[)

2)

I normally have my workstation on so I can SSH from home whenever I need to. So in that case the tmux server is always running and it is trivial to attach to my last session.

You can switch off your computer, and continue working on the day after. But in order for that to work you need to use the tmux-resurrect (which lets you save and restore sessions) which works even better with tmux-continuum (which saves sessions periodically, and automatically restores them when you start tmux).

So:

  • You can reattach if you leave your computer on
  • You can also reattach if you switch off your computer by taking advantage of these plugins: tmux-resurrect and tmux-continuum
Collapse
 
cristoamh profile image
Cristo Alberto Medina Henríquez

Cool! I'll take a look. Later I'll send you how I use ctrl and scape in the same key.

A would like to read your opinion about working with vscode vs tmux-vim.

Maybe a future post(?). I have vim ready to fight but I always end up working on vs code.

Thread Thread
 
vintharas profile image
Jaime González García

Yeah! That would be awesome! :D

hmm I should write an article about that :D Thanks for the idea!