-- Keymaps are automatically loaded on the VeryLazy event -- Default keymaps that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/keymaps.lua -- Add any additional keymaps here local map = vim.keymap.set -- Global keymaps map({ "n", "v" }, ";", ":", { desc = "Enter command mode", noremap = true, nowait = true }) -- Theme map("n", "uh", "HighlightColors Toggle", { desc = "Toggle highlighting color", nowait = true }) -- File management Nvim map("n", "op", "Oil", { desc = "Open parent directory" }) -- Markdown configs map("n", "ct", ":lua require('toggle-checkbox').toggle()", { desc = "Toggle Checkbox" }) map("n", "pb", ":lua require('gitpad').toggle_gitpad_branch()", { desc = "Toogle Gitpad branch" }) map("n", "pd", function() local date_filename = "daily-" .. os.date("%Y-%m-%d.md") require("gitpad").toggle_gitpad({ filename = date_filename }) -- or require('gitpad').toggle_gitpad({ filename = date_filename, title = 'Daily notes' }) end, { desc = "Toogle Gitpad Daily notes" }) map("n", "pf", function() local filename = vim.fn.expand("%:p") -- or just use vim.fn.bufname() if filename == "" then vim.notify("empty bufname") return end filename = vim.fn.pathshorten(filename, 2) .. ".md" require("gitpad").toggle_gitpad({ filename = filename }) -- or require('gitpad').toggle_gitpad({ filename = filename, title = 'Current file notes' }) end, { desc = "Toogle Gitpad per file notes" }) -- Git configs map("n", "gb", "GitBlameToggle", { desc = "Toggle Git Blame" }) -- Development config map({ "n", "i", "v" }, "", function() vim.lsp.buf.definition() end, { desc = "Go to definition" }) map({ "n", "i", "v" }, "", function() vim.lsp.buf.declaration() end, { desc = "Go to declaration" }) map({ "n", "i", "v" }, "rcf", "Telescope flutter commands", { desc = "Run flutter" }) map("x", "re", ":Refactor extract ", { desc = "Refactor Extract" }) map("x", "rf", ":Refactor extract_to_file ", { desc = "Refactor Extract to file" }) map("x", "rv", ":Refactor extract_var ", { desc = "Refactor Extract variable" }) map({ "n", "x" }, "ri", ":Refactor inline_var", { desc = "Refactor Extract inline variable" }) map("n", "rI", ":Refactor inline_func", { desc = "Refactor Extract inline function" }) map("n", "rb", ":Refactor extract_block", { desc = "Refactor Extract block" }) map("n", "rbf", ":Refactor extract_block_to_file", { desc = "Refactor Extract block o file" })