summaryrefslogtreecommitdiff
path: root/fnl
diff options
context:
space:
mode:
authorGustaf Rydholm <gustaf.rydholm@gmail.com>2022-08-06 15:28:32 +0200
committerGustaf Rydholm <gustaf.rydholm@gmail.com>2022-08-06 15:28:32 +0200
commit8644dab665ccb76f3950e287c56442347f5fa0bc (patch)
tree9332993df7b224ed823172bac3c46728adf615a0 /fnl
parent73ead4fccda383c099d92187412a5c1b8858a079 (diff)
Add nav key maps to toggleterm
Diffstat (limited to 'fnl')
-rw-r--r--fnl/config/toggleterm.fnl11
1 files changed, 10 insertions, 1 deletions
diff --git a/fnl/config/toggleterm.fnl b/fnl/config/toggleterm.fnl
index 87d9eb6..1aaee62 100644
--- a/fnl/config/toggleterm.fnl
+++ b/fnl/config/toggleterm.fnl
@@ -1,6 +1,15 @@
;; Terminal inside nvim.
-(module config.toggleterm {autoload {: util}})
+(module config.toggleterm {autoload {: util nvim aniseed.nvim}})
(def- opts {:shade_terminals false})
+(defn- set-terminal-keymaps []
+ (nvim.set_keymap :t :<C-h> "<Cmd>wincmd h<CR>" {})
+ (nvim.set_keymap :t :<C-j> "<Cmd>wincmd j<CR>" {})
+ (nvim.set_keymap :t :<C-k> "<Cmd>wincmd k<CR>" {})
+ (nvim.set_keymap :t :<C-l> "<Cmd>wincmd l<CR>" {}))
+
(util.use-config :toggleterm opts)
+(util.autocmd :TermOpen
+ {:pattern "term://*toggleterm#*"
+ :callback set-terminal-keymaps})