Skip to content

feat(nut): add mode#6

Merged
MunifTanjim merged 1 commit intomainfrom
feat-nut-mode
Oct 27, 2022
Merged

feat(nut): add mode#6
MunifTanjim merged 1 commit intomainfrom
feat-nut-mode

Conversation

@MunifTanjim
Copy link
Copy Markdown
Owner

local core = require("nui.bar.core")
local Bar = require("nougat.bar")
local sep = require("nougat.separator")
local nut = {
  mode = require("nougat.nut.mode").create,
}

local statusline = Bar("statusline")

statusline:add_item(nut.mode({
  prefix = " ",
  suffix = " ",
}))

statusline:add_item(nut.mode({
  sep_left = { content = " ", hl = {} },
  prefix = " ",
  suffix = " ",
  sep_right = sep.right_chevron_solid(),
  config = {
    text = {
      ["n"] = "NOR",
      ["i"] = "INS",
    },
    highlight = {
      normal = { bg = "cyan", fg = "bg" },
      insert = { bg = "purple", fg = "fg" },
    },
  },
}))

vim.go.statusline = core.generator(function(ctx)
  return statusline:generate(ctx)
end, { id = "nougat_statusline", context = {} })

Kapture 2022-10-27 at 23 01 53

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant