summaryrefslogtreecommitdiff
path: root/nvim/.config/nvim/lua/statusline/line.lua
blob: f70c2f8b98cb2878dec7d4bf5f79058993be9148 (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
local git = require('statusline.git')
local utils = require('utils')
local M = {}

-- set highlights for statusline sections
vim.api.nvim_exec(
[[
  hi PrimaryBlock ctermfg=06 ctermbg=00
  hi SecondaryBlock   ctermfg=07 ctermbg=00
  hi Blanks   ctermfg=08 ctermbg=00
  hi GitClean ctermfg=02 ctermbg=00
  hi GitDirty ctermfg=01 ctermbg=00
]], false)

function M.statusline()
  local stl = {
    '%#PrimaryBlock#',
    '%f',
    '%#Blanks#',
    '%m',
    '%#SecondaryBlock#',
    ' '..git.git_branch,
    '%=',
    '%#SecondaryBlock#',
    '%l,%c ',
    '%#PrimaryBlock#',
    '%{&filetype}',
  }
  return table.concat(stl)
end

return M