summaryrefslogtreecommitdiff
path: root/fnl/config/toggleterm.fnl
blob: dd561f3d7c6efcf62c915044779f337bef5a0fe2 (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 config.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.setup :toggleterm opts)
(autocmd.create-autocmd :TermOpen
                        {:pattern "term://*toggleterm#*"
                         :callback set-terminal-keymaps})