mirror of
https://github.com/boxpositron/absolute-vim.git
synced 2026-02-28 19:50:38 +00:00
This commit adds support for the toggleterm plugin in Neovim. It introduces a new Lua file `toggleterm.lua` in the `absolute/after` directory, which configures the toggleterm plugin. It sets up key mappings to open a terminal and toggle the lazygit terminal. The `toggleterm.lua` file imports the `toggleterm` and `Terminal` modules from the toggleterm plugin. It then sets up the toggleterm plugin using the `toggle_term.setup()` function. The `lazygit` terminal is defined using the `Terminal:new()` function. It specifies the command to run (`lazygit`), the directory to run the command in (`git_dir`), and the floating window options. It also defines an `on_open` function to start insert mode and set a key mapping to close the terminal, and an `on_close` function to start insert mode. The `_LAZYGIT_TOGGLE()` function is defined to toggle the `lazygit` terminal. Key mappings are set using the `vim.api.nvim_set_keymap()` function. The `<leader>gl` mapping is set to call the `_LAZYGIT_TOGGLE()` function, and the `<C-`` mapping is set to open a terminal using the `ToggleTerm` command. Additionally, a new Lua file `toggleterm.lua` is added in the `absolute/plugins` directory, which exports the toggleterm plugin configuration. It requires the `absolute.after.toggleterm` module to configure the toggleterm plugin.
121 B
121 B