summaryrefslogtreecommitdiff
path: root/lua/lv-floatterm/init.lua
diff options
context:
space:
mode:
authorChristian Chiarulli <[email protected]>2021-07-13 21:13:55 -0400
committerGitHub <[email protected]>2021-07-13 21:13:55 -0400
commita097fa4c04e6db34bb409e0dea302c20629da8ec (patch)
treefb1c5bdd14cac82a363ea6c25b03a475050305f2 /lua/lv-floatterm/init.lua
parent04f9f53914a7dd999117ed73c5fa0ab3b0dc95e4 (diff)
LunarVim 0.4.8 (#919)0.4.8
Diffstat (limited to 'lua/lv-floatterm/init.lua')
-rw-r--r--lua/lv-floatterm/init.lua73
1 files changed, 0 insertions, 73 deletions
diff --git a/lua/lv-floatterm/init.lua b/lua/lv-floatterm/init.lua
deleted file mode 100644
index 94696db4..00000000
--- a/lua/lv-floatterm/init.lua
+++ /dev/null
@@ -1,73 +0,0 @@
-local M = {}
-
-M.config = function()
- local status_ok, fterm = pcall(require, "FTerm")
- if not status_ok then
- return
- end
-
- fterm.setup {
- dimensions = {
- height = 0.8,
- width = 0.8,
- x = 0.5,
- y = 0.5,
- },
- border = "single", -- or 'double'
- }
-
- -- Create LazyGit Terminal
- local term = require "FTerm.terminal"
- local lazy = term:new():setup {
- cmd = "lazygit",
- dimensions = {
- height = 0.9,
- width = 0.9,
- x = 0.5,
- y = 0.3,
- },
- }
-
- 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()
- end
-
- -- Map esc to exit inside lazygit
- -- vim.api.nvim_exec(
- -- [[
- -- function LazyGitNativation()
- -- echom &filetype
- -- if &filetype ==# 'FTerm'
- -- tnoremap <Esc> q
- -- tnoremap <C-v><Esc> <Esc>
- -- endif
- -- endfunction
- -- ]],
- -- false
- -- )
- vim.api.nvim_set_keymap("n", "<A-i>", "<CMD>lua require('FTerm').toggle()<CR>", { noremap = true, silent = true })
- vim.api.nvim_set_keymap(
- "t",
- "<A-i>",
- "<C-\\><C-n><CMD>lua require('FTerm').toggle()<CR>",
- { noremap = true, silent = true }
- )
- vim.api.nvim_set_keymap("n", "<A-l>", "<CMD>lua _G.__fterm_lazygit()<CR>", { noremap = true, silent = true })
- vim.api.nvim_set_keymap(
- "t",
- "<A-l>",
- "<C-\\><C-n><CMD>lua _G.__fterm_lazygit()<CR>",
- { noremap = true, silent = true }
- )
-end
-
-return M