Compare commits
1 Commits
679201030a
...
93c0eb4679
| Author | SHA1 | Date | |
|---|---|---|---|
| 93c0eb4679 |
30
init.lua
30
init.lua
@@ -5,6 +5,36 @@ vim.g.maplocalleader = ","
|
|||||||
-- Lazy
|
-- Lazy
|
||||||
require("config.lazy")
|
require("config.lazy")
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd("VimEnter", {
|
||||||
|
callback = function()
|
||||||
|
-- Verify if the current directory is a git repo
|
||||||
|
local is_git = os.execute("git rev-parse --is-inside-work-tree > /dev/null 2>&1")
|
||||||
|
if is_git ~= 0 then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Perform an async fetch to avoid startup lag
|
||||||
|
vim.fn.jobstart("git fetch", {
|
||||||
|
on_exit = function()
|
||||||
|
-- Get the number of commits the remote is ahead of local HEAD
|
||||||
|
local count = vim.fn.system("git rev-list --count HEAD..@{u} 2>/dev/null"):gsub("%s+", "")
|
||||||
|
|
||||||
|
if count ~= "" and tonumber(count) > 0 then
|
||||||
|
vim.schedule(function()
|
||||||
|
vim.notify(
|
||||||
|
" " .. count .. " new commit(s) available on remote.",
|
||||||
|
vim.log.levels.INFO,
|
||||||
|
{ title = "Git Status", icon = "" }
|
||||||
|
)
|
||||||
|
end)
|
||||||
|
else
|
||||||
|
vim.notify("all good")
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
-- Line numbers
|
-- Line numbers
|
||||||
vim.opt.cursorline = true
|
vim.opt.cursorline = true
|
||||||
vim.wo.relativenumber = true
|
vim.wo.relativenumber = true
|
||||||
|
|||||||
@@ -2,6 +2,11 @@ return {
|
|||||||
"folke/noice.nvim",
|
"folke/noice.nvim",
|
||||||
event = "VeryLazy",
|
event = "VeryLazy",
|
||||||
config = function()
|
config = function()
|
||||||
|
vim.notify = require("notify").setup({
|
||||||
|
background_colour = "#000000",
|
||||||
|
render = "compact",
|
||||||
|
stages = "slide",
|
||||||
|
})
|
||||||
require("noice").setup({
|
require("noice").setup({
|
||||||
messages = {
|
messages = {
|
||||||
enabled = true,
|
enabled = true,
|
||||||
@@ -32,11 +37,6 @@ return {
|
|||||||
lsp_doc_border = false, -- add a border to hover docs and signature help
|
lsp_doc_border = false, -- add a border to hover docs and signature help
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
require("notify").setup({
|
|
||||||
background_colour = "#000000",
|
|
||||||
render = "compact",
|
|
||||||
stages = "slide",
|
|
||||||
})
|
|
||||||
end,
|
end,
|
||||||
dependencies = {
|
dependencies = {
|
||||||
-- if you lazy-load any plugin below, make sure to add proper `module="..."` entries
|
-- if you lazy-load any plugin below, make sure to add proper `module="..."` entries
|
||||||
|
|||||||
Reference in New Issue
Block a user