Code Monkey home page Code Monkey logo

Comments (5)

is0n avatar is0n commented on June 12, 2024 1

You can put a separator in the front of the components array.

Could you be a bit more specific?

Do you mind I covert this issue to a discussion? I think this may be helping other users.

I think that's a great idea :D

from tabby.nvim.

nanozuki avatar nanozuki commented on June 12, 2024

Yes, you can set a buffer line by tabby.nvim. But you can only use low level API to make it, because the layout of high level is fixed. Here is a simple example:

local components = function()
  local coms = {}
  local cur_bufid = vim.api.nvim_get_current_buf()
  for _, bufid in ipairs(vim.api.nvim_list_bufs()) do
    if vim.api.nvim_buf_is_valid(bufid) and vim.bo[bufid].buflisted then
      local hl = 'TabLine'
      if bufid == cur_bufid then
        hl = 'TabLineSel'
      end
      local buf_name = vim.fn.fnamemodify(vim.api.nvim_buf_get_name(bufid), ':~:.')
      table.insert(coms, {
        type = 'text',
        text = {
          string.format(' %d: %s ', bufid, buf_name),
          hl = hl,
        },
      })
      table.insert(coms, {
        type = 'text',
        text = {
          ' ',
          hl = 'TabLineFill',
        },
      })
    end
  end
  return coms
end
require('tabby').setup({
  components = components,
})

image

from tabby.nvim.

nanozuki avatar nanozuki commented on June 12, 2024

But for now, the customer handler of mouse click not implemented(in TODO list). So cannot click buffer label to switch buffer yet.

from tabby.nvim.

is0n avatar is0n commented on June 12, 2024

How could I put the buffers at the tail of my config?

from tabby.nvim.

nanozuki avatar nanozuki commented on June 12, 2024

You can put a separator in the front of the components array.

{ type = "spring" }

and the buffer labels will be pushed to the end.

Do you mind I covert this issue to a discussion? I think this may be helping other users.

from tabby.nvim.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.