diff options
author | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2023-09-23 22:05:37 +0200 |
---|---|---|
committer | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2023-09-23 22:05:37 +0200 |
commit | d474c779523c512e3bc91bc5ce7bc87cafc6372b (patch) | |
tree | 3c50cc5bf8fb55167150c76171f54590babf7118 /fnl/plugins/editor/toggleterm.fnl | |
parent | 6dcd88cde5825573a3732e8b18f7d663ca47495b (diff) |
Move user and auto cmds to plugins
Diffstat (limited to 'fnl/plugins/editor/toggleterm.fnl')
-rw-r--r-- | fnl/plugins/editor/toggleterm.fnl | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/fnl/plugins/editor/toggleterm.fnl b/fnl/plugins/editor/toggleterm.fnl index 89d203d..9c2c5dc 100644 --- a/fnl/plugins/editor/toggleterm.fnl +++ b/fnl/plugins/editor/toggleterm.fnl @@ -1,6 +1,26 @@ ;; Terminal inside nvim. +(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 :cmd :ToggleTerm + : init :keys [{1 :<leader>t 2 :<cmd>ToggleTerm<cr> :desc :Terminal}] :opts {:size 24 :shade_terminals false}} |