diff options
| -rw-r--r-- | .config/nvim/init.lua | 18 | ||||
| -rw-r--r-- | .config/nvim/plugin/50-git.lua | 2 | ||||
| -rw-r--r-- | .config/tmux/tmux.conf | 2 |
3 files changed, 20 insertions, 2 deletions
diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index 3f7515c..7ffe81f 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -66,6 +66,24 @@ vim.api.nvim_create_autocmd({ "WinEnter", "TermOpen" }, { end, }) +vim.opt.updatetime = 1000 -- Swap file save frequency; also how often GitGutter signs update in ms +-- Reload buffer when file has been modified outside of nvim +vim.api.nvim_create_autocmd({ "FocusGained", "BufEnter", "CursorHold", "CursorHoldI" }, { + desc = "Reload buffer when modified outside of nvim", + group = vim.g.dotfiles.augroup, + pattern = "*", + command = "checktime", +}) +-- Log a message when buffer is reloaded because the file has changed on disk outside of nvim +vim.api.nvim_create_autocmd({ "FileChangedShellPost" }, { + desc = "Notify buffer reloaded because its file has changed on disk", + group = vim.g.dotfiles.augroup, + pattern = "*", + callback = function() + vim.notify("File changed on disk, buffer reloaded", vim.log.levels.WARN) + end, +}) + ------------------------------------------------------------------------------------------------------------------------ -- Plugins ------------------------------------------------------------------------------------------------------------------------ diff --git a/.config/nvim/plugin/50-git.lua b/.config/nvim/plugin/50-git.lua index 609ab93..64e6cd0 100644 --- a/.config/nvim/plugin/50-git.lua +++ b/.config/nvim/plugin/50-git.lua @@ -4,8 +4,6 @@ vim.pack.add({ "https://github.com/airblade/vim-gitgutter" }) -- Show git status in the gutter -vim.opt.updatetime = 100 -- How often the git signs in the gutter update in ms - vim.keymap.set("n", "<Leader>gt", "<Cmd>GitGutterLineHighlightsToggle<CR>", { desc = "Toggle git line highlighting" }) vim.keymap.set("n", "<Leader>gg", "<Cmd>GitGutter<CR>", { desc = "Refresh GitGutter" }) vim.keymap.set("n", "<Leader>gq", "<Cmd>GitGutterQuickFix<CR>", { desc = "Git hunks to quickfix list" }) diff --git a/.config/tmux/tmux.conf b/.config/tmux/tmux.conf index 3a6be99..434bcf0 100644 --- a/.config/tmux/tmux.conf +++ b/.config/tmux/tmux.conf @@ -15,6 +15,8 @@ set-option -g window-status-format "[#I | #{p18:#{=/18/…:window_n set-option -g window-status-current-format "[ ▶ #I | #{p18:#{=/18/…:window_name}#{?window_flags,#F,}}]" set-option -g window-status-current-style "bold" +set-option -g focus-events on + unbind C-b set-option -g prefix C-Space bind-key C-space send-prefix |
