From 82548f6214fb213976ec02ad11b7c9a9664ff818 Mon Sep 17 00:00:00 2001 From: desktop Date: Mon, 4 Dec 2023 23:35:20 +0300 Subject: [PATCH] nvim : enable autoread. --- .config/nvim/init.lua | 45 ++++++++++++++-------------- .config/nvim/lua/config/autoread.lua | 5 ++++ 2 files changed, 28 insertions(+), 22 deletions(-) create mode 100644 .config/nvim/lua/config/autoread.lua diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index 248876a..1688756 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -1,24 +1,25 @@ -require('plugin/init') +require("plugin/init") -require('config/search') -require('config/tab') -require('config/etc') +require("config/autoread") +require("config/search") +require("config/tab") +require("config/etc") -require('key/leader') -require('key/filetree') -require('key/lsp') -require('key/whichkey') -require('key/navigation') -require('key/comment') -require('key/gitsigns') -require('key/trouble') -require('key/terminal') -require('key/autocomplete') -require('key/window') -require('key/telescope') -require('key/common') -require('key/todo') -require('key/align') -require('key/fold') -require('key/update') -require('key/macro') +require("key/leader") +require("key/filetree") +require("key/lsp") +require("key/whichkey") +require("key/navigation") +require("key/comment") +require("key/gitsigns") +require("key/trouble") +require("key/terminal") +require("key/autocomplete") +require("key/window") +require("key/telescope") +require("key/common") +require("key/todo") +require("key/align") +require("key/fold") +require("key/update") +require("key/macro") diff --git a/.config/nvim/lua/config/autoread.lua b/.config/nvim/lua/config/autoread.lua new file mode 100644 index 0000000..a7c4300 --- /dev/null +++ b/.config/nvim/lua/config/autoread.lua @@ -0,0 +1,5 @@ +vim.o.autoread = true +vim.api.nvim_create_autocmd({ "BufEnter", "CursorHold", "CursorHoldI", "FocusGained" }, { + command = "if mode() != 'c' | checktime | endif", + pattern = { "*" }, +})