stuff
This commit is contained in:
parent
022744c075
commit
c7594f3e40
3 changed files with 6 additions and 43 deletions
|
|
@ -80,33 +80,7 @@ vim.api.nvim_create_autocmd("UIEnter", {
|
|||
|
||||
-- Print the line number in front of each line
|
||||
vim.o.number = true
|
||||
|
||||
local numbertoggle_group = vim.api.nvim_create_augroup("numbertoggle", {})
|
||||
|
||||
vim.api.nvim_create_autocmd({ "BufEnter", "FocusGained", "InsertLeave", "CmdlineLeave", "WinEnter" }, {
|
||||
pattern = "*",
|
||||
group = numbertoggle_group,
|
||||
callback = function()
|
||||
if vim.o.nu and vim.api.nvim_get_mode().mode ~= "i" then
|
||||
vim.opt.relativenumber = true
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd({ "BufLeave", "FocusLost", "InsertEnter", "CmdlineEnter", "WinLeave" }, {
|
||||
pattern = "*",
|
||||
group = numbertoggle_group,
|
||||
callback = function()
|
||||
if vim.o.nu then
|
||||
vim.opt.relativenumber = false
|
||||
-- Conditional taken from https://github.com/rockyzhang24/dotfiles/commit/03dd14b5d43f812661b88c4660c03d714132abcf
|
||||
-- Workaround for https://github.com/neovim/neovim/issues/32068
|
||||
if not vim.tbl_contains({ "@", "-" }, vim.v.event.cmdtype) then
|
||||
vim.cmd("redraw")
|
||||
end
|
||||
end
|
||||
end,
|
||||
})
|
||||
vim.o.relativenumber = true
|
||||
|
||||
-- [[ Create user commands ]]
|
||||
-- See `:h nvim_create_user_command()` and `:h user-commands`
|
||||
|
|
@ -245,17 +219,7 @@ vim.api.nvim_create_user_command("DapInit", function()
|
|||
end, { desc = "Initialize Debug Adater Protocol support" })
|
||||
|
||||
-- [[ UI Configuration ]]
|
||||
vim.pack.add({
|
||||
"https://github.com/nvim-mini/mini.completion",
|
||||
"https://github.com/nvim-mini/mini.snippets",
|
||||
"https://github.com/nvim-mini/mini.icons",
|
||||
"https://github.com/nvim-mini/mini.statusline",
|
||||
"https://github.com/nvim-mini/mini-git",
|
||||
"https://github.com/nvim-mini/mini.diff",
|
||||
"https://github.com/nvim-mini/mini.clue",
|
||||
"https://github.com/nvim-mini/mini.hipatterns",
|
||||
"https://github.com/nvim-mini/mini.notify",
|
||||
}, { confirm = false })
|
||||
vim.pack.add({ "https://github.com/nvim-mini/mini.nvim" })
|
||||
|
||||
vim.o.winborder = "none"
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue