DEVELOPMENT ENVIRONMENT

~liljamo/nvim-flake

539075b769cd3ad58ce7645f5b80228004e54490 — Jonni Liljamo 5 months ago 8bc34ed
feat(toggleterm): init with lazygit toggle
2 files changed, 15 insertions(+), 0 deletions(-)

M config/plugins/default.nix
A config/plugins/toggleterm.nix
M config/plugins/default.nix => config/plugins/default.nix +1 -0
@@ 6,6 6,7 @@
    ./lsp.nix
    ./oil.nix
    ./telescope.nix
    ./toggleterm.nix
    ./treesitter.nix
    ./which-key.nix
    ./zen-mode.nix

A config/plugins/toggleterm.nix => config/plugins/toggleterm.nix +14 -0
@@ 0,0 1,14 @@
{
  plugins.toggleterm.enable = true;
  extraConfigLua = ''
    local Terminal = require("toggleterm.terminal").Terminal
    local lazygit = Terminal:new({ cmd = "lazygit", hidden = true, direction = "float" })

    function _lazygit_toggle()
      lazygit:toggle()
    end

    vim.api.nvim_set_keymap("n", "<leader>l", "<cmd>lua _lazygit_toggle()<CR>",
      {noremap = true, silent = true, desc = "Toggle lazygit"})
  '';
}