Skip to content

bluz71/vim-mistfly-statusline

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mistfly statusline

mistfly statusline is a simple, fast and informative statusline for Vim and (legacy) Neovim coded in Vimscript.

👉 Contemporary Neovim users will need to use the pure-Lua linefly plugin instead of mistfly.

mistfly provides optional tabline and Neovim winbar support when the appropriate settings are enabled; refer to mistflyTabLine and mistflyWinBar.

mistfly will adapt it's colors to the colorscheme currently in effect. Colors can also be customized if desired.

Lastly, mistfly is a light statusline plugin clocking in at about 500 lines of code. For comparison, the lightline, airline and lualine statusline plugins contain over 3,600, 7,300 and 8,000 lines of code respectively. In fairness, the latter plugins are more featureful, configurable and visually pleasing.

⚠️ mistfly has a predominantly fixed layout, this will not be an appropriate statusline plugin if layout flexibility is desired.

Screenshots

normal insert visual command replace

The above screenshots are using the nightfly colorscheme and the Iosevka font with Git changes, Diagnostics and indent-status enabled.

Statusline Startup Comparison

A startup comparison of mistfly against various popular statusline plugins, with their out-of-the-box defaults, on a clean and minimal Neovim setup with the moonfly colorscheme. The Neovim startup times in the following table are provived by the dstein64/vim-startuptime plugin.

Startup times are the average of five consecutive runs. Note, stock is run without any statusline plugin.

stock mistfly lightline airline lualine
20.2ms 22.9ms 32.3ms 117.6ms 26.9ms

Startup times as of January 2023 on my system; performance on other systems will vary.

Plugins, Linters and Diagnostics supported

⚡ Requirements

mistfly requires Vim 8 (or later) or Neovim 0.8 (or earlier); Neovim 0.9 (or later) is not supported; the pure-Lua linefly plugin should instead be used with contemporary versions of Neovim.

mistfly requires a GUI capable version of Vim or Neovim with an appropriate colorscheme set. A GUI client, or a modern version of Vim or Neovim with the termguicolors option enabled in a true-color terminal, is required.

Please also make sure that the laststatus option is set to either: 1, 2 or 3.

Installation

Install bluz71/vim-mistfly-statusline with your preferred plugin manager.

vim-plug:

Plug 'bluz71/vim-mistfly-statusline'

packer.nvim:

use 'bluz71/vim-mistfly-statusline'

lazy.nvim:

{ 'bluz71/vim-mistfly-statusline' },

Please do not lazy-load mistfly.

Layout And Default Colors

The mistfly-statusline layout consists of two main groupings, the left-side and right-side groups as follows:

+-------------------------------------------------+
| A | B | C | D                         X | Y | Z |
+-------------------------------------------------+
Section Purpose
A* Mode status (normal, insert, visual, command and replace modes)
B Filename (refer below for details)
C* Git branch name (if applicable)
D* Plugins notification (git, diagnostic and session status)
X Current position
Y* Total lines and current location as percentage
Z Optional indent status (spaces and tabs shift width)

Sections marked with a * are linked to a highlight group and are colored, refer to the next section for details.

Note, filenames will be displayed as follows:

  • Pathless filenames only for files in the current working directory

  • Relative paths in preference to absolute paths for files not in the current working directory

  • ~-style home directory paths in preference to absolute paths

  • Shortened, for example foo/bar/bazz/hello.txt will be displayed as f/b/b/hello.txt, but not when Neovim's global statusline (set laststatus=3) is in effect.

  • Trimmed, a maximum of four path components will be displayed for a filename, if a filename is more deeply nested then only the four most significant components, including the filename, will be displayed with an ellipses ... prefix used to indicate path trimming.

Highlight Groups And Colors

Sections marked with * in the previous section are linked to the following custom highlight groups with their associated fallbacks if the current colorscheme does not support mistfly.

Segment Custom Highlight Group Synthesized Highlight Fallback
Normal Mode MistflyNormal Directory
Insert Mode MistflyInsert String
Visual Mode MistflyVisual Statement
Command Mode MistflyCommand WarningMsg
Replace Mode MistflyReplace Error

Note, the following colorschemes support mistfly, either within the colorscheme (moonfly & nightfly) or within this plugin (all others):

Lastly, if the fallback colors do not suit then it is very easy to override with your own highlights.

🎁 Here is a simple example of customized mistfly colors. Save the following at the end of your initialization file after setting your colorscheme.

highlight! link MistflyNormal DiffChange
highlight! link MistflyInsert WildMenu
highlight! link MistflyVisual IncSearch
highlight! link MistflyCommand WildMenu
highlight! link MistflyReplace ErrorMsg

🔧 Options

Option Default State
mistflySeparatorSymbol
mistflyProgressSymbol
mistflyActiveTabSymbol
mistflyGitBranchSymbol
mistflyErrorSymbol E
mistflyWarningSymbol W
mistflyInformationSymbol I
mistflyTabLine Disabled
mistflyWinBar Disabled
mistflyWithFileIcon Enabled
mistflyWithGitBranch Enabled
mistflyWithGitStatus Enabled
mistflyWithDiagnosticStatus Enabled
mistflyWithSessionStatus Enabled
mistflyWithIndentStatus Disabled

mistflySeparatorSymbol

The mistflySeparatorSymbol option specifies which character symbol to use for segment separators in the statusline.

By default, the character (Unicode U+23AA) will be displayed.

To specify your own separator symbol please add the following to your initialization file:

" Vimscript initialization file
let g:mistflySeparatorSymbol = '<<SYMBOL-OF-YOUR-CHOOSING>>'
-- Lua initialization file
vim.g.mistflySeparatorSymbol = '<<SYMBOL-OF-YOUR-CHOOSING>>'

mistflyProgressSymbol

The mistflyProgressSymbol option specifies which character symbol to use to indicate location-as-percentage in the statusline.

By default, the character (Unicode U+2193) will be displayed.

To specify your own progress symbol, or no symbol at all, please add the following to your initialization file:

" Vimscript initialization file
let g:mistflyProgressSymbol = '<<SYMBOL-OF-YOUR-CHOOSING-OR-EMPTY>>'
-- Lua initialization file
vim.g.mistflyProgressSymbol = '<<SYMBOL-OF-YOUR-CHOOSING-OR-EMPTY>>'

mistflyActiveTabSymbol

The mistflyActiveTabSymbol option specifies which character symbol to use to signify the active tab in the tabline.

By default, the character (Unicode U+25AA) will be displayed.

To specify your own active tab symbol please add the following to your initialization file:

" Vimscript initialization file
let g:mistflyActiveTabSymbol = '<<SYMBOL-OF-YOUR-CHOOSING>>'
-- Lua initialization file
vim.g.mistflyActiveTabSymbol = '<<SYMBOL-OF-YOUR-CHOOSING>>'

mistflyGitBranchSymbol

The mistflyGitBranchSymbol option specifies which character symbol to use when displaying Git branch details.

By default, the character (Powerline U+E0A0) will be displayed. Many modern monospace fonts will contain that character.

To specify your own Git branch symbol, or no symbol at all, please add the following to your initialization file:

" Vimscript initialization file
let g:mistflyGitBranchSymbol = '<<SYMBOL-OF-YOUR-CHOOSING-OR-EMPTY>>'
-- Lua initialization file
vim.g.mistflyGitBranchSymbol = '<<SYMBOL-OF-YOUR-CHOOSING-OR-EMPTY>>'

mistflyErrorSymbol

The mistflyErrorSymbol option specifies which character symbol to use when displaying Diagnostic errors.

By default, the E character, will be displayed.

To specify your own error symbol please add the following to your initialization file:

" Vimscript initialization file
let g:mistflyErrorSymbol = '<<SYMBOL-OF-YOUR-CHOOSING>>'
-- Lua initialization file
vim.g.mistflyErrorSymbol = '<<SYMBOL-OF-YOUR-CHOOSING>>'

mistflyWarningSymbol

The mistflyWarningSymbol option specifies which character symbol to use when displaying Diagnostic warnings.

By default, the W character, will be displayed.

To specify your own warning symbol please add the following to your initialization file:

" Vimscript initialization file
let g:mistflyWarningSymbol = '<<SYMBOL-OF-YOUR-CHOOSING>>'
-- Lua initialization file
vim.g.mistflyWarningSymbol = '<<SYMBOL-OF-YOUR-CHOOSING>>'

mistflyInformationSymbol

The mistflyInformationSymbol option specifies which character symbol to use when displaying Diagnostic information.

By default, the I character, will be displayed.

To specify your own information symbol please add the following to your initialization file:

" Vimscript initialization file
let g:mistflyInformationSymbol = '<<SYMBOL-OF-YOUR-CHOOSING>>'
-- Lua initialization file
vim.g.mistflyInformationSymbol = '<<SYMBOL-OF-YOUR-CHOOSING>>'

mistflyTabLine

The mistflyTabLine option specifies whether to let this plugin manage the tabline in addition to the statusline. By default tabline management will not be undertaken.

If enabled, mistfly will render a simple numbered, and clickable, window-space layout in the tabline; note, no buffers will be displayed in the tabline since there are many plugins that already provide that capability.

To enable mistfly's tabline support please add the following to your initialization file:

" Vimscript initialization file
let g:mistflyTabLine = v:true
-- Lua initialization file
vim.g.mistflyTabLine = true

💡 Mappings, such as the following, may be useful to quickly switch between the numbered window-spaces:

nnoremap <Leader>1 1gt
nnoremap <Leader>2 2gt
nnoremap <Leader>3 3gt
nnoremap <Leader>4 4gt
nnoremap <Leader>5 5gt
nnoremap <Leader>6 6gt
nnoremap <Leader>7 7gt
nnoremap <Leader>8 8gt
nnoremap <Leader>9 9gt

A screenshot of the tabline:

tabline


mistflyWinBar

The mistflyWinBar option specifies whether to display Neovim's window bar at the top of each window. By default window bars will not be displayed.

Note, Neovim 0.8 (or later) is required for this feature.

Displaying a window bar is recommended when Neovim's global statusline is enabled via set laststatus=3; the winbar will then display the file name at the top of each window to disambiguate splits. Also, if there is only one window in the current tab then a winbar will not be displayed (it won't be needed).

To enable Neovim's winbar feature please add the following to your initialization file:

" Vimscript initialization file
let g:mistflyWinBar = v:true
-- Lua initialization file
vim.g.mistflyWinBar = true

mistflyWithFileIcon

The mistflyWithFileIcon option specifies whether a filetype icon, from a Nerd Font, will be displayed prior to the filename in the statusline (and optional winbar).

Note, a Nerd Font must be active and the vim-devicons or nvim-web-devicons plugin must also be installed and active.

By default a filetype icon will be displayed if possible.

To disable the display of a filetype icon please add the following to your initialization file:

" Vimscript initialization file
let g:mistflyWithFileIcon = v:false
-- lua initialization file
vim.g.mistflyWithFileIcon = false

mistflyWithGitBranch

The mistflyWithGitBranch option specifies whether to display Git branch details in the statusline. By default Git branches will be displayed in the statusline.

To disable the display of Git branches in the statusline please add the following to your initialization file:

" Vimscript initialization file
let g:mistflyWithGitBranch = v:false
-- Lua initialization file
vim.g.mistflyWithGitBranch = false

mistflyWithGitStatus

The mistflyWithGitStatus option specifies whether to display the Git status of the current buffer in the statusline.

The Gitsigns, GitGutter and Signify plugins are supported.

By default, the Git status will be displayed if one of the above plugins are loaded.

To disable the display of Git status in the statusline please add the following to your initialization file:

" Vimscript initialization file
let g:mistflyWithGitStatus = v:false
-- Lua initialization file
vim.g.mistflyWithGitStatus = false

mistflyWithDiagnosticStatus

The mistflyWithDiagnosticStatus option specifies whether to indicate the presence of the Diagnostics in the current buffer.

Neovim Diagnositics, ALE and Coc are supported.

By default, Diagnostics will be displayed if one of the above plugins are loaded.

If Diagnostic display is not wanted then please add the following to your initialization file:

" Vimscript initialization file
let g:mistflyWithDiagnosticStatus = v:false
-- Lua initialization file
vim.g.mistflyWithDiagnosticStatus = false

mistflyWithSessionStatus

The mistflyWithSessionStatus option specifies whether to display Obsession session details in the statusline.

By default, session details will be displayed if the plugin is loaded.

To disable the display of session details in the statusline please add the following to your initialization file:

" Vimscript initialization file
let g:mistflyWithSessionStatus = v:false
-- Lua initialization file
vim.g.mistflyWithSessionStatus = false

mistflyWithIndentStatus

The mistflyWithIndentStatus option specifies whether to display the indentation status as the last component in the statusline. By default indentation status will not be displayed.

Note, if the expandtab option is set, for the current buffer, then tab stop will be displayed, for example Tab:4 (tab equals four spaces); if on the other hand noexpandtab option is set then shift width will be displayed instead, for example Spc:2 ('spc' short for 'space').

To enable indentation status please add the following to your initialization file:

" Vimscript initialization file
let g:mistflyWithIndentStatus = v:true
-- Lua initialization file
vim.g.mistflyWithIndentStatus = true

Sponsor

Ko-fi

License

License: MIT

About

A simple Vimscript statusline for Vim

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages

No packages published