How to refresh LunarVim after Git pull or Git checkout?

125 views Asked by At

Does anyone know how to refresh LunarVim after a Git pull or a Git checkout? I keep working around this by closing and reopening LunarVim, which is completely wrong.

1

There are 1 answers

0
OguzhanOnal On
vim.o.autoread = true
vim.api.nvim_create_autocmd({ 'CursorHold', 
'CursorHoldI', 'FocusGained' }, {
      command = "if mode() != 'c' | 
      checktime | endif",
      pattern = { '*' },
})

You can create autocmd like this and it will change buffer if file changed in disk like git pull