summaryrefslogtreecommitdiff
path: root/fnl/plugins/toggleterm.fnl
blob: 12168aa6672f81707c4d9875cfed909ba7eb7d77 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
;; Terminal inside nvim.

(local keys [{1 :<leader>t 2 :<cmd>ToggleTerm<cr> :desc :Terminal}])

(local opts {:size 24 :shade_terminals false})

(local auto-cmds [[:TermOpen
                   {:pattern "term://*toggleterm#*"
                    :callback (fn []
                                (vim.keymap.set :t :<C-h> "<Cmd>wincmd h<CR>"
                                                {})
                                (vim.keymap.set :t :<C-j> "<Cmd>wincmd j<CR>"
                                                {})
                                (vim.keymap.set :t :<C-k> "<Cmd>wincmd k<CR>"
                                                {})
                                (vim.keymap.set :t :<C-l> "<Cmd>wincmd l<CR>"
                                                {}))}]
                  [:TermOpen
                   {:pattern ["term://*toggleterm#*"]
                    :command "setlocal spell!"}]])

(fn init []
  (let [cmds (require :util.cmds)]
    (cmds.create-auto-cmds auto-cmds)))

{1 :akinsho/toggleterm.nvim :version "*" :cmd :ToggleTerm : init : keys : opts}