summaryrefslogtreecommitdiff
path: root/lua/lv-floatterm/init.lua
diff options
context:
space:
mode:
authorchristianchiarulli <[email protected]>2021-07-06 19:15:37 -0400
committerchristianchiarulli <[email protected]>2021-07-06 19:15:37 -0400
commit0e2ad0c1fec50a24177129c89b3edb9007776caf (patch)
tree795f0e9ed5c9f9fa325e218a73de69a1354c2ce8 /lua/lv-floatterm/init.lua
parentf6e377fcfed932b71456a0b0780c1f5ed22cabd4 (diff)
testing autosave config poetnetially unstable
Diffstat (limited to 'lua/lv-floatterm/init.lua')
-rw-r--r--lua/lv-floatterm/init.lua62
1 files changed, 33 insertions, 29 deletions
diff --git a/lua/lv-floatterm/init.lua b/lua/lv-floatterm/init.lua
index 0901c1f6..5cd6a4ae 100644
--- a/lua/lv-floatterm/init.lua
+++ b/lua/lv-floatterm/init.lua
@@ -1,39 +1,43 @@
local M = {}
M.config = function()
- require'FTerm'.setup({
- dimensions = {
- height = 0.8,
- width = 0.8,
- x = 0.5,
- y = 0.5
- },
- border = 'single' -- or 'double'
- })
+ local status_ok, fterm = pcall(require, "FTerm")
+ if not status_ok then
+ return
+ end
- -- Create LazyGit Terminal
- local term = require("FTerm.terminal")
- local lazy = term:new():setup({
- cmd = "lazygit",
- dimensions = {
- height = 0.9,
- width = 0.9
- }
- })
+ fterm.setup {
+ dimensions = {
+ height = 0.8,
+ width = 0.8,
+ x = 0.5,
+ y = 0.5,
+ },
+ border = "single", -- or 'double'
+ }
- local function is_installed(exe)
- return vim.fn.executable(exe) == 1
- end
+ -- Create LazyGit Terminal
+ local term = require "FTerm.terminal"
+ local lazy = term:new():setup {
+ cmd = "lazygit",
+ dimensions = {
+ height = 0.9,
+ width = 0.9,
+ },
+ }
+
+ local function is_installed(exe)
+ return vim.fn.executable(exe) == 1
+ end
- -- Use this to toggle gitui in a floating terminal
- function _G.__fterm_lazygit()
- if is_installed("lazygit") ~= true then
- print("Please install lazygit. Check documentation for more information")
- return
- end
- lazy:toggle()
+ -- Use this to toggle gitui in a floating terminal
+ function _G.__fterm_lazygit()
+ if is_installed "lazygit" ~= true then
+ print "Please install lazygit. Check documentation for more information"
+ return
end
+ lazy:toggle()
+ end
end
return M
-