summaryrefslogtreecommitdiff
path: root/fnl/plugins/editor/toggleterm.fnl
diff options
context:
space:
mode:
authorGustaf Rydholm <gustaf.rydholm@gmail.com>2023-09-23 22:05:37 +0200
committerGustaf Rydholm <gustaf.rydholm@gmail.com>2023-09-23 22:05:37 +0200
commitd474c779523c512e3bc91bc5ce7bc87cafc6372b (patch)
tree3c50cc5bf8fb55167150c76171f54590babf7118 /fnl/plugins/editor/toggleterm.fnl
parent6dcd88cde5825573a3732e8b18f7d663ca47495b (diff)
Move user and auto cmds to plugins
Diffstat (limited to 'fnl/plugins/editor/toggleterm.fnl')
-rw-r--r--fnl/plugins/editor/toggleterm.fnl20
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}}