Skip to content

Instantly share code, notes, and snippets.

@sainnhe
Last active October 26, 2022 23:52
Show Gist options
  • Star 46 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save sainnhe/b8240bc047313fd6185bb8052df5a8fb to your computer and use it in GitHub Desktop.
Save sainnhe/b8240bc047313fd6185bb8052df5a8fb to your computer and use it in GitHub Desktop.
Sexy & Powerful Configuration for Lightline and Tmux

π‘Ίπ’†π’™π’š & π‘·π’π’˜π’†π’“π’‡π’–π’ π‘ͺπ’π’π’‡π’Šπ’ˆπ’–π’“π’‚π’•π’Šπ’π’ 𝒇𝒐𝒓 π‘³π’Šπ’ˆπ’‰π’•π’π’Šπ’π’† 𝒂𝒏𝒅 π‘»π’Žπ’–π’™

Nerd Font

First of all, install a nerd font, and apply it: nerd font

Then, pick a unicode over here: nerd font cheat sheet. In this case, search keyword sep

After getting the unicode number, you can use it like this: :echo "\ue0b9"

FAQ: Why are my nerdfont symbols not displaying correctly?

The display of nerdfont can be affected by many factors, including terminal emulator, font type, font size, zoom, etc.

Personally, I use tilix as terminal emulator, FuraCode Nerd Font Mono Regular as font type, font size is 12, 2x zoom on my surface pro 2017.

You can adjust it yourself and choose a configuration that suits you.

Lightline Configuration

Maybe you have noticed that the font of the lightline of the screenshot and the title of this gist is somewhat different from the font in the vicinity, this simple trick is impl by sainnhe/artify.vim.

The lightline configuration depends on these plugins:

Plug 'itchyny/lightline.vim'
Plug 'sainnhe/artify.vim'
Plug 'itchyny/vim-gitbranch'
Plug 'macthecadillac/lightline-gitdiff'
Plug 'maximbaz/lightline-ale'
Plug 'albertomontesg/lightline-asyncrun'
Plug 'rmolin88/pomodoro.vim'

This is the configuration: dotfiles

Tmux

Tmux cannot display true colors correctly, check this issue for solution: How to use true colors in vim under tmux? #1246

You can use this script to test if true colors in tmux have been overridden. If there is no difference between executing this script in tmux and out of tmux, congratulations, this annoying bug has been solved.

The tmux theme is impl by edkolev/tmuxline.vim, but it doesn't support true colors of lightline yet. I've opened a PR to solve this but have not been merged yet: Add termguicolors support for lightline #101. You can temporarily use my fork

And this is the configuration of tmuxline: dotfiles

It depends on these plugins:

set -g @plugin 'tmux-plugins/tmux-prefix-highlight'
set -g @plugin 'tmux-plugins/tmux-net-speed'
set -g @plugin 'samoshkin/tmux-plugin-sysstat'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment