Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce and Setup Tmux #67

Open
AllanChain opened this issue Jan 21, 2020 · 0 comments
Open

Introduce and Setup Tmux #67

AllanChain opened this issue Jan 21, 2020 · 0 comments
Labels

Comments

@AllanChain
Copy link
Owner

AllanChain commented Jan 21, 2020

View Post on Blog

Setup and introduce Tmux so that I can use it


Cheat Sheet

Tmux cheatsheet

Image source is in the image

Enable 256 color vim

From https://superuser.com/a/1459904

First, outside tmux, you need:

export TERM=xterm-256color

in .tmux.conf:

set -g default-terminal "screen-256color"

And don't forget to source config manually:

tmux source-file ~/.tmux.conf

All above make sure tmux have full 256 colors support.

And in your vimrc, add:

if exists("$TMUX")
    set t_Co=256
    set notermguicolors
else
    set termguicolors
endif

Enable True Color for vim

From tmux/tmux#1246 and https://github.com/lifepillar/vim-solarized8#troubleshooting

Basically,

let &t_8f = "\<Esc>[38;2;%lu;%lu;%lum"
let &t_8b = "\<Esc>[48;2;%lu;%lu;%lum"
set termguicolors

will do the trick.

Resize Panes on Keyboard

You may just use mouse though

This assumes that you've hit ctrl + b and : to get to the command prompt

:resize-pane -D (Resizes the current pane down)
:resize-pane -U (Resizes the current pane upward)
:resize-pane -L (Resizes the current pane left)
:resize-pane -R (Resizes the current pane right)
:resize-pane -D 10 (Resizes the current pane down by 10 cells)
:resize-pane -U 10 (Resizes the current pane upward by 10 cells)
:resize-pane -L 10 (Resizes the current pane left by 10 cells)
:resize-pane -R 10 (Resizes the current pane right by 10 cells)

Border Chaos

If I split the panes vertically, the first column of the right pane is overwritten by the border.

chaos

It turns out to be the old problem with MinTTY. As you can see on the top-middle of the screenshot, the border is displayed in full width (2 chars), with introduced the chaos.

To solve it, inspired by mintty/mintty#615, all you need to do is Options → Text → Locale: C (Or any language with sane character width). And the broken vim airline is solved too!

fixed

@AllanChain AllanChain changed the title Tmux Intro | AC's Blog Introduce and Setup Tmux Jul 3, 2020
@AllanChain AllanChain added the @post This is a blog post label Jul 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant