GithubHelp home page GithubHelp logo

guruor / vim-tpipeline Goto Github PK

View Code? Open in Web Editor NEW

This project forked from vimpostor/vim-tpipeline

0.0 0.0 0.0 330 KB

Embed your vim statusline in tmux

License: GNU General Public License v3.0

Shell 1.42% Lua 4.95% Makefile 1.90% Dockerfile 0.49% Vim Script 91.24%

vim-tpipeline's Introduction

vim-tpipeline

Embed your vim statusline in the tmux statusline!

Screenshot

Installation

Using vim-plug:

Plug 'vimpostor/vim-tpipeline'

It is highly recommended to put this in your ~/.tmux.conf:

set -g focus-events on
set -g status-style bg=default
set -g status-left-length 90
set -g status-right-length 90
set -g status-justify centre

Restart tmux and now you should see your vim statusline inside tmux.

vim-tpipeline is compatible with all statuslines and can be used together with other statusline plugins like lualine. If it doesn't work with yours, file a bug report.

Requirements

  • Vim 8.2.4650 (or higher) OR Neovim 0.6 (or higher)
  • True color support (set termguicolors in vim)
  • For best experience use a terminal that supports focus events (Known good terminals are wezterm, konsole and iTerm2)

Configuration

This plugin will automatically embed your statusline in tmux with sane defaults. If you want to have more control over where it is placed and how this is done, disable the autoconfiguration with g:tpipeline_autoembed and embed the statusline manually, here is one example:

" .vimrc
" You can also use Lua for configuration, see :h lua-vim-variables for help
let g:tpipeline_autoembed = 0
# .tmux.conf
set -g focus-events on
set -g status-style bg=default
set -g status-left '#(cat #{socket_path}-\#{session_id}-vimbridge)'
set -g status-left-length 90
set -g status-right '#(cat #{socket_path}-\#{session_id}-vimbridge-R)'
set -g status-right-length 90
set -g status-justify centre

By default vim-tpipeline will copy your standard vim statusline. If you want to use a different statusline just for tmux, you can set it manually:

" tpipeline comes bundled with its own custom minimal statusline
let g:tpipeline_statusline = '%!tpipeline#stl#line()'
" You can also use standard statusline syntax, see :help stl
let g:tpipeline_statusline = '%f'

There are many more options available to accomodate for every specific usecase. Check them out in the comprehensive help file using :help tpipeline-configure.

FAQ

But why?

Usually there is plenty of empty space available in your tmux statusline, hence you make much better use of your space if you put your vim statusline there. After all you don't want to have your carefully handcrafted vim config end up as a bad Internet Explorer meme, do you? meme_shitpost

Can I use the default tpipeline statusline outside of tmux as well?

Yes, use set stl=%!tpipeline#stl#line() in your ~/.vimrc. In fact this plugin uses Vim's autoload mechanism to lazily load features, i.e. if you don't use tmux, you can still use the statusline inside vim without loading unnecessary features.

Focus events are not working for me in tmux

Besides putting set -g focus-events on in your tmux config, you also need to have the XT-capability available, which you can test by issuing the tput XT command. If the capability is not present inside tmux, then there are three ways to fix the issue:

  • Put set -g default-terminal "xterm-256color" in your tmux config.
  • Force vim to enable it by using this in your .vimrc
let &t_fe = "\<Esc>[?1004h"
let &t_fd = "\<Esc>[?1004l"
  • Write your own custom terminfo entry based on tmux-256color

How do I stop the centered window list from flickering when changing panes?

Since tmux version 3.2 you can use absolute-centre instead of centre:

-set -g status-justify centre
+set -g status-justify absolute-centre

Why should I use this plugin over onestatus?

  • In onestatus the tmux statusline is updated using a blocking call, whereas tpipeline uses non-blocking jobs to asynchronously update the statusline.
  • tpipeline works out of the box with your current vim statusline, whereas onestatus does not actually use your statusline at all and requires you to configure its own statusline.
  • As a result of the above, onestatus isn't able to use many vim features such as your vim colorscheme and requires you to redefine your colors. In tpipeline, vim colors are translated to tmux syntax automatically.
  • Simple things such as showing your current mode or linenumber require writing your own function in onestatus. In tpipeline this works out of the box.

vim-tpipeline's People

Contributors

andreykaipov avatar davidsierradz avatar guruor avatar shurizzle avatar tiagovla avatar vimpostor avatar williamhsieh avatar zeertzjq avatar

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.