nvim/lua/statusline/line.lua (view raw)
1local git = require('statusline.git')
2local M = {}
3
4-- set highlights for statusline sections
5vim.api.nvim_exec(
6[[
7 hi PrimaryBlock ctermfg=06 ctermbg=00
8 hi SecondaryBlock ctermfg=07 ctermbg=00
9 hi Blanks ctermfg=08 ctermbg=00
10 hi GitClean ctermfg=02 ctermbg=00
11 hi GitDirty ctermfg=01 ctermbg=00
12]], false)
13
14function M.statusline()
15 local stl = {}
16 if vim.bo.filetype ~= 'NvimTree' then
17 stl = {''}
18 end
19
20 stl = {
21 '%#PrimaryBlock#',
22 '%f',
23 '%#Blanks#',
24 '%m',
25 '%#SecondaryBlock#',
26 ' '..git.git_branch,
27 '%=',
28 '%#SecondaryBlock#',
29 '%l,%c ',
30 '%#PrimaryBlock#',
31 '%{&filetype}',
32 }
33 return table.concat(stl)
34end
35
36return M