1
0
Fork 0
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
1.6 KiB

-- Mapping data with "desc" stored directly by vim.keymap.set().
--
-- Please use this mappings table to set keyboard mapping since this is the
-- lower level configuration and more robust one. (which-key will
-- automatically pick-up stored data by this setting.)
return {
-- first key is the mode
n = {
-- second key is the lefthand side of the map
-- mappings seen under group name "Buffer"
["<leader>bn"] = { "<cmd>tabnew<cr>", desc = "New tab" },
["<leader>bD"] = {
function()
require("astronvim.utils.status").heirline.buffer_picker(function(bufnr) require("astronvim.utils.buffer").close(bufnr) end)
end,
desc = "Pick to close",
},
-- tables with the `name` key will be registered with which-key if it's installed
-- this is useful for naming menus
["<leader>b"] = { name = "Buffers" },
-- quick save
-- ["<C-s>"] = { ":w!<cr>", desc = "Save File" }, -- change description but the same command
["<F5>"] = { '"=strftime("%H%M ")<CR>P' },
["<F6>"] = { '"=strftime("date %G-%m-%d")<CR>P' },
},
i = {
["<C-s>"] = { "<esc><cmd>w!<cr>a", desc = "Force write file" }, -- change description but the same command
-- ["<F6>"] = { '<C-R>=strftime("%Y-%m-%dT%H:%M:%S%z")<C-M>', desc = "Replace with actual date&time" },
["<F5>"] = { '<C-R>=strftime("%H%M ")<CR>' },
["<F6>"] = { '<C-R>=strftime("date %G-%m-%d")<CR>' },
["<F8>"] = { '<C-R>=strftime("%Y-%m-%dT%H:%M:%S%z")<C-M>', desc = "Insert actual date&time" },
},
t = {
-- setting a mapping to false will disable it
-- ["<esc>"] = false,
},
}