init.lua 854 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. local M = {}
  2. M.config = function()
  3. require'FTerm'.setup({
  4. dimensions = {
  5. height = 0.8,
  6. width = 0.8,
  7. x = 0.5,
  8. y = 0.5
  9. },
  10. border = 'single' -- or 'double'
  11. })
  12. -- Create LazyGit Terminal
  13. local term = require("FTerm.terminal")
  14. local lazy = term:new():setup({
  15. cmd = "lazygit",
  16. dimensions = {
  17. height = 0.9,
  18. width = 0.9
  19. }
  20. })
  21. local function is_installed(exe)
  22. return vim.fn.executable(exe) == 1
  23. end
  24. -- Use this to toggle gitui in a floating terminal
  25. function _G.__fterm_lazygit()
  26. if is_installed("lazygit") ~= true then
  27. print("Please install lazygit. Check documentation for more information")
  28. return
  29. end
  30. lazy:toggle()
  31. end
  32. end
  33. return M