summaryrefslogtreecommitdiff
path: root/fnl/config/toggleterm.fnl
blob: 329964c17b932f21479e8b5348ce8efdd848a05d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
;; Terminal inside nvim.
(module config.toggleterm
        {autoload {: util nvim aniseed.nvim autocmd config.autocmd}})

(def- opts {:size 16 :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)
(autocmd.create-autocmd :TermOpen
                        {:pattern "term://*toggleterm#*"
                         :callback set-terminal-keymaps})