Code Monkey home page Code Monkey logo

tmuxline.vim's Introduction

tmuxline.vim

Simple tmux statusline generator with support for powerline symbols and vim/airline/lightline statusline integration

img

img

Features

  • use vim/vim-airline/lightline.vim colors, so tmux and vim share the same statusline colortheme
  • preloaded with stock themes and presets, which can be combined anyway you want
  • configure tmux statusline using a simple hash, in case stock presets don't meet your needs
  • create a snapshot .conf file which can be sourced by tmux, no need to open vim to set your tmux statusline

Quickstart

use vim's statusline colors

Use one of the vim_statusline_* themes (and optionally set in vimrc let g:tmuxline_powerline_separators = 0):

:Tmuxline vim_statusline_1
" or
:Tmuxline vim_statusline_2
" or
:Tmuxline vim_statusline_3

img

use vim-airline colors

Just start vim inside of tmux. airline's colors will be applied to tmux's statusline

img

Alternatively, you can set it manually using airline_* themes:

:Tmuxline airline
" or
:Tmuxline airline_insert
" or
:Tmuxline airline_visual

If you set airline theme manually, make sure the airline-tmuxline extension is disabled, so it doesn't overwrite the theme:

let g:airline#extensions#tmuxline#enabled = 0

use lightline.vim colors

Use one of the lightline_* themes:

:Tmuxline lightline
" or
:Tmuxline lightline_insert
" or
:Tmuxline lightline_visual

img

Usage

Set a a colortheme and a preset, both arguments are optional

:Tmuxline [theme] [preset]

After running :Tmuxline, create a snapshot file which can be sourced by tmux.conf on startup

:TmuxlineSnapshot [file]

Source the created snapshot in tmux.conf

# in tmux.conf
source-file [file]

# alternatively, check file exists before sourcing it in tmux.conf
if-shell "test -f [file]" "source [file]"

Note that :Tmuxline and :TmuxlineSnapshot are available only when vim is inside a tmux session.

Configuration

Stock preset

Set g:tmuxline_preset to a stock preset and run :Tmuxline

let g:tmuxline_preset = 'nightly_fox'
" or
let g:tmuxline_preset = 'full'
" or
let g:tmuxline_preset = 'tmux'
" other presets available in autoload/tmuxline/presets/*

Custom preset

Contents of the statusline are configured with a simple hash. Left section is configured with a, b, c, right with x, y, z. cwin and win affect the current (active) window and the in-active windows respectively.

let g:tmuxline_preset = {
      \'a'    : '#S',
      \'b'    : '#W',
      \'c'    : '#H',
      \'win'  : '#I #W',
      \'cwin' : '#I #W',
      \'x'    : '%a',
      \'y'    : '#W %R',
      \'z'    : '#H'}

img

tmux will replace #X and %X. Excerpts from tmux man page:

#H    Hostname of local host
#h    Hostname of local host without the domain name
#F    Current window flag
#I    Current window index
#S    Session name
#W    Current window name
#(shell-command)  First line of the command's output

string will be passed through strftime(3) before being used.

If the values of the hash g:tmuxline_preset hold an array, a powerline separator will be placed.

let g:tmuxline_preset = {
      \'a'    : '#S',
      \'win'  : ['#I', '#W'],
      \'cwin' : ['#I', '#W', '#F'],
      \'y'    : ['%R', '%a', '%Y'],
      \'z'    : '#H'}

img

tmux allows using any command in the statusline.

let g:tmuxline_preset = {
      \'a'    : '#S',
      \'c'    : ['#(whoami)', '#(uptime | cut -d " " -f 1,2,3)'],
      \'win'  : ['#I', '#W'],
      \'cwin' : ['#I', '#W', '#F'],
      \'x'    : '#(date)',
      \'y'    : ['%R', '%a', '%Y'],
      \'z'    : '#H'}

img

Separators

Use let g:tmuxline_powerline_separators = 0 to disable using powerline symbols

To fine-tune the separators, use g:tmuxline_separators:

let g:tmuxline_separators = {
    \ 'left' : '',
    \ 'left_alt': '>',
    \ 'right' : '',
    \ 'right_alt' : '<',
    \ 'space' : ' '}

Theme

Note that vim-airline has a tmuxline extension which by default sets airline's color theme onto tmuxline. If you don't want airline colors in tmuxline, set let g:airline#extensions#tmuxline#enabled = 0 in vimrc.

Modifying g:tmuxline_theme (details below) makes sense only if the airline-tmuxline is not enabled.

Use g:tmuxline_theme to configure the theme. g:tmuxline_theme can hold either a string (stock theme) or a hash (custom theme).

let g:tmuxline_theme = 'iceberg'
" or
let g:tmuxline_theme = 'zenburn'
" or
let g:tmuxline_theme = 'jellybeans'
" other themes available in autoload/tmuxline/themes/*

Alternatively, g:tmuxline_theme can be used to fine tune a custom theme:

let g:tmuxline_theme = {
    \   'a'    : [ 236, 103 ],
    \   'b'    : [ 253, 239 ],
    \   'c'    : [ 244, 236 ],
    \   'x'    : [ 244, 236 ],
    \   'y'    : [ 253, 239 ],
    \   'z'    : [ 236, 103 ],
    \   'win'  : [ 103, 236 ],
    \   'cwin' : [ 236, 103 ],
    \   'bg'   : [ 244, 236 ],
    \ }
" values represent: [ FG, BG, ATTR ]
"   FG ang BG are color codes
"   ATTR (optional) is a comma-delimited string of one or more of bold, dim, underscore, etc. For details refer to the STYLE section in the tmux man page

Installation

The plugin's files follow the standard layout for vim plugins.

  • Pathogen git clone https://github.com/edkolev/tmuxline.vim ~/.vim/bundle/tmuxline.vim
  • Vundle Bundle 'edkolev/tmuxline.vim'
  • NeoBundle NeoBundle 'edkolev/tmuxline.vim'
  • Vim-Plug Plug 'edkolev/tmuxline.vim'

Inspired by

Rationale

Vimscript wasn't my first choice of language for this plugin. Arguably, bash would have been better suited for this task. I chose vimscript because:

  • its data scructures (arrays, hashes) are better than their bash counterparts (easier to write, to maintain). So maintaining your tmux statusline as a vim hash would be easier
  • vim has (better) package managers

Somewhat-similar plugins:

  • powerline is a great project. Still, my Raspberry Pi chokes while executing python every 2 seconds (I haven't tried powerline's daemon mode). I also find it a bit hard to personalize
  • tmux-powerline doesn't focus on easy customization but on adding extra information (segments) in tmux (gmail, weather, earthquake warnings, etc)

License

MIT License. Copyright (c) 2013-2014 Evgeni Kolev.

tmuxline.vim's People

Contributors

aswild avatar drn avatar edkolev avatar fetzerch avatar firedev avatar greg0ire avatar he-ro avatar hoov avatar joeybaker avatar perok avatar raphapr avatar sheparddw avatar stvhwrd avatar vegerot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tmuxline.vim's Issues

VCS status

Hi!
How can I add vcs status like tmux powerline?

Setting win-options in custom preset

What is the proper way to set the win_options in a custom preset? I want to replicate this functionality
let bar.win_options['window-status-activity-attr'] = 'bold' using g:tmuxline_preset.

let g:tmuxline_preset = {
\ 'a': '[#S]',
\ 'win': '#I:#W#F',
\ 'cwin': '#I:#W#F',
\ 'win-options': {
\ 'window-status-activity-attr': 'bold'},
\ 'options': {
\ 'status-justify': 'left'}
\ }

The status-justify option is reflected, however the window-status-activity-attr is not. How do I make sure it is?

Error when trying to load airline theme

When running

:Tmuxline airline

I get the following error message :

Error detected while processing function tmuxline#set_statusline..tmuxline#load_colors..tmuxline#util#load_colors_from_theme:
line 4:
E605: Exception not caught: tmuxline error: invalid theme "airline"
Error detected while processing function tmuxline#set_statusline..tmuxline#load_colors:
line 2:
E171: Missing :endif

No zoom suffix *Z in tmuxline

Nice piece of code. Thank you!

This is a feature request. I am not sure how hard or how easy it would be to implement. Anyways ...

In the default tmux without tmuxline, once you zoom out a pane using C-b z, there is an indication in the status bar with a suffix of *Z. See http://blog.sanctum.geek.nz/zooming-tmux-panes/ for a demo. Right now, tmuxline does not give an indication when a pane has been zoomed using C-b z.

Would be nice if this can be implemented.

tmux Version Requirements

It might be worth documenting the tmux version requirement. I hadn't updated homebrew on my machine in a while. I ended up with tmux 1.8, and got a handful of error messages after sourcing the snapshot I created.

In addition to the errors, the result status line looked like this....
screen shot 2014-06-21 at 12 03 49 am

After I realized that there was a newer version of tmux available, I updated it and everything was dandy 👍

BTW, it is a nifty plugin, and saved me a lot of time getting it just right. Thanks for doing what you do.

Make words bold

HI, I installed tmuxline recently, I really like it
but i want to customize a little with the font weight
I've traced the vim_statusline_1.vim and would like to change some window name's font weight
but it seems the font weight is accompanied with color
and I can't change font weight only due to the original parameter statusline_nc

so, my question is
what should I do to only make the number "17" as bold as the upper "NORMAL" word

thanks

1

Change tmux colors based on vim modes

Right now when I enter visual mode or insert mode my airline theme changes my vim statusline color. But tmux color is not changing. This issue is to watch changes in vim (or maybe airline) and propagate them to tmux.

Tmux 1.6 too old?

So I'm trying to make this work on my university server, as that's where I do most of my work.
Tmux 1.6, vim 7.2
I got it working fine on my laptop, so I have gotten it working once already.
I copied the file .tmux.conf sources (from TmuxlineSnapshot) to the server, and tmux now displays pretty.
From this, I thought that there shouldn't be version problems.

I installed airline-vim, and vim works fine(With display).
But when I install the tmuxline plugin via Pathogen, and run vim inside of tmux, vim is just a blank screen.
Vim works fine outside of tmux.
I ran vim as "vim -V9vimLog". The important output in the log is

finished sourcing /home/campus06/mtfurlan/.vim/bundle/tmuxline.vim/autoload/tmuxline/builder.vim
continuing in function <SNR>13_on_window_changed..<SNR>13_init..airline#switch_theme..airline#load_theme..airline#extensions#load_theme..airline#util#exec_funcrefs..airline#extensions#tmuxline#set_tmux_colors..tmuxline#api#set_theme..tmuxline#set_theme..tmuxline#load_line..tmuxline#util#load_line_from_preset..tmuxline#presets#powerline#get..tmuxline#new
Calling shell to execute: "(tmux source "/tmp/vY6InFd/0") >/tmp/vY6InFd/1 2>&1"
Command terminated

Full output at http://pastebin.com/vR3VbFhH

Relevant bit of tmuxline: https://github.com/edkolev/tmuxline.vim/blob/master/autoload/tmuxline.vim#L86
I tried changing tempname() to "~/temp", but it gave an error about not being able to create the file, which leads me to believe it's creating the tempfile correctly, and it's crashing when running the tmux bit.

Is this version of tmux just too old?

No indication that Prefix was pressed

Hi,

Sorry, I don’t know enough about vimscripts and tmux configuration to submit a patch myself. I noticed during the brief period I was using the Powerline tmux theme, that the background colour of the session name changes when the Prefix is pressed and waiting for a shortcut key. Would that be easy to implement in tmuxline.vim?

NEED theme patch for [window-status-activity-*]

thanks for ur tmuxline.vim.
i use vim-airline and tmuxline.vim when i coding with vim in terminal, of course with tmux.

but have a problem.
if some window is activity, in default , that window-status will be reverse.

i know how to mod it (window-status-activity-*).
but i thanks this is a part of theme. Does not requied user to custom (if them used internal theme) .

Airline theme values

Tmuxline gets the airline theme by default as expected. However, I wanted to fine tune a few fields of the airline theme. Is there any way to get the numerical values associated with g:tmuxline_theme and change them?

Settings created from tmuxline snapshot don't all show up

Hi there!
When I create my TmuxlineSnapshot file and then source it in my tmux.conf, I notice that although all of my settings show up in the snapshot, they don't seem to "activate" until I run vim in the tmux session.
Am I doing something wrong?

Here is the snippet from my .vimrc file:

let g:airline_powerline_fonts = 1
let g:tmuxline_preset = {
      \'a'       : '#S',
      \'y'       : [ '%Y-%m-%d', '%H:%M' ],
      \'z'       : [ '#h', '#(cat ~/.thyme-tmux)' ],
      \'win'     : [ '#I', '#W' ],
      \'cwin'    : [ '#I', '#W' ],
      \'options' : { 'status-justify': 'left'} }

And here is the snapshot created:

# This tmux statusbar config was created by tmuxline.vim
# on Tue, 25 Feb 2014

set -g status-bg 'colour234'
set -g message-command-fg 'colour255'
set -g status-justify 'left'
set -g status-left-length '100'
set -g status 'on'
set -g pane-active-border-fg 'colour190'
set -g message-bg 'colour238'
set -g status-right-length '100'
set -g status-right-attr 'none'
set -g message-fg 'colour255'
set -g message-command-bg 'colour238'
set -g status-attr 'none'
set -g status-utf8 'on'
set -g pane-border-fg 'colour238'
set -g status-left-attr 'none'
setw -g window-status-fg 'colour85'
setw -g window-status-attr 'none'
setw -g window-status-activity-bg 'colour234'
setw -g window-status-activity-attr 'none'
setw -g window-status-activity-fg 'colour190'
setw -g window-status-separator ''
setw -g window-status-bg 'colour234'
set -g status-left '#[fg=colour17,bg=colour190] #S #[fg=colour190,bg=colour234,nobold,nounderscore,noitalics]'
set -g status-right '#[fg=colour238,bg=colour234,nobold,nounderscore,noitalics]#[fg=colour255,bg=colour238] %Y-%m-%d  %H:%M #[fg=colour190,bg=colour238,nobold,nounderscore,noitalics]#[fg=colour17,bg=colour190] #h  #(cat ~/.thyme-tmux) '
setw -g window-status-format '#[fg=colour234,bg=colour234,nobold,nounderscore,noitalics]#[default] #I  #W #[fg=colour234,bg=colour234,nobold,nounderscore,noitalics]'
setw -g window-status-current-format '#[fg=colour234,bg=colour238,nobold,nounderscore,noitalics]#[fg=colour255,bg=colour238] #I  #W #[fg=colour238,bg=colour234,nobold,nounderscore,noitalics]'

configure default theme

As per the doc, we can declare g:tmuxline_preset in .vimrc for the default preset.

Although the code seems to indicate we can declare g:tmuxline_theme also, it doesn't affect the behaviour of the status line.

Sorry I don't know enough of VimL yet to come with a proper PR, nonetheless the code of the plugin is definitively one of the most readable VimL plugins I've seen so far. I'll learn a lot going through it!

Thanks!

Separator characters not displaying correctly

I just installed tmuxline, and I'm not able to figure out how to get the separator characters to display properly. They appear as the unicode character 0xE0B0, as shown in this picture:

screen shot 2014-04-26 at 4 39 09 pm

Interestingly, the source file itself includes that character, and I believe this is not the right separator character. I have all the utf options enabled for tmux, and my emulator is set to screen-256color everywhere. Running from within iterm2 on os x. What could be the issue?

conflict with tmux plugin manager?

Hi,
a user opened an issue related to script output on tmux plugin manger. As you can see on the screenshot, the output has some weird escape codes.

After some investigation it turns out things were ok after the user disabled tmuxline.vim.

I looked into tmuxline.vim source but couldn't find anything suspicious. Do you have any clue what could be causing this?

Thanks

Solarized light theme and vim-airline

I use vim-airline together with the 16 color solarized theme which looks correct inside tmux (if set -g default-terminal "xterm-16color" is set). However, the tmuxline colors are wrong. Has tmuxline been tested with set background=light or could it be an issue with that solarized is using 16 colors and not 256?

screenshot-terminal

Strange colors inside tmuxline

Hey,

i have the problem that my colors are some kind of messed up inside of tmuxline.
I use the luna theme, but it happens with the other themes as well.

I am not that familiar with tmuxline and the integration with vim airline,
but i could change the appearance of tmuxline.

As you can see, i use the patched fonts for vim-airline.

tmuxline

Better image:
tmuxline2

Gvim

Hi,

how can I disable tmuxline when launching gvim?
It messes up tmux appearance.

position?

Hi,

First off thank you so much for this, it's awesome! Quick question, is it possible to change the position of it so it runs along the top similar to this http://i.imgur.com/rh4NRvA.png

Thank you!

not able to get tmuxline to look right

I would like to get my tmuxline looking like :

image

and the code I used for it was taken from the second example in Custom Preset section of the README.md which is:

let g:tmuxline_preset = {
      \'a'    : '#S',
      \'win'  : ['#I', '#W'],
      \'cwin' : ['#I', '#W', '#F'],
      \'y'    : ['%R', '%a', '%Y'],
      \'z'    : '#H'}

but even when I save my .vimrc, close tmux & terminal, start new terminal & tmux with VIM running in it, this is what I see:

tmux settings problem

So obviously my tmuxline status bar does not display the right arrows. It also has my username 'max' appearing after the session name. Not sure why that is happening. Any ideas what is going on here?

Here is my .vimrc

set nocompatible              " be iMproved, required
filetype off                  " required

set t_Co=256
set background=dark
set term=screen-256color
color jellybeans 

" Lightline config
let g:lightline = {
      \ 'colorscheme': 'jellybeans',
      \ 'component': {
      \   'readonly': '%{&readonly?"⭤":""}',
      \ },
      \ 'separator': { 'left': '', 'right': '' },
      \ 'subseparator': { 'left': '', 'right': '' }
      \ }
set laststatus=2

" Tmuxline config
let g:tmuxline_preset = {
      \'a'    : '#S',
      \'win'  : ['#I', '#W'],
      \'cwin' : ['#I', '#W', '#F'],
      \'y'    : ['%R', '%a', '%Y'],
      \'z'    : '#H'}

let g:tmuxline_separators = {
    \ 'left' : '',
    \ 'left_alt': '>',
    \ 'right' : '',
    \ 'right_alt' : '<',
    \ 'space' : ' '}

" make backspace work
set backspace=2

" allows for mouse scrolling
set mouse=a

" visual up and down movement through wrapped lines/paragraphs
noremap j gj
noremap k gk

" change mapleader from \ to ,
let mapleader=","

" Unmap the arrow keys
no <down> <Nop>
no <up> <Nop>
no <left> <Nop>
no <right> <Nop>
ino <down> <Nop>
ino <up> <Nop>
ino <left> <Nop>
ino <right> <Nop>

" quickly edit/reload .vimrc file
nmap <silent> <leader>ev :e $MYVIMRC<CR>
nmap <silent> <leader>sv :so $MYVIMRC<CR>

:map <MiddleMouse> "*p 
:map! <MiddleMouse> <C-R>* 

" enable +clipboard
set clipboard=unnamedplus

set tabstop=2
set expandtab
set shiftwidth=2
set autoindent
set smartindent
set ignorecase

set number
set showcmd
set title
set nobackup
set noswapfile

" Vim can highlight whitespaces for you in a convenient way:
set list
set listchars=tab:>_,trail:.,extends:#,nbsp:.

" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim

call vundle#begin()

" let Vundle manage Vundle, required
Bundle 'gmarik/Vundle.vim'

"Bundle 'tpope/vim-fugitive'
"Bundle 'moll/vim-node'
"Bundle 'jelera/vim-javascript-syntax'
"Bundle 'pangloss/vim-javascript'
Bundle 'digitaltoad/vim-jade'
"Bundle 'scrooloose/nerdtree'
"Bundle 'tpope/vim-surround'
"Bundle 'scrooloose/nerdcommenter'
" Bundle 'godlygeek/tabular'
" Bundle 'jamescarr/snipmate-nodejs'
" Bundle 'MarcWeber/vim-addon-mw-utils'
" Bundle 'tomtom/tlib_vim'
" Bundle 'garbas/vim-snipmate'
"Bundle 'Raimondi/delimitMate'
"Bundle 'nathanaelkane/vim-indent-guides'
"Bundle 'scrooloose/syntastic'
" Bundle 'Valloric/YouCompleteMe'
" Bundle 'marijnh/tern_for_vim'
Bundle 'edkolev/tmuxline.vim'
Bundle 'itchyny/lightline.vim'
"Bundle 'maksimr/vim-jsbeautify'

" Bundle from http://vim-scripts.org/vim/scripts.html
Bundle 'L9'
Bundle 'togglecursor'

" Git plugin not hosted on GitHub
Plugin 'git://git.wincent.com/command-t.git'

" All of your Plugins must be added before the following line
call vundle#end()            " required

syntax on
filetype plugin indent on    " required

Here is my .tmux.conf

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

# use UTF8
set -g utf8
set-window-option -g utf8 on

# make tmux display things in 256 colors
set -g default-terminal "screen-256color"

# set scrollback history to 10000 (10k)
set -g history-limit 10000

# set Ctrl-x as the default prefix key combination
# and unbind C-b to free it up
set -g prefix C-x
unbind C-b


# reload config without killing server
# bind R source-file ~/.tmux/conf \; display-message "  Config reloaded..".

# use send-prefix to pass C-a through to application
bind C-a send-prefix

# shorten command delay
set -sg escape-time 1

# set window and pane index to 1 (0 by default)
set-option -g base-index 1
setw -g pane-base-index 1

# reload ~/.tmux.conf using PREFIX r
bind r source-file ~/.tmux.conf \; display "Reloaded!"

# use PREFIX | to split window horizontally and PREFIX - to split vertically
unbind %
bind \ split-window -h
unbind '"'
bind - split-window -v

# Make the current window the first window
bind T swap-window -t 1

# map Vi movement keys as pane movement keys
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R

# and use C-h and C-l to cycle thru panes
bind -r C-h select-window -t :-
bind -r C-l select-window -t :+

# resize panes using PREFIX H, J, K, L
bind H resize-pane -L 5
bind J resize-pane -D 5
bind K resize-pane -U 5
bind L resize-pane -R 5

# explicitly disable mouse control
setw -g mode-mouse off
set -g mouse-select-pane off
set -g mouse-resize-pane off
set -g mouse-select-window off

How to remove separator in preset?

I have configuration like this:

let g:tmuxline_preset = {
      \'a'    : '#{?client_prefix,#[reverse]<Prefix>#[noreverse] ,}#S',
      \'win'    : ['#I', '#W'],
      \'cwin'    : ['#I', '#W'],
      \'y'    : ['%a, %b %d'],
      \'z'    : '%R',
      \'options' : {
      \'status-justify': 'left'}
      \}

I want to remove left and right separator from the win part as seen on the screenshot:

screen shot 2016-03-04 at 5 35 42 pm

How to do that?

I've found that I could export the resulting theme to external file and edit it manually. But, its too limiting. When I open vim and change theme (I use different theme for day and night), my configuration on the external file would lost.

I also found that on the presets file call bar.win.add_left_alt_sep() would get called. It seems I've to build my own preset that way. But, I don't know how to do it.

Symbols broken?

Great idea for a plug-in. I followed the directions to install it and it activates when I load vim within tmux. I'm new to tmux so i think I got everything set correctly.

But, I seem to have some odd characters not matching anything in the screenshots:

screenshot from 2016-02-03 15-33-58

Gnome 3.18.3
Gnome-Terminal

within terminal before tmux

$ echo $TERM
xterm-256color

within tmux, running from a terminal

$ echo $TERM
xterm-256color

Using solarized color scheme which works great in both terminal and vim and tmux (finally, took some tweaking).

here's some config files.

$ ls -l .vim/bundle/
total 36
drwxr-xr-x  7 eric users 4096 Jan 27 14:53 neocomplete.vim
drwxr-xr-x  9 eric users 4096 Jan 27 14:36 nerdtree
drwxr-xr-x  6 eric users 4096 Feb  3 14:25 tmuxline.vim
drwxr-xr-x  7 eric users 4096 Jan 27 14:37 vim-airline
drwxr-xr-x  7 eric users 4096 Jan 31 13:53 vim-colors-solarized
drwxr-xr-x 13 eric users 4096 Jan 27 14:38 vim-go
drwxr-xr-x  5 eric users 4096 Feb  1 15:25 vim-obsession
drwxr-xr-x  6 eric users 4096 Feb  2 10:19 vim-prosession
drwxr-xr-x  4 eric users 4096 Jan 27 14:28 vim-sensible
$ cat .vimrc
execute pathogen#infect()
syntax on
filetype plugin indent on

let g:neocomplete#enable_at_startup = 1

let g:airline#extensions#tabline#enabled = 1
let g:airline#extensions#tabline#left_sep = ' '
let g:airline#extensions#tabline#left_alt_sep = '|'
"let g:airline_powerline_fonts = 1  " use when font isn't patched
"if !exists('g:airline_symbols')
"  let g:airline_symbols = {} " fixes fontconfig versions 
"endif
"let g:airline_symbols.space = "\ua0"
let timeoutlen = 50

" let g:go_disable_autoinstall = 0

" Highlight
let g:go_highlight_functions = 1  
let g:go_highlight_methods = 1  
let g:go_highlight_structs = 1  
let g:go_highlight_operators = 1  
let g:go_highlight_build_constraints = 1

" fixing 256 colors in tmux
" set term=screen-256color
set t_Co=256                        " force vim to use 256 colors

" fixing Background Color Erase when term is set to non-xterm
if &term =~ '256color'
  " disable Background Color Erase (BCE) so that color schemes
  " render properly when inside 256-color tmux and GNU screen.
  " see also http://snk.tuxfamily.org/log/vim-256color-bce.html
  set t_ut=
else
  " switch to fallback mode when there xterm-256color isn't detected
  " (e.g. gnome's Drop Down Shell extension)
  let g:solarized_termcolors=256
endif

" solarized theme
"let g:solarized_termcolors=256
set background=dark
colorscheme solarized

map <C-n> :NERDTreeToggle<CR>
$ cat .tmux.conf
# options
unbind C-b
set-option -g prefix C-a                # change prefix to "A"
set-option -g mouse on              # enable mouse support in gnome (though u still should know this)
set-option -g allow-rename off          # disable tmux renaming the panes (use "," to name them)
set-option -g history-limit 100000      # increase the scroll back buffer size

# key bindings
bind -n WheelUpPane copy-mode           # Start copy mode when scrolling up
bind h split-window -h              # split window horizonally
bind v split-window -v              # split window vertically

# fixing pageUp and pageDown
setw -g xterm-keys on

# fixing 256 colors
set -g default-terminal "xterm-256color"

# status lines
#set -g status-right '#[fg=red]Continuum: #{continuum_status} #[bg=yellow]#[fg=white] %d %b %Y%l:%M %p'

####
# persisting commands
run-shell ~/.tmux/plugins/tmux-resurrect/resurrect.tmux
set -g @resurrect-strategy-vim 'session'                                                                                                                                                      
set -g @resurrect-capture-pane-contents 'on'
run-shell ~/.tmux/plugins/tmux-continuum/continuum.tmux
set -g @continuum-save-interval '5'

Wrap status lines created by custom presets in double rather than single quotes

I have a command I use to fetch my LAN IP (10.0.1.x) address. The command uses awk and has single quotes in it, but I can't make it work with tmuxline.vim because the set status-left, etc. tmux.conf lines that are generated are wrapped in double quotes rather than single quotes, so I can't properly escape the sequences.

Here's an example (sorry for the mess, it's a long line):

set -g status-right "#[fg=colour0,bg=colour0,nobold,nounderscore,noitalics] #[fg=colour10,bg=colour0] #h:#(ifconfig | awk '$1 == \"inet\" { print $2 }' | tail -1)"

If that setting can be wrapped in double-quotes, as I've done here, rather than single quotes, then the escaping necessary to make that command work is straightforward. I don't think it's possible to do the escaping at all if the setting is wrapped in single-quotes.

How to change theme of Vim status line?

Hi,

I couldn't understand from the README how to update the Vim theme when within tmux?

For example, my Vim status bar looks like this...

screen shot 2013-12-29 at 13 10 32

And when I start tmux it all looks good still...

screen shot 2013-12-29 at 13 06 46

If you want to see my shell/dotfiles (specifically the bottom of my .tmux.conf where I copied the contents of the :Tmuxsnapshot command) then they are on GitHub: https://github.com/Integralist/Fresh-Install/tree/master/Shell

But when I open two panes and in one of them I open Vim the theme goes pretty ugly...

screen shot 2013-12-29 at 13 08 33

Even when I quit Vim the tmux status bar stays ugly...

screen shot 2013-12-29 at 13 09 11

So the question is two fold:

  1. How can I get Vim's status line to look like it normally does (rather than that hideous pink)?
  2. How can I get tmux to go back to its normally look after I quit Vim from another pane?

The first question is the more important of the two though :-)

Thanks for any help you can give me.

Tmuxline not inheriting airline theme

I am able to run the command Tmuxline airline and it sets the correct theme. However, when I am inside a fresh tmux session and start vim there is not theme applied to Tmuxline. I've had this working before but has something changed recently? The colors do not change at all.

I am using the airline theme powerlineish, but when trying different themes it still doesn't make a difference. tmux version is 1.9

Sometimes configuration is lost

Hi, I'm on OS X using default Terminal app and occasionally my tmux line loses its configuration. I just have to start vim to have it refreshed. Does anyone know why does it miss its configuration (colorscheme, etc)?

Too many window separators with custom preset

Hi,

I've tried to set a custom preset as follows:

let g:tmuxline_preset = {
    \'a'       : '#(whoami)@#h',
    \'b'       : '#S',
    \'win'     : ['#I', '#W'],
    \'cwin'    : ['#I', '#W', '#F'],
    \'y'       : ['%d-%m-%Y', '%H:%M'],
    \'z'       : '#(battery_pct_prompt)',
    \'options' : {'status-justify' : 'left'}}

This is very similar to the second custom preset example in README.md.
However, it seems like i'm getting too many separators between the windows, so it doesn't look as nice as in the example:
screen shot 2015-04-21 at 6 13 23 pm

Perhaps it's not too many separators, maybe just the colors are wrong.
I'm also using Airline and the Solarized colorscheme, and the terminal's colors are also solarized.
If I don't use my custom preset, and use the built-in 'powerline' preset with airline theme, the separators look great.

Any idea what I could do?
Thanks.

Wrong tmux status colors until vim is started

Can I write a version of .tmuxline.conf that can work without loading starting?

tmux 2.2
latest tmuxline
vim 7.4 1832

My .tmuxline.conf written

# This tmux statusbar config was created by tmuxline.vim
# on Sun, 29 Mar 2015

set -g status-bg "colour1"
set -g message-command-fg "colour1"
set -g status-justify "left"
set -g status-left-length "100"
set -g status "on"
set -g pane-active-border-fg "colour1"
set -g message-bg "colour0"
set -g status-right-length "100"
set -g status-right-attr "none"
set -g message-fg "colour1"
set -g message-command-bg "colour0"
set -g status-attr "none"
set -g pane-border-fg "colour0"
set -g status-left-attr "none"
setw -g window-status-fg "colour1"
setw -g window-status-attr "none"
setw -g window-status-activity-bg "colour1"
setw -g window-status-activity-attr "underscore"
setw -g window-status-activity-fg "colour1"
setw -g window-status-separator ""
setw -g window-status-bg "colour1"
set -g status-left "#[fg=colour1,bg=colour1] [#S] #[fg=colour1,bg=colour1,nobold,nounderscore,noitalics]"
set -g status-right "#[fg=colour1,bg=colour1,nobold,nounderscore,noitalics]#[fg=colour1,bg=colour1] \"#22T\" %H:%M %d-%b-%y "
setw -g window-status-format "#[fg=colour1,bg=colour1,nobold,nounderscore,noitalics]#[default] #I:#W#F #[fg=colour1,bg=colour1,nobold,nounderscore,noitalics]"
setw -g window-status-current-format "#[fg=colour1,bg=colour0,nobold,nounderscore,noitalics]#[fg=colour1,bg=colour0] #I:#W#F #[fg=colour0,bg=colour1,nobold,nounderscore,noitalics]"

Avoid spacing after session name.

I highly doubt that it is possible, but is there any way to remove the space after the session name "blog", so that the session name and the current active window are listed right after each other like "NORMAL" and "master" in my vim window?

skrmbillede 2014-02-27 kl 06 40 36

Unknown option: status-utf8

Hello,

Since, this option seems now useless and unnecessary, would it be possible to be able to modify the options set by default for tmux ?

In this case, I would like to be able to disable the status-utf8 option, in order to not have the warning message about an unknown option.

Thank you very much in advance :)

Add configurable separators

In vim-airline I'm able to configure left and right separator instead of disabling them completely.

I tried setting powerline_separators in vimrc but it doesn't seem to change the symbols (neither on startup nor when manually using :Tmuxline).

If there's already a way to set them, it would be great to have such description in README.md. If it's not possible - does it sound like a lot of work to be able to set it (or maybe even fetch the symbols from vim-airline configuration)?

How to configure a section in this powerline version

I used to use the regular powerline for tmux, and once I installed tmuxline.vim, I found that the settings I set in tmux.conf no longer take place.

I don't mind this so much, besides that I don't know where I can add my old settings again.

I mainly care about a little pomodoro script I used to cat out into a small corner of powerline, using:

`set -g status-right '#(eval $POWERLINE_COMMAND tmux right -R pane_id='tmux display -p "#D"') #(cat ~/.thyme-tmux)'

Is there a similar way to cat out a little file in tmuxline.vim?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.