summaryrefslogblamecommitdiffstats
path: root/.config/nvim/lua/statusline.lua
blob: c436a8e4b8885646a16adcace872fb6d2f9c683e (plain) (tree)















































                                                   

                                   
local api = vim.api
local cmd = vim.cmd
local utils = require('utils')

function _(str)
  return '[' .. str .. ']'
end

function set_split()
  return '%m%='
end

function get_separator()
  return ' '
end

function get_file()
  return '%f'
end

function get_fileformat()
  return '%{&fileformat}'
end

function get_fileencoding()
  return '%{&fileencoding?&fileencoding:&encoding}'
end

function get_scrollposition()
  return '%p%%'
end

function get_cursorposition()
  return '%l:%c'
end

function get_statusline()
  return table.concat({
    get_file(),
    set_split(),
    _(get_fileencoding()),
    _(get_fileformat()),
    _(get_scrollposition()),
    _(get_cursorposition()),
  })
end

-- Enable statusline
vim.o.lastatus = 2
vim.o.statusline = get_statusline()
remember that computers suck.