summaryrefslogtreecommitdiff
path: root/fnl/config/toggleterm.fnl
blob: 1aaee6274e82f412d71cf2d41a98da41ea562ce0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
;; Terminal inside nvim.
(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})