diff options
author | christianchiarulli <[email protected]> | 2021-07-14 23:15:12 -0400 |
---|---|---|
committer | christianchiarulli <[email protected]> | 2021-07-14 23:15:12 -0400 |
commit | f58782563ea933f31e8886f511ec2b5824def19b (patch) | |
tree | e6cfaf7f5a980cfe19b2a9d884a75e363e1e78e8 /lua/core/floatterm.lua | |
parent | f95e150518e40f08a2cb31365e90895e31465d7e (diff) |
user toggleterm instead of fterm
Diffstat (limited to 'lua/core/floatterm.lua')
-rw-r--r-- | lua/core/floatterm.lua | 76 |
1 files changed, 0 insertions, 76 deletions
diff --git a/lua/core/floatterm.lua b/lua/core/floatterm.lua deleted file mode 100644 index 3d7e0e6e..00000000 --- a/lua/core/floatterm.lua +++ /dev/null @@ -1,76 +0,0 @@ -local M = {} -M.config = function() - O.plugin.floatterm = { - active = false, - dimensions = { - height = 0.9, - width = 0.9, - x = 0.5, - y = 0.3, - }, - border = "single", -- or 'double' - } -end - -M.setup = function() - local status_ok, fterm = pcall(require, "FTerm") - if not status_ok then - return - end - - fterm.setup(O.plugin.floatterm) - - -- Create LazyGit Terminal - local term = require "FTerm.terminal" - local lazy = term:new():setup { - cmd = "lazygit", - dimensions = O.plugin.floatterm.dimensions, - } - - 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 - -- ) - - O.plugin.which_key.mappings["gg"] = "LazyGit" - vim.api.nvim_set_keymap("n", "<A-i>", "<CMD>lua require('FTerm').toggle()<CR>", { noremap = true, silent = true }) - vim.api.nvim_set_keymap("n", "<leader>gg", "<CMD>lua _G.__fterm_lazygit()<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 |