From ff4cb251a5394090bad75adc3e87a37bb9e49e78 Mon Sep 17 00:00:00 2001 From: Evie Litherland-Smith Date: Wed, 15 Feb 2023 16:00:45 +0000 Subject: [PATCH] Remove vim-fugitive and replace with toggleterm LazyGit --- config/nvim/lua/config/catppuccin.lua | 3 --- config/nvim/lua/config/toggleterm.lua | 32 ++++++++++++--------------- config/nvim/lua/keymaps.lua | 21 +++++------------- config/nvim/lua/plugins.lua | 1 - 4 files changed, 19 insertions(+), 38 deletions(-) diff --git a/config/nvim/lua/config/catppuccin.lua b/config/nvim/lua/config/catppuccin.lua index 5301b52d..e93065d6 100644 --- a/config/nvim/lua/config/catppuccin.lua +++ b/config/nvim/lua/config/catppuccin.lua @@ -2,9 +2,6 @@ require("catppuccin").setup({ flavour = "macchiato", transparent_background = true, term_colors = true, - dim_inactive = { - enabled = true, - }, integrations = { gitsigns = true, indent_blankline = { diff --git a/config/nvim/lua/config/toggleterm.lua b/config/nvim/lua/config/toggleterm.lua index c0156312..57c37833 100644 --- a/config/nvim/lua/config/toggleterm.lua +++ b/config/nvim/lua/config/toggleterm.lua @@ -1,22 +1,18 @@ require("toggleterm").setup({ - direction = "horizontal", - open_mapping = [[\t]], - size = function(term) - if term.direction == "horizontal" then - return 15 - elseif term.direction == "vertical" then - return vim.o.columns * 0.3 - end - end, - hide_numbers = true, -- hide the number column in toggleterm buffers - persist_size = false, + shade_terminals = false, + direction = "float", + close_on_exit = true, float_opts = { - border = "curved", - }, - winbar = { - enabled = false, - name_formatter = function(term) -- term: Terminal - return term.name - end, + border = "double", + winblend = 0, }, }) + +local Terminal = require("toggleterm.terminal").Terminal +local lazygit = Terminal:new({ cmd = "lazygit", hidden = true }) + +function _Lazygit_toggle() + lazygit:toggle() +end + +vim.api.nvim_set_keymap("n", "g", "lua _Lazygit_toggle()", { noremap = true, silent = true }) diff --git a/config/nvim/lua/keymaps.lua b/config/nvim/lua/keymaps.lua index 715c2ef1..706f0608 100644 --- a/config/nvim/lua/keymaps.lua +++ b/config/nvim/lua/keymaps.lua @@ -1,14 +1,10 @@ vim.g.mapleader = " " vim.keymap.set("i", "jk", "") - --- Toggleterm -vim.keymap.set("n", "th", "ToggleTerm direction=horizontal") -vim.keymap.set("n", "tv", "ToggleTerm direction=vertical") -vim.keymap.set("n", "tf", "ToggleTerm direction=float") -vim.keymap.set("n", "tt", "ToggleTerm direction=tab") - --- Aerial -vim.keymap.set("n", "aa", "AerialToggle") +vim.keymap.set({ "n", "t" }, "", "NavigatorLeft") +vim.keymap.set({ "n", "t" }, "", "NavigatorRight") +vim.keymap.set({ "n", "t" }, "", "NavigatorUp") +vim.keymap.set({ "n", "t" }, "", "NavigatorDown") +vim.keymap.set({ "n", "t" }, "", "NavigatorPrevious") -- Telescope vim.keymap.set("n", ";", "Telescope builtin") @@ -30,10 +26,3 @@ vim.keymap.set("n", "xw", "TroubleToggle workspace_diagnostics" vim.keymap.set("n", "xd", "TroubleToggle document_diagnostics") vim.keymap.set("n", "xq", "TroubleToggle quickfix") vim.keymap.set("n", "xl", "TroubleToggle loclist") - --- Navigator -vim.keymap.set({ "n", "t" }, "", "NavigatorLeft") -vim.keymap.set({ "n", "t" }, "", "NavigatorRight") -vim.keymap.set({ "n", "t" }, "", "NavigatorUp") -vim.keymap.set({ "n", "t" }, "", "NavigatorDown") -vim.keymap.set({ "n", "t" }, "", "NavigatorPrevious") diff --git a/config/nvim/lua/plugins.lua b/config/nvim/lua/plugins.lua index deead8b5..2d5c7e12 100644 --- a/config/nvim/lua/plugins.lua +++ b/config/nvim/lua/plugins.lua @@ -63,7 +63,6 @@ require("packer").startup({ require("config.treesitter") end, }) - use({ "tpope/vim-fugitive" }) use({ "lewis6991/gitsigns.nvim", config = function()