Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

After installing lazyvim, neovim only shows the current line number

After installing lazyvim, my neovim only shows the current line number.

How do I show all line numbers?

I typed ':set number' but it didn't work.

enter image description here

like image 385
hyde1004 Avatar asked Oct 26 '25 08:10

hyde1004


2 Answers

In your question you've posted your .bashrc file, this is not the file which contains LazyVim configuration. First you need to ensure that the number option is set to true in your LazyVim configuration files. you can add these 2 line in your options.lua file or vim-options.lua for numbers and relative numbers.

opt.number = true 
opt.relativenumber = true

or

vim.cmd("set number")
vim.cmd("set relativenumber")

If you've already tried :set number and it didn't work, its possible that your configuration is being overridden somewhere else, or there's an issue with how LazyVim is loading your configuration. you should ensure that your options.lua or vim-options.lua file is correctly placed in your nvim configuration directory.

like image 121
tribhuwan Avatar answered Oct 29 '25 05:10

tribhuwan


In my case setting it in lazy.lua didn't work, cause some plugin was overwriting it. It worked when placed at options.lua, though. I guess the reason is cause this has higher priority (probably being executed after plugins are installed)

This is the line I added to that file:

vim.opt.relativenumber = false

like image 26
Javi Avatar answered Oct 29 '25 07:10

Javi