nvim config updated

This commit is contained in:
2025-11-09 13:41:37 +01:00
parent 332a9513be
commit 20d1b9e7f5
30 changed files with 618 additions and 347 deletions

View File

@@ -0,0 +1,21 @@
-- Autocommand: trigger Flutter hot reload on save
--
-- This runs whenever you save a *.dart file (BufWritePost).
-- It checks if a tmux session named "flutter" exists.
-- If it does, it sends the keys "r<Enter>" to the "app" window
-- of that session, which tells `flutter run` to hot-reload.
--
-- Workflow:
-- 1. Start tmux: tmux new -s flutter -n app
-- 2. Inside tmux "app" window, run: flutter run
-- 3. Open another window/pane for nvim.
-- 4. Whenever you :w a Dart file in nvim, hot reload will fire.
--
vim.api.nvim_create_autocmd("BufWritePost", {
pattern = "*.dart",
callback = function()
local result = vim.fn.system({ "tmux", "send-keys", "-t", "flutter:app", "r", "Enter" })
vim.notify("Flutter hot reload triggered", vim.log.levels.INFO)
end,
})