summaryrefslogtreecommitdiffstatshomepage
path: root/nvim/.config/nvim/lua/plugins/lualine.lua
blob: 369ccf63c0f78e740724f227fb35375c060c29b5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
local status_ok, lualine = pcall(require, "lualine")
if not status_ok then
	return
end

local to_char = function(str)
	return str:sub(1, 1)
end

local nvim_gps = function()
	local status_gps_ok, gps = pcall(require, "nvim-gps")
	if not status_gps_ok then
		return
	end
	local gps_location = gps.get_location()
	if gps_location == "error" then
		return ""
	else
		return gps.get_location()
	end
end

local hide_in_width = function()
	return vim.fn.winwidth(0) > 80
end

lualine.setup({

	options = {
		component_separators = { left = "", right = "" },
		section_separators = { left = "", right = "" },
		disabled_filetypes = { "alpha" },
	},
	sections = {
		lualine_a = { { "mode", fmt = to_char } },
		lualine_c = {
			{ nvim_gps, cond = hide_in_width },
		},
	},
	tabline = {},
	extensions = { "quickfix", "fzf", "fugitive", "toggleterm", "neo-tree" },
})