add flutter shortcut

This commit is contained in:
gameloader 2023-07-17 11:21:42 +08:00
parent 62ed453c7b
commit 866429e6bc

View File

@ -197,6 +197,7 @@ map("n", "<C-o>", ":lua require'dap'.step_over()<CR>", opt)
-- set keymap based on file type
vim.cmd("autocmd FileType * lua SetKeybinds()")
function SetKeybinds()
local fileTy = vim.api.nvim_buf_get_option(0, "filetype")
local opts = { prefix = "<localleader>", buffer = 0 }
@ -212,6 +213,13 @@ function SetKeybinds()
["r"] = { ":MagmaEvaluateOperator<CR>", "Jupyter evaluate" },
["c"] = { ":MagmaEvaluateCell<CR>", "Jupyter evaluate cell" },
}, opts)
elseif fileTy == "dart" then
wk.register({
["r"] = { ":FlutterRun<CR>", "FlutterRun" },
["q"] = { ":FlutterQuit<CR>", "FlutterQuit" },
["c"] = { ":FlutterCopyProfilerUrl<CR>", "FlutterCopyProfilerUrl" },
["w"] = { ":FlutterDevTools<CR>", "FlutterDevTools" },
}, opts)
-- elseif fileTy == "sh" then
-- wk.register({
-- ["W"] = { ":w<CR>", "test write" },