1
0
Fork 0

nvim: lazygit to fterm

This commit is contained in:
Vladimír Dudr 2022-10-18 16:43:25 +02:00
parent fcd29cfc14
commit 747e27a0e3
3 changed files with 75 additions and 11 deletions

View file

@ -80,7 +80,7 @@ local function normalizeTSHighlight()
hl('@symbol', { link = 'Identifier' })
-- }}}
-- Text {{{
hl('@text', { link = 'Normal' })
hl('@text', {})
hl('@text.strong', { bold = true })
hl('@text.emphasis', { italic = true })
hl('@text.underline', { underline = true })
@ -106,15 +106,44 @@ local function normalizeTSHighlight()
end
local function customLinks()
hl('Function', { link = 'Normal', default = false })
hl('Operator', { link = 'Normal', default = false })
-- link to Normal forces bg, so cursorline breaks
hl('Function', { default = false })
hl('Operator', { default = false })
end
vim.api.nvim_create_autocmd('Colorscheme',
{ pattern = "*", callback = function() normalizeTSHighlight(); customLinks(); end }
local function normalizeTerminal()
vim.g.terminal_color_0 = 0
vim.g.terminal_color_1 = 1
vim.g.terminal_color_2 = 2
vim.g.terminal_color_3 = 3
vim.g.terminal_color_4 = 4
vim.g.terminal_color_5 = 5
vim.g.terminal_color_6 = 6
vim.g.terminal_color_7 = 7
vim.g.terminal_color_8 = 8
vim.g.terminal_color_9 = 9
vim.g.terminal_color_10 = 10
vim.g.terminal_color_11 = 11
vim.g.terminal_color_12 = 12
vim.g.terminal_color_13 = 13
vim.g.terminal_color_14 = 14
vim.g.terminal_color_15 = 15
end
local augr = vim.api.nvim_create_augroup('config_colorscheme', {});
vim.api.nvim_create_autocmd('Colorscheme', {
group = augr,
pattern = "*",
callback = function()
normalizeTSHighlight()
customLinks()
normalizeTerminal()
end
}
)
vim.api.nvim_create_autocmd('Colorscheme', {
group = augr,
pattern = "gruvbox",
callback = function()
hl('Directory', { link = 'GruvboxGreen', default = false })

View file

@ -0,0 +1,22 @@
local M = {}
function M.setup()
local fterm = require("FTerm")
local lazygit = fterm:new({
ft = 'fterm_lazygit', -- You can also override the default filetype, if you want
cmd = "lazygit",
dimensions = {
height = 0.9,
width = 0.9
}
})
-- Use this to toggle gitui in a floating terminal
vim.keymap.set('n', '<Space>g', function()
lazygit:toggle()
end)
end
return M

View file

@ -15,7 +15,7 @@ function M.setup()
local packer_bootstrap = ensure_packer()
require('packer').startup(function(use, use_rocks)
require('packer').startup(function(use)
use 'wbthomason/packer.nvim'
use {
@ -59,10 +59,23 @@ function M.setup()
}
use { 'morhetz/gruvbox' }
use { 'luisiacc/gruvbox-baby' }
use { 'chrisbra/Colorizer', cmd = 'ColorToggle', keys = { 'n', '<space>c <Cmd>ColorToggle<CR>' } }
use { 'kdheepak/lazygit.nvim', keys = { 'n', '<space>g <Cmd>LazyGit<CR>' }, cmd = 'LazyGit' }
--[[ use { 'kdheepak/lazygit.nvim',
keys = { 'n', '<space>g <Cmd>LazyGit<CR>' },
cmd = 'LazyGit',
setup = function()
vim.g.lazygit_floating_window_use_plenary = 1
vim.g.lazygit_floating_window_use_plenary = 1
end
} ]]
use { "numToStr/FTerm.nvim",
config = require("configs.fterm").setup
}
use { 'lewis6991/gitsigns.nvim',
requires = { 'nvim-lua/plenary.nvim' },
config = function() require 'gitsigns'.setup({}) end }
@ -127,10 +140,10 @@ function M.setup()
use { 'ziglang/zig.vim', ft = 'zig' }
if packer_bootstrap then
require('packer').sync()
end
end)
if packer_bootstrap then
require('packer').sync()
end
end)
end
return M