All Projects → vimpostor → Vim Tpipeline

vimpostor / Vim Tpipeline

Licence: gpl-3.0
Embed your vim statusline in tmux.

Projects that are alternatives of or similar to Vim Tpipeline

Powerline
Powerline is a statusline plugin for vim, and provides statuslines and prompts for several other applications, including zsh, bash, tmux, IPython, Awesome and Qtile.
Stars: ✭ 12,989 (+14018.48%)
Mutual labels:  tmux, statusline
Dotfiles
My Neovim, ZSH, Tmux and dev tools setup, with installation scipts
Stars: ✭ 85 (-7.61%)
Mutual labels:  tmux
Idempotent Desktop
🛸 NixOS, Xmonad, Neovim
Stars: ✭ 51 (-44.57%)
Mutual labels:  tmux
Kubectl Cssh
A kubectl plugin to ssh into Kubernetes nodes within separate tmux panes
Stars: ✭ 76 (-17.39%)
Mutual labels:  tmux
Dotfiles
My dotfiles, managed with GNU stow
Stars: ✭ 56 (-39.13%)
Mutual labels:  tmux
To Vim Tmux Zsh
如何让 vim,tmux,zsh 成为我们的神器
Stars: ✭ 78 (-15.22%)
Mutual labels:  tmux
Dotfiles
bash, zsh, git, tmux, personal toolbox
Stars: ✭ 1,035 (+1025%)
Mutual labels:  tmux
Dotfiles
My configuration files
Stars: ✭ 89 (-3.26%)
Mutual labels:  tmux
Zynix Fusion
zynix-Fusion is a framework that aims to centralize, standardizeand simplify the use of various security tools for pentest professionals.zynix-Fusion (old name: Linux evil toolkit) has few simple commands, one of which is theinit function that allows you to define a target, and thus use all the toolswithout typing anything else.
Stars: ✭ 84 (-8.7%)
Mutual labels:  tmux
Neoline.vim
Status Line for Neovim focused on beauty and performance ✅
Stars: ✭ 69 (-25%)
Mutual labels:  statusline
Dotfiles
Workstation configuration, provisioning and tools
Stars: ✭ 67 (-27.17%)
Mutual labels:  tmux
Rainbarf
it's like Rainmeter, but for CLI!
Stars: ✭ 1,087 (+1081.52%)
Mutual labels:  tmux
Dotfiles
🐧 Configuration files
Stars: ✭ 81 (-11.96%)
Mutual labels:  tmux
Dotfiles
💻 macOS / Ubuntu dotfiles
Stars: ✭ 1,074 (+1067.39%)
Mutual labels:  tmux
Isomorphic Copy
Cross platform clipboard | networkless! remote copy
Stars: ✭ 86 (-6.52%)
Mutual labels:  tmux
Tmux Spotify
🎧 Spotify plugin for tmux
Stars: ✭ 49 (-46.74%)
Mutual labels:  tmux
Dotfiles
🏡 dotfiles
Stars: ✭ 66 (-28.26%)
Mutual labels:  tmux
Tmux Config
Tmux configuration, that supercharges your tmux to build cozy and cool terminal environment
Stars: ✭ 1,210 (+1215.22%)
Mutual labels:  tmux
Dotfiles
👾 ~/
Stars: ✭ 91 (-1.09%)
Mutual labels:  tmux
Dotfiles
💀 dotfiles! managed by GNU stow
Stars: ✭ 85 (-7.61%)
Mutual labels:  tmux

vim-tpipeline

Embed your vim statusline in the tmux statusline!

Screenshot

Installation

Using vim-plug:

Plug 'vimpostor/vim-tpipeline'

Put this in your ~/.tmux.conf:

set -g focus-events on
set -g status-style bg=default
set -g status-right '#(cat #{socket_path}-\#{session_id}-vimbridge)'
set -g status-right-length 120
set -g status-interval 0

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

If you like to have a left and right part of your statusline in tmux, see :help g:tpipeline_split.

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

Requirements

  • Vim 8 (with patch 8.2.2345 for best experience) OR Neovim
  • For best experience use a terminal that supports focus events (Known good terminals are Konsole, Gnome Terminal and iTerm2)
  • True color support (set termguicolors in vim)

Configuration

By default vim-tpipeline will copy your standard vim statusline. If your statusline is empty, the default tpipeline statusline from the screenshot above is used. 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 seen above
let g:tpipeline_statusline = '%!tpipeline#stl#line()'
" You can also use standard statusline syntax, see :help stl
let g:tpipeline_statusline = '%f'

By default vim-tpipeline flattens the statusline into one continuous chunk. If you would like to keep the left part and right part separate, then set let g:tpipeline_split = 1 in your .vimrc and use the following tmux block instead:

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 120
set -g status-right '#(cat #{socket_path}-\#{session_id}-vimbridge-R)'
set -g status-right-length 120
set -g status-interval 0
set -g status-justify centre # optionally put the window list in the middle

Some terminals do not fire FocusLost signals correctly. If you don't want tpipeline to respond to FocusLost, then use:

let g:tpipeline_focuslost = 0

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 a performance penalty.

How do I get the config from the screenshot at the top?

" .vimrc
set stl=%!tpipeline#stl#line()
let g:tpipeline_split = 1
# .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 120
set -g status-right '#(cat #{socket_path}-\#{session_id}-vimbridge-R)'
set -g status-right-length 120
set -g status-interval 0
set -g status-justify centre
set -g window-status-current-format "#[fg=colour4]\uE0B6#[fg=colour7,bg=colour4]#{?window_zoomed_flag,#[fg=yellow]🔍,}#W#[fg=colour4,bg=default]\uE0B4"
set -g window-status-format "#[fg=colour244]\uE0B6#[fg=default,bg=colour244]#W#[fg=colour244,bg=default]\uE0B4"

How do I update the statusline on every cursor movement?

let g:tpipeline_cursormoved = 1

Warning: When using neovim, this can cause performance problems with some configurations. If you experience this problem, you can fix it by using set guicursor= which disables neovim's DECSCUSR feature that can sometimes cause laggy scrolling when used inside tmux. In all other cases this autocmd can be used without problems. tpipeline is heavily optimized to allow for this usage and finishes within a few milliseconds to allow for smooth scrolling.

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. Note that this option is discouraged by tmux and can cause other issues.
  • 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?

With tmux version 3.2 and above 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?

  • 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, oneline 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 oneline. In tpipeline this works out of the box.
  • In oneline the tmux statusline is updated using a blocking call, whereas tpipeline uses non-blocking jobs to asynchronously update the statusline.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].