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