Skip to content
Aquib edited this page Aug 24, 2021 · 1 revision

Some useful config Ideas:


Create color value tables to match your current colorscheme.

local gruvbox = {
    n = "#a89985",
    i = "#84a598",
    c = "#8fbf7f",
    v = "#fc802d",    -- etc...
}

-- Assign this table as mode_colors
require('staline').setup{
	mode_colors = gruvbox
}

Use non-unicode characters for showing modes.

local no_unicode_modes = {
    n = "N ",
    i = "I ",
    c = "C ",
    v = "V ",    -- etc...
}

-- Assign this table as mode_icons.
require('staline').setup{
	mode_icons = no_unicode_modes
}

-- You could change the seperators too if you want.

My personal config as of editing this file:

staline.nvim

require'staline'.setup{
	sections = {
		left = {
			'- ', '-mode', 'left_sep_double',
			'file_name', '', 'branch'
		},
		mid  = {'lsp'},
		right= {
			'cool_symbol', '',
			vim.bo.fileencoding:upper(), 'right_sep_double', '-line_column'
		}
	},
	defaults = {
		cool_symbol = "",
		left_separator = "",
		right_separator = "",
		bg = "#303030",
		full_path = false,
		branch_symbol = ""
	},
	mode_colors = {
		n = "#986fec",
		i = "#e86671",
		ic= "#e86671",
		c = "#e27d60"
	}
}
  • NOTE: as seen in this example, adding custom strings (like vim.bo.fileencoding) inside sections is possible.

Nvimtree, dashboard, and packer looks like this by default:

Dashboard
NvimTree
Packer

To turn off staline in NvimTree (and likewise for others), set this line in init.lua (from this issue)

vim.cmd [[au BufEnter,BufWinEnter,WinEnter,CmdwinEnter * if bufname('%') == "NvimTree" | set laststatus=0 | else | set laststatus=2 | endif]]
Clone this wiki locally