summaryrefslogtreecommitdiff
path: root/lua/maps/auto_close.lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua/maps/auto_close.lua')
-rw-r--r--lua/maps/auto_close.lua24
1 files changed, 24 insertions, 0 deletions
diff --git a/lua/maps/auto_close.lua b/lua/maps/auto_close.lua
new file mode 100644
index 0000000..9da8c5f
--- /dev/null
+++ b/lua/maps/auto_close.lua
@@ -0,0 +1,24 @@
+vim.api.nvim_set_keymap("i", "\"",
+ "\"\"<left>",
+ {silent = true, noremap = true})
+
+vim.api.nvim_set_keymap("i", "'",
+ "''<left>",
+ {silent = true, noremap = true})
+
+vim.api.nvim_set_keymap("i", "(",
+ "()<left>",
+ {silent = true, noremap = true})
+
+vim.api.nvim_set_keymap("i", "[",
+ "[]<left>",
+ {silent = true, noremap = true})
+
+vim.api.nvim_set_keymap("i", "{",
+ "{}<left>",
+ {silent = true, noremap = true})
+
+vim.api.nvim_set_keymap("i", "{<CR>",
+ "{<CR>}<ESC>O",
+ {silent = true, noremap = true})
+