summaryrefslogtreecommitdiff
path: root/lua/maps/terminal.lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua/maps/terminal.lua')
-rw-r--r--lua/maps/terminal.lua37
1 files changed, 37 insertions, 0 deletions
diff --git a/lua/maps/terminal.lua b/lua/maps/terminal.lua
new file mode 100644
index 0000000..cf6f999
--- /dev/null
+++ b/lua/maps/terminal.lua
@@ -0,0 +1,37 @@
+vim.api.nvim_set_keymap(
+ "n",
+ "<leader>t",
+ ":lua toggle_terminal(vim.g.terminal_height)<CR>",
+ {silent = true, noremap = true}
+)
+
+vim.api.nvim_set_keymap(
+ "i",
+ "<leader>t",
+ "<Esc>:lua toggle_terminal(vim.g.terminal_height)<CR>",
+ {silent = true, noremap = true}
+)
+
+vim.api.nvim_set_keymap(
+ "t",
+ "<leader>t",
+ "<C-\\><C-n>:lua toggle_terminal(vim.g.terminal_height)<CR>",
+ {silent = true, noremap = true}
+)
+
+-- Terminal go back to normal mode
+vim.api.nvim_set_keymap(
+ "t",
+ "<Esc>",
+ "<C-\\><C-n>",
+ {noremap = true}
+)
+
+vim.api.nvim_set_keymap(
+ "t",
+ ":q!",
+ "<C-\\><C-n>:q!<CR>",
+ {noremap = true}
+)
+
+