From 7d4c4ae3320208b743d0eb00b3387b65734fa414 Mon Sep 17 00:00:00 2001 From: Proctor Date: Mon, 4 Dec 2023 11:34:06 -0600 Subject: [PATCH] neovim: add toggleterm plugin --- .../nvim/fnl/dotfiles/plugin/toggleterm.fnl | 29 +++++++++++++++++++ nvim/.config/nvim/fnl/dotfiles/plugins.fnl | 1 + 2 files changed, 30 insertions(+) create mode 100644 nvim/.config/nvim/fnl/dotfiles/plugin/toggleterm.fnl diff --git a/nvim/.config/nvim/fnl/dotfiles/plugin/toggleterm.fnl b/nvim/.config/nvim/fnl/dotfiles/plugin/toggleterm.fnl new file mode 100644 index 0000000..0b64b97 --- /dev/null +++ b/nvim/.config/nvim/fnl/dotfiles/plugin/toggleterm.fnl @@ -0,0 +1,29 @@ +(module dotfiles.toggleterm + {autoload {a aniseed.core} + require {nvim aniseed.nvim + nu aniseed.nvim.util + toggleterm toggleterm}}) + +(toggleterm.setup { + :open_mapping : + :start_in_insert true + :insert_mappings true ;; whether or not the open mapping applies in insert mode + :terminal_mappings true ;; whether or not the open mapping applies in the opened terminals + :persist_size true + :persist_mode true ;; if set to true (default) the previous terminal mode will be remembered + }) + + +(defn set_terminal_keymaps [] + (vim.keymap.set :t : :) + (vim.keymap.set :t :jk :) + (vim.keymap.set :t : "wincmd h") + (vim.keymap.set :t : "wincmd j") + (vim.keymap.set :t : "wincmd k") + (vim.keymap.set :t : "wincmd l") + (vim.keymap.set :t : :)) + + +(nu.fn-bridge :SetTerminalKeymaps :dotfiles.toggleterm :set_terminal_keymaps {:return false}) + +(nvim.ex.autocmd :TermOpen "term://*" :call "SetTerminalKeymaps()") diff --git a/nvim/.config/nvim/fnl/dotfiles/plugins.fnl b/nvim/.config/nvim/fnl/dotfiles/plugins.fnl index 2b7a00e..baae495 100644 --- a/nvim/.config/nvim/fnl/dotfiles/plugins.fnl +++ b/nvim/.config/nvim/fnl/dotfiles/plugins.fnl @@ -23,6 +23,7 @@ :Olical/fennel.vim {} :ahmedkhalf/project.nvim {} :airblade/vim-gitgutter {} + :akinsho/toggleterm.nvim {:mod :toggleterm} :clojure-vim/vim-jack-in {} :christianrondeau/vim-base64 {} :dhruvasagar/vim-table-mode {}