nvim-configs/lua/plugins/visuals.lua

109 lines
3.6 KiB
Lua
Raw Normal View History

2024-10-06 13:13:53 +08:00
return {
2024-10-06 20:34:06 +08:00
-- {
-- "ellisonleao/gruvbox.nvim",
-- config = function()
-- vim.cmd([[colorscheme gruvbox]])
-- end
-- },
2024-10-06 13:13:53 +08:00
{
2024-10-06 20:34:06 +08:00
"rebelot/kanagawa.nvim",
2024-10-06 13:13:53 +08:00
config = function()
2024-10-06 20:34:06 +08:00
vim.cmd [[colorscheme kanagawa]]
2024-10-06 13:13:53 +08:00
end
2024-10-06 20:34:06 +08:00
}, {
2024-10-06 13:13:53 +08:00
'akinsho/bufferline.nvim',
version = "*",
dependencies = 'nvim-tree/nvim-web-devicons',
event = "VeryLazy",
config = function()
require("bufferline").setup()
end
},{
'nvim-lualine/lualine.nvim',
dependencies = { 'nvim-tree/nvim-web-devicons' },
event = "VeryLazy",
config = function()
require("lualine").setup()
end
}, {
"folke/todo-comments.nvim",
dependencies = { "nvim-lua/plenary.nvim" },
config = function()
require('todo-comments').setup({})
vim.keymap.set("n", "]t", function()
require("todo-comments").jump_next()
end, { desc = "Next todo comment" })
vim.keymap.set("n", "[t", function()
require("todo-comments").jump_prev()
end, { desc = "Previous todo comment" })
end
},{
"folke/which-key.nvim",
event = "VeryLazy",
2024-10-11 00:34:52 +08:00
},{
"lewis6991/gitsigns.nvim",
config = function()
2024-10-26 14:21:22 +08:00
require('gitsigns').setup{
on_attach = function(bufnr)
local gitsigns = require('gitsigns')
local function map(mode, l, r, opts)
opts = opts or {}
opts.buffer = bufnr
vim.keymap.set(mode, l, r, opts)
end
-- navigation
2024-12-30 17:39:09 +08:00
map('n', ']h', function()
2024-10-26 14:21:22 +08:00
if vim.wo.diff then
2024-12-30 17:39:09 +08:00
vim.cmd.normal({']h', bang = true})
2024-10-26 14:21:22 +08:00
else
gitsigns.nav_hunk('next')
end
end, {desc = "Next Git Hunk"})
2024-12-30 17:39:09 +08:00
map('n', '[h', function()
2024-10-26 14:21:22 +08:00
if vim.wo.diff then
2024-12-30 17:39:09 +08:00
vim.cmd.normal({'[h', bang = true})
2024-10-26 14:21:22 +08:00
else
gitsigns.nav_hunk('prev')
end
end, {desc = "Prev Git Hunk"})
map('n', '<leader>hs', gitsigns.stage_hunk)
map('n', '<leader>hr', gitsigns.reset_hunk)
map('v', '<leader>hs', function() gitsigns.stage_hunk {vim.fn.line('.'), vim.fn.line('v')} end)
map('v', '<leader>hr', function() gitsigns.reset_hunk {vim.fn.line('.'), vim.fn.line('v')} end)
end
}
2024-10-11 00:34:52 +08:00
end
2024-12-04 10:03:53 +08:00
},{
'MeanderingProgrammer/render-markdown.nvim',
dependencies = { 'nvim-treesitter/nvim-treesitter', 'nvim-tree/nvim-web-devicons' }, -- if you prefer nvim-web-devicons
---@module 'render-markdown'
---@type render.md.UserConfig
opts = {},
2025-02-04 15:28:04 +08:00
},{
'akinsho/toggleterm.nvim',
config = function()
local Terminal = require('toggleterm.terminal').Terminal
local lazygit = nil
2025-02-04 15:28:04 +08:00
function _lazygit_toggle()
if lazygit == nil then
lazygit = Terminal:new({
cmd = "lazygit",
hidden = true,
direction = 'float',
})
end
2025-02-04 15:28:04 +08:00
lazygit:toggle()
end
vim.api.nvim_set_keymap("n", "<leader>lg", "<cmd>lua _lazygit_toggle()<CR>", {noremap = true, silent = true})
end
2024-10-06 13:13:53 +08:00
}
}