Bind a normal-mode key to save the file.
Section: Lua keymaps
Map a save command
lua
lua
vim.keymap.set("n", "<leader>w", "<cmd>write<CR>")Explanation
`vim.keymap.set()` is the recommended API for mappings.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Lua keymaps