AstroNvim / AstroNvim

AstroNvim is an aesthetic and feature-rich neovim config that is extensible and easy to use with a great set of plugins
https://AstroNvim.com
GNU General Public License v3.0
12.62k stars 919 forks source link

Easy way to shift current line number #2354

Closed geetmankar closed 11 months ago

geetmankar commented 11 months ago

Is your feature related to a problem?

I want the line numbers to be like:

image

That is, I want the current line number to be shiftable to the left (or right). However I cannot seem to find it.

Currently, even after using the vim.opt settings of the shown image does not give me the same result

Describe the new feature

An option to shift the current line number to the left side, as shown in the earlier image.

Additional context

No response

mehalter commented 11 months ago

Yup! This is possible through our provided Heirline Lua status API:

{
  "rebelot/heirline.nvim",
  opts = function(_, opts)
    local status = require "astronvim.utils.status"
    opts.statuscolumn = {
      init = function(self) self.bufnr = vim.api.nvim_get_current_buf() end,
      status.component.foldcolumn(),
      status.component.numbercolumn {
        numbercolumn = { culright = false },
      },
      status.component.signcolumn(),
    }
  end,
}

You just want to add this somewhere in your plugins

geetmankar commented 11 months ago

Thank you so much! The option wasn't described in the main website docs, so I thought it might be complicated. Turns out it's just in the API.

Love your work by the way! I was using NvChad before but couldn't figure out how to get multiple LSPs working together since many of them have exclusive features that others don't. AstroNvim automatically does that so it's a huge relief since most of my scientific work involves working with Python.