🗑️ remove(nvim): numbertoggle plugin because now there's an autocmd which does the same thing
This commit is contained in:
parent
4fff4f9895
commit
565a64f4f1
4 changed files with 23 additions and 8 deletions
1
.config/nvim/.github/README.md
vendored
1
.config/nvim/.github/README.md
vendored
|
@ -518,7 +518,6 @@
|
|||
- [folke/noice.nvim](https://dotfyle.com/plugins/folke/noice.nvim)
|
||||
- [rcarriga/nvim-notify](https://dotfyle.com/plugins/rcarriga/nvim-notify)
|
||||
- [kawre/leetcode.nvim](https://dotfyle.com/plugins/kawre/leetcode.nvim)
|
||||
- [sitiom/nvim-numbertoggle](https://dotfyle.com/plugins/sitiom/nvim-numbertoggle)
|
||||
- [axieax/urlview.nvim](https://dotfyle.com/plugins/axieax/urlview.nvim)
|
||||
- [3rd/image.nvim](https://dotfyle.com/plugins/3rd/image.nvim)
|
||||
- [luckasRanarison/nvim-devdocs](https://dotfyle.com/plugins/luckasRanarison/nvim-devdocs)
|
||||
|
|
|
@ -87,7 +87,6 @@
|
|||
"plugins.extras.ui.context",
|
||||
"plugins.extras.ui.highlight-undo",
|
||||
"plugins.extras.ui.import-cost",
|
||||
"plugins.extras.ui.number-toggle",
|
||||
"plugins.extras.ui.rainbow-delimeters",
|
||||
"plugins.extras.ui.smooth-scrolling",
|
||||
"plugins.extras.ui.windows",
|
||||
|
@ -108,4 +107,3 @@
|
|||
},
|
||||
"version": 2
|
||||
}
|
||||
|
||||
|
|
|
@ -90,3 +90,25 @@ au({ "BufNewFile", "BufRead" }, {
|
|||
vim.diagnostic.disable(0)
|
||||
end,
|
||||
})
|
||||
local numbertoggle = ag("numbertoggle", { clear = true })
|
||||
-- Toggle between relative/absolute line numbers
|
||||
au({ "BufEnter", "FocusGained", "InsertLeave", "CmdlineLeave", "WinEnter" }, {
|
||||
pattern = "*",
|
||||
group = numbertoggle,
|
||||
callback = function()
|
||||
if vim.o.nu and vim.api.nvim_get_mode().mode ~= "i" then
|
||||
vim.opt.relativenumber = true
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
au({ "BufLeave", "FocusLost", "InsertEnter", "CmdlineEnter", "WinLeave" }, {
|
||||
pattern = "*",
|
||||
group = numbertoggle,
|
||||
callback = function()
|
||||
if vim.o.nu then
|
||||
vim.opt.relativenumber = false
|
||||
vim.cmd.redraw()
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
|
|
@ -1,4 +0,0 @@
|
|||
return {
|
||||
"sitiom/nvim-numbertoggle",
|
||||
event = "LazyFile",
|
||||
}
|
Loading…
Add table
Reference in a new issue