summaryrefslogtreecommitdiff
path: root/pkgs/custom-neovim/config/lua/mappings.lua
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/custom-neovim/config/lua/mappings.lua')
-rw-r--r--pkgs/custom-neovim/config/lua/mappings.lua10
1 files changed, 10 insertions, 0 deletions
diff --git a/pkgs/custom-neovim/config/lua/mappings.lua b/pkgs/custom-neovim/config/lua/mappings.lua
index 8c670f4..ec5788b 100644
--- a/pkgs/custom-neovim/config/lua/mappings.lua
+++ b/pkgs/custom-neovim/config/lua/mappings.lua
@@ -74,6 +74,16 @@ mapkey({"n", "v"}, "<leader>x", "Really delete character", [["_x]])
mapkey({"n", "v"}, "j", "Go down visually", "gj")
mapkey({"n", "v"}, "k", "Go up visually", "gk")
+-- Exit neovim
+mapkey("n", "<leader>q", "Save and exit neovim", function()
+ vim.cmd("wa!")
+ vim.cmd("qa!")
+end)
+
+mapkey("n", "<leader>Q", "Exit neovim", function()
+ vim.cmd("qa!")
+end)
+
-- Learn hjkl.
-- mapkey({"n", "v"}, "<left>", "Correct the keypress", function() print("Try pressing h instead.") end)
-- mapkey({"n", "v"}, "<down>", "Correct the keypress", function() print("Try pressing j instead.") end)