dotfiles/home/config/nvim/plugins/toggleterm.fnl

18 lines
888 B
Text
Raw Normal View History

2022-04-17 19:44:56 +00:00
(let [toggleterm (require :toggleterm)]
2022-04-20 14:27:26 +00:00
(toggleterm.setup {:shell vim.o.shell
:open_mapping :<C-t>
:close_on_exit true})
2022-04-17 19:44:56 +00:00
(let [augroup (vim.api.nvim_create_augroup :NifocTerm {:clear true})
2022-04-20 14:27:26 +00:00
aucmd vim.api.nvim_create_autocmd
keymap (require :nifoc.keymap)]
(aucmd :TermOpen {:pattern "term://*toggleterm#*"
:callback (fn [opts]
2022-04-17 19:44:56 +00:00
(set vim.opt_local.number false)
(set vim.opt_local.relativenumber false)
2022-04-20 14:27:26 +00:00
(set vim.opt_local.cursorline false)
2022-04-21 16:55:53 +00:00
(vim.api.nvim_buf_set_var opts.buf
:toggle_line_style 0)
2022-04-20 14:27:26 +00:00
(keymap.terminal-open opts.buf))
2022-04-17 19:44:56 +00:00
:group augroup})))
2022-04-20 14:27:26 +00:00