Skip to content

Are there any more examples of custom components? #486

Answered by shadmansaleh
mnarrell asked this question in Q&A
Discussion options

You must be logged in to vote

Check out https://github.com/nvim-lualine/lualine.nvim/wiki/Component-snippets#mixed-indent

If you want to create a new type of component . You need to extened the base component class then implement update_status method.

Checkout components in https://github.com/nvim-lualine/lualine.nvim/tree/master/lua/lualine/components . & Base component is found here .

But if you're just putting it in your config . You can just use the mixed-indent function as a component as shown here

You can just do

local function mixed_indent()
  local space_pat = [[\v^ +]]
  local tab_pat = [[\v^\t+]]
  local space_indent = vim.fn.search(space_pat, 'nwc')
  local tab_indent = vim.fn.search(tab_pat, 'nwc')
  local m…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@mnarrell
Comment options

Answer selected by mnarrell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants