Remove vim-fugitive and replace with toggleterm LazyGit

This commit is contained in:
Evie Litherland-Smith 2023-02-15 16:00:45 +00:00
parent 49a17c1d6f
commit ff4cb251a5
4 changed files with 19 additions and 38 deletions

View file

@ -2,9 +2,6 @@ require("catppuccin").setup({
flavour = "macchiato",
transparent_background = true,
term_colors = true,
dim_inactive = {
enabled = true,
},
integrations = {
gitsigns = true,
indent_blankline = {

View file

@ -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", "<leader>g", "<cmd>lua _Lazygit_toggle()<CR>", { noremap = true, silent = true })

View file

@ -1,14 +1,10 @@
vim.g.mapleader = " "
vim.keymap.set("i", "jk", "<esc>")
-- Toggleterm
vim.keymap.set("n", "<leader>th", "<cmd>ToggleTerm direction=horizontal<cr>")
vim.keymap.set("n", "<leader>tv", "<cmd>ToggleTerm direction=vertical<cr>")
vim.keymap.set("n", "<leader>tf", "<cmd>ToggleTerm direction=float<cr>")
vim.keymap.set("n", "<leader>tt", "<cmd>ToggleTerm direction=tab<cr>")
-- Aerial
vim.keymap.set("n", "<leader>aa", "<cmd>AerialToggle<cr>")
vim.keymap.set({ "n", "t" }, "<A-h>", "<CMD>NavigatorLeft<CR>")
vim.keymap.set({ "n", "t" }, "<A-l>", "<CMD>NavigatorRight<CR>")
vim.keymap.set({ "n", "t" }, "<A-k>", "<CMD>NavigatorUp<CR>")
vim.keymap.set({ "n", "t" }, "<A-j>", "<CMD>NavigatorDown<CR>")
vim.keymap.set({ "n", "t" }, "<A-p>", "<CMD>NavigatorPrevious<CR>")
-- Telescope
vim.keymap.set("n", "<leader>;", "<cmd>Telescope builtin<cr>")
@ -30,10 +26,3 @@ vim.keymap.set("n", "<leader>xw", "<cmd>TroubleToggle workspace_diagnostics<cr>"
vim.keymap.set("n", "<leader>xd", "<cmd>TroubleToggle document_diagnostics<cr>")
vim.keymap.set("n", "<leader>xq", "<cmd>TroubleToggle quickfix<cr>")
vim.keymap.set("n", "<leader>xl", "<cmd>TroubleToggle loclist<cr>")
-- Navigator
vim.keymap.set({ "n", "t" }, "<A-h>", "<CMD>NavigatorLeft<CR>")
vim.keymap.set({ "n", "t" }, "<A-l>", "<CMD>NavigatorRight<CR>")
vim.keymap.set({ "n", "t" }, "<A-k>", "<CMD>NavigatorUp<CR>")
vim.keymap.set({ "n", "t" }, "<A-j>", "<CMD>NavigatorDown<CR>")
vim.keymap.set({ "n", "t" }, "<A-p>", "<CMD>NavigatorPrevious<CR>")

View file

@ -63,7 +63,6 @@ require("packer").startup({
require("config.treesitter")
end,
})
use({ "tpope/vim-fugitive" })
use({
"lewis6991/gitsigns.nvim",
config = function()